code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static void cancelJob(String jobHandle) throws NoSuchObjectException { checkNonEmpty(jobHandle, "jobHandle"); Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, jobHandle); JobRecord jobRecord = backEnd.queryJob(key, InflationType.NONE); CancelJobTask cancelJobTask = new CancelJobTask(key, jobRecord.getQueueSettings()); try { backEnd.enqueue(cancelJobTask); } catch (TaskAlreadyExistsException e) { // OK. Some other thread has already enqueued this task. } }
class class_name[name] begin[{] method[cancelJob, return_type[void], modifier[public static], parameter[jobHandle]] begin[{] call[.checkNonEmpty, parameter[member[.jobHandle], literal["jobHandle"]]] local_variable[type[Key], key] local_variable[type[JobRecord], jobRecord] local_variable[type[CancelJobTask], cancelJobTask] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cancelJobTask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=enqueue, postfix_operators=[], prefix_operators=[], qualifier=backEnd, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TaskAlreadyExistsException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[cancelJob] operator[SEP] identifier[String] identifier[jobHandle] operator[SEP] Keyword[throws] identifier[NoSuchObjectException] { identifier[checkNonEmpty] operator[SEP] identifier[jobHandle] , literal[String] operator[SEP] operator[SEP] identifier[Key] identifier[key] operator[=] identifier[KeyFactory] operator[SEP] identifier[createKey] operator[SEP] identifier[JobRecord] operator[SEP] identifier[DATA_STORE_KIND] , identifier[jobHandle] operator[SEP] operator[SEP] identifier[JobRecord] identifier[jobRecord] operator[=] identifier[backEnd] operator[SEP] identifier[queryJob] operator[SEP] identifier[key] , identifier[InflationType] operator[SEP] identifier[NONE] operator[SEP] operator[SEP] identifier[CancelJobTask] identifier[cancelJobTask] operator[=] Keyword[new] identifier[CancelJobTask] operator[SEP] identifier[key] , identifier[jobRecord] operator[SEP] identifier[getQueueSettings] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[backEnd] operator[SEP] identifier[enqueue] operator[SEP] identifier[cancelJobTask] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TaskAlreadyExistsException] identifier[e] operator[SEP] { } }
public FacesConfigRedirectViewParamType<FacesConfigRedirectType<T>> getOrCreateViewParam() { List<Node> nodeList = childNode.get("view-param"); if (nodeList != null && nodeList.size() > 0) { return new FacesConfigRedirectViewParamTypeImpl<FacesConfigRedirectType<T>>(this, "view-param", childNode, nodeList.get(0)); } return createViewParam(); }
class class_name[name] begin[{] method[getOrCreateViewParam, return_type[type[FacesConfigRedirectViewParamType]], modifier[public], parameter[]] begin[{] local_variable[type[List], nodeList] if[binary_operation[binary_operation[member[.nodeList], !=, literal[null]], &&, binary_operation[call[nodeList.size, parameter[]], >, literal[0]]]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="view-param"), MemberReference(member=childNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=nodeList, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=FacesConfigRedirectType, sub_type=None))], dimensions=None, name=FacesConfigRedirectViewParamTypeImpl, sub_type=None))] else begin[{] None end[}] return[call[.createViewParam, parameter[]]] end[}] END[}]
Keyword[public] identifier[FacesConfigRedirectViewParamType] operator[<] identifier[FacesConfigRedirectType] operator[<] identifier[T] operator[>] operator[>] identifier[getOrCreateViewParam] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[Node] operator[>] identifier[nodeList] operator[=] identifier[childNode] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodeList] operator[!=] Other[null] operator[&&] identifier[nodeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] Keyword[new] identifier[FacesConfigRedirectViewParamTypeImpl] operator[<] identifier[FacesConfigRedirectType] operator[<] identifier[T] operator[>] operator[>] operator[SEP] Keyword[this] , literal[String] , identifier[childNode] , identifier[nodeList] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[createViewParam] operator[SEP] operator[SEP] operator[SEP] }
public FKeyModel singleFKey(String... refTableAndColumns) { makeSureTableModelExist(); if (refTableAndColumns == null || refTableAndColumns.length > 2) throw new DialectException( "singleFKey() first parameter should be table name, second parameter(optional) should be column name"); return this.tableModel.fkey().columns(this.columnName).refs(refTableAndColumns); }
class class_name[name] begin[{] method[singleFKey, return_type[type[FKeyModel]], modifier[public], parameter[refTableAndColumns]] begin[{] call[.makeSureTableModelExist, parameter[]] if[binary_operation[binary_operation[member[.refTableAndColumns], ==, literal[null]], ||, binary_operation[member[refTableAndColumns.length], >, literal[2]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="singleFKey() first parameter should be table name, second parameter(optional) should be column name")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DialectException, sub_type=None)), label=None) else begin[{] None end[}] return[THIS[member[None.tableModel]call[None.fkey, parameter[]]call[None.columns, parameter[THIS[member[None.columnName]]]]call[None.refs, parameter[member[.refTableAndColumns]]]]] end[}] END[}]
Keyword[public] identifier[FKeyModel] identifier[singleFKey] operator[SEP] identifier[String] operator[...] identifier[refTableAndColumns] operator[SEP] { identifier[makeSureTableModelExist] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[refTableAndColumns] operator[==] Other[null] operator[||] identifier[refTableAndColumns] operator[SEP] identifier[length] operator[>] Other[2] operator[SEP] Keyword[throw] Keyword[new] identifier[DialectException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[tableModel] operator[SEP] identifier[fkey] operator[SEP] operator[SEP] operator[SEP] identifier[columns] operator[SEP] Keyword[this] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] identifier[refs] operator[SEP] identifier[refTableAndColumns] operator[SEP] operator[SEP] }
public CharacterSearchResponse getCharactersCharacterIdSearch(List<String> categories, Integer characterId, String search, String acceptLanguage, String datasource, String ifNoneMatch, String language, Boolean strict, String token) throws ApiException { ApiResponse<CharacterSearchResponse> resp = getCharactersCharacterIdSearchWithHttpInfo(categories, characterId, search, acceptLanguage, datasource, ifNoneMatch, language, strict, token); return resp.getData(); }
class class_name[name] begin[{] method[getCharactersCharacterIdSearch, return_type[type[CharacterSearchResponse]], modifier[public], parameter[categories, characterId, search, acceptLanguage, datasource, ifNoneMatch, language, strict, token]] begin[{] local_variable[type[ApiResponse], resp] return[call[resp.getData, parameter[]]] end[}] END[}]
Keyword[public] identifier[CharacterSearchResponse] identifier[getCharactersCharacterIdSearch] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[categories] , identifier[Integer] identifier[characterId] , identifier[String] identifier[search] , identifier[String] identifier[acceptLanguage] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , identifier[String] identifier[language] , identifier[Boolean] identifier[strict] , identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[ApiResponse] operator[<] identifier[CharacterSearchResponse] operator[>] identifier[resp] operator[=] identifier[getCharactersCharacterIdSearchWithHttpInfo] operator[SEP] identifier[categories] , identifier[characterId] , identifier[search] , identifier[acceptLanguage] , identifier[datasource] , identifier[ifNoneMatch] , identifier[language] , identifier[strict] , identifier[token] operator[SEP] operator[SEP] Keyword[return] identifier[resp] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] }
public static BufferedImage convertImageToARGB( Image image ) { if ( image instanceof BufferedImage && ((BufferedImage)image).getType() == BufferedImage.TYPE_INT_ARGB ) return (BufferedImage)image; BufferedImage p = new BufferedImage( image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_ARGB); Graphics2D g = p.createGraphics(); g.drawImage( image, 0, 0, null ); g.dispose(); return p; }
class class_name[name] begin[{] method[convertImageToARGB, return_type[type[BufferedImage]], modifier[public static], parameter[image]] begin[{] if[binary_operation[binary_operation[member[.image], instanceof, type[BufferedImage]], &&, binary_operation[Cast(expression=MemberReference(member=image, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None)), ==, member[BufferedImage.TYPE_INT_ARGB]]]] begin[{] return[Cast(expression=MemberReference(member=image, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BufferedImage, sub_type=None))] else begin[{] None end[}] local_variable[type[BufferedImage], p] local_variable[type[Graphics2D], g] call[g.drawImage, parameter[member[.image], literal[0], literal[0], literal[null]]] call[g.dispose, parameter[]] return[member[.p]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BufferedImage] identifier[convertImageToARGB] operator[SEP] identifier[Image] identifier[image] operator[SEP] { Keyword[if] operator[SEP] identifier[image] Keyword[instanceof] identifier[BufferedImage] operator[&&] operator[SEP] operator[SEP] identifier[BufferedImage] operator[SEP] identifier[image] operator[SEP] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_ARGB] operator[SEP] Keyword[return] operator[SEP] identifier[BufferedImage] operator[SEP] identifier[image] operator[SEP] identifier[BufferedImage] identifier[p] operator[=] Keyword[new] identifier[BufferedImage] operator[SEP] identifier[image] operator[SEP] identifier[getWidth] operator[SEP] Other[null] operator[SEP] , identifier[image] operator[SEP] identifier[getHeight] operator[SEP] Other[null] operator[SEP] , identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_ARGB] operator[SEP] operator[SEP] identifier[Graphics2D] identifier[g] operator[=] identifier[p] operator[SEP] identifier[createGraphics] operator[SEP] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[drawImage] operator[SEP] identifier[image] , Other[0] , Other[0] , Other[null] operator[SEP] operator[SEP] identifier[g] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[p] operator[SEP] }
public void putSubFunction(String name, SameDiff nameSpace) { if (sameDiffFunctionInstances.containsKey(name) && sameDiffFunctionInstances.get(name) != nameSpace) { throw new ND4JIllegalStateException("Unable to replace samediff namespace. Please choose another opName"); } sameDiffFunctionInstances.put(name, nameSpace); }
class class_name[name] begin[{] method[putSubFunction, return_type[void], modifier[public], parameter[name, nameSpace]] begin[{] if[binary_operation[call[sameDiffFunctionInstances.containsKey, parameter[member[.name]]], &&, binary_operation[call[sameDiffFunctionInstances.get, parameter[member[.name]]], !=, member[.nameSpace]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to replace samediff namespace. Please choose another opName")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ND4JIllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] call[sameDiffFunctionInstances.put, parameter[member[.name], member[.nameSpace]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[putSubFunction] operator[SEP] identifier[String] identifier[name] , identifier[SameDiff] identifier[nameSpace] operator[SEP] { Keyword[if] operator[SEP] identifier[sameDiffFunctionInstances] operator[SEP] identifier[containsKey] operator[SEP] identifier[name] operator[SEP] operator[&&] identifier[sameDiffFunctionInstances] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[!=] identifier[nameSpace] operator[SEP] { Keyword[throw] Keyword[new] identifier[ND4JIllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[sameDiffFunctionInstances] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[nameSpace] operator[SEP] operator[SEP] }
@Override public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { endpoint.onDisconnected(); super.channelClosed(ctx, e); }
class class_name[name] begin[{] method[channelClosed, return_type[void], modifier[public], parameter[ctx, e]] begin[{] call[endpoint.onDisconnected, parameter[]] SuperMethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=channelClosed, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[channelClosed] operator[SEP] identifier[ChannelHandlerContext] identifier[ctx] , identifier[ChannelStateEvent] identifier[e] operator[SEP] Keyword[throws] identifier[Exception] { identifier[endpoint] operator[SEP] identifier[onDisconnected] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[channelClosed] operator[SEP] identifier[ctx] , identifier[e] operator[SEP] operator[SEP] }
public PagedList<HybridConnectionInner> listHybridConnections(final String resourceGroupName, final String name) { ServiceResponse<Page<HybridConnectionInner>> response = listHybridConnectionsSinglePageAsync(resourceGroupName, name).toBlocking().single(); return new PagedList<HybridConnectionInner>(response.body()) { @Override public Page<HybridConnectionInner> nextPage(String nextPageLink) { return listHybridConnectionsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
class class_name[name] begin[{] method[listHybridConnections, return_type[type[PagedList]], modifier[public], parameter[resourceGroupName, name]] begin[{] local_variable[type[ServiceResponse], response] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=body, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nextPageLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listHybridConnectionsNextSinglePageAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=toBlocking, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=single, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=body, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=nextPage, parameters=[FormalParameter(annotations=[], modifiers=set(), name=nextPageLink, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=HybridConnectionInner, sub_type=None))], dimensions=[], name=Page, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=HybridConnectionInner, sub_type=None))], dimensions=None, name=PagedList, sub_type=None))] end[}] END[}]
Keyword[public] identifier[PagedList] operator[<] identifier[HybridConnectionInner] operator[>] identifier[listHybridConnections] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[String] identifier[name] operator[SEP] { identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[HybridConnectionInner] operator[>] operator[>] identifier[response] operator[=] identifier[listHybridConnectionsSinglePageAsync] operator[SEP] identifier[resourceGroupName] , identifier[name] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[PagedList] operator[<] identifier[HybridConnectionInner] operator[>] operator[SEP] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[HybridConnectionInner] operator[>] identifier[nextPage] operator[SEP] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[listHybridConnectionsNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public boolean loadNewVersion(String versionsuffix, byte[] newbytedata) { javaMethodCache = null; if (GlobalConfiguration.verboseMode && log.isLoggable(Level.INFO)) { log.info("Loading new version of " + slashedtypename + ", identifying suffix " + versionsuffix + ", new data length is " + newbytedata.length + "bytes"); } // If we find our parent classloader has a weavingTransformer newbytedata = retransform(newbytedata); // TODO how slow is this? something to worry about? make it conditional on a setting? boolean reload = true; TypeDelta td = null; if (GlobalConfiguration.verifyReloads) { td = TypeDiffComputer.computeDifferences(bytesInitial, newbytedata); if (td.hasAnythingChanged()) { // need to check it isn't anything we do not yet support boolean cantReload = false; StringBuilder s = null; if (td.hasTypeDeclarationChanged()) { // Not allowed to change the type reload = false; s = new StringBuilder("Spring Loaded: Cannot reload new version of ").append( this.dottedtypename).append( "\n"); if (td.hasTypeAccessChanged()) { s.append(" Reason: Type modifiers changed from=0x" + Integer.toHexString(td.oAccess) + " to=0x" + Integer.toHexString(td.nAccess) + "\n"); cantReload = true; } if (td.hasTypeSupertypeChanged()) { s.append(" Reason: Supertype changed from ").append(td.oSuperName).append(" to ").append( td.nSuperName).append("\n"); cantReload = true; } if (td.hasTypeInterfacesChanged()) { // This next bit of code is to deal with the situation // Peter saw where on a full build some type implements // GroovyObject // but on an incremental build of just that one file, it // no longer implements it (presumably - and we could go // checking // for this - a supertype already implements the // interface but the full build wasn't smart enough to // work that out) boolean justGroovyObjectMoved = false; if (!cantReload && getTypeDescriptor().isGroovyType()) { // Is it just GroovyObject that has been lost? List<String> interfaceChanges = new ArrayList<String>(); interfaceChanges.addAll(td.oInterfaces); interfaceChanges.removeAll(td.nInterfaces); // If ifaces is just GroovyObject now then that // means it has been removed from the interface list // - which can unfortunately happen on an // incremental compile if (this.getTypeDescriptor().isGroovyType() && interfaceChanges.size() == 1 && interfaceChanges.get(0).equals("groovy/lang/GroovyObject")) { // just let it go... needs fixing in Groovy // really justGroovyObjectMoved = true; s = null; reload = true; } } if (!justGroovyObjectMoved) { s.append(" Reason: Interfaces changed from ").append(td.oInterfaces).append(" to ").append( td.nInterfaces).append("\n"); cantReload = true; } } } // if (td.haveFieldsChangedOrBeenAddedOrRemoved()) { // reload = false; // if (s == null) { // s = new StringBuilder("Spring-Loaded: Cannot reload new version of ").append(this.dottedtypename).append( // "\n"); // } // if (td.hasNewFields()) { // s.append(" Reason: New version has new fields:\n" + Utils.fieldNodeFormat(td.getNewFields().values())); // } // if (td.hasLostFields()) { // s.append(" Reason: New version has removed some fields: \n" // + Utils.fieldNodeFormat(td.getLostFields().values())); // } // } boolean somethingCalled = false; if (cantReload && td.hasAnythingChanged()) { somethingCalled = typeRegistry.fireUnableToReloadEvent(this, td, versionsuffix); } if (cantReload && s == null && td.hasAnythingChanged()) { if (!somethingCalled) { System.out.println("Something has changed preventing reload"); } } if (!somethingCalled && s != null) { System.out.println(s); } } } if (reload) { TypeRegistry.nothingReloaded = false; invokersCache_getDeclaredMethods = null; // will no longer use this cache if (GlobalConfiguration.reloadMessages) { // Only put out the message when running in limit mode (under tc Server) System.out.println("Reloading: Loading new version of " + this.dottedtypename + " [" + versionsuffix + "]"); } if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.INFO)) { log.info("Reloading: Loading new version of " + this.dottedtypename + " [" + versionsuffix + "]"); } liveVersion = new CurrentLiveVersion(this, versionsuffix, newbytedata); liveVersion.setTypeDelta(td); typeRegistry.reloadableTypeDescriptorCache.put(this.slashedtypename, liveVersion.typeDescriptor); if (typedescriptor.isGroovyType()) { fixupGroovyType(); } if (typedescriptor.isEnum()) { resetEnumRelatedState(); } if (typeRegistry.shouldRerunStaticInitializer(this, versionsuffix) || typedescriptor.isEnum()) { liveVersion.staticInitializedNeedsRerunningOnDefine = true; liveVersion.runStaticInitializer(); } else { liveVersion.staticInitializedNeedsRerunningOnDefine = false; } // For performance: // - tag the relevant types that may have been affected by this being reloaded, i.e. this type and any reloadable types in the same hierachy tagAsAffectedByReload(); tagSupertypesAsAffectedByReload(); tagSubtypesAsAffectedByReload(); typeRegistry.fireReloadEvent(this, versionsuffix); reloadProxiesIfNecessary(versionsuffix); } // dump(newbytedata); return reload; }
class class_name[name] begin[{] method[loadNewVersion, return_type[type[boolean]], modifier[public], parameter[versionsuffix, newbytedata]] begin[{] assign[member[.javaMethodCache], literal[null]] if[binary_operation[member[GlobalConfiguration.verboseMode], &&, call[log.isLoggable, parameter[member[Level.INFO]]]]] begin[{] call[log.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Loading new version of "], +, member[.slashedtypename]], +, literal[", identifying suffix "]], +, member[.versionsuffix]], +, literal[", new data length is "]], +, member[newbytedata.length]], +, literal["bytes"]]]] else begin[{] None end[}] assign[member[.newbytedata], call[.retransform, parameter[member[.newbytedata]]]] local_variable[type[boolean], reload] local_variable[type[TypeDelta], td] if[member[GlobalConfiguration.verifyReloads]] begin[{] assign[member[.td], call[TypeDiffComputer.computeDifferences, parameter[member[.bytesInitial], member[.newbytedata]]]] if[call[td.hasAnythingChanged, parameter[]]] begin[{] local_variable[type[boolean], cantReload] local_variable[type[StringBuilder], s] if[call[td.hasTypeDeclarationChanged, parameter[]]] begin[{] assign[member[.reload], literal[false]] assign[member[.s], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Spring Loaded: Cannot reload new version of ")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dottedtypename, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))] if[call[td.hasTypeAccessChanged, parameter[]]] begin[{] call[s.append, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal[" Reason: Type modifiers changed from=0x"], +, call[Integer.toHexString, parameter[member[td.oAccess]]]], +, literal[" to=0x"]], +, call[Integer.toHexString, parameter[member[td.nAccess]]]], +, literal["\n"]]]] assign[member[.cantReload], literal[true]] else begin[{] None end[}] if[call[td.hasTypeSupertypeChanged, parameter[]]] begin[{] call[s.append, parameter[literal[" Reason: Supertype changed from "]]] assign[member[.cantReload], literal[true]] else begin[{] None end[}] if[call[td.hasTypeInterfacesChanged, parameter[]]] begin[{] local_variable[type[boolean], justGroovyObjectMoved] if[binary_operation[member[.cantReload], &&, call[.getTypeDescriptor, parameter[]]]] begin[{] local_variable[type[List], interfaceChanges] call[interfaceChanges.addAll, parameter[member[td.oInterfaces]]] call[interfaceChanges.removeAll, parameter[member[td.nInterfaces]]] if[binary_operation[binary_operation[THIS[call[None.getTypeDescriptor, parameter[]]call[None.isGroovyType, parameter[]]], &&, binary_operation[call[interfaceChanges.size, parameter[]], ==, literal[1]]], &&, call[interfaceChanges.get, parameter[literal[0]]]]] begin[{] assign[member[.justGroovyObjectMoved], literal[true]] assign[member[.s], literal[null]] assign[member[.reload], literal[true]] else begin[{] None end[}] else begin[{] None end[}] if[member[.justGroovyObjectMoved]] begin[{] call[s.append, parameter[literal[" Reason: Interfaces changed from "]]] assign[member[.cantReload], literal[true]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[boolean], somethingCalled] if[binary_operation[member[.cantReload], &&, call[td.hasAnythingChanged, parameter[]]]] begin[{] assign[member[.somethingCalled], call[typeRegistry.fireUnableToReloadEvent, parameter[THIS[], member[.td], member[.versionsuffix]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.cantReload], &&, binary_operation[member[.s], ==, literal[null]]], &&, call[td.hasAnythingChanged, parameter[]]]] begin[{] if[member[.somethingCalled]] begin[{] call[System.out.println, parameter[literal["Something has changed preventing reload"]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.somethingCalled], &&, binary_operation[member[.s], !=, literal[null]]]] begin[{] call[System.out.println, parameter[member[.s]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] if[member[.reload]] begin[{] assign[member[TypeRegistry.nothingReloaded], literal[false]] assign[member[.invokersCache_getDeclaredMethods], literal[null]] if[member[GlobalConfiguration.reloadMessages]] begin[{] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Reloading: Loading new version of "], +, THIS[member[None.dottedtypename]]], +, literal[" ["]], +, member[.versionsuffix]], +, literal["]"]]]] else begin[{] None end[}] if[binary_operation[member[GlobalConfiguration.isRuntimeLogging], &&, call[log.isLoggable, parameter[member[Level.INFO]]]]] begin[{] call[log.info, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Reloading: Loading new version of "], +, THIS[member[None.dottedtypename]]], +, literal[" ["]], +, member[.versionsuffix]], +, literal["]"]]]] else begin[{] None end[}] assign[member[.liveVersion], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=versionsuffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newbytedata, 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=CurrentLiveVersion, sub_type=None))] call[liveVersion.setTypeDelta, parameter[member[.td]]] call[typeRegistry.reloadableTypeDescriptorCache.put, parameter[THIS[member[None.slashedtypename]], member[liveVersion.typeDescriptor]]] if[call[typedescriptor.isGroovyType, parameter[]]] begin[{] call[.fixupGroovyType, parameter[]] else begin[{] None end[}] if[call[typedescriptor.isEnum, parameter[]]] begin[{] call[.resetEnumRelatedState, parameter[]] else begin[{] None end[}] if[binary_operation[call[typeRegistry.shouldRerunStaticInitializer, parameter[THIS[], member[.versionsuffix]]], ||, call[typedescriptor.isEnum, parameter[]]]] begin[{] assign[member[liveVersion.staticInitializedNeedsRerunningOnDefine], literal[true]] call[liveVersion.runStaticInitializer, parameter[]] else begin[{] assign[member[liveVersion.staticInitializedNeedsRerunningOnDefine], literal[false]] end[}] call[.tagAsAffectedByReload, parameter[]] call[.tagSupertypesAsAffectedByReload, parameter[]] call[.tagSubtypesAsAffectedByReload, parameter[]] call[typeRegistry.fireReloadEvent, parameter[THIS[], member[.versionsuffix]]] call[.reloadProxiesIfNecessary, parameter[member[.versionsuffix]]] else begin[{] None end[}] return[member[.reload]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[loadNewVersion] operator[SEP] identifier[String] identifier[versionsuffix] , Keyword[byte] operator[SEP] operator[SEP] identifier[newbytedata] operator[SEP] { identifier[javaMethodCache] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[GlobalConfiguration] operator[SEP] identifier[verboseMode] operator[&&] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[INFO] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[slashedtypename] operator[+] literal[String] operator[+] identifier[versionsuffix] operator[+] literal[String] operator[+] identifier[newbytedata] operator[SEP] identifier[length] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[newbytedata] operator[=] identifier[retransform] operator[SEP] identifier[newbytedata] operator[SEP] operator[SEP] Keyword[boolean] identifier[reload] operator[=] literal[boolean] operator[SEP] identifier[TypeDelta] identifier[td] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[GlobalConfiguration] operator[SEP] identifier[verifyReloads] operator[SEP] { identifier[td] operator[=] identifier[TypeDiffComputer] operator[SEP] identifier[computeDifferences] operator[SEP] identifier[bytesInitial] , identifier[newbytedata] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[td] operator[SEP] identifier[hasAnythingChanged] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[cantReload] operator[=] literal[boolean] operator[SEP] identifier[StringBuilder] identifier[s] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[td] operator[SEP] identifier[hasTypeDeclarationChanged] operator[SEP] operator[SEP] operator[SEP] { identifier[reload] operator[=] literal[boolean] operator[SEP] identifier[s] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[dottedtypename] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[td] operator[SEP] identifier[hasTypeAccessChanged] operator[SEP] operator[SEP] operator[SEP] { identifier[s] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[td] operator[SEP] identifier[oAccess] operator[SEP] operator[+] literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[td] operator[SEP] identifier[nAccess] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[cantReload] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[td] operator[SEP] identifier[hasTypeSupertypeChanged] operator[SEP] operator[SEP] operator[SEP] { identifier[s] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[td] operator[SEP] identifier[oSuperName] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[td] operator[SEP] identifier[nSuperName] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cantReload] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[td] operator[SEP] identifier[hasTypeInterfacesChanged] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[justGroovyObjectMoved] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[cantReload] operator[&&] identifier[getTypeDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[isGroovyType] operator[SEP] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[interfaceChanges] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[interfaceChanges] operator[SEP] identifier[addAll] operator[SEP] identifier[td] operator[SEP] identifier[oInterfaces] operator[SEP] operator[SEP] identifier[interfaceChanges] operator[SEP] identifier[removeAll] operator[SEP] identifier[td] operator[SEP] identifier[nInterfaces] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getTypeDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[isGroovyType] operator[SEP] operator[SEP] operator[&&] identifier[interfaceChanges] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[interfaceChanges] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[justGroovyObjectMoved] operator[=] literal[boolean] operator[SEP] identifier[s] operator[=] Other[null] operator[SEP] identifier[reload] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[justGroovyObjectMoved] operator[SEP] { identifier[s] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[td] operator[SEP] identifier[oInterfaces] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[td] operator[SEP] identifier[nInterfaces] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cantReload] operator[=] literal[boolean] operator[SEP] } } } Keyword[boolean] identifier[somethingCalled] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[cantReload] operator[&&] identifier[td] operator[SEP] identifier[hasAnythingChanged] operator[SEP] operator[SEP] operator[SEP] { identifier[somethingCalled] operator[=] identifier[typeRegistry] operator[SEP] identifier[fireUnableToReloadEvent] operator[SEP] Keyword[this] , identifier[td] , identifier[versionsuffix] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cantReload] operator[&&] identifier[s] operator[==] Other[null] operator[&&] identifier[td] operator[SEP] identifier[hasAnythingChanged] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[somethingCalled] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[somethingCalled] operator[&&] identifier[s] operator[!=] Other[null] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[s] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[reload] operator[SEP] { identifier[TypeRegistry] operator[SEP] identifier[nothingReloaded] operator[=] literal[boolean] operator[SEP] identifier[invokersCache_getDeclaredMethods] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[GlobalConfiguration] operator[SEP] identifier[reloadMessages] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[dottedtypename] operator[+] literal[String] operator[+] identifier[versionsuffix] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[GlobalConfiguration] operator[SEP] identifier[isRuntimeLogging] operator[&&] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[INFO] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[dottedtypename] operator[+] literal[String] operator[+] identifier[versionsuffix] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[liveVersion] operator[=] Keyword[new] identifier[CurrentLiveVersion] operator[SEP] Keyword[this] , identifier[versionsuffix] , identifier[newbytedata] operator[SEP] operator[SEP] identifier[liveVersion] operator[SEP] identifier[setTypeDelta] operator[SEP] identifier[td] operator[SEP] operator[SEP] identifier[typeRegistry] operator[SEP] identifier[reloadableTypeDescriptorCache] operator[SEP] identifier[put] operator[SEP] Keyword[this] operator[SEP] identifier[slashedtypename] , identifier[liveVersion] operator[SEP] identifier[typeDescriptor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typedescriptor] operator[SEP] identifier[isGroovyType] operator[SEP] operator[SEP] operator[SEP] { identifier[fixupGroovyType] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[typedescriptor] operator[SEP] identifier[isEnum] operator[SEP] operator[SEP] operator[SEP] { identifier[resetEnumRelatedState] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[typeRegistry] operator[SEP] identifier[shouldRerunStaticInitializer] operator[SEP] Keyword[this] , identifier[versionsuffix] operator[SEP] operator[||] identifier[typedescriptor] operator[SEP] identifier[isEnum] operator[SEP] operator[SEP] operator[SEP] { identifier[liveVersion] operator[SEP] identifier[staticInitializedNeedsRerunningOnDefine] operator[=] literal[boolean] operator[SEP] identifier[liveVersion] operator[SEP] identifier[runStaticInitializer] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[liveVersion] operator[SEP] identifier[staticInitializedNeedsRerunningOnDefine] operator[=] literal[boolean] operator[SEP] } identifier[tagAsAffectedByReload] operator[SEP] operator[SEP] operator[SEP] identifier[tagSupertypesAsAffectedByReload] operator[SEP] operator[SEP] operator[SEP] identifier[tagSubtypesAsAffectedByReload] operator[SEP] operator[SEP] operator[SEP] identifier[typeRegistry] operator[SEP] identifier[fireReloadEvent] operator[SEP] Keyword[this] , identifier[versionsuffix] operator[SEP] operator[SEP] identifier[reloadProxiesIfNecessary] operator[SEP] identifier[versionsuffix] operator[SEP] operator[SEP] } Keyword[return] identifier[reload] operator[SEP] }
public static String fieldsToString (Object object, String sep) { StringBuilder buf = new StringBuilder("["); fieldsToString(buf, object, sep); return buf.append("]").toString(); }
class class_name[name] begin[{] method[fieldsToString, return_type[type[String]], modifier[public static], parameter[object, sep]] begin[{] local_variable[type[StringBuilder], buf] call[.fieldsToString, parameter[member[.buf], member[.object], member[.sep]]] return[call[buf.append, parameter[literal["]"]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[fieldsToString] operator[SEP] identifier[Object] identifier[object] , identifier[String] identifier[sep] operator[SEP] { identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[fieldsToString] operator[SEP] identifier[buf] , identifier[object] , identifier[sep] operator[SEP] operator[SEP] Keyword[return] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private void initAnnotatedFields() { final Set<Field> hiddenFields = Reflections.getHiddenFields(beanClass); inject(hiddenFields); final Set<Field> inheritedFields = Reflections.getInheritedFields(beanClass); inject(inheritedFields); final Set<Field> ownFields = Reflections.getOwnFields(beanClass); inject(ownFields); }
class class_name[name] begin[{] method[initAnnotatedFields, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[Set], hiddenFields] call[.inject, parameter[member[.hiddenFields]]] local_variable[type[Set], inheritedFields] call[.inject, parameter[member[.inheritedFields]]] local_variable[type[Set], ownFields] call[.inject, parameter[member[.ownFields]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[initAnnotatedFields] operator[SEP] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[Field] operator[>] identifier[hiddenFields] operator[=] identifier[Reflections] operator[SEP] identifier[getHiddenFields] operator[SEP] identifier[beanClass] operator[SEP] operator[SEP] identifier[inject] operator[SEP] identifier[hiddenFields] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[Field] operator[>] identifier[inheritedFields] operator[=] identifier[Reflections] operator[SEP] identifier[getInheritedFields] operator[SEP] identifier[beanClass] operator[SEP] operator[SEP] identifier[inject] operator[SEP] identifier[inheritedFields] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[Field] operator[>] identifier[ownFields] operator[=] identifier[Reflections] operator[SEP] identifier[getOwnFields] operator[SEP] identifier[beanClass] operator[SEP] operator[SEP] identifier[inject] operator[SEP] identifier[ownFields] operator[SEP] operator[SEP] }
static <E> int getMovedPosition(E[] d, int del) { int j = del; for (;;) { if (++j == d.length) j = 0; // invariant: interval ]del, j] contains only non-null elements // whose index is in ]del, j] E test = d[j]; if (test == null) return j; int k = getIndex(test, d.length); // check if k is in ]del, j] (this interval can wrap over) if ((del < j) ? (del < k) && (k <= j) : (del < k) || (k <= j)) // the test element should not be shifted continue; // else it should be shifted return j; } }
class class_name[name] begin[{] method[getMovedPosition, return_type[type[int]], modifier[static], parameter[d, del]] begin[{] local_variable[type[int], j] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=test)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=test, 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=ReturnStatement(expression=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=test, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[])], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=del, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), if_false=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=del, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=||), if_true=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=del, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&)), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), ReturnStatement(expression=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=None, init=None, update=None), label=None) end[}] END[}]
Keyword[static] operator[<] identifier[E] operator[>] Keyword[int] identifier[getMovedPosition] operator[SEP] identifier[E] operator[SEP] operator[SEP] identifier[d] , Keyword[int] identifier[del] operator[SEP] { Keyword[int] identifier[j] operator[=] identifier[del] operator[SEP] Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[++] identifier[j] operator[==] identifier[d] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[=] Other[0] operator[SEP] identifier[E] identifier[test] operator[=] identifier[d] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[test] operator[==] Other[null] operator[SEP] Keyword[return] identifier[j] operator[SEP] Keyword[int] identifier[k] operator[=] identifier[getIndex] operator[SEP] identifier[test] , identifier[d] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[del] operator[<] identifier[j] operator[SEP] operator[?] operator[SEP] identifier[del] operator[<] identifier[k] operator[SEP] operator[&&] operator[SEP] identifier[k] operator[<=] identifier[j] operator[SEP] operator[:] operator[SEP] identifier[del] operator[<] identifier[k] operator[SEP] operator[||] operator[SEP] identifier[k] operator[<=] identifier[j] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[return] identifier[j] operator[SEP] } }
@Override public CreateAutoScalingGroupResult createAutoScalingGroup(CreateAutoScalingGroupRequest request) { request = beforeClientExecution(request); return executeCreateAutoScalingGroup(request); }
class class_name[name] begin[{] method[createAutoScalingGroup, return_type[type[CreateAutoScalingGroupResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeCreateAutoScalingGroup, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CreateAutoScalingGroupResult] identifier[createAutoScalingGroup] operator[SEP] identifier[CreateAutoScalingGroupRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeCreateAutoScalingGroup] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void send(SIBusMessage msg, SITransaction tran) throws SISessionUnavailableException, SISessionDroppedException, SIConnectionUnavailableException, SIConnectionDroppedException, SIResourceException, SIConnectionLostException, SILimitExceededException, SIErrorException, SINotAuthorizedException, SIIncorrectCallException, SINotPossibleInCurrentConfigurationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "send", new Object[] {msg, tran}); try { closeLock.readLock().lockInterruptibly(); try { checkAlreadyClosed(); // XCT Instrumentation for SIBus //lohith liberty change /* if(XctSettings.isAnyEnabled()) { Xct xct = Xct.current(); if(xct.annotationsEnabled()) { Annotation annotation= new Annotation(XctJmsConstants.XCT_SIBUS).add(XctJmsConstants.XCT_PROXY_SEND); annotation.associate(XctJmsConstants.XCT_DEST_NAME,getDestinationAddress().getDestinationName()); annotation.add(new Annotation(XctJmsConstants.XCT_DEST_TYPE).add(destType.toString())); String transacted = XctJmsConstants.XCT_TRANSACTED_FALSE; if (tran !=null) transacted = XctJmsConstants.XCT_TRANSACTED_TRUE; annotation.add(new Annotation(XctJmsConstants.XCT_TRANSACTED).add(transacted)); annotation.add(new Annotation(XctJmsConstants.XCT_RELIABILITY).add(msg.getReliability().toString())); xct.begin(annotation); } else xct.begin(); String xctCorrelationIDString = Xct.current().toString(); msg.setXctCorrelationID(xctCorrelationIDString); }*/ // Now we need to synchronise on the transaction object if there is one. if (tran != null) { synchronized (tran) { // Check transaction is in a valid state. // Enlisted for an XA UOW and not rolledback or // completed for a local transaction. if (!((Transaction) tran).isValid()) { throw new SIIncorrectCallException( nls.getFormattedMessage("TRANSACTION_COMPLETE_SICO1022", null, null) ); } _send(msg, tran); } } else { _send(msg, null); } //lohith liberty change /*if(XctSettings.isAnyEnabled()) { Xct xct = Xct.current(); if(xct.annotationsEnabled()) { Annotation annotation= new Annotation(XctJmsConstants.XCT_SIBUS).add(XctJmsConstants.XCT_PROXY_SEND); xct.end(annotation); } else xct.end(); }*/ } finally { closeLock.readLock().unlock(); } } catch (InterruptedException e) { // No FFDC code needed } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "send"); }
class class_name[name] begin[{] method[send, return_type[void], modifier[public], parameter[msg, tran]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["send"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tran, 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[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=readLock, postfix_operators=[], prefix_operators=[], qualifier=closeLock, selectors=[MethodInvocation(arguments=[], member=lockInterruptibly, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=checkAlreadyClosed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tran, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=_send, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[SynchronizedStatement(block=[IfStatement(condition=Cast(expression=MemberReference(member=tran, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Transaction, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TRANSACTION_COMPLETE_SICO1022"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIIncorrectCallException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tran, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=_send, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, lock=MemberReference(member=tran, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=readLock, postfix_operators=[], prefix_operators=[], qualifier=closeLock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["send"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[send] operator[SEP] identifier[SIBusMessage] identifier[msg] , identifier[SITransaction] identifier[tran] operator[SEP] Keyword[throws] identifier[SISessionUnavailableException] , identifier[SISessionDroppedException] , identifier[SIConnectionUnavailableException] , identifier[SIConnectionDroppedException] , identifier[SIResourceException] , identifier[SIConnectionLostException] , identifier[SILimitExceededException] , identifier[SIErrorException] , identifier[SINotAuthorizedException] , identifier[SIIncorrectCallException] , identifier[SINotPossibleInCurrentConfigurationException] { 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] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[msg] , identifier[tran] } operator[SEP] operator[SEP] Keyword[try] { identifier[closeLock] operator[SEP] identifier[readLock] operator[SEP] operator[SEP] operator[SEP] identifier[lockInterruptibly] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[checkAlreadyClosed] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tran] operator[!=] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[tran] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] identifier[Transaction] operator[SEP] identifier[tran] operator[SEP] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[SIIncorrectCallException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Other[null] , Other[null] operator[SEP] operator[SEP] operator[SEP] } identifier[_send] operator[SEP] identifier[msg] , identifier[tran] operator[SEP] operator[SEP] } } Keyword[else] { identifier[_send] operator[SEP] identifier[msg] , Other[null] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[closeLock] operator[SEP] identifier[readLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] 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] operator[SEP] operator[SEP] }
private <T> void _registerMicroElementTypeConverter (@Nonnull final Class <T> aClass, @Nonnull final IMicroTypeConverter <T> aConverter) { ValueEnforcer.notNull (aClass, "Class"); ValueEnforcer.notNull (aConverter, "Converter"); m_aRWLock.writeLocked ( () -> { // The main class should not already be registered if (m_aMap.containsKey (aClass)) throw new IllegalArgumentException ("A micro type converter for class " + aClass + " is already registered!"); if (m_bUseClassHierarchy) { // Automatically register the class, and all parent classes/interfaces for (final WeakReference <Class <?>> aCurWRSrcClass : ClassHierarchyCache.getClassHierarchyIterator (aClass)) { final Class <?> aCurSrcClass = aCurWRSrcClass.get (); if (aCurSrcClass != null) if (!m_aMap.containsKey (aCurSrcClass)) { m_aMap.put (aCurSrcClass, aConverter); if (LOGGER.isDebugEnabled ()) LOGGER.debug ("Registered micro type converter for '" + aCurSrcClass.toString () + "'"); } } } else { m_aMap.put (aClass, aConverter); if (LOGGER.isDebugEnabled ()) LOGGER.debug ("Registered micro type converter for '" + aClass.toString () + "'"); } }); }
class class_name[name] begin[{] method[_registerMicroElementTypeConverter, return_type[void], modifier[private], parameter[aClass, aConverter]] begin[{] call[ValueEnforcer.notNull, parameter[member[.aClass], literal["Class"]]] call[ValueEnforcer.notNull, parameter[member[.aConverter], literal["Converter"]]] call[m_aRWLock.writeLocked, parameter[LambdaExpression(body=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=aClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=m_aMap, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A micro type converter for class "), operandr=MemberReference(member=aClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is already registered!"), 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)), IfStatement(condition=MemberReference(member=m_bUseClassHierarchy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aConverter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=m_aMap, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Registered micro type converter for '"), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=aClass, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None))]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=aCurWRSrcClass, selectors=[], type_arguments=None), name=aCurSrcClass)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aCurSrcClass, 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=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=aCurSrcClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=['!'], qualifier=m_aMap, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aCurSrcClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aConverter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=m_aMap, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Registered micro type converter for '"), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=aCurSrcClass, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None))])))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=aClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getClassHierarchyIterator, postfix_operators=[], prefix_operators=[], qualifier=ClassHierarchyCache, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aCurWRSrcClass)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))], dimensions=[], name=WeakReference, sub_type=None))), label=None)]))], parameters=[])]] end[}] END[}]
Keyword[private] operator[<] identifier[T] operator[>] Keyword[void] identifier[_registerMicroElementTypeConverter] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[aClass] , annotation[@] identifier[Nonnull] Keyword[final] identifier[IMicroTypeConverter] operator[<] identifier[T] operator[>] identifier[aConverter] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aClass] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aConverter] , literal[String] operator[SEP] operator[SEP] identifier[m_aRWLock] operator[SEP] identifier[writeLocked] operator[SEP] operator[SEP] operator[SEP] operator[->] { Keyword[if] operator[SEP] identifier[m_aMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[aClass] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[aClass] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_bUseClassHierarchy] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[WeakReference] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[aCurWRSrcClass] operator[:] identifier[ClassHierarchyCache] operator[SEP] identifier[getClassHierarchyIterator] operator[SEP] identifier[aClass] operator[SEP] operator[SEP] { Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[aCurSrcClass] operator[=] identifier[aCurWRSrcClass] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aCurSrcClass] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[m_aMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[aCurSrcClass] operator[SEP] operator[SEP] { identifier[m_aMap] operator[SEP] identifier[put] operator[SEP] identifier[aCurSrcClass] , identifier[aConverter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[aCurSrcClass] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[m_aMap] operator[SEP] identifier[put] operator[SEP] identifier[aClass] , identifier[aConverter] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[aClass] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public final Stream<List<T>> chunk(final int chunkSize) { synchronized (this.state) { checkState(); return new ChunkStream<T>(this, chunkSize); } }
class class_name[name] begin[{] method[chunk, return_type[type[Stream]], modifier[final public], parameter[chunkSize]] begin[{] SYNCHRONIZED[THIS[member[None.state]]] BEGIN[{] call[.checkState, parameter[]] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=chunkSize, 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))], dimensions=None, name=ChunkStream, sub_type=None))] END[}] end[}] END[}]
Keyword[public] Keyword[final] identifier[Stream] operator[<] identifier[List] operator[<] identifier[T] operator[>] operator[>] identifier[chunk] operator[SEP] Keyword[final] Keyword[int] identifier[chunkSize] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[state] operator[SEP] { identifier[checkState] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ChunkStream] operator[<] identifier[T] operator[>] operator[SEP] Keyword[this] , identifier[chunkSize] operator[SEP] operator[SEP] } }
protected DoubleMatrix getMatrix(int n) { Map<Integer, DoubleMatrix> degreeMap = matrixCache.get(this.getClass()); if (degreeMap == null) { degreeMap = new HashMap<>(); matrixCache.put(this.getClass(), degreeMap); } DoubleMatrix m = degreeMap.get(n); if (m == null) { m = createMatrix(n); m.decompose(); degreeMap.put(n, m); } return m; }
class class_name[name] begin[{] method[getMatrix, return_type[type[DoubleMatrix]], modifier[protected], parameter[n]] begin[{] local_variable[type[Map], degreeMap] if[binary_operation[member[.degreeMap], ==, literal[null]]] begin[{] assign[member[.degreeMap], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))] call[matrixCache.put, parameter[THIS[call[None.getClass, parameter[]]], member[.degreeMap]]] else begin[{] None end[}] local_variable[type[DoubleMatrix], m] if[binary_operation[member[.m], ==, literal[null]]] begin[{] assign[member[.m], call[.createMatrix, parameter[member[.n]]]] call[m.decompose, parameter[]] call[degreeMap.put, parameter[member[.n], member[.m]]] else begin[{] None end[}] return[member[.m]] end[}] END[}]
Keyword[protected] identifier[DoubleMatrix] identifier[getMatrix] operator[SEP] Keyword[int] identifier[n] operator[SEP] { identifier[Map] operator[<] identifier[Integer] , identifier[DoubleMatrix] operator[>] identifier[degreeMap] operator[=] identifier[matrixCache] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[degreeMap] operator[==] Other[null] operator[SEP] { identifier[degreeMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[matrixCache] operator[SEP] identifier[put] operator[SEP] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[degreeMap] operator[SEP] operator[SEP] } identifier[DoubleMatrix] identifier[m] operator[=] identifier[degreeMap] operator[SEP] identifier[get] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[==] Other[null] operator[SEP] { identifier[m] operator[=] identifier[createMatrix] operator[SEP] identifier[n] operator[SEP] operator[SEP] identifier[m] operator[SEP] identifier[decompose] operator[SEP] operator[SEP] operator[SEP] identifier[degreeMap] operator[SEP] identifier[put] operator[SEP] identifier[n] , identifier[m] operator[SEP] operator[SEP] } Keyword[return] identifier[m] operator[SEP] }
public static String url(PMSession session, String url, Boolean confirm, String prefix) { if (session != null) { final String contextPath = PMEntitySupport.getInstance().getContext_path(); final StringBuilder sb = new StringBuilder(); if (prefix != null) { sb.append(prefix); } if (confirm) { sb.append("loadPageConfirm('"); } else { sb.append("loadPage('"); } sb.append(contextPath); sb.append("/"); sb.append(session.getStringEncrypter().encrypt( (url.startsWith("/")) ? url.substring(1) : url)); sb.append(".jpm')"); return sb.toString(); } else { return url; } }
class class_name[name] begin[{] method[url, return_type[type[String]], modifier[public static], parameter[session, url, confirm, prefix]] begin[{] if[binary_operation[member[.session], !=, literal[null]]] begin[{] local_variable[type[String], contextPath] local_variable[type[StringBuilder], sb] if[binary_operation[member[.prefix], !=, literal[null]]] begin[{] call[sb.append, parameter[member[.prefix]]] else begin[{] None end[}] if[member[.confirm]] begin[{] call[sb.append, parameter[literal["loadPageConfirm('"]]] else begin[{] call[sb.append, parameter[literal["loadPage('"]]] end[}] call[sb.append, parameter[member[.contextPath]]] call[sb.append, parameter[literal["/"]]] call[sb.append, parameter[call[session.getStringEncrypter, parameter[]]]] call[sb.append, parameter[literal[".jpm')"]]] return[call[sb.toString, parameter[]]] else begin[{] return[member[.url]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[url] operator[SEP] identifier[PMSession] identifier[session] , identifier[String] identifier[url] , identifier[Boolean] identifier[confirm] , identifier[String] identifier[prefix] operator[SEP] { Keyword[if] operator[SEP] identifier[session] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[String] identifier[contextPath] operator[=] identifier[PMEntitySupport] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getContext_path] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prefix] operator[!=] Other[null] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[confirm] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[contextPath] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[session] operator[SEP] identifier[getStringEncrypter] operator[SEP] operator[SEP] operator[SEP] identifier[encrypt] operator[SEP] operator[SEP] identifier[url] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[?] identifier[url] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[:] identifier[url] operator[SEP] 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] } Keyword[else] { Keyword[return] identifier[url] operator[SEP] } }
public static Map<String, Object> newMapInstance(Class<?> mapClass) { if (mapClass == null || mapClass.isAssignableFrom(ArrayMap.class)) { return ArrayMap.create(); } if (mapClass.isAssignableFrom(TreeMap.class)) { return new TreeMap<String, Object>(); } @SuppressWarnings("unchecked") Map<String, Object> result = (Map<String, Object>) Types.newInstance(mapClass); return result; }
class class_name[name] begin[{] method[newMapInstance, return_type[type[Map]], modifier[public static], parameter[mapClass]] begin[{] if[binary_operation[binary_operation[member[.mapClass], ==, literal[null]], ||, call[mapClass.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayMap, sub_type=None))]]]] begin[{] return[call[ArrayMap.create, parameter[]]] else begin[{] None end[}] if[call[mapClass.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TreeMap, sub_type=None))]]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=TreeMap, sub_type=None))] else begin[{] None end[}] local_variable[type[Map], result] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[newMapInstance] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[mapClass] operator[SEP] { Keyword[if] operator[SEP] identifier[mapClass] operator[==] Other[null] operator[||] identifier[mapClass] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[ArrayMap] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[return] identifier[ArrayMap] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[mapClass] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[TreeMap] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[TreeMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[result] operator[=] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[Types] operator[SEP] identifier[newInstance] operator[SEP] identifier[mapClass] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public void skipHttpHeader() throws IOException { if (this.httpHeaderStream != null) { // Empty the httpHeaderStream for (int available = this.httpHeaderStream.available(); this.httpHeaderStream != null && (available = this.httpHeaderStream.available()) > 0;) { // We should be in this loop once only we should only do this // buffer allocation once. byte [] buffer = new byte[available]; // The read nulls out httpHeaderStream when done with it so // need check for null in the loop control line. read(buffer, 0, available); } } }
class class_name[name] begin[{] method[skipHttpHeader, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[THIS[member[None.httpHeaderStream]], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=available, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=buffer)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=available, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=httpHeaderStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=available, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=httpHeaderStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=available, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=httpHeaderStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=available, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=available)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=None), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[skipHttpHeader] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[httpHeaderStream] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[available] operator[=] Keyword[this] operator[SEP] identifier[httpHeaderStream] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[httpHeaderStream] operator[!=] Other[null] operator[&&] operator[SEP] identifier[available] operator[=] Keyword[this] operator[SEP] identifier[httpHeaderStream] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[available] operator[SEP] operator[SEP] identifier[read] operator[SEP] identifier[buffer] , Other[0] , identifier[available] operator[SEP] operator[SEP] } } }
public void setIpRoutes(java.util.Collection<IpRoute> ipRoutes) { if (ipRoutes == null) { this.ipRoutes = null; return; } this.ipRoutes = new com.amazonaws.internal.SdkInternalList<IpRoute>(ipRoutes); }
class class_name[name] begin[{] method[setIpRoutes, return_type[void], modifier[public], parameter[ipRoutes]] begin[{] if[binary_operation[member[.ipRoutes], ==, literal[null]]] begin[{] assign[THIS[member[None.ipRoutes]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.ipRoutes]], ClassCreator(arguments=[MemberReference(member=ipRoutes, 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=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=IpRoute, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setIpRoutes] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[IpRoute] operator[>] identifier[ipRoutes] operator[SEP] { Keyword[if] operator[SEP] identifier[ipRoutes] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[ipRoutes] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[ipRoutes] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[IpRoute] operator[>] operator[SEP] identifier[ipRoutes] operator[SEP] operator[SEP] }
public static DnsCache getWholeDnsCache() { try { return InetAddressCacheUtil.listInetAddressCache(); } catch (Exception e) { throw new DnsCacheManipulatorException("Fail to getWholeDnsCache, cause: " + e.toString(), e); } }
class class_name[name] begin[{] method[getWholeDnsCache, return_type[type[DnsCache]], modifier[public static], parameter[]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=listInetAddressCache, postfix_operators=[], prefix_operators=[], qualifier=InetAddressCacheUtil, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Fail to getWholeDnsCache, cause: "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DnsCacheManipulatorException, 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[DnsCache] identifier[getWholeDnsCache] operator[SEP] operator[SEP] { Keyword[try] { Keyword[return] identifier[InetAddressCacheUtil] operator[SEP] identifier[listInetAddressCache] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[DnsCacheManipulatorException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
protected ServiceTracker<IExecutors, ?> getExecutorsServiceTracker(BundleContext bundleContext) throws InvalidSyntaxException { ServiceTracker<IExecutors, ?> tracker = new ServiceTracker<IExecutors, Object>( bundleContext, bundleContext.createFilter( "(&(" + Constants.OBJECTCLASS + "=" + IExecutors.class.getName() + //$NON-NLS-1$ //$NON-NLS-2$ ")(name=" + getServletBundleName() + "))"), //$NON-NLS-1$ //$NON-NLS-2$ null); tracker.open(); return tracker; }
class class_name[name] begin[{] method[getExecutorsServiceTracker, return_type[type[ServiceTracker]], modifier[protected], parameter[bundleContext]] begin[{] local_variable[type[ServiceTracker], tracker] call[tracker.open, parameter[]] return[member[.tracker]] end[}] END[}]
Keyword[protected] identifier[ServiceTracker] operator[<] identifier[IExecutors] , operator[?] operator[>] identifier[getExecutorsServiceTracker] operator[SEP] identifier[BundleContext] identifier[bundleContext] operator[SEP] Keyword[throws] identifier[InvalidSyntaxException] { identifier[ServiceTracker] operator[<] identifier[IExecutors] , operator[?] operator[>] identifier[tracker] operator[=] Keyword[new] identifier[ServiceTracker] operator[<] identifier[IExecutors] , identifier[Object] operator[>] operator[SEP] identifier[bundleContext] , identifier[bundleContext] operator[SEP] identifier[createFilter] operator[SEP] literal[String] operator[+] identifier[Constants] operator[SEP] identifier[OBJECTCLASS] operator[+] literal[String] operator[+] identifier[IExecutors] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getServletBundleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] , Other[null] operator[SEP] operator[SEP] identifier[tracker] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[tracker] operator[SEP] }
public SetDomainRefererACLResponse setDomainRefererACL(SetDomainRefererACLRequest request) { checkNotNull(request, "The parameter request should NOT be null."); InternalRequest internalRequest = createRequest(request, HttpMethodName.PUT, DOMAIN, request.getDomain(), "config"); internalRequest.addParameter("refererACL",""); this.attachRequestToBody(request, internalRequest); return invokeHttpClient(internalRequest, SetDomainRefererACLResponse.class); }
class class_name[name] begin[{] method[setDomainRefererACL, return_type[type[SetDomainRefererACLResponse]], modifier[public], parameter[request]] begin[{] call[.checkNotNull, parameter[member[.request], literal["The parameter request should NOT be null."]]] local_variable[type[InternalRequest], internalRequest] call[internalRequest.addParameter, parameter[literal["refererACL"], literal[""]]] THIS[call[None.attachRequestToBody, parameter[member[.request], member[.internalRequest]]]] return[call[.invokeHttpClient, parameter[member[.internalRequest], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SetDomainRefererACLResponse, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[SetDomainRefererACLResponse] identifier[setDomainRefererACL] operator[SEP] identifier[SetDomainRefererACLRequest] identifier[request] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[request] , literal[String] operator[SEP] operator[SEP] identifier[InternalRequest] identifier[internalRequest] operator[=] identifier[createRequest] operator[SEP] identifier[request] , identifier[HttpMethodName] operator[SEP] identifier[PUT] , identifier[DOMAIN] , identifier[request] operator[SEP] identifier[getDomain] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[internalRequest] operator[SEP] identifier[addParameter] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[attachRequestToBody] operator[SEP] identifier[request] , identifier[internalRequest] operator[SEP] operator[SEP] Keyword[return] identifier[invokeHttpClient] operator[SEP] identifier[internalRequest] , identifier[SetDomainRefererACLResponse] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public void start() { if (this.isActive) return; if (clock == null) { throw new IllegalStateException("Clock is not set"); } this.isActive = true; logger.info("Starting "); cpuThread.activate(); logger.info("Started "); }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[]] begin[{] if[THIS[member[None.isActive]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[member[.clock], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Clock is not set")], 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[}] assign[THIS[member[None.isActive]], literal[true]] call[logger.info, parameter[literal["Starting "]]] call[cpuThread.activate, parameter[]] call[logger.info, parameter[literal["Started "]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isActive] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[clock] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[isActive] operator[=] literal[boolean] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cpuThread] operator[SEP] identifier[activate] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public static <K, V> List<V> addToValueList(Map<K, List<V>> map, K key, V value) { List<V> valueList = map.get(key); if (valueList == null) { valueList = new ArrayList<V>(); map.put(key, valueList); } valueList.add(value); return valueList; }
class class_name[name] begin[{] method[addToValueList, return_type[type[List]], modifier[public static], parameter[map, key, value]] begin[{] local_variable[type[List], valueList] if[binary_operation[member[.valueList], ==, literal[null]]] begin[{] assign[member[.valueList], 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=V, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] call[map.put, parameter[member[.key], member[.valueList]]] else begin[{] None end[}] call[valueList.add, parameter[member[.value]]] return[member[.valueList]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[List] operator[<] identifier[V] operator[>] identifier[addToValueList] operator[SEP] identifier[Map] operator[<] identifier[K] , identifier[List] operator[<] identifier[V] operator[>] operator[>] identifier[map] , identifier[K] identifier[key] , identifier[V] identifier[value] operator[SEP] { identifier[List] operator[<] identifier[V] operator[>] identifier[valueList] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[valueList] operator[==] Other[null] operator[SEP] { identifier[valueList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[V] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[valueList] operator[SEP] operator[SEP] } identifier[valueList] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[valueList] operator[SEP] }
public Object getSessionAttribute(String key, Object defaultValue) { Object attributeValue = this.sessionAttributes.get(key); if (attributeValue == null) attributeValue = defaultValue; return attributeValue; }
class class_name[name] begin[{] method[getSessionAttribute, return_type[type[Object]], modifier[public], parameter[key, defaultValue]] begin[{] local_variable[type[Object], attributeValue] if[binary_operation[member[.attributeValue], ==, literal[null]]] begin[{] assign[member[.attributeValue], member[.defaultValue]] else begin[{] None end[}] return[member[.attributeValue]] end[}] END[}]
Keyword[public] identifier[Object] identifier[getSessionAttribute] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[defaultValue] operator[SEP] { identifier[Object] identifier[attributeValue] operator[=] Keyword[this] operator[SEP] identifier[sessionAttributes] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attributeValue] operator[==] Other[null] operator[SEP] identifier[attributeValue] operator[=] identifier[defaultValue] operator[SEP] Keyword[return] identifier[attributeValue] operator[SEP] }
public Section addSection(Component component, String title, Format format, String content) { return add(component, title, format, content); }
class class_name[name] begin[{] method[addSection, return_type[type[Section]], modifier[public], parameter[component, title, format, content]] begin[{] return[call[.add, parameter[member[.component], member[.title], member[.format], member[.content]]]] end[}] END[}]
Keyword[public] identifier[Section] identifier[addSection] operator[SEP] identifier[Component] identifier[component] , identifier[String] identifier[title] , identifier[Format] identifier[format] , identifier[String] identifier[content] operator[SEP] { Keyword[return] identifier[add] operator[SEP] identifier[component] , identifier[title] , identifier[format] , identifier[content] operator[SEP] operator[SEP] }
private static List<NameValuePair> genericNameWithNameValuePairProcess(String s) { String name; Map<String, String> params = null; List<NameValuePair> nameValues = new ArrayList<NameValuePair>(); List<String> pkgs = new ArrayList<String>(); int index = s.indexOf(";"); if (index == -1) { name = s; params = new HashMap<String, String>(); pkgs.add(name); } else { name = s.substring(0, index).trim(); String tail = s.substring(index + 1).trim(); pkgs.add(name); // add the first package StringBuilder parameters = new StringBuilder(); // take into consideration of multiple packages separated by ';' // while they share the same attributes or directives List<String> tailParts = split(tail, ";"); boolean firstParameter = false; for (String part : tailParts) { // if it is not a parameter and no parameter appears in front of it, it must a package if (!!!(part.contains("="))) { // Need to make sure no parameter appears before the package, otherwise ignore this string // as this syntax is invalid if (!!!(firstParameter)) pkgs.add(part); } else { if (!!!(firstParameter)) firstParameter = true; parameters.append(part + ";"); } } if (parameters.length() != 0) { //remove the final ';' if there is one if (parameters.toString().endsWith(";")) { parameters = parameters.deleteCharAt(parameters.length() - 1); } params = genericNameValueProcess(parameters.toString()); } } for (String pkg : pkgs) { nameValues.add(new NameValuePair(pkg, params)); } return nameValues; }
class class_name[name] begin[{] method[genericNameWithNameValuePairProcess, return_type[type[List]], modifier[private static], parameter[s]] begin[{] local_variable[type[String], name] local_variable[type[Map], params] local_variable[type[List], nameValues] local_variable[type[List], pkgs] local_variable[type[int], index] if[binary_operation[member[.index], ==, literal[1]]] begin[{] assign[member[.name], member[.s]] assign[member[.params], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))] call[pkgs.add, parameter[member[.name]]] else begin[{] assign[member[.name], call[s.substring, parameter[literal[0], member[.index]]]] local_variable[type[String], tail] call[pkgs.add, parameter[member[.name]]] local_variable[type[StringBuilder], parameters] local_variable[type[List], tailParts] local_variable[type[boolean], firstParameter] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=contains, postfix_operators=[], prefix_operators=['!', '!', '!'], qualifier=part, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=firstParameter, postfix_operators=[], prefix_operators=['!', '!', '!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=firstParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=part, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=";"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=firstParameter, postfix_operators=[], prefix_operators=['!', '!', '!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=part, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=pkgs, selectors=[], type_arguments=None), label=None))]))]), control=EnhancedForControl(iterable=MemberReference(member=tailParts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=part)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[binary_operation[call[parameters.length, parameter[]], !=, literal[0]]] begin[{] if[call[parameters.toString, parameter[]]] begin[{] assign[member[.parameters], call[parameters.deleteCharAt, parameter[binary_operation[call[parameters.length, parameter[]], -, literal[1]]]]] else begin[{] None end[}] assign[member[.params], call[.genericNameValueProcess, parameter[call[parameters.toString, parameter[]]]]] else begin[{] None end[}] end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=pkg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=params, 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=NameValuePair, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=nameValues, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pkgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pkg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.nameValues]] end[}] END[}]
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[NameValuePair] operator[>] identifier[genericNameWithNameValuePairProcess] operator[SEP] identifier[String] identifier[s] operator[SEP] { identifier[String] identifier[name] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[NameValuePair] operator[>] identifier[nameValues] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[NameValuePair] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[pkgs] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] { identifier[name] operator[=] identifier[s] operator[SEP] identifier[params] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[pkgs] operator[SEP] identifier[add] operator[SEP] identifier[name] operator[SEP] operator[SEP] } Keyword[else] { identifier[name] operator[=] identifier[s] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[tail] operator[=] identifier[s] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[pkgs] operator[SEP] identifier[add] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[parameters] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[tailParts] operator[=] identifier[split] operator[SEP] identifier[tail] , literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[firstParameter] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[part] operator[:] identifier[tailParts] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[!] operator[!] operator[SEP] identifier[part] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[!] operator[!] operator[SEP] identifier[firstParameter] operator[SEP] operator[SEP] identifier[pkgs] operator[SEP] identifier[add] operator[SEP] identifier[part] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[!] operator[!] operator[!] operator[SEP] identifier[firstParameter] operator[SEP] operator[SEP] identifier[firstParameter] operator[=] literal[boolean] operator[SEP] identifier[parameters] operator[SEP] identifier[append] operator[SEP] identifier[part] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[parameters] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[parameters] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[parameters] operator[=] identifier[parameters] operator[SEP] identifier[deleteCharAt] operator[SEP] identifier[parameters] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } identifier[params] operator[=] identifier[genericNameValueProcess] operator[SEP] identifier[parameters] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[String] identifier[pkg] operator[:] identifier[pkgs] operator[SEP] { identifier[nameValues] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[NameValuePair] operator[SEP] identifier[pkg] , identifier[params] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[nameValues] operator[SEP] }
void setLexerAndParser(final Lexer lexer, final ParserWithFormula parser) { this.lexer = lexer; this.parser = parser; this.parser.setFormulaFactory(this.f); this.lexer.removeErrorListeners(); this.parser.removeErrorListeners(); this.parser.setErrorHandler(new BailErrorStrategy()); }
class class_name[name] begin[{] method[setLexerAndParser, return_type[void], modifier[default], parameter[lexer, parser]] begin[{] assign[THIS[member[None.lexer]], member[.lexer]] assign[THIS[member[None.parser]], member[.parser]] THIS[member[None.parser]call[None.setFormulaFactory, parameter[THIS[member[None.f]]]]] THIS[member[None.lexer]call[None.removeErrorListeners, parameter[]]] THIS[member[None.parser]call[None.removeErrorListeners, parameter[]]] THIS[member[None.parser]call[None.setErrorHandler, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BailErrorStrategy, sub_type=None))]]] end[}] END[}]
Keyword[void] identifier[setLexerAndParser] operator[SEP] Keyword[final] identifier[Lexer] identifier[lexer] , Keyword[final] identifier[ParserWithFormula] identifier[parser] operator[SEP] { Keyword[this] operator[SEP] identifier[lexer] operator[=] identifier[lexer] operator[SEP] Keyword[this] operator[SEP] identifier[parser] operator[=] identifier[parser] operator[SEP] Keyword[this] operator[SEP] identifier[parser] operator[SEP] identifier[setFormulaFactory] operator[SEP] Keyword[this] operator[SEP] identifier[f] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[lexer] operator[SEP] identifier[removeErrorListeners] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[parser] operator[SEP] identifier[removeErrorListeners] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[parser] operator[SEP] identifier[setErrorHandler] operator[SEP] Keyword[new] identifier[BailErrorStrategy] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static String percentageGraph(int perc, int width) throws IOException { assert perc >= 0; assert perc <= 100; StringBuilder builder = new StringBuilder(); builder.append("<table border=\"1px\" width=\""); builder.append(width); builder.append("px\"><tr>"); if(perc > 0) { builder.append("<td cellspacing=\"0\" class=\"perc_filled\" width=\""); builder.append(perc); builder.append("%\"></td>"); }if(perc < 100) { builder.append("<td cellspacing=\"0\" class=\"perc_nonfilled\" width=\""); builder.append(100 - perc); builder.append("%\"></td>"); } builder.append("</tr></table>"); return builder.toString(); }
class class_name[name] begin[{] method[percentageGraph, return_type[type[String]], modifier[public static], parameter[perc, width]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=perc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None, value=None) AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=perc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100), operator=<=), label=None, value=None) local_variable[type[StringBuilder], builder] call[builder.append, parameter[literal["<table border=\"1px\" width=\""]]] call[builder.append, parameter[member[.width]]] call[builder.append, parameter[literal["px\"><tr>"]]] if[binary_operation[member[.perc], >, literal[0]]] begin[{] call[builder.append, parameter[literal["<td cellspacing=\"0\" class=\"perc_filled\" width=\""]]] call[builder.append, parameter[member[.perc]]] call[builder.append, parameter[literal["%\"></td>"]]] else begin[{] None end[}] if[binary_operation[member[.perc], <, literal[100]]] begin[{] call[builder.append, parameter[literal["<td cellspacing=\"0\" class=\"perc_nonfilled\" width=\""]]] call[builder.append, parameter[binary_operation[literal[100], -, member[.perc]]]] call[builder.append, parameter[literal["%\"></td>"]]] else begin[{] None end[}] call[builder.append, parameter[literal["</tr></table>"]]] return[call[builder.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[percentageGraph] operator[SEP] Keyword[int] identifier[perc] , Keyword[int] identifier[width] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[assert] identifier[perc] operator[>=] Other[0] operator[SEP] Keyword[assert] identifier[perc] operator[<=] Other[100] 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[builder] operator[SEP] identifier[append] operator[SEP] identifier[width] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[perc] operator[>] Other[0] 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[perc] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[perc] operator[<] Other[100] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] Other[100] operator[-] identifier[perc] 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[return] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private static boolean multiPointRelateEnvelope_(MultiPoint multipoint_a, Envelope envelope_b, double tolerance, int relation, ProgressTracker progress_tracker) { switch (relation) { case Relation.disjoint: return multiPointDisjointEnvelope_(multipoint_a, envelope_b, tolerance, progress_tracker); case Relation.within: return multiPointWithinEnvelope_(multipoint_a, envelope_b, tolerance, progress_tracker); case Relation.contains: return multiPointContainsEnvelope_(multipoint_a, envelope_b, tolerance, progress_tracker); case Relation.equals: return multiPointEqualsEnvelope_(multipoint_a, envelope_b, tolerance, progress_tracker); case Relation.touches: return multiPointTouchesEnvelope_(multipoint_a, envelope_b, tolerance, progress_tracker); case Relation.crosses: return multiPointCrossesEnvelope_(multipoint_a, envelope_b, tolerance, progress_tracker); default: break; // warning fix } return false; }
class class_name[name] begin[{] method[multiPointRelateEnvelope_, return_type[type[boolean]], modifier[private static], parameter[multipoint_a, envelope_b, tolerance, relation, progress_tracker]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=disjoint, postfix_operators=[], prefix_operators=[], qualifier=Relation, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=multipoint_a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=envelope_b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tolerance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=progress_tracker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=multiPointDisjointEnvelope_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=within, postfix_operators=[], prefix_operators=[], qualifier=Relation, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=multipoint_a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=envelope_b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tolerance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=progress_tracker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=multiPointWithinEnvelope_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=contains, postfix_operators=[], prefix_operators=[], qualifier=Relation, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=multipoint_a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=envelope_b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tolerance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=progress_tracker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=multiPointContainsEnvelope_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=equals, postfix_operators=[], prefix_operators=[], qualifier=Relation, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=multipoint_a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=envelope_b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tolerance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=progress_tracker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=multiPointEqualsEnvelope_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=touches, postfix_operators=[], prefix_operators=[], qualifier=Relation, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=multipoint_a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=envelope_b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tolerance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=progress_tracker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=multiPointTouchesEnvelope_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=crosses, postfix_operators=[], prefix_operators=[], qualifier=Relation, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=multipoint_a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=envelope_b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tolerance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=progress_tracker, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=multiPointCrossesEnvelope_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MemberReference(member=relation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[literal[false]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[multiPointRelateEnvelope_] operator[SEP] identifier[MultiPoint] identifier[multipoint_a] , identifier[Envelope] identifier[envelope_b] , Keyword[double] identifier[tolerance] , Keyword[int] identifier[relation] , identifier[ProgressTracker] identifier[progress_tracker] operator[SEP] { Keyword[switch] operator[SEP] identifier[relation] operator[SEP] { Keyword[case] identifier[Relation] operator[SEP] identifier[disjoint] operator[:] Keyword[return] identifier[multiPointDisjointEnvelope_] operator[SEP] identifier[multipoint_a] , identifier[envelope_b] , identifier[tolerance] , identifier[progress_tracker] operator[SEP] operator[SEP] Keyword[case] identifier[Relation] operator[SEP] identifier[within] operator[:] Keyword[return] identifier[multiPointWithinEnvelope_] operator[SEP] identifier[multipoint_a] , identifier[envelope_b] , identifier[tolerance] , identifier[progress_tracker] operator[SEP] operator[SEP] Keyword[case] identifier[Relation] operator[SEP] identifier[contains] operator[:] Keyword[return] identifier[multiPointContainsEnvelope_] operator[SEP] identifier[multipoint_a] , identifier[envelope_b] , identifier[tolerance] , identifier[progress_tracker] operator[SEP] operator[SEP] Keyword[case] identifier[Relation] operator[SEP] identifier[equals] operator[:] Keyword[return] identifier[multiPointEqualsEnvelope_] operator[SEP] identifier[multipoint_a] , identifier[envelope_b] , identifier[tolerance] , identifier[progress_tracker] operator[SEP] operator[SEP] Keyword[case] identifier[Relation] operator[SEP] identifier[touches] operator[:] Keyword[return] identifier[multiPointTouchesEnvelope_] operator[SEP] identifier[multipoint_a] , identifier[envelope_b] , identifier[tolerance] , identifier[progress_tracker] operator[SEP] operator[SEP] Keyword[case] identifier[Relation] operator[SEP] identifier[crosses] operator[:] Keyword[return] identifier[multiPointCrossesEnvelope_] operator[SEP] identifier[multipoint_a] , identifier[envelope_b] , identifier[tolerance] , identifier[progress_tracker] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static <A> A reduceLeft (F<A,A> func, Iterable<? extends A> values) { Iterator<? extends A> iter = values.iterator(); A zero = iter.next(); while (iter.hasNext()) { zero = func.apply(zero, iter.next()); } return zero; }
class class_name[name] begin[{] method[reduceLeft, return_type[type[A]], modifier[public static], parameter[func, values]] begin[{] local_variable[type[Iterator], iter] local_variable[type[A], zero] while[call[iter.hasNext, parameter[]]] begin[{] assign[member[.zero], call[func.apply, parameter[member[.zero], call[iter.next, parameter[]]]]] end[}] return[member[.zero]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[A] operator[>] identifier[A] identifier[reduceLeft] operator[SEP] identifier[F] operator[<] identifier[A] , identifier[A] operator[>] identifier[func] , identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[A] operator[>] identifier[values] operator[SEP] { identifier[Iterator] operator[<] operator[?] Keyword[extends] identifier[A] operator[>] identifier[iter] operator[=] identifier[values] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[A] identifier[zero] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[zero] operator[=] identifier[func] operator[SEP] identifier[apply] operator[SEP] identifier[zero] , identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[zero] operator[SEP] }
private static int getAbsoluteLevelOffset(@NotNull String path, @NotNull ResourceResolver resourceResolver) { Matcher versionHistoryMatcher = VERSION_HISTORY_PATTERN.matcher(path); if (versionHistoryMatcher.matches()) { return 3; } Matcher legacyVersionHistoryMatcher = LEGACY_VERSION_HISTORY_PATTERN.matcher(path); if (legacyVersionHistoryMatcher.matches()) { if (isTenant(resourceResolver)) { legacyVersionHistoryMatcher = LEGACY_VERSION_HISTORY_TENANT_PATTERN.matcher(path); if (legacyVersionHistoryMatcher.matches()) { return 3; } } return 2; } Matcher launchesMatcher = LAUNCHES_PATTERN.matcher(path); if (launchesMatcher.matches()) { return 6; } return 0; }
class class_name[name] begin[{] method[getAbsoluteLevelOffset, return_type[type[int]], modifier[private static], parameter[path, resourceResolver]] begin[{] local_variable[type[Matcher], versionHistoryMatcher] if[call[versionHistoryMatcher.matches, parameter[]]] begin[{] return[literal[3]] else begin[{] None end[}] local_variable[type[Matcher], legacyVersionHistoryMatcher] if[call[legacyVersionHistoryMatcher.matches, parameter[]]] begin[{] if[call[.isTenant, parameter[member[.resourceResolver]]]] begin[{] assign[member[.legacyVersionHistoryMatcher], call[LEGACY_VERSION_HISTORY_TENANT_PATTERN.matcher, parameter[member[.path]]]] if[call[legacyVersionHistoryMatcher.matches, parameter[]]] begin[{] return[literal[3]] else begin[{] None end[}] else begin[{] None end[}] return[literal[2]] else begin[{] None end[}] local_variable[type[Matcher], launchesMatcher] if[call[launchesMatcher.matches, parameter[]]] begin[{] return[literal[6]] else begin[{] None end[}] return[literal[0]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[int] identifier[getAbsoluteLevelOffset] operator[SEP] annotation[@] identifier[NotNull] identifier[String] identifier[path] , annotation[@] identifier[NotNull] identifier[ResourceResolver] identifier[resourceResolver] operator[SEP] { identifier[Matcher] identifier[versionHistoryMatcher] operator[=] identifier[VERSION_HISTORY_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[versionHistoryMatcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[3] operator[SEP] } identifier[Matcher] identifier[legacyVersionHistoryMatcher] operator[=] identifier[LEGACY_VERSION_HISTORY_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[legacyVersionHistoryMatcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isTenant] operator[SEP] identifier[resourceResolver] operator[SEP] operator[SEP] { identifier[legacyVersionHistoryMatcher] operator[=] identifier[LEGACY_VERSION_HISTORY_TENANT_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[legacyVersionHistoryMatcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[3] operator[SEP] } } Keyword[return] Other[2] operator[SEP] } identifier[Matcher] identifier[launchesMatcher] operator[=] identifier[LAUNCHES_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[launchesMatcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[6] operator[SEP] } Keyword[return] Other[0] operator[SEP] }
public static final Path create(Path path, String perms) throws IOException { return create(path, null, perms); }
class class_name[name] begin[{] method[create, return_type[type[Path]], modifier[final public static], parameter[path, perms]] begin[{] return[call[.create, parameter[member[.path], literal[null], member[.perms]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] identifier[Path] identifier[create] operator[SEP] identifier[Path] identifier[path] , identifier[String] identifier[perms] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[create] operator[SEP] identifier[path] , Other[null] , identifier[perms] operator[SEP] operator[SEP] }
@CanIgnoreReturnValue // TODO(cpovirk): Consider calling getDone() in our own code. public static <V> V getDone(Future<V> future) throws ExecutionException { /* * We throw IllegalStateException, since the call could succeed later. Perhaps we "should" throw * IllegalArgumentException, since the call could succeed with a different argument. Those * exceptions' docs suggest that either is acceptable. Google's Java Practices page recommends * IllegalArgumentException here, in part to keep its recommendation simple: Static methods * should throw IllegalStateException only when they use static state. * * * Why do we deviate here? The answer: We want for fluentFuture.getDone() to throw the same * exception as Futures.getDone(fluentFuture). */ checkState(future.isDone(), "Future was expected to be done: %s", future); return getUninterruptibly(future); }
class class_name[name] begin[{] method[getDone, return_type[type[V]], modifier[public static], parameter[future]] begin[{] call[.checkState, parameter[call[future.isDone, parameter[]], literal["Future was expected to be done: %s"], member[.future]]] return[call[.getUninterruptibly, parameter[member[.future]]]] end[}] END[}]
annotation[@] identifier[CanIgnoreReturnValue] Keyword[public] Keyword[static] operator[<] identifier[V] operator[>] identifier[V] identifier[getDone] operator[SEP] identifier[Future] operator[<] identifier[V] operator[>] identifier[future] operator[SEP] Keyword[throws] identifier[ExecutionException] { identifier[checkState] operator[SEP] identifier[future] operator[SEP] identifier[isDone] operator[SEP] operator[SEP] , literal[String] , identifier[future] operator[SEP] operator[SEP] Keyword[return] identifier[getUninterruptibly] operator[SEP] identifier[future] operator[SEP] operator[SEP] }
public Charset detectCodepage(URL url) throws IOException { Charset result; BufferedInputStream in = new BufferedInputStream(url.openStream()); result = this.detectCodepage(in, Integer.MAX_VALUE); in.close(); return result; }
class class_name[name] begin[{] method[detectCodepage, return_type[type[Charset]], modifier[public], parameter[url]] begin[{] local_variable[type[Charset], result] local_variable[type[BufferedInputStream], in] assign[member[.result], THIS[call[None.detectCodepage, parameter[member[.in], member[Integer.MAX_VALUE]]]]] call[in.close, parameter[]] return[member[.result]] end[}] END[}]
Keyword[public] identifier[Charset] identifier[detectCodepage] operator[SEP] identifier[URL] identifier[url] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Charset] identifier[result] operator[SEP] identifier[BufferedInputStream] identifier[in] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[url] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[this] operator[SEP] identifier[detectCodepage] operator[SEP] identifier[in] , identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] identifier[in] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
private void handleException(final Call call, final Exception e, final Callback callback) { if (call.isCanceled()) { callback.onCancellation(); } else { callback.onFailure(e); } }
class class_name[name] begin[{] method[handleException, return_type[void], modifier[private], parameter[call, e, callback]] begin[{] if[call[call.isCanceled, parameter[]]] begin[{] call[callback.onCancellation, parameter[]] else begin[{] call[callback.onFailure, parameter[member[.e]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[handleException] operator[SEP] Keyword[final] identifier[Call] identifier[call] , Keyword[final] identifier[Exception] identifier[e] , Keyword[final] identifier[Callback] identifier[callback] operator[SEP] { Keyword[if] operator[SEP] identifier[call] operator[SEP] identifier[isCanceled] operator[SEP] operator[SEP] operator[SEP] { identifier[callback] operator[SEP] identifier[onCancellation] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[callback] operator[SEP] identifier[onFailure] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public void execute() throws Exception { // Read the properties file, if it exists. properties = new Properties(); if (propertiesFile != null) { FileInputStream propertiesStream = null; try { propertiesStream = new FileInputStream(propertiesFile); properties.load(propertiesStream); } catch (final Exception e) { throw new RuntimeException(e); } finally { if (propertiesStream != null) { try { propertiesStream.close(); } catch (final IOException e) { logger.error(e.getMessage(), e) ; } } } } else { properties.putAll(Configuration.configuration); } if (!properties.containsKey(CONF_PLUGIN_DIRS)) { properties.setProperty(CONF_PLUGIN_DIRS, configuration.getOrDefault(CONF_PLUGIN_DIRS, "plugins;demo")); } if (!properties.containsKey(CONF_PLUGIN_IGNORES)) { properties.setProperty(CONF_PLUGIN_IGNORES, configuration.getOrDefault(CONF_PLUGIN_IGNORES, "")); } // Get the list of plugin directories from the properties. final String[] pluginDirs = properties.getProperty(CONF_PLUGIN_DIRS).split(PARAM_VALUE_SEPARATOR); final Set<String> pluginIgnores = new HashSet<>(); if (properties.getProperty(CONF_PLUGIN_IGNORES) != null) { pluginIgnores.addAll(Arrays.asList(properties.getProperty(CONF_PLUGIN_IGNORES).split(PARAM_VALUE_SEPARATOR))); } final String pluginOrderProperty = properties.getProperty(CONF_PLUGIN_ORDER); if (pluginOrderProperty != null) { final List<String> plugins = asList(pluginOrderProperty.trim().split("\\s+")); Collections.reverse(plugins); int priority = 1; for (final String plugin: plugins) { pluginOrder.put(plugin, priority++); } } for (final String tmpl : properties.getProperty(CONF_TEMPLATES, "").split(PARAM_VALUE_SEPARATOR)) { final String t = tmpl.trim(); if (t.length() != 0) { logger.warn(MessageUtils.getMessage("DOTJ080W", "templates", "template").toString()); templateSet.put(t, null); } } for (final String pluginDir2 : pluginDirs) { File pluginDir = new File(pluginDir2); if (!pluginDir.isAbsolute()) { pluginDir = new File(ditaDir, pluginDir.getPath()); } final File[] pluginFiles = pluginDir.listFiles(); for (int i = 0; (pluginFiles != null) && (i < pluginFiles.length); i++) { final File f = pluginFiles[i]; final File descFile = new File(pluginFiles[i], "plugin.xml"); if (pluginFiles[i].isDirectory() && !pluginIgnores.contains(f.getName()) && descFile.exists()) { descSet.add(descFile); } } } mergePlugins(); integrate(); logChanges(pluginList, getPluginIds(pluginsDoc)); }
class class_name[name] begin[{] method[execute, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.properties], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Properties, sub_type=None))] if[binary_operation[member[.propertiesFile], !=, literal[null]]] begin[{] local_variable[type[FileInputStream], propertiesStream] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=propertiesStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=propertiesFile, 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=FileInputStream, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=propertiesStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=propertiesStream, 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=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=propertiesStream, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), 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=['IOException']))], finally_block=None, label=None, resources=None)]))], label=None, resources=None) else begin[{] call[properties.putAll, parameter[member[Configuration.configuration]]] end[}] if[call[properties.containsKey, parameter[member[.CONF_PLUGIN_DIRS]]]] begin[{] call[properties.setProperty, parameter[member[.CONF_PLUGIN_DIRS], call[configuration.getOrDefault, parameter[member[.CONF_PLUGIN_DIRS], literal["plugins;demo"]]]]] else begin[{] None end[}] if[call[properties.containsKey, parameter[member[.CONF_PLUGIN_IGNORES]]]] begin[{] call[properties.setProperty, parameter[member[.CONF_PLUGIN_IGNORES], call[configuration.getOrDefault, parameter[member[.CONF_PLUGIN_IGNORES], literal[""]]]]] else begin[{] None end[}] local_variable[type[String], pluginDirs] local_variable[type[Set], pluginIgnores] if[binary_operation[call[properties.getProperty, parameter[member[.CONF_PLUGIN_IGNORES]]], !=, literal[null]]] begin[{] call[pluginIgnores.addAll, parameter[call[Arrays.asList, parameter[call[properties.getProperty, parameter[member[.CONF_PLUGIN_IGNORES]]]]]]] else begin[{] None end[}] local_variable[type[String], pluginOrderProperty] if[binary_operation[member[.pluginOrderProperty], !=, literal[null]]] begin[{] local_variable[type[List], plugins] call[Collections.reverse, parameter[member[.plugins]]] local_variable[type[int], priority] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=plugin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=priority, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=pluginOrder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=plugins, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=plugin)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=tmpl, selectors=[], type_arguments=None), name=t)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="DOTJ080W"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="templates"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="template")], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=MessageUtils, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=put, postfix_operators=[], prefix_operators=[], qualifier=templateSet, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=CONF_TEMPLATES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[MethodInvocation(arguments=[MemberReference(member=PARAM_VALUE_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tmpl)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=pluginDir2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=pluginDir)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isAbsolute, postfix_operators=[], prefix_operators=['!'], qualifier=pluginDir, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pluginDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=ditaDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=pluginDir, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=listFiles, postfix_operators=[], prefix_operators=[], qualifier=pluginDir, selectors=[], type_arguments=None), name=pluginFiles)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=File, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=pluginFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=f)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=pluginFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="plugin.xml")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=descFile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pluginFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=isDirectory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=pluginIgnores, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=descFile, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=descFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=descSet, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pluginFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=pluginFiles, selectors=[]), operator=<), 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)]), control=EnhancedForControl(iterable=MemberReference(member=pluginDirs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pluginDir2)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[.mergePlugins, parameter[]] call[.integrate, parameter[]] call[.logChanges, parameter[member[.pluginList], call[.getPluginIds, parameter[member[.pluginsDoc]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[properties] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[propertiesFile] operator[!=] Other[null] operator[SEP] { identifier[FileInputStream] identifier[propertiesStream] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[propertiesStream] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[propertiesFile] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[load] operator[SEP] identifier[propertiesStream] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[propertiesStream] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[propertiesStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } } } Keyword[else] { identifier[properties] operator[SEP] identifier[putAll] operator[SEP] identifier[Configuration] operator[SEP] identifier[configuration] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[properties] operator[SEP] identifier[containsKey] operator[SEP] identifier[CONF_PLUGIN_DIRS] operator[SEP] operator[SEP] { identifier[properties] operator[SEP] identifier[setProperty] operator[SEP] identifier[CONF_PLUGIN_DIRS] , identifier[configuration] operator[SEP] identifier[getOrDefault] operator[SEP] identifier[CONF_PLUGIN_DIRS] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[properties] operator[SEP] identifier[containsKey] operator[SEP] identifier[CONF_PLUGIN_IGNORES] operator[SEP] operator[SEP] { identifier[properties] operator[SEP] identifier[setProperty] operator[SEP] identifier[CONF_PLUGIN_IGNORES] , identifier[configuration] operator[SEP] identifier[getOrDefault] operator[SEP] identifier[CONF_PLUGIN_IGNORES] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[pluginDirs] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[CONF_PLUGIN_DIRS] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[PARAM_VALUE_SEPARATOR] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[pluginIgnores] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[CONF_PLUGIN_IGNORES] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[pluginIgnores] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[CONF_PLUGIN_IGNORES] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[PARAM_VALUE_SEPARATOR] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[pluginOrderProperty] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[CONF_PLUGIN_ORDER] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pluginOrderProperty] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[plugins] operator[=] identifier[asList] operator[SEP] identifier[pluginOrderProperty] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[reverse] operator[SEP] identifier[plugins] operator[SEP] operator[SEP] Keyword[int] identifier[priority] operator[=] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[plugin] operator[:] identifier[plugins] operator[SEP] { identifier[pluginOrder] operator[SEP] identifier[put] operator[SEP] identifier[plugin] , identifier[priority] operator[++] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[tmpl] operator[:] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[CONF_TEMPLATES] , literal[String] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[PARAM_VALUE_SEPARATOR] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[t] operator[=] identifier[tmpl] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] identifier[MessageUtils] operator[SEP] identifier[getMessage] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[templateSet] operator[SEP] identifier[put] operator[SEP] identifier[t] , Other[null] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[pluginDir2] operator[:] identifier[pluginDirs] operator[SEP] { identifier[File] identifier[pluginDir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[pluginDir2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[pluginDir] operator[SEP] identifier[isAbsolute] operator[SEP] operator[SEP] operator[SEP] { identifier[pluginDir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[ditaDir] , identifier[pluginDir] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[File] operator[SEP] operator[SEP] identifier[pluginFiles] operator[=] identifier[pluginDir] operator[SEP] identifier[listFiles] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] operator[SEP] identifier[pluginFiles] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[i] operator[<] identifier[pluginFiles] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] identifier[File] identifier[f] operator[=] identifier[pluginFiles] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[descFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[pluginFiles] operator[SEP] identifier[i] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pluginFiles] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[pluginIgnores] operator[SEP] identifier[contains] operator[SEP] identifier[f] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[descFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[descSet] operator[SEP] identifier[add] operator[SEP] identifier[descFile] operator[SEP] operator[SEP] } } } identifier[mergePlugins] operator[SEP] operator[SEP] operator[SEP] identifier[integrate] operator[SEP] operator[SEP] operator[SEP] identifier[logChanges] operator[SEP] identifier[pluginList] , identifier[getPluginIds] operator[SEP] identifier[pluginsDoc] operator[SEP] operator[SEP] operator[SEP] }
@Override public ResourceSet<Transcription> read(final TwilioRestClient client) { return new ResourceSet<>(this, client, firstPage(client)); }
class class_name[name] begin[{] method[read, return_type[type[ResourceSet]], modifier[public], parameter[client]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=firstPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ResourceSet, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ResourceSet] operator[<] identifier[Transcription] operator[>] identifier[read] operator[SEP] Keyword[final] identifier[TwilioRestClient] identifier[client] operator[SEP] { Keyword[return] Keyword[new] identifier[ResourceSet] operator[<] operator[>] operator[SEP] Keyword[this] , identifier[client] , identifier[firstPage] operator[SEP] identifier[client] operator[SEP] operator[SEP] operator[SEP] }
private WFSharedContext extractWFDispatcherResult( final DispatcherResult dispatcherResult, final List<StepExecutionResult> results, final Map<String, Collection<StepExecutionResult>> failures, final Map<Integer, StepExecutionResult> stepFailures, int index, int max ) { WFSharedContext wfSharedContext = new WFSharedContext(); ArrayList<HashMap<String, NodeStepResult>> mergedStepResults = new ArrayList<>(max); ArrayList<Boolean> successes = new ArrayList<>(max); HashMap<Integer, Map<String, NodeStepResult>> mergedStepFailures = new HashMap<>(); //Convert a dispatcher result to a list of StepExecutionResults. //each result for node in the dispatcheresult contains a workflow result //unroll each workflow result, append the result of each step into map of node results //merge each step result with the mergedStepResults //DispatcherResult contains map {nodename: NodeStepResult} for (final String nodeName : dispatcherResult.getResults().keySet()) { final NodeStepResult stepResult = dispatcherResult.getResults().get(nodeName); if (stepResult.getSharedContext() != null) { wfSharedContext.merge(stepResult.getSharedContext()); } //This NodeStepResult is produced by the DispatchedWorkflow wrapper WorkflowExecutionResult result = DispatchedWorkflow.extractWorkflowResult(stepResult); failures.computeIfAbsent(nodeName, k -> new ArrayList<>()); //extract failures for this node final Collection<StepExecutionResult> thisNodeFailures = result.getNodeFailures().get(nodeName); if (null != thisNodeFailures && thisNodeFailures.size() > 0) { failures.get(nodeName).addAll(thisNodeFailures); } //extract failures by step (for this node) Map<Integer, NodeStepResult> perStepFailures = DispatchedWorkflow.extractStepFailures(result, stepResult.getNode()); for (final Map.Entry<Integer, NodeStepResult> entry : perStepFailures.entrySet()) { Integer stepNum = entry.getKey(); NodeStepResult value = entry.getValue(); mergedStepFailures.computeIfAbsent(stepNum, k -> new HashMap<>()); mergedStepFailures.get(stepNum).put(nodeName, value); } if (result.getResultSet().size() < 1 && result.getNodeFailures().size() < 1 && result.getStepFailures() .size() < 1 && !result.isSuccess()) { //failure could be prior to any node step mergedStepFailures.computeIfAbsent(0, k -> new HashMap<>()); mergedStepFailures.get(0).put(nodeName, stepResult); } //The WorkflowExecutionResult has a list of StepExecutionResults produced by NodeDispatchStepExecutor List<NodeStepResult> results1 = DispatchedWorkflow.extractNodeStepResults(result, stepResult.getNode()); int i = 0; for (final NodeStepResult nodeStepResult : results1) { while (mergedStepResults.size() <= i) { mergedStepResults.add(new HashMap<>()); } while (successes.size() <= i) { successes.add(Boolean.TRUE); } HashMap<String, NodeStepResult> map = mergedStepResults.get(i); map.put(nodeName, nodeStepResult); if (!nodeStepResult.isSuccess()) { successes.set(i, false); // failures.get(nodeName).add(nodeStepResult); } i++; } } //add a new wrapped DispatcherResults for each original step int x = 0; for (final HashMap<String, NodeStepResult> map : mergedStepResults) { Boolean success = successes.get(x); DispatcherResult r = new DispatcherResultImpl(map, null != success ? success : false); results.add(NodeDispatchStepExecutor.wrapDispatcherResult(r)); x++; } //merge failures for each step for (final Integer integer : mergedStepFailures.keySet()) { Map<String, NodeStepResult> map = mergedStepFailures.get(integer); DispatcherResult r = new DispatcherResultImpl(map, false); stepFailures.put(integer, NodeDispatchStepExecutor.wrapDispatcherResult(r)); } return wfSharedContext; }
class class_name[name] begin[{] method[extractWFDispatcherResult, return_type[type[WFSharedContext]], modifier[private], parameter[dispatcherResult, results, failures, stepFailures, index, max]] begin[{] local_variable[type[WFSharedContext], wfSharedContext] local_variable[type[ArrayList], mergedStepResults] local_variable[type[ArrayList], successes] local_variable[type[HashMap], mergedStepFailures] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResults, postfix_operators=[], prefix_operators=[], qualifier=dispatcherResult, selectors=[MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=stepResult)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=NodeStepResult, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSharedContext, postfix_operators=[], prefix_operators=[], qualifier=stepResult, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSharedContext, postfix_operators=[], prefix_operators=[], qualifier=stepResult, selectors=[], type_arguments=None)], member=merge, postfix_operators=[], prefix_operators=[], qualifier=wfSharedContext, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=stepResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractWorkflowResult, postfix_operators=[], prefix_operators=[], qualifier=DispatchedWorkflow, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=WorkflowExecutionResult, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), parameters=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=computeIfAbsent, postfix_operators=[], prefix_operators=[], qualifier=failures, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNodeFailures, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=thisNodeFailures)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=StepExecutionResult, sub_type=None))], dimensions=[], name=Collection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=thisNodeFailures, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=thisNodeFailures, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=failures, selectors=[MethodInvocation(arguments=[MemberReference(member=thisNodeFailures, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=stepResult, selectors=[], type_arguments=None)], member=extractStepFailures, postfix_operators=[], prefix_operators=[], qualifier=DispatchedWorkflow, selectors=[], type_arguments=None), name=perStepFailures)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NodeStepResult, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=stepNum)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeStepResult, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stepNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), parameters=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=computeIfAbsent, postfix_operators=[], prefix_operators=[], qualifier=mergedStepFailures, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stepNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mergedStepFailures, selectors=[MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=perStepFailures, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NodeStepResult, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getResultSet, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNodeFailures, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStepFailures, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<), operator=&&), operandr=MethodInvocation(arguments=[], member=isSuccess, postfix_operators=[], prefix_operators=['!'], qualifier=result, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), LambdaExpression(body=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), parameters=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=computeIfAbsent, postfix_operators=[], prefix_operators=[], qualifier=mergedStepFailures, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=mergedStepFailures, selectors=[MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stepResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=stepResult, selectors=[], type_arguments=None)], member=extractNodeStepResults, postfix_operators=[], prefix_operators=[], qualifier=DispatchedWorkflow, selectors=[], type_arguments=None), name=results1)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NodeStepResult, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=mergedStepResults, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=mergedStepResults, selectors=[], type_arguments=None), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=TRUE, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=successes, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=successes, selectors=[], type_arguments=None), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mergedStepResults, selectors=[], type_arguments=None), name=map)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NodeStepResult, sub_type=None))], dimensions=[], name=HashMap, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nodeStepResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isSuccess, postfix_operators=[], prefix_operators=['!'], qualifier=nodeStepResult, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=set, postfix_operators=[], prefix_operators=[], qualifier=successes, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=results1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=nodeStepResult)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=NodeStepResult, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getResults, postfix_operators=[], prefix_operators=[], qualifier=dispatcherResult, selectors=[MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=nodeName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[int], x] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=successes, selectors=[], type_arguments=None), name=success)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=success, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), if_true=MemberReference(member=success, 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=DispatcherResultImpl, sub_type=None)), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DispatcherResult, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrapDispatcherResult, postfix_operators=[], prefix_operators=[], qualifier=NodeDispatchStepExecutor, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=mergedStepResults, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=map)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NodeStepResult, sub_type=None))], dimensions=[], name=HashMap, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=integer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=mergedStepFailures, selectors=[], type_arguments=None), name=map)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NodeStepResult, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=map, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DispatcherResultImpl, sub_type=None)), name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DispatcherResult, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=integer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrapDispatcherResult, postfix_operators=[], prefix_operators=[], qualifier=NodeDispatchStepExecutor, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=stepFailures, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=mergedStepFailures, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=integer)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None) return[member[.wfSharedContext]] end[}] END[}]
Keyword[private] identifier[WFSharedContext] identifier[extractWFDispatcherResult] operator[SEP] Keyword[final] identifier[DispatcherResult] identifier[dispatcherResult] , Keyword[final] identifier[List] operator[<] identifier[StepExecutionResult] operator[>] identifier[results] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Collection] operator[<] identifier[StepExecutionResult] operator[>] operator[>] identifier[failures] , Keyword[final] identifier[Map] operator[<] identifier[Integer] , identifier[StepExecutionResult] operator[>] identifier[stepFailures] , Keyword[int] identifier[index] , Keyword[int] identifier[max] operator[SEP] { identifier[WFSharedContext] identifier[wfSharedContext] operator[=] Keyword[new] identifier[WFSharedContext] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[HashMap] operator[<] identifier[String] , identifier[NodeStepResult] operator[>] operator[>] identifier[mergedStepResults] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[max] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[Boolean] operator[>] identifier[successes] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[max] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[Integer] , identifier[Map] operator[<] identifier[String] , identifier[NodeStepResult] operator[>] operator[>] identifier[mergedStepFailures] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[nodeName] operator[:] identifier[dispatcherResult] operator[SEP] identifier[getResults] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[NodeStepResult] identifier[stepResult] operator[=] identifier[dispatcherResult] operator[SEP] identifier[getResults] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nodeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stepResult] operator[SEP] identifier[getSharedContext] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[wfSharedContext] operator[SEP] identifier[merge] operator[SEP] identifier[stepResult] operator[SEP] identifier[getSharedContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[WorkflowExecutionResult] identifier[result] operator[=] identifier[DispatchedWorkflow] operator[SEP] identifier[extractWorkflowResult] operator[SEP] identifier[stepResult] operator[SEP] operator[SEP] identifier[failures] operator[SEP] identifier[computeIfAbsent] operator[SEP] identifier[nodeName] , identifier[k] operator[->] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[StepExecutionResult] operator[>] identifier[thisNodeFailures] operator[=] identifier[result] operator[SEP] identifier[getNodeFailures] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nodeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[thisNodeFailures] operator[&&] identifier[thisNodeFailures] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[failures] operator[SEP] identifier[get] operator[SEP] identifier[nodeName] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[thisNodeFailures] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[Integer] , identifier[NodeStepResult] operator[>] identifier[perStepFailures] operator[=] identifier[DispatchedWorkflow] operator[SEP] identifier[extractStepFailures] operator[SEP] identifier[result] , identifier[stepResult] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[NodeStepResult] operator[>] identifier[entry] operator[:] identifier[perStepFailures] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Integer] identifier[stepNum] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[NodeStepResult] identifier[value] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[mergedStepFailures] operator[SEP] identifier[computeIfAbsent] operator[SEP] identifier[stepNum] , identifier[k] operator[->] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mergedStepFailures] operator[SEP] identifier[get] operator[SEP] identifier[stepNum] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[nodeName] , identifier[value] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[getResultSet] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[1] operator[&&] identifier[result] operator[SEP] identifier[getNodeFailures] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[1] operator[&&] identifier[result] operator[SEP] identifier[getStepFailures] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[1] operator[&&] operator[!] identifier[result] operator[SEP] identifier[isSuccess] operator[SEP] operator[SEP] operator[SEP] { identifier[mergedStepFailures] operator[SEP] identifier[computeIfAbsent] operator[SEP] Other[0] , identifier[k] operator[->] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mergedStepFailures] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[nodeName] , identifier[stepResult] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[NodeStepResult] operator[>] identifier[results1] operator[=] identifier[DispatchedWorkflow] operator[SEP] identifier[extractNodeStepResults] operator[SEP] identifier[result] , identifier[stepResult] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[NodeStepResult] identifier[nodeStepResult] operator[:] identifier[results1] operator[SEP] { Keyword[while] operator[SEP] identifier[mergedStepResults] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<=] identifier[i] operator[SEP] { identifier[mergedStepResults] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[successes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<=] identifier[i] operator[SEP] { identifier[successes] operator[SEP] identifier[add] operator[SEP] identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] operator[SEP] } identifier[HashMap] operator[<] identifier[String] , identifier[NodeStepResult] operator[>] identifier[map] operator[=] identifier[mergedStepResults] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[nodeName] , identifier[nodeStepResult] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[nodeStepResult] operator[SEP] identifier[isSuccess] operator[SEP] operator[SEP] operator[SEP] { identifier[successes] operator[SEP] identifier[set] operator[SEP] identifier[i] , literal[boolean] operator[SEP] operator[SEP] } identifier[i] operator[++] operator[SEP] } } Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[HashMap] operator[<] identifier[String] , identifier[NodeStepResult] operator[>] identifier[map] operator[:] identifier[mergedStepResults] operator[SEP] { identifier[Boolean] identifier[success] operator[=] identifier[successes] operator[SEP] identifier[get] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[DispatcherResult] identifier[r] operator[=] Keyword[new] identifier[DispatcherResultImpl] operator[SEP] identifier[map] , Other[null] operator[!=] identifier[success] operator[?] identifier[success] operator[:] literal[boolean] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[NodeDispatchStepExecutor] operator[SEP] identifier[wrapDispatcherResult] operator[SEP] identifier[r] operator[SEP] operator[SEP] operator[SEP] identifier[x] operator[++] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] identifier[Integer] identifier[integer] operator[:] identifier[mergedStepFailures] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[NodeStepResult] operator[>] identifier[map] operator[=] identifier[mergedStepFailures] operator[SEP] identifier[get] operator[SEP] identifier[integer] operator[SEP] operator[SEP] identifier[DispatcherResult] identifier[r] operator[=] Keyword[new] identifier[DispatcherResultImpl] operator[SEP] identifier[map] , literal[boolean] operator[SEP] operator[SEP] identifier[stepFailures] operator[SEP] identifier[put] operator[SEP] identifier[integer] , identifier[NodeDispatchStepExecutor] operator[SEP] identifier[wrapDispatcherResult] operator[SEP] identifier[r] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[wfSharedContext] operator[SEP] }
public BaseTable doMakeTable(Record record) { BaseTable table = null; boolean bIsQueryRecord = record.isQueryRecord(); boolean bIsQuerySupported = !DBConstants.FALSE.equalsIgnoreCase(this.getProperty(SQLParams.SQL_JOINS_SUPPORTED)); if ((bIsQueryRecord) && (bIsQuerySupported)) if (!DBConstants.TRUE.equalsIgnoreCase(this.getProperty(SQLParams.SQL_VIEWS_BUILT))) { // If this is a query and there are no SQL Views, make sure this query doesn't have an object (multi) query as one of it's records. if (record instanceof QueryRecord) // Always bIsQuerySupported = !((QueryRecord)record).isComplexQuery(); } int iRawDBType = (record.getDatabaseType() & DBConstants.TABLE_TYPE_MASK); if (((iRawDBType == DBConstants.LOCAL) || (iRawDBType == DBConstants.TABLE)) && (!bIsQueryRecord)) table = new JdbcTable(this, record); else if ((bIsQueryRecord) && ((!bIsQuerySupported) || ((record.getDatabaseType() & DBConstants.MANUAL_QUERY) != 0))) { // Physical Tables cannot process SQL queries, so use QueryTable! PassThruTable passThruTable = new QueryTable(this, record); passThruTable.addTable(record.getRecordlistAt(0).getTable()); table = passThruTable; } else if ((iRawDBType == DBConstants.LOCAL) || (iRawDBType == DBConstants.REMOTE) || (iRawDBType == DBConstants.TABLE)) table = new JdbcTable(this, record); else table = super.doMakeTable(record); return table; }
class class_name[name] begin[{] method[doMakeTable, return_type[type[BaseTable]], modifier[public], parameter[record]] begin[{] local_variable[type[BaseTable], table] local_variable[type[boolean], bIsQueryRecord] local_variable[type[boolean], bIsQuerySupported] if[binary_operation[member[.bIsQueryRecord], &&, member[.bIsQuerySupported]]] begin[{] if[call[DBConstants.TRUE.equalsIgnoreCase, parameter[THIS[call[None.getProperty, parameter[member[SQLParams.SQL_VIEWS_BUILT]]]]]]] begin[{] if[binary_operation[member[.record], instanceof, type[QueryRecord]]] begin[{] assign[member[.bIsQuerySupported], Cast(expression=MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=QueryRecord, sub_type=None))] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[int], iRawDBType] if[binary_operation[binary_operation[binary_operation[member[.iRawDBType], ==, member[DBConstants.LOCAL]], ||, binary_operation[member[.iRawDBType], ==, member[DBConstants.TABLE]]], &&, member[.bIsQueryRecord]]] begin[{] assign[member[.table], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=record, 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=JdbcTable, sub_type=None))] else begin[{] if[binary_operation[member[.bIsQueryRecord], &&, binary_operation[member[.bIsQuerySupported], ||, binary_operation[binary_operation[call[record.getDatabaseType, parameter[]], &, member[DBConstants.MANUAL_QUERY]], !=, literal[0]]]]] begin[{] local_variable[type[PassThruTable], passThruTable] call[passThruTable.addTable, parameter[call[record.getRecordlistAt, parameter[literal[0]]]]] assign[member[.table], member[.passThruTable]] else begin[{] if[binary_operation[binary_operation[binary_operation[member[.iRawDBType], ==, member[DBConstants.LOCAL]], ||, binary_operation[member[.iRawDBType], ==, member[DBConstants.REMOTE]]], ||, binary_operation[member[.iRawDBType], ==, member[DBConstants.TABLE]]]] begin[{] assign[member[.table], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=record, 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=JdbcTable, sub_type=None))] else begin[{] assign[member[.table], SuperMethodInvocation(arguments=[MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doMakeTable, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] end[}] end[}] return[member[.table]] end[}] END[}]
Keyword[public] identifier[BaseTable] identifier[doMakeTable] operator[SEP] identifier[Record] identifier[record] operator[SEP] { identifier[BaseTable] identifier[table] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[bIsQueryRecord] operator[=] identifier[record] operator[SEP] identifier[isQueryRecord] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[bIsQuerySupported] operator[=] operator[!] identifier[DBConstants] operator[SEP] identifier[FALSE] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[SQLParams] operator[SEP] identifier[SQL_JOINS_SUPPORTED] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[bIsQueryRecord] operator[SEP] operator[&&] operator[SEP] identifier[bIsQuerySupported] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[DBConstants] operator[SEP] identifier[TRUE] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[SQLParams] operator[SEP] identifier[SQL_VIEWS_BUILT] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[record] Keyword[instanceof] identifier[QueryRecord] operator[SEP] identifier[bIsQuerySupported] operator[=] operator[!] operator[SEP] operator[SEP] identifier[QueryRecord] operator[SEP] identifier[record] operator[SEP] operator[SEP] identifier[isComplexQuery] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[iRawDBType] operator[=] operator[SEP] identifier[record] operator[SEP] identifier[getDatabaseType] operator[SEP] operator[SEP] operator[&] identifier[DBConstants] operator[SEP] identifier[TABLE_TYPE_MASK] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[iRawDBType] operator[==] identifier[DBConstants] operator[SEP] identifier[LOCAL] operator[SEP] operator[||] operator[SEP] identifier[iRawDBType] operator[==] identifier[DBConstants] operator[SEP] identifier[TABLE] operator[SEP] operator[SEP] operator[&&] operator[SEP] operator[!] identifier[bIsQueryRecord] operator[SEP] operator[SEP] identifier[table] operator[=] Keyword[new] identifier[JdbcTable] operator[SEP] Keyword[this] , identifier[record] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[bIsQueryRecord] operator[SEP] operator[&&] operator[SEP] operator[SEP] operator[!] identifier[bIsQuerySupported] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[getDatabaseType] operator[SEP] operator[SEP] operator[&] identifier[DBConstants] operator[SEP] identifier[MANUAL_QUERY] operator[SEP] operator[!=] Other[0] operator[SEP] operator[SEP] operator[SEP] { identifier[PassThruTable] identifier[passThruTable] operator[=] Keyword[new] identifier[QueryTable] operator[SEP] Keyword[this] , identifier[record] operator[SEP] operator[SEP] identifier[passThruTable] operator[SEP] identifier[addTable] operator[SEP] identifier[record] operator[SEP] identifier[getRecordlistAt] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[table] operator[=] identifier[passThruTable] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[iRawDBType] operator[==] identifier[DBConstants] operator[SEP] identifier[LOCAL] operator[SEP] operator[||] operator[SEP] identifier[iRawDBType] operator[==] identifier[DBConstants] operator[SEP] identifier[REMOTE] operator[SEP] operator[||] operator[SEP] identifier[iRawDBType] operator[==] identifier[DBConstants] operator[SEP] identifier[TABLE] operator[SEP] operator[SEP] identifier[table] operator[=] Keyword[new] identifier[JdbcTable] operator[SEP] Keyword[this] , identifier[record] operator[SEP] operator[SEP] Keyword[else] identifier[table] operator[=] Keyword[super] operator[SEP] identifier[doMakeTable] operator[SEP] identifier[record] operator[SEP] operator[SEP] Keyword[return] identifier[table] operator[SEP] }
public static Map<String, Object> getAnnotation(Class<?> annotationType, Element element) { for (AnnotationMirror annotation : element.getAnnotationMirrors()) { if (!rawTypeToString(annotation.getAnnotationType(), '$').equals( annotationType.getName())) { continue; } return parseAnnotationMirror(annotationType, annotation); } return null; // Annotation not found. }
class class_name[name] begin[{] method[getAnnotation, return_type[type[Map]], modifier[public static], parameter[annotationType, element]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAnnotationType, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='$')], member=rawTypeToString, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=annotationType, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=annotationType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseAnnotationMirror, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAnnotationMirrors, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationMirror, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[getAnnotation] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[annotationType] , identifier[Element] identifier[element] operator[SEP] { Keyword[for] operator[SEP] identifier[AnnotationMirror] identifier[annotation] operator[:] identifier[element] operator[SEP] identifier[getAnnotationMirrors] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[rawTypeToString] operator[SEP] identifier[annotation] operator[SEP] identifier[getAnnotationType] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[annotationType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[return] identifier[parseAnnotationMirror] operator[SEP] identifier[annotationType] , identifier[annotation] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
protected IConceptSet getA(int B, int r) { if (B >= CONCEPTS) { resizeConcepts(B); } if (r >= ROLES) { resizeRoles(r); } // Note the "+1" in the following line: final int index = indexOf(B, r) + 1; if (null == data[index]) { data[index] = new SparseConceptSet(); addRole(r); if (null != base && index < base.length && null != base[index]) { data[index].addAll(base[index]); } } return data[index]; }
class class_name[name] begin[{] method[getA, return_type[type[IConceptSet]], modifier[protected], parameter[B, r]] begin[{] if[binary_operation[member[.B], >=, member[.CONCEPTS]]] begin[{] call[.resizeConcepts, parameter[member[.B]]] else begin[{] None end[}] if[binary_operation[member[.r], >=, member[.ROLES]]] begin[{] call[.resizeRoles, parameter[member[.r]]] else begin[{] None end[}] local_variable[type[int], index] if[binary_operation[literal[null], ==, member[.data]]] begin[{] assign[member[.data], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SparseConceptSet, sub_type=None))] call[.addRole, parameter[member[.r]]] if[binary_operation[binary_operation[binary_operation[literal[null], !=, member[.base]], &&, binary_operation[member[.index], <, member[base.length]]], &&, binary_operation[literal[null], !=, member[.base]]]] begin[{] member[.data] else begin[{] None end[}] else begin[{] None end[}] return[member[.data]] end[}] END[}]
Keyword[protected] identifier[IConceptSet] identifier[getA] operator[SEP] Keyword[int] identifier[B] , Keyword[int] identifier[r] operator[SEP] { Keyword[if] operator[SEP] identifier[B] operator[>=] identifier[CONCEPTS] operator[SEP] { identifier[resizeConcepts] operator[SEP] identifier[B] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[r] operator[>=] identifier[ROLES] operator[SEP] { identifier[resizeRoles] operator[SEP] identifier[r] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[index] operator[=] identifier[indexOf] operator[SEP] identifier[B] , identifier[r] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[data] operator[SEP] identifier[index] operator[SEP] operator[SEP] { identifier[data] operator[SEP] identifier[index] operator[SEP] operator[=] Keyword[new] identifier[SparseConceptSet] operator[SEP] operator[SEP] operator[SEP] identifier[addRole] operator[SEP] identifier[r] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[base] operator[&&] identifier[index] operator[<] identifier[base] operator[SEP] identifier[length] operator[&&] Other[null] operator[!=] identifier[base] operator[SEP] identifier[index] operator[SEP] operator[SEP] { identifier[data] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[base] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[data] operator[SEP] identifier[index] operator[SEP] operator[SEP] }
@Override public Set<PermissionConfig> getClientPermissionConfigs() { Set<PermissionConfig> permissionConfigs = securityService != null ? securityService.getClientPermissionConfigs() : staticSecurityConfig.getClientPermissionConfigs(); return Collections.unmodifiableSet(permissionConfigs); }
class class_name[name] begin[{] method[getClientPermissionConfigs, return_type[type[Set]], modifier[public], parameter[]] begin[{] local_variable[type[Set], permissionConfigs] return[call[Collections.unmodifiableSet, parameter[member[.permissionConfigs]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[PermissionConfig] operator[>] identifier[getClientPermissionConfigs] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[PermissionConfig] operator[>] identifier[permissionConfigs] operator[=] identifier[securityService] operator[!=] Other[null] operator[?] identifier[securityService] operator[SEP] identifier[getClientPermissionConfigs] operator[SEP] operator[SEP] operator[:] identifier[staticSecurityConfig] operator[SEP] identifier[getClientPermissionConfigs] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableSet] operator[SEP] identifier[permissionConfigs] operator[SEP] operator[SEP] }
public static void checkMgen(MethodGen mgen) { if (skipChecks) { return; } try { mgen.toString(); // ensure it can be formatted without exceptions mgen.getLineNumberTable(mgen.getConstantPool()); InstructionList ilist = mgen.getInstructionList(); if (ilist == null || ilist.getStart() == null) { return; } CodeExceptionGen[] exceptionHandlers = mgen.getExceptionHandlers(); for (CodeExceptionGen gen : exceptionHandlers) { assert ilist.contains(gen.getStartPC()) : "exception handler " + gen + " has been forgotten in " + mgen.getClassName() + "." + mgen.getName(); } MethodGen nmg = new MethodGen(mgen.getMethod(), mgen.getClassName(), mgen.getConstantPool()); nmg.getLineNumberTable(mgen.getConstantPool()); } catch (Throwable t) { Error e = new Error( String.format( "failure while checking method %s.%s%n", mgen.getClassName(), mgen.getName()), t); e.printStackTrace(); throw e; } }
class class_name[name] begin[{] method[checkMgen, return_type[void], modifier[public static], parameter[mgen]] begin[{] if[member[.skipChecks]] begin[{] return[None] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConstantPool, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None)], member=getLineNumberTable, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInstructionList, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None), name=ilist)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InstructionList, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ilist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=ilist, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getExceptionHandlers, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None), name=exceptionHandlers)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=CodeExceptionGen, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[AssertStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStartPC, postfix_operators=[], prefix_operators=[], qualifier=gen, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=ilist, selectors=[], type_arguments=None), label=None, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="exception handler "), operandr=MemberReference(member=gen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has been forgotten in "), operator=+), operandr=MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None), operator=+))]), control=EnhancedForControl(iterable=MemberReference(member=exceptionHandlers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=gen)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CodeExceptionGen, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getConstantPool, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MethodGen, sub_type=None)), name=nmg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodGen, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConstantPool, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None)], member=getLineNumberTable, postfix_operators=[], prefix_operators=[], qualifier=nmg, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failure while checking method %s.%s%n"), MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=mgen, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=t, 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=Error, sub_type=None)), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Error, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[checkMgen] operator[SEP] identifier[MethodGen] identifier[mgen] operator[SEP] { Keyword[if] operator[SEP] identifier[skipChecks] operator[SEP] { Keyword[return] operator[SEP] } Keyword[try] { identifier[mgen] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[mgen] operator[SEP] identifier[getLineNumberTable] operator[SEP] identifier[mgen] operator[SEP] identifier[getConstantPool] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[InstructionList] identifier[ilist] operator[=] identifier[mgen] operator[SEP] identifier[getInstructionList] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ilist] operator[==] Other[null] operator[||] identifier[ilist] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[CodeExceptionGen] operator[SEP] operator[SEP] identifier[exceptionHandlers] operator[=] identifier[mgen] operator[SEP] identifier[getExceptionHandlers] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CodeExceptionGen] identifier[gen] operator[:] identifier[exceptionHandlers] operator[SEP] { Keyword[assert] identifier[ilist] operator[SEP] identifier[contains] operator[SEP] identifier[gen] operator[SEP] identifier[getStartPC] operator[SEP] operator[SEP] operator[SEP] operator[:] literal[String] operator[+] identifier[gen] operator[+] literal[String] operator[+] identifier[mgen] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[mgen] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] } identifier[MethodGen] identifier[nmg] operator[=] Keyword[new] identifier[MethodGen] operator[SEP] identifier[mgen] operator[SEP] identifier[getMethod] operator[SEP] operator[SEP] , identifier[mgen] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] , identifier[mgen] operator[SEP] identifier[getConstantPool] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[nmg] operator[SEP] identifier[getLineNumberTable] operator[SEP] identifier[mgen] operator[SEP] identifier[getConstantPool] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[Error] identifier[e] operator[=] Keyword[new] identifier[Error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[mgen] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] , identifier[mgen] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] , identifier[t] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } }
private CASHInterval determineNextIntervalAtMaxLevel(ObjectHeap<CASHInterval> heap) { CASHInterval next = doDetermineNextIntervalAtMaxLevel(heap); // noise path was chosen while(next == null) { if(heap.isEmpty()) { return null; } next = doDetermineNextIntervalAtMaxLevel(heap); } return next; }
class class_name[name] begin[{] method[determineNextIntervalAtMaxLevel, return_type[type[CASHInterval]], modifier[private], parameter[heap]] begin[{] local_variable[type[CASHInterval], next] while[binary_operation[member[.next], ==, literal[null]]] begin[{] if[call[heap.isEmpty, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] assign[member[.next], call[.doDetermineNextIntervalAtMaxLevel, parameter[member[.heap]]]] end[}] return[member[.next]] end[}] END[}]
Keyword[private] identifier[CASHInterval] identifier[determineNextIntervalAtMaxLevel] operator[SEP] identifier[ObjectHeap] operator[<] identifier[CASHInterval] operator[>] identifier[heap] operator[SEP] { identifier[CASHInterval] identifier[next] operator[=] identifier[doDetermineNextIntervalAtMaxLevel] operator[SEP] identifier[heap] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[next] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[heap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[next] operator[=] identifier[doDetermineNextIntervalAtMaxLevel] operator[SEP] identifier[heap] operator[SEP] operator[SEP] } Keyword[return] identifier[next] operator[SEP] }
protected boolean fill(final Context2D context, final Attributes attr, double alpha) { final boolean filled = attr.hasFill(); if ((filled) || (attr.isFillShapeForSelection())) { alpha = alpha * attr.getFillAlpha(); if (alpha <= 0) { return false; } if (context.isSelection()) { final String color = getColorKey(); if (null == color) { return false; } context.save(); context.setFillColor(color); context.fill(); context.restore(); return true; } if (false == filled) { return false; } context.save(); if (attr.hasShadow()) { doApplyShadow(context, attr); } context.setGlobalAlpha(alpha); final String fill = attr.getFillColor(); if (null != fill) { context.setFillColor(fill); context.fill(); context.restore(); return true; } final FillGradient grad = attr.getFillGradient(); if (null != grad) { final String type = grad.getType(); if (LinearGradient.TYPE.equals(type)) { context.setFillGradient(grad.asLinearGradient()); context.fill(); context.restore(); return true; } else if (RadialGradient.TYPE.equals(type)) { context.setFillGradient(grad.asRadialGradient()); context.fill(); context.restore(); return true; } else if (PatternGradient.TYPE.equals(type)) { context.setFillGradient(grad.asPatternGradient()); context.fill(); context.restore(); return true; } } context.restore(); } return false; }
class class_name[name] begin[{] method[fill, return_type[type[boolean]], modifier[protected], parameter[context, attr, alpha]] begin[{] local_variable[type[boolean], filled] if[binary_operation[member[.filled], ||, call[attr.isFillShapeForSelection, parameter[]]]] begin[{] assign[member[.alpha], binary_operation[member[.alpha], *, call[attr.getFillAlpha, parameter[]]]] if[binary_operation[member[.alpha], <=, literal[0]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[context.isSelection, parameter[]]] begin[{] local_variable[type[String], color] if[binary_operation[literal[null], ==, member[.color]]] begin[{] return[literal[false]] else begin[{] None end[}] call[context.save, parameter[]] call[context.setFillColor, parameter[member[.color]]] call[context.fill, parameter[]] call[context.restore, parameter[]] return[literal[true]] else begin[{] None end[}] if[binary_operation[literal[false], ==, member[.filled]]] begin[{] return[literal[false]] else begin[{] None end[}] call[context.save, parameter[]] if[call[attr.hasShadow, parameter[]]] begin[{] call[.doApplyShadow, parameter[member[.context], member[.attr]]] else begin[{] None end[}] call[context.setGlobalAlpha, parameter[member[.alpha]]] local_variable[type[String], fill] if[binary_operation[literal[null], !=, member[.fill]]] begin[{] call[context.setFillColor, parameter[member[.fill]]] call[context.fill, parameter[]] call[context.restore, parameter[]] return[literal[true]] else begin[{] None end[}] local_variable[type[FillGradient], grad] if[binary_operation[literal[null], !=, member[.grad]]] begin[{] local_variable[type[String], type] if[call[LinearGradient.TYPE.equals, parameter[member[.type]]]] begin[{] call[context.setFillGradient, parameter[call[grad.asLinearGradient, parameter[]]]] call[context.fill, parameter[]] call[context.restore, parameter[]] return[literal[true]] else begin[{] if[call[RadialGradient.TYPE.equals, parameter[member[.type]]]] begin[{] call[context.setFillGradient, parameter[call[grad.asRadialGradient, parameter[]]]] call[context.fill, parameter[]] call[context.restore, parameter[]] return[literal[true]] else begin[{] if[call[PatternGradient.TYPE.equals, parameter[member[.type]]]] begin[{] call[context.setFillGradient, parameter[call[grad.asPatternGradient, parameter[]]]] call[context.fill, parameter[]] call[context.restore, parameter[]] return[literal[true]] else begin[{] None end[}] end[}] end[}] else begin[{] None end[}] call[context.restore, parameter[]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[fill] operator[SEP] Keyword[final] identifier[Context2D] identifier[context] , Keyword[final] identifier[Attributes] identifier[attr] , Keyword[double] identifier[alpha] operator[SEP] { Keyword[final] Keyword[boolean] identifier[filled] operator[=] identifier[attr] operator[SEP] identifier[hasFill] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[filled] operator[SEP] operator[||] operator[SEP] identifier[attr] operator[SEP] identifier[isFillShapeForSelection] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[alpha] operator[=] identifier[alpha] operator[*] identifier[attr] operator[SEP] identifier[getFillAlpha] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[alpha] operator[<=] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[isSelection] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[color] operator[=] identifier[getColorKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[color] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[context] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setFillColor] operator[SEP] identifier[color] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[fill] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[restore] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] literal[boolean] operator[==] identifier[filled] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[context] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attr] operator[SEP] identifier[hasShadow] operator[SEP] operator[SEP] operator[SEP] { identifier[doApplyShadow] operator[SEP] identifier[context] , identifier[attr] operator[SEP] operator[SEP] } identifier[context] operator[SEP] identifier[setGlobalAlpha] operator[SEP] identifier[alpha] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[fill] operator[=] identifier[attr] operator[SEP] identifier[getFillColor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[fill] operator[SEP] { identifier[context] operator[SEP] identifier[setFillColor] operator[SEP] identifier[fill] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[fill] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[restore] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[final] identifier[FillGradient] identifier[grad] operator[=] identifier[attr] operator[SEP] identifier[getFillGradient] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[grad] operator[SEP] { Keyword[final] identifier[String] identifier[type] operator[=] identifier[grad] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LinearGradient] operator[SEP] identifier[TYPE] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[context] operator[SEP] identifier[setFillGradient] operator[SEP] identifier[grad] operator[SEP] identifier[asLinearGradient] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[fill] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[restore] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[RadialGradient] operator[SEP] identifier[TYPE] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[context] operator[SEP] identifier[setFillGradient] operator[SEP] identifier[grad] operator[SEP] identifier[asRadialGradient] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[fill] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[restore] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[PatternGradient] operator[SEP] identifier[TYPE] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[context] operator[SEP] identifier[setFillGradient] operator[SEP] identifier[grad] operator[SEP] identifier[asPatternGradient] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[fill] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[restore] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } identifier[context] operator[SEP] identifier[restore] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void setResourceARNs(java.util.Collection<ResourceARNDetail> resourceARNs) { if (resourceARNs == null) { this.resourceARNs = null; return; } this.resourceARNs = new java.util.ArrayList<ResourceARNDetail>(resourceARNs); }
class class_name[name] begin[{] method[setResourceARNs, return_type[void], modifier[public], parameter[resourceARNs]] begin[{] if[binary_operation[member[.resourceARNs], ==, literal[null]]] begin[{] assign[THIS[member[None.resourceARNs]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.resourceARNs]], ClassCreator(arguments=[MemberReference(member=resourceARNs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ResourceARNDetail, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setResourceARNs] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[ResourceARNDetail] operator[>] identifier[resourceARNs] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceARNs] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[resourceARNs] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[resourceARNs] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ResourceARNDetail] operator[>] operator[SEP] identifier[resourceARNs] operator[SEP] operator[SEP] }
public static <T> T[] notEmpty(final T[] array, final String message) { return INSTANCE.notEmpty(array, message); }
class class_name[name] begin[{] method[notEmpty, return_type[type[T]], modifier[public static], parameter[array, message]] begin[{] return[call[INSTANCE.notEmpty, parameter[member[.array], member[.message]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[notEmpty] operator[SEP] Keyword[final] identifier[T] operator[SEP] operator[SEP] identifier[array] , Keyword[final] identifier[String] identifier[message] operator[SEP] { Keyword[return] identifier[INSTANCE] operator[SEP] identifier[notEmpty] operator[SEP] identifier[array] , identifier[message] operator[SEP] operator[SEP] }
public static <T> Single<Set<T>> values(CacheConfigBean cacheConfigBean, String key, Class<T> vClazz) { return values(cacheConfigBean, key) .map(values -> { Set<T> _values = new TreeSet<>(); if (values != null && !values.isEmpty()) { values.forEach(value -> { _values.add(Reflection.toType(value, vClazz)); }); } return _values; }); }
class class_name[name] begin[{] method[values, return_type[type[Single]], modifier[public static], parameter[cacheConfigBean, key, vClazz]] begin[{] return[call[.values, parameter[member[.cacheConfigBean], member[.key]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Single] operator[<] identifier[Set] operator[<] identifier[T] operator[>] operator[>] identifier[values] operator[SEP] identifier[CacheConfigBean] identifier[cacheConfigBean] , identifier[String] identifier[key] , identifier[Class] operator[<] identifier[T] operator[>] identifier[vClazz] operator[SEP] { Keyword[return] identifier[values] operator[SEP] identifier[cacheConfigBean] , identifier[key] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[values] operator[->] { identifier[Set] operator[<] identifier[T] operator[>] identifier[_values] operator[=] Keyword[new] identifier[TreeSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[!=] Other[null] operator[&&] operator[!] identifier[values] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[values] operator[SEP] identifier[forEach] operator[SEP] identifier[value] operator[->] { identifier[_values] operator[SEP] identifier[add] operator[SEP] identifier[Reflection] operator[SEP] identifier[toType] operator[SEP] identifier[value] , identifier[vClazz] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } Keyword[return] identifier[_values] operator[SEP] } operator[SEP] operator[SEP] }
public void reconstituteAnycastRMEPhaseTwo(int startMode, DestinationDefinition definition) throws MessageStoreException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "reconstituteAnycastRMEPhaseTwo", new Object[] { Integer.valueOf(startMode), definition}); // We need to reconstiture the AnycastInputHandlers/RCDs so that all parts of the destination // are ready for various reasons: // - The inactivity timer is initiated to allow automatic cleanup if a new consumer doesn't attach // - Incoming control messages for existing anycast streams are correctly processed // - The asynchDeletionThread sees all of the destination, so it can correctly clean it up if it // is deleted boolean flush = false; // We flush the streams if in START_FLUSH mode, but not if we're in recovery mode, because we won't // be able to send any messages to the DME if( ((startMode & JsConstants.ME_START_FLUSH ) == JsConstants.ME_START_FLUSH ) && ((startMode & JsConstants.ME_START_RECOVERY ) == 0 ) ) flush = true; synchronized (_anycastInputHandlers) { for(Iterator i = _aiContainerItemStreams.values().iterator(); i.hasNext();) { // If the AIH hasn't been reconstituted yet (can be kicked off from inside // the local reconstitution when it chooses a ConsumerManager) we do it now. AIContainerItemStream stream = (AIContainerItemStream) i.next(); String key = SIMPUtils.getRemoteGetKey(stream.getDmeId(), stream.getGatheringTargetDestUuid()); AnycastInputHandler aih = _anycastInputHandlers.get(key); if(aih == null) { aih = createAIHandRCD(stream.getDmeId(), stream.getGatheringTargetDestUuid(), definition, flush); _anycastInputHandlers.put(key, aih); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "reconstituteAnycastRMEPhaseTwo"); }
class class_name[name] begin[{] method[reconstituteAnycastRMEPhaseTwo, return_type[void], modifier[public], parameter[startMode, definition]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["reconstituteAnycastRMEPhaseTwo"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[MemberReference(member=startMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), MemberReference(member=definition, 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[boolean], flush] if[binary_operation[binary_operation[binary_operation[member[.startMode], &, member[JsConstants.ME_START_FLUSH]], ==, member[JsConstants.ME_START_FLUSH]], &&, binary_operation[binary_operation[member[.startMode], &, member[JsConstants.ME_START_RECOVERY]], ==, literal[0]]]] begin[{] assign[member[.flush], literal[true]] else begin[{] None end[}] SYNCHRONIZED[member[._anycastInputHandlers]] BEGIN[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AIContainerItemStream, sub_type=None)), name=stream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AIContainerItemStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDmeId, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getGatheringTargetDestUuid, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None)], member=getRemoteGetKey, postfix_operators=[], prefix_operators=[], qualifier=SIMPUtils, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=_anycastInputHandlers, selectors=[], type_arguments=None), name=aih)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnycastInputHandler, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aih, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=aih, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDmeId, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getGatheringTargetDestUuid, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), MemberReference(member=definition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=flush, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createAIHandRCD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=aih, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=_anycastInputHandlers, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=i, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=_aiContainerItemStreams, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) END[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["reconstituteAnycastRMEPhaseTwo"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[reconstituteAnycastRMEPhaseTwo] operator[SEP] Keyword[int] identifier[startMode] , identifier[DestinationDefinition] identifier[definition] operator[SEP] Keyword[throws] identifier[MessageStoreException] , identifier[SIResourceException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[startMode] operator[SEP] , identifier[definition] } operator[SEP] operator[SEP] Keyword[boolean] identifier[flush] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[startMode] operator[&] identifier[JsConstants] operator[SEP] identifier[ME_START_FLUSH] operator[SEP] operator[==] identifier[JsConstants] operator[SEP] identifier[ME_START_FLUSH] operator[SEP] operator[&&] operator[SEP] operator[SEP] identifier[startMode] operator[&] identifier[JsConstants] operator[SEP] identifier[ME_START_RECOVERY] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] identifier[flush] operator[=] literal[boolean] operator[SEP] Keyword[synchronized] operator[SEP] identifier[_anycastInputHandlers] operator[SEP] { Keyword[for] operator[SEP] identifier[Iterator] identifier[i] operator[=] identifier[_aiContainerItemStreams] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[AIContainerItemStream] identifier[stream] operator[=] operator[SEP] identifier[AIContainerItemStream] operator[SEP] identifier[i] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[key] operator[=] identifier[SIMPUtils] operator[SEP] identifier[getRemoteGetKey] operator[SEP] identifier[stream] operator[SEP] identifier[getDmeId] operator[SEP] operator[SEP] , identifier[stream] operator[SEP] identifier[getGatheringTargetDestUuid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AnycastInputHandler] identifier[aih] operator[=] identifier[_anycastInputHandlers] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aih] operator[==] Other[null] operator[SEP] { identifier[aih] operator[=] identifier[createAIHandRCD] operator[SEP] identifier[stream] operator[SEP] identifier[getDmeId] operator[SEP] operator[SEP] , identifier[stream] operator[SEP] identifier[getGatheringTargetDestUuid] operator[SEP] operator[SEP] , identifier[definition] , identifier[flush] operator[SEP] operator[SEP] identifier[_anycastInputHandlers] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[aih] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public Packer setAnchorNorthWest(final boolean how) { if (how == true) { gc.anchor = GridBagConstraints.NORTHWEST; } else { gc.anchor &= ~GridBagConstraints.NORTHWEST; } setConstraints(comp, gc); return this; }
class class_name[name] begin[{] method[setAnchorNorthWest, return_type[type[Packer]], modifier[public], parameter[how]] begin[{] if[binary_operation[member[.how], ==, literal[true]]] begin[{] assign[member[gc.anchor], member[GridBagConstraints.NORTHWEST]] else begin[{] assign[member[gc.anchor], member[GridBagConstraints.NORTHWEST]] end[}] call[.setConstraints, parameter[member[.comp], member[.gc]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Packer] identifier[setAnchorNorthWest] operator[SEP] Keyword[final] Keyword[boolean] identifier[how] operator[SEP] { Keyword[if] operator[SEP] identifier[how] operator[==] literal[boolean] operator[SEP] { identifier[gc] operator[SEP] identifier[anchor] operator[=] identifier[GridBagConstraints] operator[SEP] identifier[NORTHWEST] operator[SEP] } Keyword[else] { identifier[gc] operator[SEP] identifier[anchor] operator[&=] operator[~] identifier[GridBagConstraints] operator[SEP] identifier[NORTHWEST] operator[SEP] } identifier[setConstraints] operator[SEP] identifier[comp] , identifier[gc] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public boolean isFilterMatch(BaseMessageHeader messageHeader) { boolean bMatch = true; if (messageHeader != null) { if (this.getQueueName() != null) if (!this.getQueueName().equals(messageHeader.getQueueName())) return false; // No match if (this.getQueueType() != null) if (!this.getQueueType().equals(messageHeader.getQueueType())) return false; // No match if (this.getMessageSource() != null) if (this.getMessageSource() == messageHeader.getMessageSource()) return false; // If the source codes are the same object, don't echo! Object[][] mxMessageHeader = messageHeader.getNameValueTree(); Object[][] mxMessageFilter = this.getNameValueTree(); bMatch = this.compareTrees(mxMessageHeader, mxMessageFilter, false); if (bMatch) if (messageHeader.getRegistryIDMatch() != null) if (!messageHeader.getRegistryIDMatch().equals(this.getRegistryID())) bMatch = false; } return bMatch; // MATCH!!! }
class class_name[name] begin[{] method[isFilterMatch, return_type[type[boolean]], modifier[public], parameter[messageHeader]] begin[{] local_variable[type[boolean], bMatch] if[binary_operation[member[.messageHeader], !=, literal[null]]] begin[{] if[binary_operation[THIS[call[None.getQueueName, parameter[]]], !=, literal[null]]] begin[{] if[THIS[call[None.getQueueName, parameter[]]call[None.equals, parameter[call[messageHeader.getQueueName, parameter[]]]]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[THIS[call[None.getQueueType, parameter[]]], !=, literal[null]]] begin[{] if[THIS[call[None.getQueueType, parameter[]]call[None.equals, parameter[call[messageHeader.getQueueType, parameter[]]]]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[THIS[call[None.getMessageSource, parameter[]]], !=, literal[null]]] begin[{] if[binary_operation[THIS[call[None.getMessageSource, parameter[]]], ==, call[messageHeader.getMessageSource, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[Object], mxMessageHeader] local_variable[type[Object], mxMessageFilter] assign[member[.bMatch], THIS[call[None.compareTrees, parameter[member[.mxMessageHeader], member[.mxMessageFilter], literal[false]]]]] if[member[.bMatch]] begin[{] if[binary_operation[call[messageHeader.getRegistryIDMatch, parameter[]], !=, literal[null]]] begin[{] if[call[messageHeader.getRegistryIDMatch, parameter[]]] begin[{] assign[member[.bMatch], literal[false]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] return[member[.bMatch]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isFilterMatch] operator[SEP] identifier[BaseMessageHeader] identifier[messageHeader] operator[SEP] { Keyword[boolean] identifier[bMatch] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[messageHeader] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getQueueName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[getQueueName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[messageHeader] operator[SEP] identifier[getQueueName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getQueueType] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[getQueueType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[messageHeader] operator[SEP] identifier[getQueueType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getMessageSource] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getMessageSource] operator[SEP] operator[SEP] operator[==] identifier[messageHeader] operator[SEP] identifier[getMessageSource] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mxMessageHeader] operator[=] identifier[messageHeader] operator[SEP] identifier[getNameValueTree] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mxMessageFilter] operator[=] Keyword[this] operator[SEP] identifier[getNameValueTree] operator[SEP] operator[SEP] operator[SEP] identifier[bMatch] operator[=] Keyword[this] operator[SEP] identifier[compareTrees] operator[SEP] identifier[mxMessageHeader] , identifier[mxMessageFilter] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bMatch] operator[SEP] Keyword[if] operator[SEP] identifier[messageHeader] operator[SEP] identifier[getRegistryIDMatch] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[messageHeader] operator[SEP] identifier[getRegistryIDMatch] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[getRegistryID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bMatch] operator[=] literal[boolean] operator[SEP] } Keyword[return] identifier[bMatch] operator[SEP] }
public OvhOvhPabxDialplan billingAccount_ovhPabx_serviceName_dialplan_POST(String billingAccount, String serviceName, Boolean anonymousRejection, String name, OvhOvhPabxDialplanNumberPresentationEnum showCallerNumber, Long transferTimeout) throws IOException { String qPath = "/telephony/{billingAccount}/ovhPabx/{serviceName}/dialplan"; StringBuilder sb = path(qPath, billingAccount, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "anonymousRejection", anonymousRejection); addBody(o, "name", name); addBody(o, "showCallerNumber", showCallerNumber); addBody(o, "transferTimeout", transferTimeout); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhOvhPabxDialplan.class); }
class class_name[name] begin[{] method[billingAccount_ovhPabx_serviceName_dialplan_POST, return_type[type[OvhOvhPabxDialplan]], modifier[public], parameter[billingAccount, serviceName, anonymousRejection, name, showCallerNumber, transferTimeout]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[HashMap], o] call[.addBody, parameter[member[.o], literal["anonymousRejection"], member[.anonymousRejection]]] call[.addBody, parameter[member[.o], literal["name"], member[.name]]] call[.addBody, parameter[member[.o], literal["showCallerNumber"], member[.showCallerNumber]]] call[.addBody, parameter[member[.o], literal["transferTimeout"], member[.transferTimeout]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhOvhPabxDialplan, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhOvhPabxDialplan] identifier[billingAccount_ovhPabx_serviceName_dialplan_POST] operator[SEP] identifier[String] identifier[billingAccount] , identifier[String] identifier[serviceName] , identifier[Boolean] identifier[anonymousRejection] , identifier[String] identifier[name] , identifier[OvhOvhPabxDialplanNumberPresentationEnum] identifier[showCallerNumber] , identifier[Long] identifier[transferTimeout] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[billingAccount] , identifier[serviceName] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[anonymousRejection] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[showCallerNumber] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[transferTimeout] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhOvhPabxDialplan] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
@Override public Object getValue(final Object _object) throws EFapsException { final ArrayList<Object> tempList = new ArrayList<Object>(); tempList.add(_object); return getValue(tempList); }
class class_name[name] begin[{] method[getValue, return_type[type[Object]], modifier[public], parameter[_object]] begin[{] local_variable[type[ArrayList], tempList] call[tempList.add, parameter[member[._object]]] return[call[.getValue, parameter[member[.tempList]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[getValue] operator[SEP] Keyword[final] identifier[Object] identifier[_object] operator[SEP] Keyword[throws] identifier[EFapsException] { Keyword[final] identifier[ArrayList] operator[<] identifier[Object] operator[>] identifier[tempList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[tempList] operator[SEP] identifier[add] operator[SEP] identifier[_object] operator[SEP] operator[SEP] Keyword[return] identifier[getValue] operator[SEP] identifier[tempList] operator[SEP] operator[SEP] }
public ValidationException getUnableToInstantiateConstraintFactoryClassException( final String constraintFactoryClassName, final ValidationException exception) { return new ValidationException( MESSAGE.getUnableToInstantiateConstraintFactoryClassException(constraintFactoryClassName), exception); }
class class_name[name] begin[{] method[getUnableToInstantiateConstraintFactoryClassException, return_type[type[ValidationException]], modifier[public], parameter[constraintFactoryClassName, exception]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=constraintFactoryClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUnableToInstantiateConstraintFactoryClassException, postfix_operators=[], prefix_operators=[], qualifier=MESSAGE, selectors=[], type_arguments=None), MemberReference(member=exception, 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=ValidationException, sub_type=None))] end[}] END[}]
Keyword[public] identifier[ValidationException] identifier[getUnableToInstantiateConstraintFactoryClassException] operator[SEP] Keyword[final] identifier[String] identifier[constraintFactoryClassName] , Keyword[final] identifier[ValidationException] identifier[exception] operator[SEP] { Keyword[return] Keyword[new] identifier[ValidationException] operator[SEP] identifier[MESSAGE] operator[SEP] identifier[getUnableToInstantiateConstraintFactoryClassException] operator[SEP] identifier[constraintFactoryClassName] operator[SEP] , identifier[exception] operator[SEP] operator[SEP] }
@Override @Nonnull public JQueryInvocation jqinvoke (@Nonnull @Nonempty final String sMethod) { return new JQueryInvocation (this, sMethod); }
class class_name[name] begin[{] method[jqinvoke, return_type[type[JQueryInvocation]], modifier[public], parameter[sMethod]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=sMethod, 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=JQueryInvocation, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[Nonnull] Keyword[public] identifier[JQueryInvocation] identifier[jqinvoke] operator[SEP] annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] Keyword[final] identifier[String] identifier[sMethod] operator[SEP] { Keyword[return] Keyword[new] identifier[JQueryInvocation] operator[SEP] Keyword[this] , identifier[sMethod] operator[SEP] operator[SEP] }
private void addRelevantPluginDependenciesToClasspath(Set<URL> path) throws MojoExecutionException { if (hasCommandlineArgs()) { arguments = parseCommandlineArgs(); } try { Iterator<Artifact> iter = this.determineRelevantPluginDependencies().iterator(); while (iter.hasNext()) { Artifact classPathElement = iter.next(); // we must skip org.osgi.core, otherwise we get a // java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set if (classPathElement.getArtifactId().equals("org.osgi.core")) { getLog().debug("Skipping org.osgi.core -> " + classPathElement.getGroupId() + "/" + classPathElement.getArtifactId() + "/" + classPathElement.getVersion()); continue; } getLog().debug("Adding plugin dependency artifact: " + classPathElement.getArtifactId() + " to classpath"); path.add(classPathElement.getFile().toURI().toURL()); } } catch (MalformedURLException e) { throw new MojoExecutionException("Error during setting up classpath", e); } }
class class_name[name] begin[{] method[addRelevantPluginDependenciesToClasspath, return_type[void], modifier[private], parameter[path]] begin[{] if[call[.hasCommandlineArgs, parameter[]]] begin[{] assign[member[.arguments], call[.parseCommandlineArgs, parameter[]]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=determineRelevantPluginDependencies, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=iter)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Artifact, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), name=classPathElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Artifact, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getArtifactId, postfix_operators=[], prefix_operators=[], qualifier=classPathElement, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.osgi.core")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Skipping org.osgi.core -> "), operandr=MethodInvocation(arguments=[], member=getGroupId, postfix_operators=[], prefix_operators=[], qualifier=classPathElement, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MethodInvocation(arguments=[], member=getArtifactId, postfix_operators=[], prefix_operators=[], qualifier=classPathElement, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MethodInvocation(arguments=[], member=getVersion, postfix_operators=[], prefix_operators=[], qualifier=classPathElement, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=getLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Adding plugin dependency artifact: "), operandr=MethodInvocation(arguments=[], member=getArtifactId, postfix_operators=[], prefix_operators=[], qualifier=classPathElement, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to classpath"), operator=+)], member=debug, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=classPathElement, selectors=[MethodInvocation(arguments=[], member=toURI, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toURL, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error during setting up classpath"), 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=MojoExecutionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MalformedURLException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[addRelevantPluginDependenciesToClasspath] operator[SEP] identifier[Set] operator[<] identifier[URL] operator[>] identifier[path] operator[SEP] Keyword[throws] identifier[MojoExecutionException] { Keyword[if] operator[SEP] identifier[hasCommandlineArgs] operator[SEP] operator[SEP] operator[SEP] { identifier[arguments] operator[=] identifier[parseCommandlineArgs] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[Iterator] operator[<] identifier[Artifact] operator[>] identifier[iter] operator[=] Keyword[this] operator[SEP] identifier[determineRelevantPluginDependencies] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Artifact] identifier[classPathElement] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[classPathElement] operator[SEP] identifier[getArtifactId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[classPathElement] operator[SEP] identifier[getGroupId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[classPathElement] operator[SEP] identifier[getArtifactId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[classPathElement] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[getLog] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[classPathElement] operator[SEP] identifier[getArtifactId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[add] operator[SEP] identifier[classPathElement] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] identifier[toURL] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[MalformedURLException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[MojoExecutionException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public void addError(AbstractPageError ape) { assert (ape != null); // if this is not the error reporter, then find an error reporter above this one. if (_containerErrors == null && _errors == null) { Tag par = getParent(); while (par != null) { if (par instanceof org.apache.beehive.netui.tags.IErrorReporter) { _containerErrors = (org.apache.beehive.netui.tags.IErrorReporter) par; break; } par = par.getParent(); } } // if there is an error reporter, add the error and return if (_containerErrors != null) { _containerErrors.addError(ape); return; } // This is the error reporter. if (_errors == null) { _errors = new ArrayList(); } // add the error and update it _errors.add(ape); ape.errorNo = _errors.size(); }
class class_name[name] begin[{] method[addError, return_type[void], modifier[public], parameter[ape]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=ape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) if[binary_operation[binary_operation[member[._containerErrors], ==, literal[null]], &&, binary_operation[member[._errors], ==, literal[null]]]] begin[{] local_variable[type[Tag], par] while[binary_operation[member[.par], !=, literal[null]]] begin[{] if[binary_operation[member[.par], instanceof, type[org]]] begin[{] assign[member[._containerErrors], Cast(expression=MemberReference(member=par, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=apache, sub_type=ReferenceType(arguments=None, dimensions=None, name=beehive, sub_type=ReferenceType(arguments=None, dimensions=None, name=netui, sub_type=ReferenceType(arguments=None, dimensions=None, name=tags, sub_type=ReferenceType(arguments=None, dimensions=None, name=IErrorReporter, sub_type=None)))))))] BreakStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.par], call[par.getParent, parameter[]]] end[}] else begin[{] None end[}] if[binary_operation[member[._containerErrors], !=, literal[null]]] begin[{] call[_containerErrors.addError, parameter[member[.ape]]] return[None] else begin[{] None end[}] if[binary_operation[member[._errors], ==, literal[null]]] begin[{] 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=ArrayList, sub_type=None))] else begin[{] None end[}] call[_errors.add, parameter[member[.ape]]] assign[member[ape.errorNo], call[_errors.size, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addError] operator[SEP] identifier[AbstractPageError] identifier[ape] operator[SEP] { Keyword[assert] operator[SEP] identifier[ape] operator[!=] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_containerErrors] operator[==] Other[null] operator[&&] identifier[_errors] operator[==] Other[null] operator[SEP] { identifier[Tag] identifier[par] operator[=] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[par] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[par] Keyword[instanceof] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[beehive] operator[SEP] identifier[netui] operator[SEP] identifier[tags] operator[SEP] identifier[IErrorReporter] operator[SEP] { identifier[_containerErrors] operator[=] operator[SEP] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[beehive] operator[SEP] identifier[netui] operator[SEP] identifier[tags] operator[SEP] identifier[IErrorReporter] operator[SEP] identifier[par] operator[SEP] Keyword[break] operator[SEP] } identifier[par] operator[=] identifier[par] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[_containerErrors] operator[!=] Other[null] operator[SEP] { identifier[_containerErrors] operator[SEP] identifier[addError] operator[SEP] identifier[ape] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[_errors] operator[==] Other[null] operator[SEP] { identifier[_errors] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] } identifier[_errors] operator[SEP] identifier[add] operator[SEP] identifier[ape] operator[SEP] operator[SEP] identifier[ape] operator[SEP] identifier[errorNo] operator[=] identifier[_errors] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(Device device, ProtocolMarshaller protocolMarshaller) { if (device == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(device.getHostPath(), HOSTPATH_BINDING); protocolMarshaller.marshall(device.getContainerPath(), CONTAINERPATH_BINDING); protocolMarshaller.marshall(device.getPermissions(), PERMISSIONS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[device, protocolMarshaller]] begin[{] if[binary_operation[member[.device], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHostPath, postfix_operators=[], prefix_operators=[], qualifier=device, selectors=[], type_arguments=None), MemberReference(member=HOSTPATH_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getContainerPath, postfix_operators=[], prefix_operators=[], qualifier=device, selectors=[], type_arguments=None), MemberReference(member=CONTAINERPATH_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPermissions, postfix_operators=[], prefix_operators=[], qualifier=device, selectors=[], type_arguments=None), MemberReference(member=PERMISSIONS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[Device] identifier[device] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[device] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[device] operator[SEP] identifier[getHostPath] operator[SEP] operator[SEP] , identifier[HOSTPATH_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[device] operator[SEP] identifier[getContainerPath] operator[SEP] operator[SEP] , identifier[CONTAINERPATH_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[device] operator[SEP] identifier[getPermissions] operator[SEP] operator[SEP] , identifier[PERMISSIONS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
JSchema box(Map context) { if (boxed != null) return boxed; // only do it once JSVariant subTop = new JSVariant(); subTop.cases = cases; subTop.boxedBy = this; boxed = (JSchema)context.get(subTop); if (boxed == null) { boxed = new JSchema(subTop, context); for (int i = 0; i < cases.length; i++) cases[i].parent = subTop; context.put(subTop, boxed); } return boxed; }
class class_name[name] begin[{] method[box, return_type[type[JSchema]], modifier[default], parameter[context]] begin[{] if[binary_operation[member[.boxed], !=, literal[null]]] begin[{] return[member[.boxed]] else begin[{] None end[}] local_variable[type[JSVariant], subTop] assign[member[subTop.cases], member[.cases]] assign[member[subTop.boxedBy], THIS[]] assign[member[.boxed], Cast(expression=MethodInvocation(arguments=[MemberReference(member=subTop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JSchema, sub_type=None))] if[binary_operation[member[.boxed], ==, literal[null]]] begin[{] assign[member[.boxed], ClassCreator(arguments=[MemberReference(member=subTop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, 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=JSchema, sub_type=None))] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=cases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=parent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=subTop, 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=cases, 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[context.put, parameter[member[.subTop], member[.boxed]]] else begin[{] None end[}] return[member[.boxed]] end[}] END[}]
identifier[JSchema] identifier[box] operator[SEP] identifier[Map] identifier[context] operator[SEP] { Keyword[if] operator[SEP] identifier[boxed] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[boxed] operator[SEP] identifier[JSVariant] identifier[subTop] operator[=] Keyword[new] identifier[JSVariant] operator[SEP] operator[SEP] operator[SEP] identifier[subTop] operator[SEP] identifier[cases] operator[=] identifier[cases] operator[SEP] identifier[subTop] operator[SEP] identifier[boxedBy] operator[=] Keyword[this] operator[SEP] identifier[boxed] operator[=] operator[SEP] identifier[JSchema] operator[SEP] identifier[context] operator[SEP] identifier[get] operator[SEP] identifier[subTop] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[boxed] operator[==] Other[null] operator[SEP] { identifier[boxed] operator[=] Keyword[new] identifier[JSchema] operator[SEP] identifier[subTop] , identifier[context] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[cases] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[cases] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[parent] operator[=] identifier[subTop] operator[SEP] identifier[context] operator[SEP] identifier[put] operator[SEP] identifier[subTop] , identifier[boxed] operator[SEP] operator[SEP] } Keyword[return] identifier[boxed] operator[SEP] }
public final void deleteIntent(IntentName name) { DeleteIntentRequest request = DeleteIntentRequest.newBuilder().setName(name == null ? null : name.toString()).build(); deleteIntent(request); }
class class_name[name] begin[{] method[deleteIntent, return_type[void], modifier[final public], parameter[name]] begin[{] local_variable[type[DeleteIntentRequest], request] call[.deleteIntent, parameter[member[.request]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[deleteIntent] operator[SEP] identifier[IntentName] identifier[name] operator[SEP] { identifier[DeleteIntentRequest] identifier[request] operator[=] identifier[DeleteIntentRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setName] operator[SEP] identifier[name] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[name] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[deleteIntent] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
@Override public T remove(int index) { if (displacement != null) { return super.get(index - displacement); } return super.remove(index); }
class class_name[name] begin[{] method[remove, return_type[type[T]], modifier[public], parameter[index]] begin[{] if[binary_operation[member[.displacement], !=, literal[null]]] begin[{] return[SuperMethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=displacement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=get, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] else begin[{] None end[}] return[SuperMethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[remove] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[if] operator[SEP] identifier[displacement] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[super] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[-] identifier[displacement] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[remove] operator[SEP] identifier[index] operator[SEP] operator[SEP] }
public Set<SourceSinkInfo> getSourceSinkInfoSet(Location location) { Set<SourceSinkInfo> result = sourceSinkMap.get(location); return result != null ? result : Collections.<SourceSinkInfo> emptySet(); }
class class_name[name] begin[{] method[getSourceSinkInfoSet, return_type[type[Set]], modifier[public], parameter[location]] begin[{] local_variable[type[Set], result] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[], member=Collections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SourceSinkInfo, sub_type=None))]), if_true=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[public] identifier[Set] operator[<] identifier[SourceSinkInfo] operator[>] identifier[getSourceSinkInfoSet] operator[SEP] identifier[Location] identifier[location] operator[SEP] { identifier[Set] operator[<] identifier[SourceSinkInfo] operator[>] identifier[result] operator[=] identifier[sourceSinkMap] operator[SEP] identifier[get] operator[SEP] identifier[location] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[!=] Other[null] operator[?] identifier[result] operator[:] identifier[Collections] operator[SEP] operator[<] identifier[SourceSinkInfo] operator[>] identifier[emptySet] operator[SEP] operator[SEP] operator[SEP] }
public static void repairParentRelationships(Collection<ActivityInstanceImpl> values, String processInstanceId) { for (ActivityInstanceImpl activityInstance : values) { // if the determined activity instance id and the parent activity instance are equal, // just put the activity instance under the process instance if (valuesEqual(activityInstance.getId(), activityInstance.getParentActivityInstanceId())) { activityInstance.setParentActivityInstanceId(processInstanceId); } } }
class class_name[name] begin[{] method[repairParentRelationships, return_type[void], modifier[public static], parameter[values, processInstanceId]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=activityInstance, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getParentActivityInstanceId, postfix_operators=[], prefix_operators=[], qualifier=activityInstance, selectors=[], type_arguments=None)], member=valuesEqual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=processInstanceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParentActivityInstanceId, postfix_operators=[], prefix_operators=[], qualifier=activityInstance, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=activityInstance)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ActivityInstanceImpl, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[repairParentRelationships] operator[SEP] identifier[Collection] operator[<] identifier[ActivityInstanceImpl] operator[>] identifier[values] , identifier[String] identifier[processInstanceId] operator[SEP] { Keyword[for] operator[SEP] identifier[ActivityInstanceImpl] identifier[activityInstance] operator[:] identifier[values] operator[SEP] { Keyword[if] operator[SEP] identifier[valuesEqual] operator[SEP] identifier[activityInstance] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[activityInstance] operator[SEP] identifier[getParentActivityInstanceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[activityInstance] operator[SEP] identifier[setParentActivityInstanceId] operator[SEP] identifier[processInstanceId] operator[SEP] operator[SEP] } } }
public Versioned<V> addChild(String name, V newValue, long newVersion) { DefaultDocumentTreeNode<V> child = (DefaultDocumentTreeNode<V>) children.get(name); if (child != null) { return child.value(); } children.put(name, new DefaultDocumentTreeNode<>( new DocumentPath(name, path()), newValue, newVersion, ordering, this)); return null; }
class class_name[name] begin[{] method[addChild, return_type[type[Versioned]], modifier[public], parameter[name, newValue, newVersion]] begin[{] local_variable[type[DefaultDocumentTreeNode], child] if[binary_operation[member[.child], !=, literal[null]]] begin[{] return[call[child.value, parameter[]]] else begin[{] None end[}] call[children.put, parameter[member[.name], ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DocumentPath, sub_type=None)), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newVersion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ordering, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=DefaultDocumentTreeNode, sub_type=None))]] return[literal[null]] end[}] END[}]
Keyword[public] identifier[Versioned] operator[<] identifier[V] operator[>] identifier[addChild] operator[SEP] identifier[String] identifier[name] , identifier[V] identifier[newValue] , Keyword[long] identifier[newVersion] operator[SEP] { identifier[DefaultDocumentTreeNode] operator[<] identifier[V] operator[>] identifier[child] operator[=] operator[SEP] identifier[DefaultDocumentTreeNode] operator[<] identifier[V] operator[>] operator[SEP] identifier[children] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[child] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[child] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] } identifier[children] operator[SEP] identifier[put] operator[SEP] identifier[name] , Keyword[new] identifier[DefaultDocumentTreeNode] operator[<] operator[>] operator[SEP] Keyword[new] identifier[DocumentPath] operator[SEP] identifier[name] , identifier[path] operator[SEP] operator[SEP] operator[SEP] , identifier[newValue] , identifier[newVersion] , identifier[ordering] , Keyword[this] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
protected final String findSpecName(final List<I18nSpecificsOfItem> pSpecificsOfItemLst, final SpecificsOfItem pSpec, final Languages pLang) { for (I18nSpecificsOfItem i18nsp : pSpecificsOfItemLst) { if (i18nsp.getHasName().getItsId().equals(pSpec.getItsId()) && i18nsp.getLang().getItsId().equals(pLang.getItsId())) { return i18nsp.getItsName(); } } return pSpec.getItsName(); }
class class_name[name] begin[{] method[findSpecName, return_type[type[String]], modifier[final protected], parameter[pSpecificsOfItemLst, pSpec, pLang]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHasName, postfix_operators=[], prefix_operators=[], qualifier=i18nsp, selectors=[MethodInvocation(arguments=[], member=getItsId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getItsId, postfix_operators=[], prefix_operators=[], qualifier=pSpec, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getLang, postfix_operators=[], prefix_operators=[], qualifier=i18nsp, selectors=[MethodInvocation(arguments=[], member=getItsId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getItsId, postfix_operators=[], prefix_operators=[], qualifier=pLang, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getItsName, postfix_operators=[], prefix_operators=[], qualifier=i18nsp, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=pSpecificsOfItemLst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=i18nsp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=I18nSpecificsOfItem, sub_type=None))), label=None) return[call[pSpec.getItsName, parameter[]]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[String] identifier[findSpecName] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[I18nSpecificsOfItem] operator[>] identifier[pSpecificsOfItemLst] , Keyword[final] identifier[SpecificsOfItem] identifier[pSpec] , Keyword[final] identifier[Languages] identifier[pLang] operator[SEP] { Keyword[for] operator[SEP] identifier[I18nSpecificsOfItem] identifier[i18nsp] operator[:] identifier[pSpecificsOfItemLst] operator[SEP] { Keyword[if] operator[SEP] identifier[i18nsp] operator[SEP] identifier[getHasName] operator[SEP] operator[SEP] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[pSpec] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[i18nsp] operator[SEP] identifier[getLang] operator[SEP] operator[SEP] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[pLang] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[i18nsp] operator[SEP] identifier[getItsName] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[pSpec] operator[SEP] identifier[getItsName] operator[SEP] operator[SEP] operator[SEP] }
private void finalization() { Map<String, Object> dataModel = newHashMap(); dataModel.put("cppFormatter", new SourceFormatter()); Set<ClassModel> dependencies = newHashSet(); for (Java4CppType type : context.getClassesAlreadyDone()) { Class<?> clazz = type.getRawClass(); if (isValid(clazz)) { dependencies.add(context.getClassModel(clazz)); } } dataModel.put("classes", dependencies); dataModel.put("symbols", context.getFileManager().getSymbols().getSymbols()); context.getTemplateManager().processGlobalTemplates(dataModel); context.getTemplateManager().copyFiles(); }
class class_name[name] begin[{] method[finalization, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[Map], dataModel] call[dataModel.put, parameter[literal["cppFormatter"], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SourceFormatter, sub_type=None))]] local_variable[type[Set], dependencies] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getRawClass, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isValid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getClassModel, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=dependencies, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getClassesAlreadyDone, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Java4CppType, sub_type=None))), label=None) call[dataModel.put, parameter[literal["classes"], member[.dependencies]]] call[dataModel.put, parameter[literal["symbols"], call[context.getFileManager, parameter[]]]] call[context.getTemplateManager, parameter[]] call[context.getTemplateManager, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[finalization] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[dataModel] operator[=] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] identifier[dataModel] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[new] identifier[SourceFormatter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[ClassModel] operator[>] identifier[dependencies] operator[=] identifier[newHashSet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Java4CppType] identifier[type] operator[:] identifier[context] operator[SEP] identifier[getClassesAlreadyDone] operator[SEP] operator[SEP] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[type] operator[SEP] identifier[getRawClass] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isValid] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] { identifier[dependencies] operator[SEP] identifier[add] operator[SEP] identifier[context] operator[SEP] identifier[getClassModel] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] operator[SEP] } } identifier[dataModel] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[dependencies] operator[SEP] operator[SEP] identifier[dataModel] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[context] operator[SEP] identifier[getFileManager] operator[SEP] operator[SEP] operator[SEP] identifier[getSymbols] operator[SEP] operator[SEP] operator[SEP] identifier[getSymbols] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[getTemplateManager] operator[SEP] operator[SEP] operator[SEP] identifier[processGlobalTemplates] operator[SEP] identifier[dataModel] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[getTemplateManager] operator[SEP] operator[SEP] operator[SEP] identifier[copyFiles] operator[SEP] operator[SEP] operator[SEP] }
public static String[] toStringArray(String pString, String pDelimiters) { if (isEmpty(pString)) { return new String[0]; } StringTokenIterator st = new StringTokenIterator(pString, pDelimiters); List<String> v = new ArrayList<String>(); while (st.hasMoreElements()) { v.add(st.nextToken()); } return v.toArray(new String[v.size()]); }
class class_name[name] begin[{] method[toStringArray, return_type[type[String]], modifier[public static], parameter[pString, pDelimiters]] begin[{] if[call[.isEmpty, parameter[member[.pString]]]] begin[{] return[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] else begin[{] None end[}] local_variable[type[StringTokenIterator], st] local_variable[type[List], v] while[call[st.hasMoreElements, parameter[]]] begin[{] call[v.add, parameter[call[st.nextToken, parameter[]]]] end[}] return[call[v.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[toStringArray] operator[SEP] identifier[String] identifier[pString] , identifier[String] identifier[pDelimiters] operator[SEP] { Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] identifier[pString] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] } identifier[StringTokenIterator] identifier[st] operator[=] Keyword[new] identifier[StringTokenIterator] operator[SEP] identifier[pString] , identifier[pDelimiters] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[v] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[st] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[v] operator[SEP] identifier[add] operator[SEP] identifier[st] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[v] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[v] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@GET @PermitAll @Path("uniquetag/{uniqueTag}") public Response findByUniqueTag(@PathParam("uniqueTag") String uniqueTag) { checkNotNull(uniqueTag); DContact contact = dao.findByUniqueTag(null, uniqueTag); return null != contact ? Response.ok(contact).build() : Response.status(Response.Status.NOT_FOUND).build(); }
class class_name[name] begin[{] method[findByUniqueTag, return_type[type[Response]], modifier[public], parameter[uniqueTag]] begin[{] call[.checkNotNull, parameter[member[.uniqueTag]]] local_variable[type[DContact], contact] return[TernaryExpression(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=contact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), if_false=MethodInvocation(arguments=[MemberReference(member=NOT_FOUND, postfix_operators=[], prefix_operators=[], qualifier=Response.Status, selectors=[])], member=status, postfix_operators=[], prefix_operators=[], qualifier=Response, selectors=[MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=MethodInvocation(arguments=[MemberReference(member=contact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ok, postfix_operators=[], prefix_operators=[], qualifier=Response, selectors=[MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))] end[}] END[}]
annotation[@] identifier[GET] annotation[@] identifier[PermitAll] annotation[@] identifier[Path] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Response] identifier[findByUniqueTag] operator[SEP] annotation[@] identifier[PathParam] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[uniqueTag] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[uniqueTag] operator[SEP] operator[SEP] identifier[DContact] identifier[contact] operator[=] identifier[dao] operator[SEP] identifier[findByUniqueTag] operator[SEP] Other[null] , identifier[uniqueTag] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[!=] identifier[contact] operator[?] identifier[Response] operator[SEP] identifier[ok] operator[SEP] identifier[contact] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[:] identifier[Response] operator[SEP] identifier[status] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[NOT_FOUND] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
@Bean @ConditionalOnProperty(prefix = JavaMelodyConfigurationProperties.PREFIX, name = "spring-monitoring-enabled", matchIfMissing = true) public MonitoringSpringAdvisor monitoringSpringAsyncAdvisor() { return new MonitoringSpringAdvisor( Pointcuts.union(new AnnotationMatchingPointcut(Async.class), new AnnotationMatchingPointcut(null, Async.class))); }
class class_name[name] begin[{] method[monitoringSpringAsyncAdvisor, return_type[type[MonitoringSpringAdvisor]], modifier[public], parameter[]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Async, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnnotationMatchingPointcut, sub_type=None)), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Async, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnnotationMatchingPointcut, sub_type=None))], member=union, postfix_operators=[], prefix_operators=[], qualifier=Pointcuts, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MonitoringSpringAdvisor, sub_type=None))] end[}] END[}]
annotation[@] identifier[Bean] annotation[@] identifier[ConditionalOnProperty] operator[SEP] identifier[prefix] operator[=] identifier[JavaMelodyConfigurationProperties] operator[SEP] identifier[PREFIX] , identifier[name] operator[=] literal[String] , identifier[matchIfMissing] operator[=] literal[boolean] operator[SEP] Keyword[public] identifier[MonitoringSpringAdvisor] identifier[monitoringSpringAsyncAdvisor] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[MonitoringSpringAdvisor] operator[SEP] identifier[Pointcuts] operator[SEP] identifier[union] operator[SEP] Keyword[new] identifier[AnnotationMatchingPointcut] operator[SEP] identifier[Async] operator[SEP] Keyword[class] operator[SEP] , Keyword[new] identifier[AnnotationMatchingPointcut] operator[SEP] Other[null] , identifier[Async] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected void addUUIDColumnToTable(CmsSetupDb dbCon, String tablename, String column) throws SQLException { System.out.println(new Exception().getStackTrace()[0].toString()); if (!dbCon.hasTableOrColumn(tablename, column)) { String query = readQuery(QUERY_ADD_TEMP_UUID_COLUMN); // Get the query // if the table is not one of the ONLINE or OFFLINE resources add the new column in the first position if (!RESOURCES_TABLES_LIST.contains(tablename)) { query += " FIRST"; } Map<String, String> replacer = new HashMap<String, String>(); // Build the replacements replacer.put(REPLACEMENT_TABLENAME, tablename); replacer.put(REPLACEMENT_COLUMN, column); dbCon.updateSqlStatement(query, replacer, null); // execute the query } else { System.out.println("column " + column + " in table " + tablename + " already exists"); } }
class class_name[name] begin[{] method[addUUIDColumnToTable, return_type[void], modifier[protected], parameter[dbCon, tablename, column]] begin[{] call[System.out.println, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getStackTrace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None))]] if[call[dbCon.hasTableOrColumn, parameter[member[.tablename], member[.column]]]] begin[{] local_variable[type[String], query] if[call[RESOURCES_TABLES_LIST.contains, parameter[member[.tablename]]]] begin[{] assign[member[.query], literal[" FIRST"]] else begin[{] None end[}] local_variable[type[Map], replacer] call[replacer.put, parameter[member[.REPLACEMENT_TABLENAME], member[.tablename]]] call[replacer.put, parameter[member[.REPLACEMENT_COLUMN], member[.column]]] call[dbCon.updateSqlStatement, parameter[member[.query], member[.replacer], literal[null]]] else begin[{] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["column "], +, member[.column]], +, literal[" in table "]], +, member[.tablename]], +, literal[" already exists"]]]] end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[addUUIDColumnToTable] operator[SEP] identifier[CmsSetupDb] identifier[dbCon] , identifier[String] identifier[tablename] , identifier[String] identifier[column] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] Keyword[new] identifier[Exception] operator[SEP] operator[SEP] operator[SEP] identifier[getStackTrace] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[dbCon] operator[SEP] identifier[hasTableOrColumn] operator[SEP] identifier[tablename] , identifier[column] operator[SEP] operator[SEP] { identifier[String] identifier[query] operator[=] identifier[readQuery] operator[SEP] identifier[QUERY_ADD_TEMP_UUID_COLUMN] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[RESOURCES_TABLES_LIST] operator[SEP] identifier[contains] operator[SEP] identifier[tablename] operator[SEP] operator[SEP] { identifier[query] operator[+=] literal[String] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[replacer] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[replacer] operator[SEP] identifier[put] operator[SEP] identifier[REPLACEMENT_TABLENAME] , identifier[tablename] operator[SEP] operator[SEP] identifier[replacer] operator[SEP] identifier[put] operator[SEP] identifier[REPLACEMENT_COLUMN] , identifier[column] operator[SEP] operator[SEP] identifier[dbCon] operator[SEP] identifier[updateSqlStatement] operator[SEP] identifier[query] , identifier[replacer] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[column] operator[+] literal[String] operator[+] identifier[tablename] operator[+] literal[String] operator[SEP] operator[SEP] } }
public <T extends Params> void serializeParams(OutputStream output, T param) throws IOException { // TODO: Add params-specific options. objectMapper.writerFor(param.getClass()).writeValue(output, param); }
class class_name[name] begin[{] method[serializeParams, return_type[void], modifier[public], parameter[output, param]] begin[{] call[objectMapper.writerFor, parameter[call[param.getClass, parameter[]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Params] operator[>] Keyword[void] identifier[serializeParams] operator[SEP] identifier[OutputStream] identifier[output] , identifier[T] identifier[param] operator[SEP] Keyword[throws] identifier[IOException] { identifier[objectMapper] operator[SEP] identifier[writerFor] operator[SEP] identifier[param] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writeValue] operator[SEP] identifier[output] , identifier[param] operator[SEP] operator[SEP] }
public void removeMessageListener(MessageListener<? extends Message> messageListener) { removeListener(messageListener.getChannelIdentifier(), messageListener.getMessageType(), messageListener); }
class class_name[name] begin[{] method[removeMessageListener, return_type[void], modifier[public], parameter[messageListener]] begin[{] call[.removeListener, parameter[call[messageListener.getChannelIdentifier, parameter[]], call[messageListener.getMessageType, parameter[]], member[.messageListener]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[removeMessageListener] operator[SEP] identifier[MessageListener] operator[<] operator[?] Keyword[extends] identifier[Message] operator[>] identifier[messageListener] operator[SEP] { identifier[removeListener] operator[SEP] identifier[messageListener] operator[SEP] identifier[getChannelIdentifier] operator[SEP] operator[SEP] , identifier[messageListener] operator[SEP] identifier[getMessageType] operator[SEP] operator[SEP] , identifier[messageListener] operator[SEP] operator[SEP] }
public ServerConfig setPort(int port) { if (!NetUtils.isRandomPort(port) && NetUtils.isInvalidPort(port)) { throw ExceptionUtils.buildRuntime("server.port", port + "", "port must between -1 and 65535 (-1 means random port)"); } this.port = port; return this; }
class class_name[name] begin[{] method[setPort, return_type[type[ServerConfig]], modifier[public], parameter[port]] begin[{] if[binary_operation[call[NetUtils.isRandomPort, parameter[member[.port]]], &&, call[NetUtils.isInvalidPort, parameter[member[.port]]]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="server.port"), BinaryOperation(operandl=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="port must between -1 and 65535 (-1 means random port)")], member=buildRuntime, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] assign[THIS[member[None.port]], member[.port]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ServerConfig] identifier[setPort] operator[SEP] Keyword[int] identifier[port] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[NetUtils] operator[SEP] identifier[isRandomPort] operator[SEP] identifier[port] operator[SEP] operator[&&] identifier[NetUtils] operator[SEP] identifier[isInvalidPort] operator[SEP] identifier[port] operator[SEP] operator[SEP] { Keyword[throw] identifier[ExceptionUtils] operator[SEP] identifier[buildRuntime] operator[SEP] literal[String] , identifier[port] operator[+] literal[String] , literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[port] operator[=] identifier[port] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public boolean connect(InetSocketAddress address) { nioThread = new NIOThread(address); nioThread.start(); isConnecting = true; long timeToSleep = this.connectTimeOut; if(LOGGER.isTraceEnabled()){ LOGGER.trace("NIO connect go to sleep - " + timeToSleep); } while(isConnecting && timeToSleep > 0){ long now = System.currentTimeMillis(); try { synchronized(connectHolder){ connectHolder.wait(timeToSleep); } } catch (InterruptedException e) { // do nothing. } timeToSleep = timeToSleep - (System.currentTimeMillis() - now); if(LOGGER.isTraceEnabled()){ LOGGER.trace("NIO connect go to sleep - " + timeToSleep + ", isConnecting=" + isConnecting); } } if(! isConnected()){ onConnectFailed(); return false; }else{ lenBuffer.clear(); incomingBuffer = lenBuffer; return true; } }
class class_name[name] begin[{] method[connect, return_type[type[boolean]], modifier[public], parameter[address]] begin[{] assign[member[.nioThread], ClassCreator(arguments=[MemberReference(member=address, 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=NIOThread, sub_type=None))] call[nioThread.start, parameter[]] assign[member[.isConnecting], literal[true]] local_variable[type[long], timeToSleep] if[call[LOGGER.isTraceEnabled, parameter[]]] begin[{] call[LOGGER.trace, parameter[binary_operation[literal["NIO connect go to sleep - "], +, member[.timeToSleep]]]] else begin[{] None end[}] while[binary_operation[member[.isConnecting], &&, binary_operation[member[.timeToSleep], >, literal[0]]]] begin[{] local_variable[type[long], now] TryStatement(block=[SynchronizedStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timeToSleep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wait, postfix_operators=[], prefix_operators=[], qualifier=connectHolder, selectors=[], type_arguments=None), label=None)], label=None, lock=MemberReference(member=connectHolder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) assign[member[.timeToSleep], binary_operation[member[.timeToSleep], -, binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.now]]]] if[call[LOGGER.isTraceEnabled, parameter[]]] begin[{] call[LOGGER.trace, parameter[binary_operation[binary_operation[binary_operation[literal["NIO connect go to sleep - "], +, member[.timeToSleep]], +, literal[", isConnecting="]], +, member[.isConnecting]]]] else begin[{] None end[}] end[}] if[call[.isConnected, parameter[]]] begin[{] call[.onConnectFailed, parameter[]] return[literal[false]] else begin[{] call[lenBuffer.clear, parameter[]] assign[member[.incomingBuffer], member[.lenBuffer]] return[literal[true]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[connect] operator[SEP] identifier[InetSocketAddress] identifier[address] operator[SEP] { identifier[nioThread] operator[=] Keyword[new] identifier[NIOThread] operator[SEP] identifier[address] operator[SEP] operator[SEP] identifier[nioThread] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[isConnecting] operator[=] literal[boolean] operator[SEP] Keyword[long] identifier[timeToSleep] operator[=] Keyword[this] operator[SEP] identifier[connectTimeOut] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[timeToSleep] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[isConnecting] operator[&&] identifier[timeToSleep] operator[>] Other[0] operator[SEP] { Keyword[long] identifier[now] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[synchronized] operator[SEP] identifier[connectHolder] operator[SEP] { identifier[connectHolder] operator[SEP] identifier[wait] operator[SEP] identifier[timeToSleep] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { } identifier[timeToSleep] operator[=] identifier[timeToSleep] operator[-] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[now] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[timeToSleep] operator[+] literal[String] operator[+] identifier[isConnecting] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[isConnected] operator[SEP] operator[SEP] operator[SEP] { identifier[onConnectFailed] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { identifier[lenBuffer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[incomingBuffer] operator[=] identifier[lenBuffer] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } }
private String getRowFormat(List<Integer> widths) { StringBuilder rowFormat = new StringBuilder(spaces(this.indentation)); for (int i=0; i< widths.size(); i++) { rowFormat.append("%"); rowFormat.append(this.flags != null ? this.flags.get(i) : ""); rowFormat.append(widths.get(i).toString()); rowFormat.append("s"); rowFormat.append(spaces(this.delimiterWidth)); } rowFormat.append("\n"); return rowFormat.toString(); }
class class_name[name] begin[{] method[getRowFormat, return_type[type[String]], modifier[private], parameter[widths]] begin[{] local_variable[type[StringBuilder], rowFormat] 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=rowFormat, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=flags, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=flags, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]))], member=append, postfix_operators=[], prefix_operators=[], qualifier=rowFormat, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=widths, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=rowFormat, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="s")], member=append, postfix_operators=[], prefix_operators=[], qualifier=rowFormat, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=delimiterWidth, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=spaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=rowFormat, 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=widths, 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[rowFormat.append, parameter[literal["\n"]]] return[call[rowFormat.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[getRowFormat] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[widths] operator[SEP] { identifier[StringBuilder] identifier[rowFormat] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[spaces] operator[SEP] Keyword[this] operator[SEP] identifier[indentation] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[widths] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[rowFormat] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[rowFormat] operator[SEP] identifier[append] operator[SEP] Keyword[this] operator[SEP] identifier[flags] operator[!=] Other[null] operator[?] Keyword[this] operator[SEP] identifier[flags] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[:] literal[String] operator[SEP] operator[SEP] identifier[rowFormat] operator[SEP] identifier[append] operator[SEP] identifier[widths] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[rowFormat] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[rowFormat] operator[SEP] identifier[append] operator[SEP] identifier[spaces] operator[SEP] Keyword[this] operator[SEP] identifier[delimiterWidth] operator[SEP] operator[SEP] operator[SEP] } identifier[rowFormat] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[rowFormat] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
Rule FieldGroup() { return Sequence(String("G:"), ZeroOrMore(WSP()).suppressNode(), TexText(), HeaderEol()).label(FieldGroup); }
class class_name[name] begin[{] method[FieldGroup, return_type[type[Rule]], modifier[default], parameter[]] begin[{] return[call[.Sequence, parameter[call[.String, parameter[literal["G:"]]], call[.ZeroOrMore, parameter[call[.WSP, parameter[]]]], call[.TexText, parameter[]], call[.HeaderEol, parameter[]]]]] end[}] END[}]
identifier[Rule] identifier[FieldGroup] operator[SEP] operator[SEP] { Keyword[return] identifier[Sequence] operator[SEP] identifier[String] operator[SEP] literal[String] operator[SEP] , identifier[ZeroOrMore] operator[SEP] identifier[WSP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[suppressNode] operator[SEP] operator[SEP] , identifier[TexText] operator[SEP] operator[SEP] , identifier[HeaderEol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[label] operator[SEP] identifier[FieldGroup] operator[SEP] operator[SEP] }
public void setLocation(Location location) { if (location != null) { this.location = location; } else { this.location = Location.Unspecified; } }
class class_name[name] begin[{] method[setLocation, return_type[void], modifier[public], parameter[location]] begin[{] if[binary_operation[member[.location], !=, literal[null]]] begin[{] assign[THIS[member[None.location]], member[.location]] else begin[{] assign[THIS[member[None.location]], member[Location.Unspecified]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setLocation] operator[SEP] identifier[Location] identifier[location] operator[SEP] { Keyword[if] operator[SEP] identifier[location] operator[!=] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[location] operator[=] identifier[location] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[location] operator[=] identifier[Location] operator[SEP] identifier[Unspecified] operator[SEP] } }
public B setHttpHeader(CharSequence name, Object value) { requireNonNull(name, "name"); requireNonNull(value, "value"); httpHeaders.setObject(HttpHeaderNames.of(name), value); return self(); }
class class_name[name] begin[{] method[setHttpHeader, return_type[type[B]], modifier[public], parameter[name, value]] begin[{] call[.requireNonNull, parameter[member[.name], literal["name"]]] call[.requireNonNull, parameter[member[.value], literal["value"]]] call[httpHeaders.setObject, parameter[call[HttpHeaderNames.of, parameter[member[.name]]], member[.value]]] return[call[.self, parameter[]]] end[}] END[}]
Keyword[public] identifier[B] identifier[setHttpHeader] operator[SEP] identifier[CharSequence] identifier[name] , identifier[Object] identifier[value] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[name] , literal[String] operator[SEP] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[value] , literal[String] operator[SEP] operator[SEP] identifier[httpHeaders] operator[SEP] identifier[setObject] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[of] operator[SEP] identifier[name] operator[SEP] , identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[self] operator[SEP] operator[SEP] operator[SEP] }
@Override public AppSession getNewSession(String sessionId, Class<? extends AppSession> aClass, ApplicationId applicationId, Object[] args) { try { // FIXME: add proper handling for SessionId if (aClass == ClientShSession.class) { ShClientSessionImpl clientSession = null; if (sessionId == null) { if (args != null && args.length > 0 && args[0] instanceof Request) { Request request = (Request) args[0]; sessionId = request.getSessionId(); } else { sessionId = this.sessionFactory.getSessionId(); } } IShClientSessionData sessionData = (IShClientSessionData) this.sessionDataFactory.getAppSessionData(ClientShSession.class, sessionId); sessionData.setApplicationId(applicationId); clientSession = new ShClientSessionImpl(sessionData, this.getMessageFactory(), sessionFactory, this.getClientShSessionListener()); sessionDataSource.addSession(clientSession); clientSession.getSessions().get(0).setRequestListener(clientSession); return clientSession; } else if (aClass == ServerShSession.class) { ShServerSessionImpl serverSession = null; if (sessionId == null) { if (args != null && args.length > 0 && args[0] instanceof Request) { Request request = (Request) args[0]; sessionId = request.getSessionId(); } else { sessionId = this.sessionFactory.getSessionId(); } } IShServerSessionData sessionData = (IShServerSessionData) this.sessionDataFactory.getAppSessionData(ServerShSession.class, sessionId); sessionData.setApplicationId(applicationId); serverSession = new ShServerSessionImpl(sessionData, this.getMessageFactory(), sessionFactory, getServerShSessionListener()); sessionDataSource.addSession(serverSession); serverSession.getSessions().get(0).setRequestListener(serverSession); return serverSession; } else { throw new IllegalArgumentException("Wrong session class: [" + aClass + "]. Supported[" + ClientShSession.class + "]"); } } catch (IllegalArgumentException iae) { throw iae; } catch (Exception e) { logger.error("Failure to obtain new Sh Session.", e); } return null; }
class class_name[name] begin[{] method[getNewSession, return_type[type[AppSession]], modifier[public], parameter[sessionId, aClass, applicationId, args]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClientShSession, sub_type=None)), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=aClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServerShSession, sub_type=None)), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Wrong session class: ["), operandr=MemberReference(member=aClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]. Supported["), operator=+), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClientShSession, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=serverSession)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ShServerSessionImpl, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=args, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=ReferenceType(arguments=None, dimensions=[], name=Request, sub_type=None), operator=instanceof), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sessionFactory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getSessionId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=Request, sub_type=None)), name=request)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Request, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getSessionId, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sessionDataFactory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServerShSession, sub_type=None)), MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAppSessionData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=IShServerSessionData, sub_type=None)), name=sessionData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IShServerSessionData, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=applicationId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setApplicationId, postfix_operators=[], prefix_operators=[], qualifier=sessionData, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=serverSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=sessionData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getMessageFactory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MemberReference(member=sessionFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getServerShSessionListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShServerSessionImpl, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=serverSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSession, postfix_operators=[], prefix_operators=[], qualifier=sessionDataSource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getSessions, postfix_operators=[], prefix_operators=[], qualifier=serverSession, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=serverSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRequestListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=serverSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=clientSession)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ShClientSessionImpl, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=args, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), operandr=ReferenceType(arguments=None, dimensions=[], name=Request, sub_type=None), operator=instanceof), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sessionFactory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getSessionId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type=ReferenceType(arguments=None, dimensions=[], name=Request, sub_type=None)), name=request)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Request, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getSessionId, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sessionDataFactory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClientShSession, sub_type=None)), MemberReference(member=sessionId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAppSessionData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=IShClientSessionData, sub_type=None)), name=sessionData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IShClientSessionData, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=applicationId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setApplicationId, postfix_operators=[], prefix_operators=[], qualifier=sessionData, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=clientSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=sessionData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getMessageFactory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MemberReference(member=sessionFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getClientShSessionListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShClientSessionImpl, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=clientSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSession, postfix_operators=[], prefix_operators=[], qualifier=sessionDataSource, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getSessions, postfix_operators=[], prefix_operators=[], qualifier=clientSession, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=clientSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRequestListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=clientSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=MemberReference(member=iae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=iae, types=['IllegalArgumentException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failure to obtain new Sh Session."), 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[}]
annotation[@] identifier[Override] Keyword[public] identifier[AppSession] identifier[getNewSession] operator[SEP] identifier[String] identifier[sessionId] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[AppSession] operator[>] identifier[aClass] , identifier[ApplicationId] identifier[applicationId] , identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[aClass] operator[==] identifier[ClientShSession] operator[SEP] Keyword[class] operator[SEP] { identifier[ShClientSessionImpl] identifier[clientSession] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[sessionId] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[args] operator[!=] Other[null] operator[&&] identifier[args] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] identifier[args] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[Request] operator[SEP] { identifier[Request] identifier[request] operator[=] operator[SEP] identifier[Request] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[sessionId] operator[=] identifier[request] operator[SEP] identifier[getSessionId] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[sessionId] operator[=] Keyword[this] operator[SEP] identifier[sessionFactory] operator[SEP] identifier[getSessionId] operator[SEP] operator[SEP] operator[SEP] } } identifier[IShClientSessionData] identifier[sessionData] operator[=] operator[SEP] identifier[IShClientSessionData] operator[SEP] Keyword[this] operator[SEP] identifier[sessionDataFactory] operator[SEP] identifier[getAppSessionData] operator[SEP] identifier[ClientShSession] operator[SEP] Keyword[class] , identifier[sessionId] operator[SEP] operator[SEP] identifier[sessionData] operator[SEP] identifier[setApplicationId] operator[SEP] identifier[applicationId] operator[SEP] operator[SEP] identifier[clientSession] operator[=] Keyword[new] identifier[ShClientSessionImpl] operator[SEP] identifier[sessionData] , Keyword[this] operator[SEP] identifier[getMessageFactory] operator[SEP] operator[SEP] , identifier[sessionFactory] , Keyword[this] operator[SEP] identifier[getClientShSessionListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sessionDataSource] operator[SEP] identifier[addSession] operator[SEP] identifier[clientSession] operator[SEP] operator[SEP] identifier[clientSession] operator[SEP] identifier[getSessions] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[setRequestListener] operator[SEP] identifier[clientSession] operator[SEP] operator[SEP] Keyword[return] identifier[clientSession] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[aClass] operator[==] identifier[ServerShSession] operator[SEP] Keyword[class] operator[SEP] { identifier[ShServerSessionImpl] identifier[serverSession] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[sessionId] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[args] operator[!=] Other[null] operator[&&] identifier[args] operator[SEP] identifier[length] operator[>] Other[0] operator[&&] identifier[args] operator[SEP] Other[0] operator[SEP] Keyword[instanceof] identifier[Request] operator[SEP] { identifier[Request] identifier[request] operator[=] operator[SEP] identifier[Request] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[sessionId] operator[=] identifier[request] operator[SEP] identifier[getSessionId] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[sessionId] operator[=] Keyword[this] operator[SEP] identifier[sessionFactory] operator[SEP] identifier[getSessionId] operator[SEP] operator[SEP] operator[SEP] } } identifier[IShServerSessionData] identifier[sessionData] operator[=] operator[SEP] identifier[IShServerSessionData] operator[SEP] Keyword[this] operator[SEP] identifier[sessionDataFactory] operator[SEP] identifier[getAppSessionData] operator[SEP] identifier[ServerShSession] operator[SEP] Keyword[class] , identifier[sessionId] operator[SEP] operator[SEP] identifier[sessionData] operator[SEP] identifier[setApplicationId] operator[SEP] identifier[applicationId] operator[SEP] operator[SEP] identifier[serverSession] operator[=] Keyword[new] identifier[ShServerSessionImpl] operator[SEP] identifier[sessionData] , Keyword[this] operator[SEP] identifier[getMessageFactory] operator[SEP] operator[SEP] , identifier[sessionFactory] , identifier[getServerShSessionListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sessionDataSource] operator[SEP] identifier[addSession] operator[SEP] identifier[serverSession] operator[SEP] operator[SEP] identifier[serverSession] operator[SEP] identifier[getSessions] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[setRequestListener] operator[SEP] identifier[serverSession] operator[SEP] operator[SEP] Keyword[return] identifier[serverSession] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[aClass] operator[+] literal[String] operator[+] identifier[ClientShSession] operator[SEP] Keyword[class] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[iae] operator[SEP] { Keyword[throw] identifier[iae] 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] }
public final void setGuaranteedSourceMessagingEngineUUID(SIBUuid8 value) { if (value != null) jmo.setField(ControlAccess.SOURCEMEUUID, value.toByteArray()); else jmo.setField(ControlAccess.SOURCEMEUUID, null); }
class class_name[name] begin[{] method[setGuaranteedSourceMessagingEngineUUID, return_type[void], modifier[final public], parameter[value]] begin[{] if[binary_operation[member[.value], !=, literal[null]]] begin[{] call[jmo.setField, parameter[member[ControlAccess.SOURCEMEUUID], call[value.toByteArray, parameter[]]]] else begin[{] call[jmo.setField, parameter[member[ControlAccess.SOURCEMEUUID], literal[null]]] end[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[setGuaranteedSourceMessagingEngineUUID] operator[SEP] identifier[SIBUuid8] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] identifier[jmo] operator[SEP] identifier[setField] operator[SEP] identifier[ControlAccess] operator[SEP] identifier[SOURCEMEUUID] , identifier[value] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[jmo] operator[SEP] identifier[setField] operator[SEP] identifier[ControlAccess] operator[SEP] identifier[SOURCEMEUUID] , Other[null] operator[SEP] operator[SEP] }
@Override public ModelService getModelService(String serviceName){ ModelService service = null; if (getCache().isCached(serviceName)) { service = getCache().getService(serviceName); } else { service= this.getDirectoryServiceClient().getService(serviceName, watcher); if(service != null){ getCache().putService(serviceName, service); } } return service; }
class class_name[name] begin[{] method[getModelService, return_type[type[ModelService]], modifier[public], parameter[serviceName]] begin[{] local_variable[type[ModelService], service] if[call[.getCache, parameter[]]] begin[{] assign[member[.service], call[.getCache, parameter[]]] else begin[{] assign[member[.service], THIS[call[None.getDirectoryServiceClient, parameter[]]call[None.getService, parameter[member[.serviceName], member[.watcher]]]]] if[binary_operation[member[.service], !=, literal[null]]] begin[{] call[.getCache, parameter[]] else begin[{] None end[}] end[}] return[member[.service]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ModelService] identifier[getModelService] operator[SEP] identifier[String] identifier[serviceName] operator[SEP] { identifier[ModelService] identifier[service] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[getCache] operator[SEP] operator[SEP] operator[SEP] identifier[isCached] operator[SEP] identifier[serviceName] operator[SEP] operator[SEP] { identifier[service] operator[=] identifier[getCache] operator[SEP] operator[SEP] operator[SEP] identifier[getService] operator[SEP] identifier[serviceName] operator[SEP] operator[SEP] } Keyword[else] { identifier[service] operator[=] Keyword[this] operator[SEP] identifier[getDirectoryServiceClient] operator[SEP] operator[SEP] operator[SEP] identifier[getService] operator[SEP] identifier[serviceName] , identifier[watcher] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[service] operator[!=] Other[null] operator[SEP] { identifier[getCache] operator[SEP] operator[SEP] operator[SEP] identifier[putService] operator[SEP] identifier[serviceName] , identifier[service] operator[SEP] operator[SEP] } } Keyword[return] identifier[service] operator[SEP] }
public void compact() { if (prev == this) throw new IllegalStateException(); if (!prev.owner) return; // Cannot compact: prev isn't writable. int byteCount = limit - pos; int availableByteCount = SIZE - prev.limit + (prev.shared ? 0 : prev.pos); if (byteCount > availableByteCount) return; // Cannot compact: not enough writable space. writeTo(prev, byteCount); pop(); SegmentPool.recycle(this); }
class class_name[name] begin[{] method[compact, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.prev], ==, THIS[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[member[prev.owner]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], byteCount] local_variable[type[int], availableByteCount] if[binary_operation[member[.byteCount], >, member[.availableByteCount]]] begin[{] return[None] else begin[{] None end[}] call[.writeTo, parameter[member[.prev], member[.byteCount]]] call[.pop, parameter[]] call[SegmentPool.recycle, parameter[THIS[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[compact] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[prev] operator[==] Keyword[this] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[prev] operator[SEP] identifier[owner] operator[SEP] Keyword[return] operator[SEP] Keyword[int] identifier[byteCount] operator[=] identifier[limit] operator[-] identifier[pos] operator[SEP] Keyword[int] identifier[availableByteCount] operator[=] identifier[SIZE] operator[-] identifier[prev] operator[SEP] identifier[limit] operator[+] operator[SEP] identifier[prev] operator[SEP] identifier[shared] operator[?] Other[0] operator[:] identifier[prev] operator[SEP] identifier[pos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[byteCount] operator[>] identifier[availableByteCount] operator[SEP] Keyword[return] operator[SEP] identifier[writeTo] operator[SEP] identifier[prev] , identifier[byteCount] operator[SEP] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] identifier[SegmentPool] operator[SEP] identifier[recycle] operator[SEP] Keyword[this] operator[SEP] operator[SEP] }
public ServerSideConfigurationBuilder resourcePool(String name, long size, MemoryUnit unit, String serverResource) { return resourcePool(name, new Pool(unit.toBytes(size), serverResource)); }
class class_name[name] begin[{] method[resourcePool, return_type[type[ServerSideConfigurationBuilder]], modifier[public], parameter[name, size, unit, serverResource]] begin[{] return[call[.resourcePool, parameter[member[.name], ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toBytes, postfix_operators=[], prefix_operators=[], qualifier=unit, selectors=[], type_arguments=None), MemberReference(member=serverResource, 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=Pool, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[ServerSideConfigurationBuilder] identifier[resourcePool] operator[SEP] identifier[String] identifier[name] , Keyword[long] identifier[size] , identifier[MemoryUnit] identifier[unit] , identifier[String] identifier[serverResource] operator[SEP] { Keyword[return] identifier[resourcePool] operator[SEP] identifier[name] , Keyword[new] identifier[Pool] operator[SEP] identifier[unit] operator[SEP] identifier[toBytes] operator[SEP] identifier[size] operator[SEP] , identifier[serverResource] operator[SEP] operator[SEP] operator[SEP] }
public static synchronized boolean pushSubject(String username) { if (securityService == null || username == null) { if (tc.isDebugEnabled()) { Tr.debug(tc, "returning false because user or securityService is null," + " user= " + username + " secsvc= " + securityService); } return false; } AuthenticationService authenticationService = securityService.getAuthenticationService(); Subject tempSubject = new Subject(); Hashtable<String, Object> hashtable = new Hashtable<String, Object>(); if (!authenticationService.isAllowHashTableLoginWithIdOnly()) { hashtable.put(AuthenticationConstants.INTERNAL_ASSERTION_KEY, Boolean.TRUE); } hashtable.put("com.ibm.wsspi.security.cred.userId", username); tempSubject.getPublicCredentials().add(hashtable); try { Subject new_subject = authenticationService.authenticate(JaasLoginConfigConstants.SYSTEM_WEB_INBOUND, tempSubject); return setRunAsSubject(new_subject); } catch (AuthenticationException e) { FFDCFilter.processException(e, TokenPropagationHelper.class.getName(), "pushSubject", new Object[] { username }); Tr.error(tc, "ERROR_AUTHENTICATE", new Object[] { e.getMessage() }); // CWWKS6103E return false; } catch (Exception e) { FFDCFilter.processException(e, TokenPropagationHelper.class.getName(), "pushSubject", new Object[] { username }); return false; } }
class class_name[name] begin[{] method[pushSubject, return_type[type[boolean]], modifier[synchronized public static], parameter[username]] begin[{] if[binary_operation[binary_operation[member[.securityService], ==, literal[null]], ||, binary_operation[member[.username], ==, literal[null]]]] begin[{] if[call[tc.isDebugEnabled, parameter[]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[binary_operation[literal["returning false because user or securityService is null,"], +, literal[" user= "]], +, member[.username]], +, literal[" secsvc= "]], +, member[.securityService]]]] else begin[{] None end[}] return[literal[false]] else begin[{] None end[}] local_variable[type[AuthenticationService], authenticationService] local_variable[type[Subject], tempSubject] local_variable[type[Hashtable], hashtable] if[call[authenticationService.isAllowHashTableLoginWithIdOnly, parameter[]]] begin[{] call[hashtable.put, parameter[member[AuthenticationConstants.INTERNAL_ASSERTION_KEY], member[Boolean.TRUE]]] else begin[{] None end[}] call[hashtable.put, parameter[literal["com.ibm.wsspi.security.cred.userId"], member[.username]]] call[tempSubject.getPublicCredentials, parameter[]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=SYSTEM_WEB_INBOUND, postfix_operators=[], prefix_operators=[], qualifier=JaasLoginConfigConstants, selectors=[]), MemberReference(member=tempSubject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=authenticate, postfix_operators=[], prefix_operators=[], qualifier=authenticationService, selectors=[], type_arguments=None), name=new_subject)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Subject, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=new_subject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setRunAsSubject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TokenPropagationHelper, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pushSubject"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ERROR_AUTHENTICATE"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=error, postfix_operators=[], prefix_operators=[], qualifier=Tr, 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=['AuthenticationException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TokenPropagationHelper, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pushSubject"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, 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=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[synchronized] Keyword[boolean] identifier[pushSubject] operator[SEP] identifier[String] identifier[username] operator[SEP] { Keyword[if] operator[SEP] identifier[securityService] operator[==] Other[null] operator[||] identifier[username] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] 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[+] literal[String] operator[+] identifier[username] operator[+] literal[String] operator[+] identifier[securityService] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } identifier[AuthenticationService] identifier[authenticationService] operator[=] identifier[securityService] operator[SEP] identifier[getAuthenticationService] operator[SEP] operator[SEP] operator[SEP] identifier[Subject] identifier[tempSubject] operator[=] Keyword[new] identifier[Subject] operator[SEP] operator[SEP] operator[SEP] identifier[Hashtable] operator[<] identifier[String] , identifier[Object] operator[>] identifier[hashtable] operator[=] Keyword[new] identifier[Hashtable] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[authenticationService] operator[SEP] identifier[isAllowHashTableLoginWithIdOnly] operator[SEP] operator[SEP] operator[SEP] { identifier[hashtable] operator[SEP] identifier[put] operator[SEP] identifier[AuthenticationConstants] operator[SEP] identifier[INTERNAL_ASSERTION_KEY] , identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] operator[SEP] } identifier[hashtable] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[username] operator[SEP] operator[SEP] identifier[tempSubject] operator[SEP] identifier[getPublicCredentials] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[hashtable] operator[SEP] operator[SEP] Keyword[try] { identifier[Subject] identifier[new_subject] operator[=] identifier[authenticationService] operator[SEP] identifier[authenticate] operator[SEP] identifier[JaasLoginConfigConstants] operator[SEP] identifier[SYSTEM_WEB_INBOUND] , identifier[tempSubject] operator[SEP] operator[SEP] Keyword[return] identifier[setRunAsSubject] operator[SEP] identifier[new_subject] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[AuthenticationException] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , identifier[TokenPropagationHelper] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[username] } operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , identifier[TokenPropagationHelper] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[username] } operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } }
public R setTimezone(String timezone) { mBodyMap.put(BoxUser.FIELD_TIMEZONE, timezone); return (R) this; }
class class_name[name] begin[{] method[setTimezone, return_type[type[R]], modifier[public], parameter[timezone]] begin[{] call[mBodyMap.put, parameter[member[BoxUser.FIELD_TIMEZONE], member[.timezone]]] return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))] end[}] END[}]
Keyword[public] identifier[R] identifier[setTimezone] operator[SEP] identifier[String] identifier[timezone] operator[SEP] { identifier[mBodyMap] operator[SEP] identifier[put] operator[SEP] identifier[BoxUser] operator[SEP] identifier[FIELD_TIMEZONE] , identifier[timezone] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[R] operator[SEP] Keyword[this] operator[SEP] }
AWSCredentialsProvider createCredentialsProvider() throws StageException { String accessKey = credentialConfigs.getAccessKey().get(); String secretKey = credentialConfigs.getSecretKey().get(); if (accessKey != null && !accessKey.isEmpty() && secretKey != null && !secretKey.isEmpty()) { return new AWSStaticCredentialsProvider(new BasicAWSCredentials(credentialConfigs.getAccessKey().get(), credentialConfigs.getSecretKey().get() )); } return null; }
class class_name[name] begin[{] method[createCredentialsProvider, return_type[type[AWSCredentialsProvider]], modifier[default], parameter[]] begin[{] local_variable[type[String], accessKey] local_variable[type[String], secretKey] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.accessKey], !=, literal[null]], &&, call[accessKey.isEmpty, parameter[]]], &&, binary_operation[member[.secretKey], !=, literal[null]]], &&, call[secretKey.isEmpty, parameter[]]]] begin[{] return[ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getAccessKey, postfix_operators=[], prefix_operators=[], qualifier=credentialConfigs, selectors=[MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getSecretKey, postfix_operators=[], prefix_operators=[], qualifier=credentialConfigs, selectors=[MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BasicAWSCredentials, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AWSStaticCredentialsProvider, sub_type=None))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
identifier[AWSCredentialsProvider] identifier[createCredentialsProvider] operator[SEP] operator[SEP] Keyword[throws] identifier[StageException] { identifier[String] identifier[accessKey] operator[=] identifier[credentialConfigs] operator[SEP] identifier[getAccessKey] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[secretKey] operator[=] identifier[credentialConfigs] operator[SEP] identifier[getSecretKey] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[accessKey] operator[!=] Other[null] operator[&&] operator[!] identifier[accessKey] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[secretKey] operator[!=] Other[null] operator[&&] operator[!] identifier[secretKey] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[AWSStaticCredentialsProvider] operator[SEP] Keyword[new] identifier[BasicAWSCredentials] operator[SEP] identifier[credentialConfigs] operator[SEP] identifier[getAccessKey] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[credentialConfigs] operator[SEP] identifier[getSecretKey] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@Override public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) { return cpDefinitionInventoryPersistence.findWithDynamicQuery(dynamicQuery); }
class class_name[name] begin[{] method[dynamicQuery, return_type[type[List]], modifier[public], parameter[dynamicQuery]] begin[{] return[call[cpDefinitionInventoryPersistence.findWithDynamicQuery, parameter[member[.dynamicQuery]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[dynamicQuery] operator[SEP] identifier[DynamicQuery] identifier[dynamicQuery] operator[SEP] { Keyword[return] identifier[cpDefinitionInventoryPersistence] operator[SEP] identifier[findWithDynamicQuery] operator[SEP] identifier[dynamicQuery] operator[SEP] operator[SEP] }
static boolean wildcardMatch(String filename, String wildcardMatcher, IOCase caseSensitivity) { if (filename == null && wildcardMatcher == null) { return true; } if (filename == null || wildcardMatcher == null) { return false; } if (caseSensitivity == null) { caseSensitivity = IOCase.SENSITIVE; } String[] wcs = splitOnTokens(wildcardMatcher); boolean anyChars = false; int textIdx = 0; int wcsIdx = 0; Stack<int[]> backtrack = new Stack<int[]>(); // loop around a backtrack stack, to handle complex * matching do { if (backtrack.size() > 0) { int[] array = backtrack.pop(); wcsIdx = array[0]; textIdx = array[1]; anyChars = true; } // loop whilst tokens and text left to process while (wcsIdx < wcs.length) { if (wcs[wcsIdx].equals("?")) { // ? so move to next text char textIdx++; if (textIdx > filename.length()) { break; } anyChars = false; } else if (wcs[wcsIdx].equals("*")) { // set any chars status anyChars = true; if (wcsIdx == wcs.length - 1) { textIdx = filename.length(); } } else { // matching text token if (anyChars) { // any chars then try to locate text token textIdx = caseSensitivity.checkIndexOf(filename, textIdx, wcs[wcsIdx]); if (textIdx == -1) { // token not found break; } int repeat = caseSensitivity.checkIndexOf(filename, textIdx + 1, wcs[wcsIdx]); if (repeat >= 0) { backtrack.push(new int[] { wcsIdx, repeat }); } } else { // matching from current position if (!caseSensitivity.checkRegionMatches(filename, textIdx, wcs[wcsIdx])) { // couldnt match token break; } } // matched text token, move text index to end of matched token textIdx += wcs[wcsIdx].length(); anyChars = false; } wcsIdx++; } // full match if (wcsIdx == wcs.length && textIdx == filename.length()) { return true; } } while (backtrack.size() > 0); return false; }
class class_name[name] begin[{] method[wildcardMatch, return_type[type[boolean]], modifier[static], parameter[filename, wildcardMatcher, caseSensitivity]] begin[{] if[binary_operation[binary_operation[member[.filename], ==, literal[null]], &&, binary_operation[member[.wildcardMatcher], ==, literal[null]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.filename], ==, literal[null]], ||, binary_operation[member[.wildcardMatcher], ==, literal[null]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[.caseSensitivity], ==, literal[null]]] begin[{] assign[member[.caseSensitivity], member[IOCase.SENSITIVE]] else begin[{] None end[}] local_variable[type[String], wcs] local_variable[type[boolean], anyChars] local_variable[type[int], textIdx] local_variable[type[int], wcsIdx] local_variable[type[Stack], backtrack] do[binary_operation[call[backtrack.size, parameter[]], >, literal[0]]] begin[{] if[binary_operation[call[backtrack.size, parameter[]], >, literal[0]]] begin[{] local_variable[type[int], array] assign[member[.wcsIdx], member[.array]] assign[member[.textIdx], member[.array]] assign[member[.anyChars], literal[true]] else begin[{] None end[}] while[binary_operation[member[.wcsIdx], <, member[wcs.length]]] begin[{] if[member[.wcs]] begin[{] member[.textIdx] if[binary_operation[member[.textIdx], >, call[filename.length, parameter[]]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.anyChars], literal[false]] else begin[{] if[member[.wcs]] begin[{] assign[member[.anyChars], literal[true]] if[binary_operation[member[.wcsIdx], ==, binary_operation[member[wcs.length], -, literal[1]]]] begin[{] assign[member[.textIdx], call[filename.length, parameter[]]] else begin[{] None end[}] else begin[{] if[member[.anyChars]] begin[{] assign[member[.textIdx], call[caseSensitivity.checkIndexOf, parameter[member[.filename], member[.textIdx], member[.wcs]]]] if[binary_operation[member[.textIdx], ==, literal[1]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[int], repeat] if[binary_operation[member[.repeat], >=, literal[0]]] begin[{] call[backtrack.push, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=wcsIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=repeat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]] else begin[{] None end[}] else begin[{] if[call[caseSensitivity.checkRegionMatches, parameter[member[.filename], member[.textIdx], member[.wcs]]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] end[}] assign[member[.textIdx], member[.wcs]] assign[member[.anyChars], literal[false]] end[}] end[}] member[.wcsIdx] end[}] if[binary_operation[binary_operation[member[.wcsIdx], ==, member[wcs.length]], &&, binary_operation[member[.textIdx], ==, call[filename.length, parameter[]]]]] begin[{] return[literal[true]] else begin[{] None end[}] end[}] return[literal[false]] end[}] END[}]
Keyword[static] Keyword[boolean] identifier[wildcardMatch] operator[SEP] identifier[String] identifier[filename] , identifier[String] identifier[wildcardMatcher] , identifier[IOCase] identifier[caseSensitivity] operator[SEP] { Keyword[if] operator[SEP] identifier[filename] operator[==] Other[null] operator[&&] identifier[wildcardMatcher] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[filename] operator[==] Other[null] operator[||] identifier[wildcardMatcher] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[caseSensitivity] operator[==] Other[null] operator[SEP] { identifier[caseSensitivity] operator[=] identifier[IOCase] operator[SEP] identifier[SENSITIVE] operator[SEP] } identifier[String] operator[SEP] operator[SEP] identifier[wcs] operator[=] identifier[splitOnTokens] operator[SEP] identifier[wildcardMatcher] operator[SEP] operator[SEP] Keyword[boolean] identifier[anyChars] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[textIdx] operator[=] Other[0] operator[SEP] Keyword[int] identifier[wcsIdx] operator[=] Other[0] operator[SEP] identifier[Stack] operator[<] Keyword[int] operator[SEP] operator[SEP] operator[>] identifier[backtrack] operator[=] Keyword[new] identifier[Stack] operator[<] Keyword[int] operator[SEP] operator[SEP] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[do] { Keyword[if] operator[SEP] identifier[backtrack] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[array] operator[=] identifier[backtrack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] identifier[wcsIdx] operator[=] identifier[array] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[textIdx] operator[=] identifier[array] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[anyChars] operator[=] literal[boolean] operator[SEP] } Keyword[while] operator[SEP] identifier[wcsIdx] operator[<] identifier[wcs] operator[SEP] identifier[length] operator[SEP] { Keyword[if] operator[SEP] identifier[wcs] operator[SEP] identifier[wcsIdx] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[textIdx] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[textIdx] operator[>] identifier[filename] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } identifier[anyChars] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[wcs] operator[SEP] identifier[wcsIdx] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[anyChars] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[wcsIdx] operator[==] identifier[wcs] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] { identifier[textIdx] operator[=] identifier[filename] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[anyChars] operator[SEP] { identifier[textIdx] operator[=] identifier[caseSensitivity] operator[SEP] identifier[checkIndexOf] operator[SEP] identifier[filename] , identifier[textIdx] , identifier[wcs] operator[SEP] identifier[wcsIdx] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[textIdx] operator[==] operator[-] Other[1] operator[SEP] { Keyword[break] operator[SEP] } Keyword[int] identifier[repeat] operator[=] identifier[caseSensitivity] operator[SEP] identifier[checkIndexOf] operator[SEP] identifier[filename] , identifier[textIdx] operator[+] Other[1] , identifier[wcs] operator[SEP] identifier[wcsIdx] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[repeat] operator[>=] Other[0] operator[SEP] { identifier[backtrack] operator[SEP] identifier[push] operator[SEP] Keyword[new] Keyword[int] operator[SEP] operator[SEP] { identifier[wcsIdx] , identifier[repeat] } operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[caseSensitivity] operator[SEP] identifier[checkRegionMatches] operator[SEP] identifier[filename] , identifier[textIdx] , identifier[wcs] operator[SEP] identifier[wcsIdx] operator[SEP] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } } identifier[textIdx] operator[+=] identifier[wcs] operator[SEP] identifier[wcsIdx] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[anyChars] operator[=] literal[boolean] operator[SEP] } identifier[wcsIdx] operator[++] operator[SEP] } Keyword[if] operator[SEP] identifier[wcsIdx] operator[==] identifier[wcs] operator[SEP] identifier[length] operator[&&] identifier[textIdx] operator[==] identifier[filename] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[while] operator[SEP] identifier[backtrack] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public void addBinding(String interfaceName, String specificBindingName) throws NameAlreadyBoundException // d457053.1 { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "addBinding: " + interfaceName + ", " + specificBindingName); addToServerContextBindingMap(interfaceName, specificBindingName); ivEjbContextBindingMap.put(interfaceName, specificBindingName); }
class class_name[name] begin[{] method[addBinding, return_type[void], modifier[public], parameter[interfaceName, specificBindingName]] 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["addBinding: "], +, member[.interfaceName]], +, literal[", "]], +, member[.specificBindingName]]]] else begin[{] None end[}] call[.addToServerContextBindingMap, parameter[member[.interfaceName], member[.specificBindingName]]] call[ivEjbContextBindingMap.put, parameter[member[.interfaceName], member[.specificBindingName]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addBinding] operator[SEP] identifier[String] identifier[interfaceName] , identifier[String] identifier[specificBindingName] operator[SEP] Keyword[throws] identifier[NameAlreadyBoundException] { 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[interfaceName] operator[+] literal[String] operator[+] identifier[specificBindingName] operator[SEP] operator[SEP] identifier[addToServerContextBindingMap] operator[SEP] identifier[interfaceName] , identifier[specificBindingName] operator[SEP] operator[SEP] identifier[ivEjbContextBindingMap] operator[SEP] identifier[put] operator[SEP] identifier[interfaceName] , identifier[specificBindingName] operator[SEP] operator[SEP] }
public static <K, V> Cache<K, V> createCache(String sqlCacheClass, String prefix, Properties properties) { if (StringUtil.isEmpty(sqlCacheClass)) { try { Class.forName("com.google.common.cache.Cache"); return new GuavaCache<K, V>(properties, prefix); } catch (Throwable t) { return new SimpleCache<K, V>(properties, prefix); } } else { try { Class<? extends Cache> clazz = (Class<? extends Cache>) Class.forName(sqlCacheClass); try { Constructor<? extends Cache> constructor = clazz.getConstructor(Properties.class, String.class); return constructor.newInstance(properties, prefix); } catch (Exception e) { return clazz.newInstance(); } } catch (Throwable t) { throw new PageException("Created Sql Cache [" + sqlCacheClass + "] Error", t); } } }
class class_name[name] begin[{] method[createCache, return_type[type[Cache]], modifier[public static], parameter[sqlCacheClass, prefix, properties]] begin[{] if[call[StringUtil.isEmpty, parameter[member[.sqlCacheClass]]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.google.common.cache.Cache")], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prefix, 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=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=GuavaCache, sub_type=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prefix, 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=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=SimpleCache, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) else begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=sqlCacheClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Cache, sub_type=None))], dimensions=[], name=Class, sub_type=None)), name=clazz)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Cache, sub_type=None))], dimensions=[], name=Class, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Properties, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=getConstructor, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), name=constructor)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=Cache, sub_type=None))], dimensions=[], name=Constructor, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=constructor, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=clazz, 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)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Created Sql Cache ["), operandr=MemberReference(member=sqlCacheClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] Error"), operator=+), MemberReference(member=t, 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=PageException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Cache] operator[<] identifier[K] , identifier[V] operator[>] identifier[createCache] operator[SEP] identifier[String] identifier[sqlCacheClass] , identifier[String] identifier[prefix] , identifier[Properties] identifier[properties] operator[SEP] { Keyword[if] operator[SEP] identifier[StringUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[sqlCacheClass] operator[SEP] operator[SEP] { Keyword[try] { identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[GuavaCache] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[properties] , identifier[prefix] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] Keyword[new] identifier[SimpleCache] operator[<] identifier[K] , identifier[V] operator[>] operator[SEP] identifier[properties] , identifier[prefix] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[try] { identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Cache] operator[>] identifier[clazz] operator[=] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Cache] operator[>] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[sqlCacheClass] operator[SEP] operator[SEP] Keyword[try] { identifier[Constructor] operator[<] operator[?] Keyword[extends] identifier[Cache] operator[>] identifier[constructor] operator[=] identifier[clazz] operator[SEP] identifier[getConstructor] operator[SEP] identifier[Properties] operator[SEP] Keyword[class] , identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[constructor] operator[SEP] identifier[newInstance] operator[SEP] identifier[properties] , identifier[prefix] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] identifier[clazz] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[throw] Keyword[new] identifier[PageException] operator[SEP] literal[String] operator[+] identifier[sqlCacheClass] operator[+] literal[String] , identifier[t] operator[SEP] operator[SEP] } } }
static void checkForDownloads(InstanceType instanceType, boolean checkTimeStamp, boolean cleanup) { LOGGER.entering(); if (checkTimeStamp && (lastModifiedTime == DOWNLOAD_FILE.lastModified())) { return; } lastModifiedTime = DOWNLOAD_FILE.lastModified(); if (cleanup) { cleanup(); } List<URLChecksumEntity> artifactDetails = new ArrayList<ArtifactDetails.URLChecksumEntity>(); try { artifactDetails = ArtifactDetails.getArtifactDetailsForCurrentPlatformByRole(DOWNLOAD_FILE, instanceType); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Unable to open download.json file", e); throw new RuntimeException(e); } downloadAndExtractArtifacts(artifactDetails); LOGGER.exiting(); }
class class_name[name] begin[{] method[checkForDownloads, return_type[void], modifier[static], parameter[instanceType, checkTimeStamp, cleanup]] begin[{] call[LOGGER.entering, parameter[]] if[binary_operation[member[.checkTimeStamp], &&, binary_operation[member[.lastModifiedTime], ==, call[DOWNLOAD_FILE.lastModified, parameter[]]]]] begin[{] return[None] else begin[{] None end[}] assign[member[.lastModifiedTime], call[DOWNLOAD_FILE.lastModified, parameter[]]] if[member[.cleanup]] begin[{] call[.cleanup, parameter[]] else begin[{] None end[}] local_variable[type[List], artifactDetails] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=artifactDetails, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=DOWNLOAD_FILE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=instanceType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getArtifactDetailsForCurrentPlatformByRole, postfix_operators=[], prefix_operators=[], qualifier=ArtifactDetails, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to open download.json file"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) call[.downloadAndExtractArtifacts, parameter[member[.artifactDetails]]] call[LOGGER.exiting, parameter[]] end[}] END[}]
Keyword[static] Keyword[void] identifier[checkForDownloads] operator[SEP] identifier[InstanceType] identifier[instanceType] , Keyword[boolean] identifier[checkTimeStamp] , Keyword[boolean] identifier[cleanup] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[entering] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[checkTimeStamp] operator[&&] operator[SEP] identifier[lastModifiedTime] operator[==] identifier[DOWNLOAD_FILE] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[lastModifiedTime] operator[=] identifier[DOWNLOAD_FILE] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cleanup] operator[SEP] { identifier[cleanup] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[URLChecksumEntity] operator[>] identifier[artifactDetails] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ArtifactDetails] operator[SEP] identifier[URLChecksumEntity] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[artifactDetails] operator[=] identifier[ArtifactDetails] operator[SEP] identifier[getArtifactDetailsForCurrentPlatformByRole] operator[SEP] identifier[DOWNLOAD_FILE] , identifier[instanceType] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[downloadAndExtractArtifacts] operator[SEP] identifier[artifactDetails] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[exiting] operator[SEP] operator[SEP] operator[SEP] }
public void fromYamlFile(File yamlPolicyFile) throws IOException, ChaincodeEndorsementPolicyParseException { final Yaml yaml = new Yaml(); final Map<?, ?> load = (Map<?, ?>) yaml.load(new FileInputStream(yamlPolicyFile)); Map<?, ?> mp = (Map<?, ?>) load.get("policy"); if (null == mp) { throw new ChaincodeEndorsementPolicyParseException("The policy file has no policy section"); } IndexedHashMap<String, MSPPrincipal> identities = parseIdentities((Map<?, ?>) load.get("identities")); SignaturePolicy sp = parsePolicy(identities, mp); policyBytes = Policies.SignaturePolicyEnvelope.newBuilder() .setVersion(0) .addAllIdentities(identities.values()) .setRule(sp) .build().toByteArray(); }
class class_name[name] begin[{] method[fromYamlFile, return_type[void], modifier[public], parameter[yamlPolicyFile]] begin[{] local_variable[type[Yaml], yaml] local_variable[type[Map], load] local_variable[type[Map], mp] if[binary_operation[literal[null], ==, member[.mp]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The policy file has no policy section")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChaincodeEndorsementPolicyParseException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[IndexedHashMap], identities] local_variable[type[SignaturePolicy], sp] assign[member[.policyBytes], call[Policies.SignaturePolicyEnvelope.newBuilder, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[fromYamlFile] operator[SEP] identifier[File] identifier[yamlPolicyFile] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ChaincodeEndorsementPolicyParseException] { Keyword[final] identifier[Yaml] identifier[yaml] operator[=] Keyword[new] identifier[Yaml] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Map] operator[<] operator[?] , operator[?] operator[>] identifier[load] operator[=] operator[SEP] identifier[Map] operator[<] operator[?] , operator[?] operator[>] operator[SEP] identifier[yaml] operator[SEP] identifier[load] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[yamlPolicyFile] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] operator[?] , operator[?] operator[>] identifier[mp] operator[=] operator[SEP] identifier[Map] operator[<] operator[?] , operator[?] operator[>] operator[SEP] identifier[load] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[mp] operator[SEP] { Keyword[throw] Keyword[new] identifier[ChaincodeEndorsementPolicyParseException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[IndexedHashMap] operator[<] identifier[String] , identifier[MSPPrincipal] operator[>] identifier[identities] operator[=] identifier[parseIdentities] operator[SEP] operator[SEP] identifier[Map] operator[<] operator[?] , operator[?] operator[>] operator[SEP] identifier[load] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[SignaturePolicy] identifier[sp] operator[=] identifier[parsePolicy] operator[SEP] identifier[identities] , identifier[mp] operator[SEP] operator[SEP] identifier[policyBytes] operator[=] identifier[Policies] operator[SEP] identifier[SignaturePolicyEnvelope] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setVersion] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[addAllIdentities] operator[SEP] identifier[identities] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setRule] operator[SEP] identifier[sp] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] }
public boolean isShowing() { View view = decorView.findViewById(R.id.dialogplus_outmost_container); return view != null; }
class class_name[name] begin[{] method[isShowing, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[View], view] return[binary_operation[member[.view], !=, literal[null]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isShowing] operator[SEP] operator[SEP] { identifier[View] identifier[view] operator[=] identifier[decorView] operator[SEP] identifier[findViewById] operator[SEP] identifier[R] operator[SEP] identifier[id] operator[SEP] identifier[dialogplus_outmost_container] operator[SEP] operator[SEP] Keyword[return] identifier[view] operator[!=] Other[null] operator[SEP] }
@Override public HttpFilterBuilder equal(final String value) { return addUriRequestFilter(new Matcher<String>() { @Override public boolean matches(String val) { return val.equals(value); } @Override public String toString() { return String.format("equal('%s')", value); } }); }
class class_name[name] begin[{] method[equal, return_type[type[HttpFilterBuilder]], modifier[public], parameter[value]] begin[{] return[call[.addUriRequestFilter, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=val, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=matches, parameters=[FormalParameter(annotations=[], modifiers=set(), name=val, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="equal('%s')"), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=toString, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Matcher, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[HttpFilterBuilder] identifier[equal] operator[SEP] Keyword[final] identifier[String] identifier[value] operator[SEP] { Keyword[return] identifier[addUriRequestFilter] operator[SEP] Keyword[new] identifier[Matcher] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] identifier[String] identifier[val] operator[SEP] { Keyword[return] identifier[val] operator[SEP] identifier[equals] operator[SEP] identifier[value] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toString] operator[SEP] operator[SEP] { Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[value] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public String[] getLockTokens() { String[] arr = new String[tokens.size()]; tokens.keySet().toArray(arr); return arr; }
class class_name[name] begin[{] method[getLockTokens, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], arr] call[tokens.keySet, parameter[]] return[member[.arr]] end[}] END[}]
Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[getLockTokens] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[arr] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[tokens] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[tokens] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] identifier[arr] operator[SEP] operator[SEP] Keyword[return] identifier[arr] operator[SEP] }
public static String readString(Reader is, String term) throws IOException { CharArrayWriter baos = new CharArrayWriter(); int ch_int; char last = term.charAt(term.length() - 1); while ((ch_int = is.read()) >= 0) { final char ch = (char) ch_int; baos.write(ch); if (ch == last && baos.size() >= term.length()) { String tmp = baos.toString(); if (tmp.substring(tmp.length() - term.length()) .equals(term)) { return tmp.substring(0, tmp.length() - term.length()); } } } return baos.toString(); }
class class_name[name] begin[{] method[readString, return_type[type[String]], modifier[public static], parameter[is, term]] begin[{] local_variable[type[CharArrayWriter], baos] local_variable[type[int], ch_int] local_variable[type[char], last] while[binary_operation[assign[member[.ch_int], call[is.read, parameter[]]], >=, literal[0]]] begin[{] local_variable[type[char], ch] call[baos.write, parameter[member[.ch]]] if[binary_operation[binary_operation[member[.ch], ==, member[.last]], &&, binary_operation[call[baos.size, parameter[]], >=, call[term.length, parameter[]]]]] begin[{] local_variable[type[String], tmp] if[call[tmp.substring, parameter[binary_operation[call[tmp.length, parameter[]], -, call[term.length, parameter[]]]]]] begin[{] return[call[tmp.substring, parameter[literal[0], binary_operation[call[tmp.length, parameter[]], -, call[term.length, parameter[]]]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] return[call[baos.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[readString] operator[SEP] identifier[Reader] identifier[is] , identifier[String] identifier[term] operator[SEP] Keyword[throws] identifier[IOException] { identifier[CharArrayWriter] identifier[baos] operator[=] Keyword[new] identifier[CharArrayWriter] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[ch_int] operator[SEP] Keyword[char] identifier[last] operator[=] identifier[term] operator[SEP] identifier[charAt] operator[SEP] identifier[term] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[ch_int] operator[=] identifier[is] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] { Keyword[final] Keyword[char] identifier[ch] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[ch_int] operator[SEP] identifier[baos] operator[SEP] identifier[write] operator[SEP] identifier[ch] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ch] operator[==] identifier[last] operator[&&] identifier[baos] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>=] identifier[term] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[tmp] operator[=] identifier[baos] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmp] operator[SEP] identifier[substring] operator[SEP] identifier[tmp] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[term] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[term] operator[SEP] operator[SEP] { Keyword[return] identifier[tmp] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[tmp] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[term] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] identifier[baos] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static void inject(Injector.Configuration config) { long millis = System.currentTimeMillis(); if(ProfileService.getInstance(config.getContext()).isActive(config.getContext(), Profile.INJECTION)) { ExplicitInjectors.CONFIGURATION.inject(config); ExplicitInjectors.LAYOUT.inject(config); if(config.getInjectionMode().equals(InjectionMode.EXPLICIT)) { InjectionUtils.injectExplicitly(config); } else { InjectionUtils.injectImplicitly(config); } } millis = System.currentTimeMillis() - millis; Log.i("INSTRUMENTATION:IckleInjectionProfile#inject()", InjectionUtils.class.getClass().getSimpleName() + ": " + millis + "ms"); }
class class_name[name] begin[{] method[inject, return_type[void], modifier[public static], parameter[config]] begin[{] local_variable[type[long], millis] if[call[ProfileService.getInstance, parameter[call[config.getContext, parameter[]]]]] begin[{] call[ExplicitInjectors.CONFIGURATION.inject, parameter[member[.config]]] call[ExplicitInjectors.LAYOUT.inject, parameter[member[.config]]] if[call[config.getInjectionMode, parameter[]]] begin[{] call[InjectionUtils.injectExplicitly, parameter[member[.config]]] else begin[{] call[InjectionUtils.injectImplicitly, parameter[member[.config]]] end[}] else begin[{] None end[}] assign[member[.millis], binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.millis]]] call[Log.i, parameter[literal["INSTRUMENTATION:IckleInjectionProfile#inject()"], binary_operation[binary_operation[binary_operation[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=InjectionUtils, sub_type=None)), +, literal[": "]], +, member[.millis]], +, literal["ms"]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[inject] operator[SEP] identifier[Injector] operator[SEP] identifier[Configuration] identifier[config] operator[SEP] { Keyword[long] identifier[millis] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ProfileService] operator[SEP] identifier[getInstance] operator[SEP] identifier[config] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[isActive] operator[SEP] identifier[config] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] , identifier[Profile] operator[SEP] identifier[INJECTION] operator[SEP] operator[SEP] { identifier[ExplicitInjectors] operator[SEP] identifier[CONFIGURATION] operator[SEP] identifier[inject] operator[SEP] identifier[config] operator[SEP] operator[SEP] identifier[ExplicitInjectors] operator[SEP] identifier[LAYOUT] operator[SEP] identifier[inject] operator[SEP] identifier[config] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[getInjectionMode] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[InjectionMode] operator[SEP] identifier[EXPLICIT] operator[SEP] operator[SEP] { identifier[InjectionUtils] operator[SEP] identifier[injectExplicitly] operator[SEP] identifier[config] operator[SEP] operator[SEP] } Keyword[else] { identifier[InjectionUtils] operator[SEP] identifier[injectImplicitly] operator[SEP] identifier[config] operator[SEP] operator[SEP] } } identifier[millis] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[millis] operator[SEP] identifier[Log] operator[SEP] identifier[i] operator[SEP] literal[String] , identifier[InjectionUtils] operator[SEP] Keyword[class] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[millis] operator[+] literal[String] operator[SEP] operator[SEP] }