code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
@SuppressWarnings({ "unchecked", "rawtypes" }) public Map<String, String> getAttributes() { return (Map) this.get(CloudTrailEventField.attributes.name()); }
class class_name[name] begin[{] method[getAttributes, return_type[type[Map]], modifier[public], parameter[]] begin[{] return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=CloudTrailEventField.attributes, selectors=[], type_arguments=None)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] { literal[String] , literal[String] } operator[SEP] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getAttributes] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[Map] operator[SEP] Keyword[this] operator[SEP] identifier[get] operator[SEP] identifier[CloudTrailEventField] operator[SEP] identifier[attributes] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected boolean hasTraceeContextProviderPrimitiveTypeAnnotation(final Object instance) { if (instance == null) { return false; } TraceeContextProviderPrimitiveType annotation = TraceeContextLogAnnotationUtilities.getAnnotationFromType(instance, TraceeContextProviderPrimitiveType.class); return annotation != null; }
class class_name[name] begin[{] method[hasTraceeContextProviderPrimitiveTypeAnnotation, return_type[type[boolean]], modifier[protected], parameter[instance]] begin[{] if[binary_operation[member[.instance], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[TraceeContextProviderPrimitiveType], annotation] return[binary_operation[member[.annotation], !=, literal[null]]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[hasTraceeContextProviderPrimitiveTypeAnnotation] operator[SEP] Keyword[final] identifier[Object] identifier[instance] operator[SEP] { Keyword[if] operator[SEP] identifier[instance] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[TraceeContextProviderPrimitiveType] identifier[annotation] operator[=] identifier[TraceeContextLogAnnotationUtilities] operator[SEP] identifier[getAnnotationFromType] operator[SEP] identifier[instance] , identifier[TraceeContextProviderPrimitiveType] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[annotation] operator[!=] Other[null] operator[SEP] }
@SuppressWarnings("unchecked") public <T> T getAnnotation(final Class<? extends Annotation> annotationClass) { final Annotation annotation = accessibleObject.getAnnotation(annotationClass); if (annotation != null) { return (T) annotation; } for (final Annotation parameterAnnoation : parameterAnnotations) { if (parameterAnnoation.annotationType() == annotationClass) { return (T) parameterAnnoation; } } return null; }
class class_name[name] begin[{] method[getAnnotation, return_type[type[T]], modifier[public], parameter[annotationClass]] begin[{] local_variable[type[Annotation], annotation] if[binary_operation[member[.annotation], !=, literal[null]]] begin[{] return[Cast(expression=MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=annotationType, postfix_operators=[], prefix_operators=[], qualifier=parameterAnnoation, selectors=[], type_arguments=None), operandr=MemberReference(member=annotationClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=parameterAnnoation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=parameterAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=parameterAnnoation)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[getAnnotation] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[annotationClass] operator[SEP] { Keyword[final] identifier[Annotation] identifier[annotation] operator[=] identifier[accessibleObject] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[annotationClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[annotation] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[annotation] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] identifier[Annotation] identifier[parameterAnnoation] operator[:] identifier[parameterAnnotations] operator[SEP] { Keyword[if] operator[SEP] identifier[parameterAnnoation] operator[SEP] identifier[annotationType] operator[SEP] operator[SEP] operator[==] identifier[annotationClass] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[parameterAnnoation] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
final public void addParentFromToken(MtasToken token) throws IOException { if (!closed && (token != null)) { if (token.checkParentId()) { addSinglePoint(token.getParentId(), token.getPrefixId(), token.getTermRef(), token.getId(), token.getTokenRef()); } } }
class class_name[name] begin[{] method[addParentFromToken, return_type[void], modifier[final public], parameter[token]] begin[{] if[binary_operation[member[.closed], &&, binary_operation[member[.token], !=, literal[null]]]] begin[{] if[call[token.checkParentId, parameter[]]] begin[{] call[.addSinglePoint, parameter[call[token.getParentId, parameter[]], call[token.getPrefixId, parameter[]], call[token.getTermRef, parameter[]], call[token.getId, parameter[]], call[token.getTokenRef, parameter[]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[final] Keyword[public] Keyword[void] identifier[addParentFromToken] operator[SEP] identifier[MtasToken] identifier[token] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[closed] operator[&&] operator[SEP] identifier[token] operator[!=] Other[null] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[checkParentId] operator[SEP] operator[SEP] operator[SEP] { identifier[addSinglePoint] operator[SEP] identifier[token] operator[SEP] identifier[getParentId] operator[SEP] operator[SEP] , identifier[token] operator[SEP] identifier[getPrefixId] operator[SEP] operator[SEP] , identifier[token] operator[SEP] identifier[getTermRef] operator[SEP] operator[SEP] , identifier[token] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[token] operator[SEP] identifier[getTokenRef] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
public boolean saveDetailPages(CmsObject cms, String rootPath, List<CmsDetailPageInfo> detailPages, CmsUUID newId) throws CmsException { CmsADEConfigData configData = lookupConfiguration(cms, rootPath); CmsDetailPageConfigurationWriter configWriter; String originalSiteRoot = cms.getRequestContext().getSiteRoot(); try { cms.getRequestContext().setSiteRoot(""); if (configData.isModuleConfiguration()) { return false; } CmsResource configFile = configData.getResource(); configWriter = new CmsDetailPageConfigurationWriter(cms, configFile); configWriter.updateAndSave(detailPages, newId); return true; } finally { cms.getRequestContext().setSiteRoot(originalSiteRoot); } }
class class_name[name] begin[{] method[saveDetailPages, return_type[type[boolean]], modifier[public], parameter[cms, rootPath, detailPages, newId]] begin[{] local_variable[type[CmsADEConfigData], configData] local_variable[type[CmsDetailPageConfigurationWriter], configWriter] local_variable[type[String], originalSiteRoot] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getRequestContext, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=setSiteRoot, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isModuleConfiguration, postfix_operators=[], prefix_operators=[], qualifier=configData, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=configData, selectors=[], type_arguments=None), name=configFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=configWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=cms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=configFile, 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=CmsDetailPageConfigurationWriter, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=detailPages, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateAndSave, postfix_operators=[], prefix_operators=[], qualifier=configWriter, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getRequestContext, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[MethodInvocation(arguments=[MemberReference(member=originalSiteRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSiteRoot, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[boolean] identifier[saveDetailPages] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[String] identifier[rootPath] , identifier[List] operator[<] identifier[CmsDetailPageInfo] operator[>] identifier[detailPages] , identifier[CmsUUID] identifier[newId] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[CmsADEConfigData] identifier[configData] operator[=] identifier[lookupConfiguration] operator[SEP] identifier[cms] , identifier[rootPath] operator[SEP] operator[SEP] identifier[CmsDetailPageConfigurationWriter] identifier[configWriter] operator[SEP] identifier[String] identifier[originalSiteRoot] operator[=] identifier[cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getSiteRoot] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[setSiteRoot] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[configData] operator[SEP] identifier[isModuleConfiguration] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[CmsResource] identifier[configFile] operator[=] identifier[configData] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] identifier[configWriter] operator[=] Keyword[new] identifier[CmsDetailPageConfigurationWriter] operator[SEP] identifier[cms] , identifier[configFile] operator[SEP] operator[SEP] identifier[configWriter] operator[SEP] identifier[updateAndSave] operator[SEP] identifier[detailPages] , identifier[newId] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[finally] { identifier[cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[setSiteRoot] operator[SEP] identifier[originalSiteRoot] operator[SEP] operator[SEP] } }
public final SearchUrisResponse searchUris(String uri, List<ThreatType> threatTypes) { SearchUrisRequest request = SearchUrisRequest.newBuilder().setUri(uri).addAllThreatTypes(threatTypes).build(); return searchUris(request); }
class class_name[name] begin[{] method[searchUris, return_type[type[SearchUrisResponse]], modifier[final public], parameter[uri, threatTypes]] begin[{] local_variable[type[SearchUrisRequest], request] return[call[.searchUris, parameter[member[.request]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[SearchUrisResponse] identifier[searchUris] operator[SEP] identifier[String] identifier[uri] , identifier[List] operator[<] identifier[ThreatType] operator[>] identifier[threatTypes] operator[SEP] { identifier[SearchUrisRequest] identifier[request] operator[=] identifier[SearchUrisRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setUri] operator[SEP] identifier[uri] operator[SEP] operator[SEP] identifier[addAllThreatTypes] operator[SEP] identifier[threatTypes] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[searchUris] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
private AbstractBaseDTNode<I, D> updateDTTarget(TTTTransition<I, D> transition, boolean hard) { if (transition.isTree()) { return transition.getTreeTarget().dtLeaf; } AbstractBaseDTNode<I, D> dt = transition.getNonTreeTarget(); dt = dtree.sift(dt, transition.getAccessSequence(), hard); transition.setNonTreeTarget(dt); return dt; }
class class_name[name] begin[{] method[updateDTTarget, return_type[type[AbstractBaseDTNode]], modifier[private], parameter[transition, hard]] begin[{] if[call[transition.isTree, parameter[]]] begin[{] return[call[transition.getTreeTarget, parameter[]]] else begin[{] None end[}] local_variable[type[AbstractBaseDTNode], dt] assign[member[.dt], call[dtree.sift, parameter[member[.dt], call[transition.getAccessSequence, parameter[]], member[.hard]]]] call[transition.setNonTreeTarget, parameter[member[.dt]]] return[member[.dt]] end[}] END[}]
Keyword[private] identifier[AbstractBaseDTNode] operator[<] identifier[I] , identifier[D] operator[>] identifier[updateDTTarget] operator[SEP] identifier[TTTTransition] operator[<] identifier[I] , identifier[D] operator[>] identifier[transition] , Keyword[boolean] identifier[hard] operator[SEP] { Keyword[if] operator[SEP] identifier[transition] operator[SEP] identifier[isTree] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[transition] operator[SEP] identifier[getTreeTarget] operator[SEP] operator[SEP] operator[SEP] identifier[dtLeaf] operator[SEP] } identifier[AbstractBaseDTNode] operator[<] identifier[I] , identifier[D] operator[>] identifier[dt] operator[=] identifier[transition] operator[SEP] identifier[getNonTreeTarget] operator[SEP] operator[SEP] operator[SEP] identifier[dt] operator[=] identifier[dtree] operator[SEP] identifier[sift] operator[SEP] identifier[dt] , identifier[transition] operator[SEP] identifier[getAccessSequence] operator[SEP] operator[SEP] , identifier[hard] operator[SEP] operator[SEP] identifier[transition] operator[SEP] identifier[setNonTreeTarget] operator[SEP] identifier[dt] operator[SEP] operator[SEP] Keyword[return] identifier[dt] operator[SEP] }
public void marshall(StartNotebookInstanceRequest startNotebookInstanceRequest, ProtocolMarshaller protocolMarshaller) { if (startNotebookInstanceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(startNotebookInstanceRequest.getNotebookInstanceName(), NOTEBOOKINSTANCENAME_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[startNotebookInstanceRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.startNotebookInstanceRequest], ==, 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=getNotebookInstanceName, postfix_operators=[], prefix_operators=[], qualifier=startNotebookInstanceRequest, selectors=[], type_arguments=None), MemberReference(member=NOTEBOOKINSTANCENAME_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[StartNotebookInstanceRequest] identifier[startNotebookInstanceRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[startNotebookInstanceRequest] 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[startNotebookInstanceRequest] operator[SEP] identifier[getNotebookInstanceName] operator[SEP] operator[SEP] , identifier[NOTEBOOKINSTANCENAME_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public StringBuffer prepare(UCharacterIterator src, int options) throws StringPrepParseException{ // map StringBuffer mapOut = map(src,options); StringBuffer normOut = mapOut;// initialize if(doNFKC){ // normalize normOut = normalize(mapOut); } int ch; char result; UCharacterIterator iter = UCharacterIterator.getInstance(normOut); Values val = new Values(); int direction=UCharacterDirection.CHAR_DIRECTION_COUNT, firstCharDir=UCharacterDirection.CHAR_DIRECTION_COUNT; int rtlPos=-1, ltrPos=-1; boolean rightToLeft=false, leftToRight=false; while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){ result = getCodePointValue(ch); getValues(result,val); if(val.type == PROHIBITED ){ throw new StringPrepParseException("A prohibited code point was found in the input", StringPrepParseException.PROHIBITED_ERROR,iter.getText(),val.value); } if(checkBiDi) { direction = bdp.getClass(ch); if(firstCharDir == UCharacterDirection.CHAR_DIRECTION_COUNT){ firstCharDir = direction; } if(direction == UCharacterDirection.LEFT_TO_RIGHT){ leftToRight = true; ltrPos = iter.getIndex()-1; } if(direction == UCharacterDirection.RIGHT_TO_LEFT || direction == UCharacterDirection.RIGHT_TO_LEFT_ARABIC){ rightToLeft = true; rtlPos = iter.getIndex()-1; } } } if(checkBiDi == true){ // satisfy 2 if( leftToRight == true && rightToLeft == true){ throw new StringPrepParseException("The input does not conform to the rules for BiDi code points.", StringPrepParseException.CHECK_BIDI_ERROR,iter.getText(), (rtlPos>ltrPos) ? rtlPos : ltrPos); } //satisfy 3 if( rightToLeft == true && !((firstCharDir == UCharacterDirection.RIGHT_TO_LEFT || firstCharDir == UCharacterDirection.RIGHT_TO_LEFT_ARABIC) && (direction == UCharacterDirection.RIGHT_TO_LEFT || direction == UCharacterDirection.RIGHT_TO_LEFT_ARABIC)) ){ throw new StringPrepParseException("The input does not conform to the rules for BiDi code points.", StringPrepParseException.CHECK_BIDI_ERROR,iter.getText(), (rtlPos>ltrPos) ? rtlPos : ltrPos); } } return normOut; }
class class_name[name] begin[{] method[prepare, return_type[type[StringBuffer]], modifier[public], parameter[src, options]] begin[{] local_variable[type[StringBuffer], mapOut] local_variable[type[StringBuffer], normOut] if[member[.doNFKC]] begin[{] assign[member[.normOut], call[.normalize, parameter[member[.mapOut]]]] else begin[{] None end[}] local_variable[type[int], ch] local_variable[type[char], result] local_variable[type[UCharacterIterator], iter] local_variable[type[Values], val] local_variable[type[int], direction] local_variable[type[int], rtlPos] local_variable[type[boolean], rightToLeft] while[binary_operation[assign[member[.ch], call[iter.nextCodePoint, parameter[]]], !=, member[UCharacterIterator.DONE]]] begin[{] assign[member[.result], call[.getCodePointValue, parameter[member[.ch]]]] call[.getValues, parameter[member[.result], member[.val]]] if[binary_operation[member[val.type], ==, member[.PROHIBITED]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A prohibited code point was found in the input"), MemberReference(member=PROHIBITED_ERROR, postfix_operators=[], prefix_operators=[], qualifier=StringPrepParseException, selectors=[]), MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=val, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringPrepParseException, sub_type=None)), label=None) else begin[{] None end[}] if[member[.checkBiDi]] begin[{] assign[member[.direction], call[bdp.getClass, parameter[member[.ch]]]] if[binary_operation[member[.firstCharDir], ==, member[UCharacterDirection.CHAR_DIRECTION_COUNT]]] begin[{] assign[member[.firstCharDir], member[.direction]] else begin[{] None end[}] if[binary_operation[member[.direction], ==, member[UCharacterDirection.LEFT_TO_RIGHT]]] begin[{] assign[member[.leftToRight], literal[true]] assign[member[.ltrPos], binary_operation[call[iter.getIndex, parameter[]], -, literal[1]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.direction], ==, member[UCharacterDirection.RIGHT_TO_LEFT]], ||, binary_operation[member[.direction], ==, member[UCharacterDirection.RIGHT_TO_LEFT_ARABIC]]]] begin[{] assign[member[.rightToLeft], literal[true]] assign[member[.rtlPos], binary_operation[call[iter.getIndex, parameter[]], -, literal[1]]] else begin[{] None end[}] else begin[{] None end[}] end[}] if[binary_operation[member[.checkBiDi], ==, literal[true]]] begin[{] if[binary_operation[binary_operation[member[.leftToRight], ==, literal[true]], &&, binary_operation[member[.rightToLeft], ==, literal[true]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The input does not conform to the rules for BiDi code points."), MemberReference(member=CHECK_BIDI_ERROR, postfix_operators=[], prefix_operators=[], qualifier=StringPrepParseException, selectors=[]), MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=rtlPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ltrPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), if_false=MemberReference(member=ltrPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=rtlPos, 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=StringPrepParseException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[member[.rightToLeft], ==, literal[true]], &&, binary_operation[binary_operation[binary_operation[member[.firstCharDir], ==, member[UCharacterDirection.RIGHT_TO_LEFT]], ||, binary_operation[member[.firstCharDir], ==, member[UCharacterDirection.RIGHT_TO_LEFT_ARABIC]]], &&, binary_operation[binary_operation[member[.direction], ==, member[UCharacterDirection.RIGHT_TO_LEFT]], ||, binary_operation[member[.direction], ==, member[UCharacterDirection.RIGHT_TO_LEFT_ARABIC]]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The input does not conform to the rules for BiDi code points."), MemberReference(member=CHECK_BIDI_ERROR, postfix_operators=[], prefix_operators=[], qualifier=StringPrepParseException, selectors=[]), MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=rtlPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ltrPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), if_false=MemberReference(member=ltrPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=rtlPos, 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=StringPrepParseException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] None end[}] return[member[.normOut]] end[}] END[}]
Keyword[public] identifier[StringBuffer] identifier[prepare] operator[SEP] identifier[UCharacterIterator] identifier[src] , Keyword[int] identifier[options] operator[SEP] Keyword[throws] identifier[StringPrepParseException] { identifier[StringBuffer] identifier[mapOut] operator[=] identifier[map] operator[SEP] identifier[src] , identifier[options] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[normOut] operator[=] identifier[mapOut] operator[SEP] Keyword[if] operator[SEP] identifier[doNFKC] operator[SEP] { identifier[normOut] operator[=] identifier[normalize] operator[SEP] identifier[mapOut] operator[SEP] operator[SEP] } Keyword[int] identifier[ch] operator[SEP] Keyword[char] identifier[result] operator[SEP] identifier[UCharacterIterator] identifier[iter] operator[=] identifier[UCharacterIterator] operator[SEP] identifier[getInstance] operator[SEP] identifier[normOut] operator[SEP] operator[SEP] identifier[Values] identifier[val] operator[=] Keyword[new] identifier[Values] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[direction] operator[=] identifier[UCharacterDirection] operator[SEP] identifier[CHAR_DIRECTION_COUNT] , identifier[firstCharDir] operator[=] identifier[UCharacterDirection] operator[SEP] identifier[CHAR_DIRECTION_COUNT] operator[SEP] Keyword[int] identifier[rtlPos] operator[=] operator[-] Other[1] , identifier[ltrPos] operator[=] operator[-] Other[1] operator[SEP] Keyword[boolean] identifier[rightToLeft] operator[=] literal[boolean] , identifier[leftToRight] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[ch] operator[=] identifier[iter] operator[SEP] identifier[nextCodePoint] operator[SEP] operator[SEP] operator[SEP] operator[!=] identifier[UCharacterIterator] operator[SEP] identifier[DONE] operator[SEP] { identifier[result] operator[=] identifier[getCodePointValue] operator[SEP] identifier[ch] operator[SEP] operator[SEP] identifier[getValues] operator[SEP] identifier[result] , identifier[val] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[SEP] identifier[type] operator[==] identifier[PROHIBITED] operator[SEP] { Keyword[throw] Keyword[new] identifier[StringPrepParseException] operator[SEP] literal[String] , identifier[StringPrepParseException] operator[SEP] identifier[PROHIBITED_ERROR] , identifier[iter] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , identifier[val] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[checkBiDi] operator[SEP] { identifier[direction] operator[=] identifier[bdp] operator[SEP] identifier[getClass] operator[SEP] identifier[ch] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[firstCharDir] operator[==] identifier[UCharacterDirection] operator[SEP] identifier[CHAR_DIRECTION_COUNT] operator[SEP] { identifier[firstCharDir] operator[=] identifier[direction] operator[SEP] } Keyword[if] operator[SEP] identifier[direction] operator[==] identifier[UCharacterDirection] operator[SEP] identifier[LEFT_TO_RIGHT] operator[SEP] { identifier[leftToRight] operator[=] literal[boolean] operator[SEP] identifier[ltrPos] operator[=] identifier[iter] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] } Keyword[if] operator[SEP] identifier[direction] operator[==] identifier[UCharacterDirection] operator[SEP] identifier[RIGHT_TO_LEFT] operator[||] identifier[direction] operator[==] identifier[UCharacterDirection] operator[SEP] identifier[RIGHT_TO_LEFT_ARABIC] operator[SEP] { identifier[rightToLeft] operator[=] literal[boolean] operator[SEP] identifier[rtlPos] operator[=] identifier[iter] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] } } } Keyword[if] operator[SEP] identifier[checkBiDi] operator[==] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[leftToRight] operator[==] literal[boolean] operator[&&] identifier[rightToLeft] operator[==] literal[boolean] operator[SEP] { Keyword[throw] Keyword[new] identifier[StringPrepParseException] operator[SEP] literal[String] , identifier[StringPrepParseException] operator[SEP] identifier[CHECK_BIDI_ERROR] , identifier[iter] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , operator[SEP] identifier[rtlPos] operator[>] identifier[ltrPos] operator[SEP] operator[?] identifier[rtlPos] operator[:] identifier[ltrPos] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[rightToLeft] operator[==] literal[boolean] operator[&&] operator[!] operator[SEP] operator[SEP] identifier[firstCharDir] operator[==] identifier[UCharacterDirection] operator[SEP] identifier[RIGHT_TO_LEFT] operator[||] identifier[firstCharDir] operator[==] identifier[UCharacterDirection] operator[SEP] identifier[RIGHT_TO_LEFT_ARABIC] operator[SEP] operator[&&] operator[SEP] identifier[direction] operator[==] identifier[UCharacterDirection] operator[SEP] identifier[RIGHT_TO_LEFT] operator[||] identifier[direction] operator[==] identifier[UCharacterDirection] operator[SEP] identifier[RIGHT_TO_LEFT_ARABIC] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[StringPrepParseException] operator[SEP] literal[String] , identifier[StringPrepParseException] operator[SEP] identifier[CHECK_BIDI_ERROR] , identifier[iter] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , operator[SEP] identifier[rtlPos] operator[>] identifier[ltrPos] operator[SEP] operator[?] identifier[rtlPos] operator[:] identifier[ltrPos] operator[SEP] operator[SEP] } } Keyword[return] identifier[normOut] operator[SEP] }
public ResultList<MovieBasic> getRatedMovies(String sessionId, int accountId, Integer page, String sortBy, String language) throws MovieDbException { return tmdbAccount.getRatedMovies(sessionId, accountId, page, sortBy, language); }
class class_name[name] begin[{] method[getRatedMovies, return_type[type[ResultList]], modifier[public], parameter[sessionId, accountId, page, sortBy, language]] begin[{] return[call[tmdbAccount.getRatedMovies, parameter[member[.sessionId], member[.accountId], member[.page], member[.sortBy], member[.language]]]] end[}] END[}]
Keyword[public] identifier[ResultList] operator[<] identifier[MovieBasic] operator[>] identifier[getRatedMovies] operator[SEP] identifier[String] identifier[sessionId] , Keyword[int] identifier[accountId] , identifier[Integer] identifier[page] , identifier[String] identifier[sortBy] , identifier[String] identifier[language] operator[SEP] Keyword[throws] identifier[MovieDbException] { Keyword[return] identifier[tmdbAccount] operator[SEP] identifier[getRatedMovies] operator[SEP] identifier[sessionId] , identifier[accountId] , identifier[page] , identifier[sortBy] , identifier[language] operator[SEP] operator[SEP] }
protected ColumnFamilyHistogram createColumnFamilyHistogram(String name, Histogram keyspaceHistogram) { Histogram cfHistogram = Metrics.newHistogram(factory.createMetricName(name), true); register(name, cfHistogram); return new ColumnFamilyHistogram(cfHistogram, keyspaceHistogram, Metrics.newHistogram(globalNameFactory.createMetricName(name), true)); }
class class_name[name] begin[{] method[createColumnFamilyHistogram, return_type[type[ColumnFamilyHistogram]], modifier[protected], parameter[name, keyspaceHistogram]] begin[{] local_variable[type[Histogram], cfHistogram] call[.register, parameter[member[.name], member[.cfHistogram]]] return[ClassCreator(arguments=[MemberReference(member=cfHistogram, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=keyspaceHistogram, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createMetricName, postfix_operators=[], prefix_operators=[], qualifier=globalNameFactory, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=newHistogram, postfix_operators=[], prefix_operators=[], qualifier=Metrics, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ColumnFamilyHistogram, sub_type=None))] end[}] END[}]
Keyword[protected] identifier[ColumnFamilyHistogram] identifier[createColumnFamilyHistogram] operator[SEP] identifier[String] identifier[name] , identifier[Histogram] identifier[keyspaceHistogram] operator[SEP] { identifier[Histogram] identifier[cfHistogram] operator[=] identifier[Metrics] operator[SEP] identifier[newHistogram] operator[SEP] identifier[factory] operator[SEP] identifier[createMetricName] operator[SEP] identifier[name] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[register] operator[SEP] identifier[name] , identifier[cfHistogram] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ColumnFamilyHistogram] operator[SEP] identifier[cfHistogram] , identifier[keyspaceHistogram] , identifier[Metrics] operator[SEP] identifier[newHistogram] operator[SEP] identifier[globalNameFactory] operator[SEP] identifier[createMetricName] operator[SEP] identifier[name] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] operator[SEP] }
public void addDependency(String notation, String scope ) { Map<String, String> notationMap = Notation.parse(notation); Dependency dependency = new Dependency(); dependency.setGroupId(notationMap.get("groupId")); dependency.setArtifactId(notationMap.get("artifactId")); dependency.setType(notationMap.get("type")); dependency.setVersion(notationMap.get("version")); dependency.setScope( scope ); addDependency(dependency); }
class class_name[name] begin[{] method[addDependency, return_type[void], modifier[public], parameter[notation, scope]] begin[{] local_variable[type[Map], notationMap] local_variable[type[Dependency], dependency] call[dependency.setGroupId, parameter[call[notationMap.get, parameter[literal["groupId"]]]]] call[dependency.setArtifactId, parameter[call[notationMap.get, parameter[literal["artifactId"]]]]] call[dependency.setType, parameter[call[notationMap.get, parameter[literal["type"]]]]] call[dependency.setVersion, parameter[call[notationMap.get, parameter[literal["version"]]]]] call[dependency.setScope, parameter[member[.scope]]] call[.addDependency, parameter[member[.dependency]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addDependency] operator[SEP] identifier[String] identifier[notation] , identifier[String] identifier[scope] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[notationMap] operator[=] identifier[Notation] operator[SEP] identifier[parse] operator[SEP] identifier[notation] operator[SEP] operator[SEP] identifier[Dependency] identifier[dependency] operator[=] Keyword[new] identifier[Dependency] operator[SEP] operator[SEP] operator[SEP] identifier[dependency] operator[SEP] identifier[setGroupId] operator[SEP] identifier[notationMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[dependency] operator[SEP] identifier[setArtifactId] operator[SEP] identifier[notationMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[dependency] operator[SEP] identifier[setType] operator[SEP] identifier[notationMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[dependency] operator[SEP] identifier[setVersion] operator[SEP] identifier[notationMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[dependency] operator[SEP] identifier[setScope] operator[SEP] identifier[scope] operator[SEP] operator[SEP] identifier[addDependency] operator[SEP] identifier[dependency] operator[SEP] operator[SEP] }
@Override public PutEncryptionConfigResult putEncryptionConfig(PutEncryptionConfigRequest request) { request = beforeClientExecution(request); return executePutEncryptionConfig(request); }
class class_name[name] begin[{] method[putEncryptionConfig, return_type[type[PutEncryptionConfigResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executePutEncryptionConfig, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[PutEncryptionConfigResult] identifier[putEncryptionConfig] operator[SEP] identifier[PutEncryptionConfigRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executePutEncryptionConfig] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
private void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException { s.defaultReadObject(); // Read nothing initialize(MIN_SIZE); for(;;) { final TypeK K = (TypeK) s.readObject(); final TypeV V = (TypeV) s.readObject(); if( K == null ) break; put(K,V); // Insert with an offical put } }
class class_name[name] begin[{] method[readObject, return_type[void], modifier[private], parameter[s]] begin[{] call[s.defaultReadObject, parameter[]] call[.initialize, parameter[member[.MIN_SIZE]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=TypeK, sub_type=None)), name=K)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TypeK, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=TypeV, sub_type=None)), name=V)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TypeV, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=K, 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=BreakStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=K, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=V, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=None, init=None, update=None), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[readObject] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[ObjectInputStream] identifier[s] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] { identifier[s] operator[SEP] identifier[defaultReadObject] operator[SEP] operator[SEP] operator[SEP] identifier[initialize] operator[SEP] identifier[MIN_SIZE] operator[SEP] operator[SEP] Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[TypeK] identifier[K] operator[=] operator[SEP] identifier[TypeK] operator[SEP] identifier[s] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[TypeV] identifier[V] operator[=] operator[SEP] identifier[TypeV] operator[SEP] identifier[s] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[K] operator[==] Other[null] operator[SEP] Keyword[break] operator[SEP] identifier[put] operator[SEP] identifier[K] , identifier[V] operator[SEP] operator[SEP] } }
public boolean isItemSelected(final int index) { checkIndex(index); OptionElement item = selectElement.getOptions().getItem(index); Option option = itemMap.get(item); return option != null && option.isSelected(); }
class class_name[name] begin[{] method[isItemSelected, return_type[type[boolean]], modifier[public], parameter[index]] begin[{] call[.checkIndex, parameter[member[.index]]] local_variable[type[OptionElement], item] local_variable[type[Option], option] return[binary_operation[binary_operation[member[.option], !=, literal[null]], &&, call[option.isSelected, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isItemSelected] operator[SEP] Keyword[final] Keyword[int] identifier[index] operator[SEP] { identifier[checkIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[OptionElement] identifier[item] operator[=] identifier[selectElement] operator[SEP] identifier[getOptions] operator[SEP] operator[SEP] operator[SEP] identifier[getItem] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[Option] identifier[option] operator[=] identifier[itemMap] operator[SEP] identifier[get] operator[SEP] identifier[item] operator[SEP] operator[SEP] Keyword[return] identifier[option] operator[!=] Other[null] operator[&&] identifier[option] operator[SEP] identifier[isSelected] operator[SEP] operator[SEP] operator[SEP] }
private Entry consolidate(Entry someRoot) { Entry minRoot = someRoot; // `rootsByDegree[d]` will hold the best root we've looked at so far with degree `d`. final Object[] rootsByDegree = new Object[MAX_DEGREE]; for (Entry currRoot : getCycle(someRoot)) { // Put `currRoot` into `rootsByDegree`. If there's already something in its spot, // merge them into a new tree of degree `degree + 1`. Keep merging until we find an // empty spot. Entry mergedRoot = currRoot; for (int degree = currRoot.degree; rootsByDegree[degree] != null; degree++) { @SuppressWarnings("unchecked") Entry oldRoot = (Entry) rootsByDegree[degree]; // move the worse root beneath the better root if (comparator.compare(mergedRoot.priority, oldRoot.priority) < 0) { mergedRoot = setParent(oldRoot, mergedRoot); } else { mergedRoot = setParent(mergedRoot, oldRoot); } rootsByDegree[degree] = null; } rootsByDegree[mergedRoot.degree] = mergedRoot; if (comparator.compare(mergedRoot.priority, minRoot.priority) <= 0) { minRoot = mergedRoot; } } return minRoot; }
class class_name[name] begin[{] method[consolidate, return_type[type[Entry]], modifier[private], parameter[someRoot]] begin[{] local_variable[type[Entry], minRoot] local_variable[type[Object], rootsByDegree] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=currRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=mergedRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=rootsByDegree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=degree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), name=oldRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=mergedRoot, selectors=[]), MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=oldRoot, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=comparator, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mergedRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=mergedRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=oldRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mergedRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=oldRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mergedRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rootsByDegree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=degree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=rootsByDegree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=degree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=degree, postfix_operators=[], prefix_operators=[], qualifier=currRoot, selectors=[]), name=degree)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=degree, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rootsByDegree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=degree, postfix_operators=[], prefix_operators=[], qualifier=mergedRoot, selectors=[]))]), type==, value=MemberReference(member=mergedRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=mergedRoot, selectors=[]), MemberReference(member=priority, postfix_operators=[], prefix_operators=[], qualifier=minRoot, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=comparator, 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=Assignment(expressionl=MemberReference(member=minRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=mergedRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=someRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCycle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=currRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None))), label=None) return[member[.minRoot]] end[}] END[}]
Keyword[private] identifier[Entry] identifier[consolidate] operator[SEP] identifier[Entry] identifier[someRoot] operator[SEP] { identifier[Entry] identifier[minRoot] operator[=] identifier[someRoot] operator[SEP] Keyword[final] identifier[Object] operator[SEP] operator[SEP] identifier[rootsByDegree] operator[=] Keyword[new] identifier[Object] operator[SEP] identifier[MAX_DEGREE] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] identifier[currRoot] operator[:] identifier[getCycle] operator[SEP] identifier[someRoot] operator[SEP] operator[SEP] { identifier[Entry] identifier[mergedRoot] operator[=] identifier[currRoot] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[degree] operator[=] identifier[currRoot] operator[SEP] identifier[degree] operator[SEP] identifier[rootsByDegree] operator[SEP] identifier[degree] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[degree] operator[++] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Entry] identifier[oldRoot] operator[=] operator[SEP] identifier[Entry] operator[SEP] identifier[rootsByDegree] operator[SEP] identifier[degree] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[comparator] operator[SEP] identifier[compare] operator[SEP] identifier[mergedRoot] operator[SEP] identifier[priority] , identifier[oldRoot] operator[SEP] identifier[priority] operator[SEP] operator[<] Other[0] operator[SEP] { identifier[mergedRoot] operator[=] identifier[setParent] operator[SEP] identifier[oldRoot] , identifier[mergedRoot] operator[SEP] operator[SEP] } Keyword[else] { identifier[mergedRoot] operator[=] identifier[setParent] operator[SEP] identifier[mergedRoot] , identifier[oldRoot] operator[SEP] operator[SEP] } identifier[rootsByDegree] operator[SEP] identifier[degree] operator[SEP] operator[=] Other[null] operator[SEP] } identifier[rootsByDegree] operator[SEP] identifier[mergedRoot] operator[SEP] identifier[degree] operator[SEP] operator[=] identifier[mergedRoot] operator[SEP] Keyword[if] operator[SEP] identifier[comparator] operator[SEP] identifier[compare] operator[SEP] identifier[mergedRoot] operator[SEP] identifier[priority] , identifier[minRoot] operator[SEP] identifier[priority] operator[SEP] operator[<=] Other[0] operator[SEP] { identifier[minRoot] operator[=] identifier[mergedRoot] operator[SEP] } } Keyword[return] identifier[minRoot] operator[SEP] }
public void marshall(AlertTarget alertTarget, ProtocolMarshaller protocolMarshaller) { if (alertTarget == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(alertTarget.getAlertTargetArn(), ALERTTARGETARN_BINDING); protocolMarshaller.marshall(alertTarget.getRoleArn(), ROLEARN_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[alertTarget, protocolMarshaller]] begin[{] if[binary_operation[member[.alertTarget], ==, 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=getAlertTargetArn, postfix_operators=[], prefix_operators=[], qualifier=alertTarget, selectors=[], type_arguments=None), MemberReference(member=ALERTTARGETARN_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=getRoleArn, postfix_operators=[], prefix_operators=[], qualifier=alertTarget, selectors=[], type_arguments=None), MemberReference(member=ROLEARN_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[AlertTarget] identifier[alertTarget] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[alertTarget] 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[alertTarget] operator[SEP] identifier[getAlertTargetArn] operator[SEP] operator[SEP] , identifier[ALERTTARGETARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[alertTarget] operator[SEP] identifier[getRoleArn] operator[SEP] operator[SEP] , identifier[ROLEARN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public GitlabProject getProject(Serializable projectId) throws IOException { String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId); return retrieve().to(tailUrl, GitlabProject.class); }
class class_name[name] begin[{] method[getProject, return_type[type[GitlabProject]], modifier[public], parameter[projectId]] begin[{] local_variable[type[String], tailUrl] return[call[.retrieve, parameter[]]] end[}] END[}]
Keyword[public] identifier[GitlabProject] identifier[getProject] operator[SEP] identifier[Serializable] identifier[projectId] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[tailUrl] operator[=] identifier[GitlabProject] operator[SEP] identifier[URL] operator[+] literal[String] operator[+] identifier[sanitizeProjectId] operator[SEP] identifier[projectId] operator[SEP] operator[SEP] Keyword[return] identifier[retrieve] operator[SEP] operator[SEP] operator[SEP] identifier[to] operator[SEP] identifier[tailUrl] , identifier[GitlabProject] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public ResultType updateTag(Integer tagId, String newTagName) { BeanUtil.requireNonNull(tagId, "tagId is null"); BeanUtil.requireNonNull(newTagName, "newTagName is null"); LOG.debug("编辑标签....."); String url = BASE_API_URL + "cgi-bin/tags/update?access_token=#"; Map<String, Object> param = new HashMap<String, Object>(); param.put("id", tagId); param.put("name", newTagName); BaseResponse response = executePost(url, JSONUtil.toJson(param)); return ResultType.get(response.getErrcode()); }
class class_name[name] begin[{] method[updateTag, return_type[type[ResultType]], modifier[public], parameter[tagId, newTagName]] begin[{] call[BeanUtil.requireNonNull, parameter[member[.tagId], literal["tagId is null"]]] call[BeanUtil.requireNonNull, parameter[member[.newTagName], literal["newTagName is null"]]] call[LOG.debug, parameter[literal["编辑标签....."]]] local_variable[type[String], url] local_variable[type[Map], param] call[param.put, parameter[literal["id"], member[.tagId]]] call[param.put, parameter[literal["name"], member[.newTagName]]] local_variable[type[BaseResponse], response] return[call[ResultType.get, parameter[call[response.getErrcode, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[ResultType] identifier[updateTag] operator[SEP] identifier[Integer] identifier[tagId] , identifier[String] identifier[newTagName] operator[SEP] { identifier[BeanUtil] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[tagId] , literal[String] operator[SEP] operator[SEP] identifier[BeanUtil] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[newTagName] , literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[url] operator[=] identifier[BASE_API_URL] operator[+] literal[String] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[param] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[tagId] operator[SEP] operator[SEP] identifier[param] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[newTagName] operator[SEP] operator[SEP] identifier[BaseResponse] identifier[response] operator[=] identifier[executePost] operator[SEP] identifier[url] , identifier[JSONUtil] operator[SEP] identifier[toJson] operator[SEP] identifier[param] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ResultType] operator[SEP] identifier[get] operator[SEP] identifier[response] operator[SEP] identifier[getErrcode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public boolean detectOperaAndroidTablet() { if (userAgent.indexOf(engineOpera) != -1 && (userAgent.indexOf(deviceAndroid) != -1 && userAgent.indexOf(deviceTablet) != -1)) { return true; } return false; }
class class_name[name] begin[{] method[detectOperaAndroidTablet, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[call[userAgent.indexOf, parameter[member[.engineOpera]]], !=, literal[1]], &&, binary_operation[binary_operation[call[userAgent.indexOf, parameter[member[.deviceAndroid]]], !=, literal[1]], &&, binary_operation[call[userAgent.indexOf, parameter[member[.deviceTablet]]], !=, literal[1]]]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[detectOperaAndroidTablet] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[userAgent] operator[SEP] identifier[indexOf] operator[SEP] identifier[engineOpera] operator[SEP] operator[!=] operator[-] Other[1] operator[&&] operator[SEP] identifier[userAgent] operator[SEP] identifier[indexOf] operator[SEP] identifier[deviceAndroid] operator[SEP] operator[!=] operator[-] Other[1] operator[&&] identifier[userAgent] operator[SEP] identifier[indexOf] operator[SEP] identifier[deviceTablet] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void actionParent() throws Exception { String ouFqn = CmsOrganizationalUnit.getParentFqn(getParamOufqn()); Map<String, String[]> params = new HashMap<String, String[]>(); params.put(A_CmsOrgUnitDialog.PARAM_OUFQN, new String[] {ouFqn}); params.put(CmsDialog.PARAM_ACTION, new String[] {CmsDialog.DIALOG_INITIAL}); String toolPath = getCurrentToolPath().substring(0, getCurrentToolPath().lastIndexOf("/")); getToolManager().jspForwardTool(this, toolPath, params); actionCloseDialog(); }
class class_name[name] begin[{] method[actionParent, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[String], ouFqn] local_variable[type[Map], params] call[params.put, parameter[member[A_CmsOrgUnitDialog.PARAM_OUFQN], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=ouFqn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]] call[params.put, parameter[member[CmsDialog.PARAM_ACTION], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=DIALOG_INITIAL, postfix_operators=[], prefix_operators=[], qualifier=CmsDialog, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]] local_variable[type[String], toolPath] call[.getToolManager, parameter[]] call[.actionCloseDialog, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[actionParent] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[ouFqn] operator[=] identifier[CmsOrganizationalUnit] operator[SEP] identifier[getParentFqn] operator[SEP] identifier[getParamOufqn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[SEP] operator[SEP] operator[>] identifier[params] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[SEP] operator[SEP] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] identifier[A_CmsOrgUnitDialog] operator[SEP] identifier[PARAM_OUFQN] , Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[ouFqn] } operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] identifier[CmsDialog] operator[SEP] identifier[PARAM_ACTION] , Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[CmsDialog] operator[SEP] identifier[DIALOG_INITIAL] } operator[SEP] operator[SEP] identifier[String] identifier[toolPath] operator[=] identifier[getCurrentToolPath] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[getCurrentToolPath] operator[SEP] operator[SEP] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[getToolManager] operator[SEP] operator[SEP] operator[SEP] identifier[jspForwardTool] operator[SEP] Keyword[this] , identifier[toolPath] , identifier[params] operator[SEP] operator[SEP] identifier[actionCloseDialog] operator[SEP] operator[SEP] operator[SEP] }
public synchronized void gainPrimacy() throws IOException { Preconditions.checkState(mWriter == null, "writer must be null in secondary mode"); Preconditions.checkState(mTailerThread != null, "tailer thread must not be null in secondary mode"); mTailerThread.awaitTermination(true); long nextSequenceNumber = mTailerThread.getNextSequenceNumber(); mTailerThread = null; nextSequenceNumber = catchUp(nextSequenceNumber); mWriter = new UfsJournalLogWriter(this, nextSequenceNumber); mAsyncWriter = new AsyncJournalWriter(mWriter); mState = State.PRIMARY; }
class class_name[name] begin[{] method[gainPrimacy, return_type[void], modifier[synchronized public], parameter[]] begin[{] call[Preconditions.checkState, parameter[binary_operation[member[.mWriter], ==, literal[null]], literal["writer must be null in secondary mode"]]] call[Preconditions.checkState, parameter[binary_operation[member[.mTailerThread], !=, literal[null]], literal["tailer thread must not be null in secondary mode"]]] call[mTailerThread.awaitTermination, parameter[literal[true]]] local_variable[type[long], nextSequenceNumber] assign[member[.mTailerThread], literal[null]] assign[member[.nextSequenceNumber], call[.catchUp, parameter[member[.nextSequenceNumber]]]] assign[member[.mWriter], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=nextSequenceNumber, 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=UfsJournalLogWriter, sub_type=None))] assign[member[.mAsyncWriter], ClassCreator(arguments=[MemberReference(member=mWriter, 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=AsyncJournalWriter, sub_type=None))] assign[member[.mState], member[State.PRIMARY]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[gainPrimacy] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[mWriter] operator[==] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkState] operator[SEP] identifier[mTailerThread] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[mTailerThread] operator[SEP] identifier[awaitTermination] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[long] identifier[nextSequenceNumber] operator[=] identifier[mTailerThread] operator[SEP] identifier[getNextSequenceNumber] operator[SEP] operator[SEP] operator[SEP] identifier[mTailerThread] operator[=] Other[null] operator[SEP] identifier[nextSequenceNumber] operator[=] identifier[catchUp] operator[SEP] identifier[nextSequenceNumber] operator[SEP] operator[SEP] identifier[mWriter] operator[=] Keyword[new] identifier[UfsJournalLogWriter] operator[SEP] Keyword[this] , identifier[nextSequenceNumber] operator[SEP] operator[SEP] identifier[mAsyncWriter] operator[=] Keyword[new] identifier[AsyncJournalWriter] operator[SEP] identifier[mWriter] operator[SEP] operator[SEP] identifier[mState] operator[=] identifier[State] operator[SEP] identifier[PRIMARY] operator[SEP] }
public String getHeapMemoryUsage() { MemoryUsage memoryUsage = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage(); return JsonUtils.marshalToString(memoryUsage); }
class class_name[name] begin[{] method[getHeapMemoryUsage, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[MemoryUsage], memoryUsage] return[call[JsonUtils.marshalToString, parameter[member[.memoryUsage]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getHeapMemoryUsage] operator[SEP] operator[SEP] { identifier[MemoryUsage] identifier[memoryUsage] operator[=] identifier[ManagementFactory] operator[SEP] identifier[getMemoryMXBean] operator[SEP] operator[SEP] operator[SEP] identifier[getHeapMemoryUsage] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[JsonUtils] operator[SEP] identifier[marshalToString] operator[SEP] identifier[memoryUsage] operator[SEP] operator[SEP] }
protected void updateTrackLocation(T image) { get_subwindow(image, templateNew); // calculate response of the classifier at all locations // matlab: k = dense_gauss_kernel(sigma, x, z); dense_gauss_kernel(sigma, templateNew, template,k); fft.forward(k,kf); // response = real(ifft2(alphaf .* fft2(k))); %(Eq. 9) DiscreteFourierTransformOps.multiplyComplex(alphaf, kf, tmpFourier0); fft.inverse(tmpFourier0, response); // find the pixel with the largest response int N = response.width*response.height; int indexBest = -1; double valueBest = -1; for( int i = 0; i < N; i++ ) { double v = response.data[i]; if( v > valueBest ) { valueBest = v; indexBest = i; } } int peakX = indexBest % response.width; int peakY = indexBest / response.width; // sub-pixel peak estimation subpixelPeak(peakX, peakY); // peak in region's coordinate system float deltaX = (peakX+offX) - templateNew.width/2; float deltaY = (peakY+offY) - templateNew.height/2; // convert peak location into image coordinate system regionTrack.x0 = regionTrack.x0 + deltaX*stepX; regionTrack.y0 = regionTrack.y0 + deltaY*stepY; updateRegionOut(); }
class class_name[name] begin[{] method[updateTrackLocation, return_type[void], modifier[protected], parameter[image]] begin[{] call[.get_subwindow, parameter[member[.image], member[.templateNew]]] call[.dense_gauss_kernel, parameter[member[.sigma], member[.templateNew], member[.template], member[.k]]] call[fft.forward, parameter[member[.k], member[.kf]]] call[DiscreteFourierTransformOps.multiplyComplex, parameter[member[.alphaf], member[.kf], member[.tmpFourier0]]] call[fft.inverse, parameter[member[.tmpFourier0], member[.response]]] local_variable[type[int], N] local_variable[type[int], indexBest] local_variable[type[double], valueBest] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=v)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=valueBest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueBest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=indexBest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[int], peakX] local_variable[type[int], peakY] call[.subpixelPeak, parameter[member[.peakX], member[.peakY]]] local_variable[type[float], deltaX] local_variable[type[float], deltaY] assign[member[regionTrack.x0], binary_operation[member[regionTrack.x0], +, binary_operation[member[.deltaX], *, member[.stepX]]]] assign[member[regionTrack.y0], binary_operation[member[regionTrack.y0], +, binary_operation[member[.deltaY], *, member[.stepY]]]] call[.updateRegionOut, parameter[]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[updateTrackLocation] operator[SEP] identifier[T] identifier[image] operator[SEP] { identifier[get_subwindow] operator[SEP] identifier[image] , identifier[templateNew] operator[SEP] operator[SEP] identifier[dense_gauss_kernel] operator[SEP] identifier[sigma] , identifier[templateNew] , identifier[template] , identifier[k] operator[SEP] operator[SEP] identifier[fft] operator[SEP] identifier[forward] operator[SEP] identifier[k] , identifier[kf] operator[SEP] operator[SEP] identifier[DiscreteFourierTransformOps] operator[SEP] identifier[multiplyComplex] operator[SEP] identifier[alphaf] , identifier[kf] , identifier[tmpFourier0] operator[SEP] operator[SEP] identifier[fft] operator[SEP] identifier[inverse] operator[SEP] identifier[tmpFourier0] , identifier[response] operator[SEP] operator[SEP] Keyword[int] identifier[N] operator[=] identifier[response] operator[SEP] identifier[width] operator[*] identifier[response] operator[SEP] identifier[height] operator[SEP] Keyword[int] identifier[indexBest] operator[=] operator[-] Other[1] operator[SEP] Keyword[double] identifier[valueBest] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[N] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[double] identifier[v] operator[=] identifier[response] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[>] identifier[valueBest] operator[SEP] { identifier[valueBest] operator[=] identifier[v] operator[SEP] identifier[indexBest] operator[=] identifier[i] operator[SEP] } } Keyword[int] identifier[peakX] operator[=] identifier[indexBest] operator[%] identifier[response] operator[SEP] identifier[width] operator[SEP] Keyword[int] identifier[peakY] operator[=] identifier[indexBest] operator[/] identifier[response] operator[SEP] identifier[width] operator[SEP] identifier[subpixelPeak] operator[SEP] identifier[peakX] , identifier[peakY] operator[SEP] operator[SEP] Keyword[float] identifier[deltaX] operator[=] operator[SEP] identifier[peakX] operator[+] identifier[offX] operator[SEP] operator[-] identifier[templateNew] operator[SEP] identifier[width] operator[/] Other[2] operator[SEP] Keyword[float] identifier[deltaY] operator[=] operator[SEP] identifier[peakY] operator[+] identifier[offY] operator[SEP] operator[-] identifier[templateNew] operator[SEP] identifier[height] operator[/] Other[2] operator[SEP] identifier[regionTrack] operator[SEP] identifier[x0] operator[=] identifier[regionTrack] operator[SEP] identifier[x0] operator[+] identifier[deltaX] operator[*] identifier[stepX] operator[SEP] identifier[regionTrack] operator[SEP] identifier[y0] operator[=] identifier[regionTrack] operator[SEP] identifier[y0] operator[+] identifier[deltaY] operator[*] identifier[stepY] operator[SEP] identifier[updateRegionOut] operator[SEP] operator[SEP] operator[SEP] }
private Class<?> resolveJavaClass(final String fqn) throws ClassNotFoundException { String[] parts = fqn.split("\\."); if (parts.length < 2) { throw new JsiiException("Malformed FQN: " + fqn); } String moduleName = parts[0]; JsonNode names = this.getClient().getModuleNames(moduleName); if (!names.has("java")) { throw new JsiiException("No java name for module " + moduleName); } final JsiiModule module = this.loadedModules.get(moduleName); if (module == null) { throw new JsiiException("No loaded module is named " + moduleName); } return module.resolveClass(fqn); }
class class_name[name] begin[{] method[resolveJavaClass, return_type[type[Class]], modifier[private], parameter[fqn]] begin[{] local_variable[type[String], parts] if[binary_operation[member[parts.length], <, literal[2]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Malformed FQN: "), operandr=MemberReference(member=fqn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsiiException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], moduleName] local_variable[type[JsonNode], names] if[call[names.has, parameter[literal["java"]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No java name for module "), operandr=MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsiiException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[JsiiModule], module] if[binary_operation[member[.module], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No loaded module is named "), operandr=MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsiiException, sub_type=None)), label=None) else begin[{] None end[}] return[call[module.resolveClass, parameter[member[.fqn]]]] end[}] END[}]
Keyword[private] identifier[Class] operator[<] operator[?] operator[>] identifier[resolveJavaClass] operator[SEP] Keyword[final] identifier[String] identifier[fqn] operator[SEP] Keyword[throws] identifier[ClassNotFoundException] { identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[fqn] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[<] Other[2] operator[SEP] { Keyword[throw] Keyword[new] identifier[JsiiException] operator[SEP] literal[String] operator[+] identifier[fqn] operator[SEP] operator[SEP] } identifier[String] identifier[moduleName] operator[=] identifier[parts] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[JsonNode] identifier[names] operator[=] Keyword[this] operator[SEP] identifier[getClient] operator[SEP] operator[SEP] operator[SEP] identifier[getModuleNames] operator[SEP] identifier[moduleName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[names] operator[SEP] identifier[has] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[JsiiException] operator[SEP] literal[String] operator[+] identifier[moduleName] operator[SEP] operator[SEP] } Keyword[final] identifier[JsiiModule] identifier[module] operator[=] Keyword[this] operator[SEP] identifier[loadedModules] operator[SEP] identifier[get] operator[SEP] identifier[moduleName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[module] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[JsiiException] operator[SEP] literal[String] operator[+] identifier[moduleName] operator[SEP] operator[SEP] } Keyword[return] identifier[module] operator[SEP] identifier[resolveClass] operator[SEP] identifier[fqn] operator[SEP] operator[SEP] }
@Override public CommerceWarehouse findByPrimaryKey(Serializable primaryKey) throws NoSuchWarehouseException { CommerceWarehouse commerceWarehouse = fetchByPrimaryKey(primaryKey); if (commerceWarehouse == null) { if (_log.isDebugEnabled()) { _log.debug(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } throw new NoSuchWarehouseException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey); } return commerceWarehouse; }
class class_name[name] begin[{] method[findByPrimaryKey, return_type[type[CommerceWarehouse]], modifier[public], parameter[primaryKey]] begin[{] local_variable[type[CommerceWarehouse], commerceWarehouse] if[binary_operation[member[.commerceWarehouse], ==, literal[null]]] begin[{] if[call[_log.isDebugEnabled, parameter[]]] begin[{] call[_log.debug, parameter[binary_operation[member[._NO_SUCH_ENTITY_WITH_PRIMARY_KEY], +, member[.primaryKey]]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=_NO_SUCH_ENTITY_WITH_PRIMARY_KEY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=primaryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchWarehouseException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.commerceWarehouse]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceWarehouse] identifier[findByPrimaryKey] operator[SEP] identifier[Serializable] identifier[primaryKey] operator[SEP] Keyword[throws] identifier[NoSuchWarehouseException] { identifier[CommerceWarehouse] identifier[commerceWarehouse] operator[=] identifier[fetchByPrimaryKey] operator[SEP] identifier[primaryKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceWarehouse] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[_log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[_log] operator[SEP] identifier[debug] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_PRIMARY_KEY] operator[+] identifier[primaryKey] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[NoSuchWarehouseException] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_PRIMARY_KEY] operator[+] identifier[primaryKey] operator[SEP] operator[SEP] } Keyword[return] identifier[commerceWarehouse] operator[SEP] }
public NativeQuery withDMLResultsDisplaySize(int DMLResultsDisplaySize) { if (!getOperationType(boundStatement).isUpsert) { options.setDMLResultsDisplaySize(Optional.of(Integer.max(0,Integer.min(DMLResultsDisplaySize, CassandraOptions.MAX_RESULTS_DISPLAY_SIZE)))); } return this; }
class class_name[name] begin[{] method[withDMLResultsDisplaySize, return_type[type[NativeQuery]], modifier[public], parameter[DMLResultsDisplaySize]] begin[{] if[call[.getOperationType, parameter[member[.boundStatement]]]] begin[{] call[options.setDMLResultsDisplaySize, parameter[call[Optional.of, parameter[call[Integer.max, parameter[literal[0], call[Integer.min, parameter[member[.DMLResultsDisplaySize], member[CassandraOptions.MAX_RESULTS_DISPLAY_SIZE]]]]]]]]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[NativeQuery] identifier[withDMLResultsDisplaySize] operator[SEP] Keyword[int] identifier[DMLResultsDisplaySize] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[getOperationType] operator[SEP] identifier[boundStatement] operator[SEP] operator[SEP] identifier[isUpsert] operator[SEP] { identifier[options] operator[SEP] identifier[setDMLResultsDisplaySize] operator[SEP] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[Integer] operator[SEP] identifier[max] operator[SEP] Other[0] , identifier[Integer] operator[SEP] identifier[min] operator[SEP] identifier[DMLResultsDisplaySize] , identifier[CassandraOptions] operator[SEP] identifier[MAX_RESULTS_DISPLAY_SIZE] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public Contact viewContact(final String id) throws NotFoundException, GeneralException, UnauthorizedException { if (id == null) { throw new IllegalArgumentException("Contact ID must be specified."); } return messageBirdService.requestByID(CONTACTPATH, id, Contact.class); }
class class_name[name] begin[{] method[viewContact, return_type[type[Contact]], modifier[public], parameter[id]] begin[{] if[binary_operation[member[.id], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Contact ID must be specified.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[messageBirdService.requestByID, parameter[member[.CONTACTPATH], member[.id], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Contact, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Contact] identifier[viewContact] operator[SEP] Keyword[final] identifier[String] identifier[id] operator[SEP] Keyword[throws] identifier[NotFoundException] , identifier[GeneralException] , identifier[UnauthorizedException] { Keyword[if] operator[SEP] identifier[id] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[messageBirdService] operator[SEP] identifier[requestByID] operator[SEP] identifier[CONTACTPATH] , identifier[id] , identifier[Contact] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public static String getDefaultReasonPhrase(char errorCode) { switch (errorCode) { case BAD_REQUEST: return "(Bad Request): The request was malformed. The client should not " + "retry the request without modification from the previous attempt."; case UNAUTHORIZED: return "(Unauthorized): The Binding Request did not contain a MESSAGE-" + "INTEGRITY attribute."; case UNKNOWN_ATTRIBUTE: return "(Unknown Attribute): The server did not understand a mandatory " + "attribute in the request."; case STALE_CREDENTIALS: return "(Stale Credentials): The Binding Request did contain a MESSAGE-" + "INTEGRITY attribute, but it used a shared secret that has " + "expired. The client should obtain a new shared secret and try" + "again"; case INTEGRITY_CHECK_FAILURE: return "(Integrity Check Failure): The Binding Request contained a " + "MESSAGE-INTEGRITY attribute, but the HMAC failed verification. " + "This could be a sign of a potential attack, or client " + "implementation error."; case MISSING_USERNAME: return "(Missing Username): The Binding Request contained a MESSAGE-" + "INTEGRITY attribute, but not a USERNAME attribute. Both must be" + "present for integrity checks."; case USE_TLS: return "(Use TLS): The Shared Secret request has to be sent over TLS, but" + "was not received over TLS."; case SERVER_ERROR: return "(Server Error): The server has suffered a temporary error. The" + "client should try again."; case GLOBAL_FAILURE: return "(Global Failure:) The server is refusing to fulfill the request." + "The client should not retry."; default: return "Unknown Error"; } }
class class_name[name] begin[{] method[getDefaultReasonPhrase, return_type[type[String]], modifier[public static], parameter[errorCode]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['BAD_REQUEST'], statements=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(Bad Request): The request was malformed. The client should not "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="retry the request without modification from the previous attempt."), operator=+), label=None)]), SwitchStatementCase(case=['UNAUTHORIZED'], statements=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(Unauthorized): The Binding Request did not contain a MESSAGE-"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTEGRITY attribute."), operator=+), label=None)]), SwitchStatementCase(case=['UNKNOWN_ATTRIBUTE'], statements=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(Unknown Attribute): The server did not understand a mandatory "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="attribute in the request."), operator=+), label=None)]), SwitchStatementCase(case=['STALE_CREDENTIALS'], statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(Stale Credentials): The Binding Request did contain a MESSAGE-"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTEGRITY attribute, but it used a shared secret that has "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="expired. The client should obtain a new shared secret and try"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="again"), operator=+), label=None)]), SwitchStatementCase(case=['INTEGRITY_CHECK_FAILURE'], statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(Integrity Check Failure): The Binding Request contained a "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MESSAGE-INTEGRITY attribute, but the HMAC failed verification. "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This could be a sign of a potential attack, or client "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="implementation error."), operator=+), label=None)]), SwitchStatementCase(case=['MISSING_USERNAME'], statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(Missing Username): The Binding Request contained a MESSAGE-"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTEGRITY attribute, but not a USERNAME attribute. Both must be"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="present for integrity checks."), operator=+), label=None)]), SwitchStatementCase(case=['USE_TLS'], statements=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(Use TLS): The Shared Secret request has to be sent over TLS, but"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="was not received over TLS."), operator=+), label=None)]), SwitchStatementCase(case=['SERVER_ERROR'], statements=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(Server Error): The server has suffered a temporary error. The"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="client should try again."), operator=+), label=None)]), SwitchStatementCase(case=['GLOBAL_FAILURE'], statements=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(Global Failure:) The server is refusing to fulfill the request."), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The client should not retry."), operator=+), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown Error"), label=None)])], expression=MemberReference(member=errorCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getDefaultReasonPhrase] operator[SEP] Keyword[char] identifier[errorCode] operator[SEP] { Keyword[switch] operator[SEP] identifier[errorCode] operator[SEP] { Keyword[case] identifier[BAD_REQUEST] operator[:] Keyword[return] literal[String] operator[+] literal[String] operator[SEP] Keyword[case] identifier[UNAUTHORIZED] operator[:] Keyword[return] literal[String] operator[+] literal[String] operator[SEP] Keyword[case] identifier[UNKNOWN_ATTRIBUTE] operator[:] Keyword[return] literal[String] operator[+] literal[String] operator[SEP] Keyword[case] identifier[STALE_CREDENTIALS] operator[:] Keyword[return] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] Keyword[case] identifier[INTEGRITY_CHECK_FAILURE] operator[:] Keyword[return] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] Keyword[case] identifier[MISSING_USERNAME] operator[:] Keyword[return] literal[String] operator[+] literal[String] operator[+] literal[String] operator[SEP] Keyword[case] identifier[USE_TLS] operator[:] Keyword[return] literal[String] operator[+] literal[String] operator[SEP] Keyword[case] identifier[SERVER_ERROR] operator[:] Keyword[return] literal[String] operator[+] literal[String] operator[SEP] Keyword[case] identifier[GLOBAL_FAILURE] operator[:] Keyword[return] literal[String] operator[+] literal[String] operator[SEP] Keyword[default] operator[:] Keyword[return] literal[String] operator[SEP] } }
@Override public EClass getUserSettings() { if (userSettingsEClass == null) { userSettingsEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(StorePackage.eNS_URI).getEClassifiers().get(10); } return userSettingsEClass; }
class class_name[name] begin[{] method[getUserSettings, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.userSettingsEClass], ==, literal[null]]] begin[{] assign[member[.userSettingsEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=StorePackage, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.userSettingsEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getUserSettings] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[userSettingsEClass] operator[==] Other[null] operator[SEP] { identifier[userSettingsEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[StorePackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[10] operator[SEP] operator[SEP] } Keyword[return] identifier[userSettingsEClass] operator[SEP] }
private Double getDouble(String number) { try { return Double.parseDouble(number); } catch (NumberFormatException e) { return null; } }
class class_name[name] begin[{] method[getDouble, return_type[type[Double]], modifier[private], parameter[number]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseDouble, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] identifier[Double] identifier[getDouble] operator[SEP] identifier[String] identifier[number] operator[SEP] { Keyword[try] { Keyword[return] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[number] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } }
@Override public int getPriority() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getPriority"); if (msgPriority == -2) { JsMessage localMsg = getJSMessage(true); msgPriority = localMsg.getPriority().intValue(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getPriority", Integer.valueOf(msgPriority)); return msgPriority; }
class class_name[name] begin[{] method[getPriority, return_type[type[int]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["getPriority"]]] else begin[{] None end[}] if[binary_operation[member[.msgPriority], ==, literal[2]]] begin[{] local_variable[type[JsMessage], localMsg] assign[member[.msgPriority], call[localMsg.getPriority, parameter[]]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["getPriority"], call[Integer.valueOf, parameter[member[.msgPriority]]]]] else begin[{] None end[}] return[member[.msgPriority]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[getPriority] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[msgPriority] operator[==] operator[-] Other[2] operator[SEP] { identifier[JsMessage] identifier[localMsg] operator[=] identifier[getJSMessage] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[msgPriority] operator[=] identifier[localMsg] operator[SEP] identifier[getPriority] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[msgPriority] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[msgPriority] operator[SEP] }
TransactionReceipt executeTransaction( String data, BigInteger weiValue, String funcName) throws TransactionException, IOException { TransactionReceipt receipt = send(contractAddress, data, weiValue, gasProvider.getGasPrice(funcName), gasProvider.getGasLimit(funcName)); if (!receipt.isStatusOK()) { throw new TransactionException( String.format( "Transaction has failed with status: %s. " + "Gas used: %d. (not-enough gas?)", receipt.getStatus(), receipt.getGasUsed())); } return receipt; }
class class_name[name] begin[{] method[executeTransaction, return_type[type[TransactionReceipt]], modifier[default], parameter[data, weiValue, funcName]] begin[{] local_variable[type[TransactionReceipt], receipt] if[call[receipt.isStatusOK, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Transaction has failed with status: %s. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Gas used: %d. (not-enough gas?)"), operator=+), MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=receipt, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getGasUsed, postfix_operators=[], prefix_operators=[], qualifier=receipt, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TransactionException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.receipt]] end[}] END[}]
identifier[TransactionReceipt] identifier[executeTransaction] operator[SEP] identifier[String] identifier[data] , identifier[BigInteger] identifier[weiValue] , identifier[String] identifier[funcName] operator[SEP] Keyword[throws] identifier[TransactionException] , identifier[IOException] { identifier[TransactionReceipt] identifier[receipt] operator[=] identifier[send] operator[SEP] identifier[contractAddress] , identifier[data] , identifier[weiValue] , identifier[gasProvider] operator[SEP] identifier[getGasPrice] operator[SEP] identifier[funcName] operator[SEP] , identifier[gasProvider] operator[SEP] identifier[getGasLimit] operator[SEP] identifier[funcName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[receipt] operator[SEP] identifier[isStatusOK] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[TransactionException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] operator[+] literal[String] , identifier[receipt] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[receipt] operator[SEP] identifier[getGasUsed] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[receipt] operator[SEP] }
public Counter<F> getFeatureCounter() { Counter<F> featureCounts = new ClassicCounter<F>(); for (int i=0; i < this.size(); i++) { BasicDatum<L, F> datum = (BasicDatum<L, F>) getDatum(i); Set<F> featureSet = new HashSet<F>(datum.asFeatures()); for (F key : featureSet) { featureCounts.incrementCount(key, 1.0); } } return featureCounts; }
class class_name[name] begin[{] method[getFeatureCounter, return_type[type[Counter]], modifier[public], parameter[]] begin[{] local_variable[type[Counter], featureCounts] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDatum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=L, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=F, sub_type=None))], dimensions=[], name=BasicDatum, sub_type=None)), name=datum)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=L, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=F, sub_type=None))], dimensions=[], name=BasicDatum, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=asFeatures, postfix_operators=[], prefix_operators=[], qualifier=datum, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=F, sub_type=None))], dimensions=None, name=HashSet, sub_type=None)), name=featureSet)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=F, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0)], member=incrementCount, postfix_operators=[], prefix_operators=[], qualifier=featureCounts, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=featureSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=F, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.featureCounts]] end[}] END[}]
Keyword[public] identifier[Counter] operator[<] identifier[F] operator[>] identifier[getFeatureCounter] operator[SEP] operator[SEP] { identifier[Counter] operator[<] identifier[F] operator[>] identifier[featureCounts] operator[=] Keyword[new] identifier[ClassicCounter] operator[<] identifier[F] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[BasicDatum] operator[<] identifier[L] , identifier[F] operator[>] identifier[datum] operator[=] operator[SEP] identifier[BasicDatum] operator[<] identifier[L] , identifier[F] operator[>] operator[SEP] identifier[getDatum] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[F] operator[>] identifier[featureSet] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[F] operator[>] operator[SEP] identifier[datum] operator[SEP] identifier[asFeatures] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[F] identifier[key] operator[:] identifier[featureSet] operator[SEP] { identifier[featureCounts] operator[SEP] identifier[incrementCount] operator[SEP] identifier[key] , literal[Float] operator[SEP] operator[SEP] } } Keyword[return] identifier[featureCounts] operator[SEP] }
public static Boolean hasBeenEnhancedForFeature(final Class<?> controllerClass, final String featureName) { boolean hasBeenEnhanced = false; final Enhanced enhancedAnnotation = controllerClass.getAnnotation(Enhanced.class); if(enhancedAnnotation != null) { final String[] enhancedFor = enhancedAnnotation.enhancedFor(); if(enhancedFor != null) { hasBeenEnhanced = GrailsArrayUtils.contains(enhancedFor, featureName); } } return hasBeenEnhanced; }
class class_name[name] begin[{] method[hasBeenEnhancedForFeature, return_type[type[Boolean]], modifier[public static], parameter[controllerClass, featureName]] begin[{] local_variable[type[boolean], hasBeenEnhanced] local_variable[type[Enhanced], enhancedAnnotation] if[binary_operation[member[.enhancedAnnotation], !=, literal[null]]] begin[{] local_variable[type[String], enhancedFor] if[binary_operation[member[.enhancedFor], !=, literal[null]]] begin[{] assign[member[.hasBeenEnhanced], call[GrailsArrayUtils.contains, parameter[member[.enhancedFor], member[.featureName]]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.hasBeenEnhanced]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Boolean] identifier[hasBeenEnhancedForFeature] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[controllerClass] , Keyword[final] identifier[String] identifier[featureName] operator[SEP] { Keyword[boolean] identifier[hasBeenEnhanced] operator[=] literal[boolean] operator[SEP] Keyword[final] identifier[Enhanced] identifier[enhancedAnnotation] operator[=] identifier[controllerClass] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[Enhanced] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[enhancedAnnotation] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[enhancedFor] operator[=] identifier[enhancedAnnotation] operator[SEP] identifier[enhancedFor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[enhancedFor] operator[!=] Other[null] operator[SEP] { identifier[hasBeenEnhanced] operator[=] identifier[GrailsArrayUtils] operator[SEP] identifier[contains] operator[SEP] identifier[enhancedFor] , identifier[featureName] operator[SEP] operator[SEP] } } Keyword[return] identifier[hasBeenEnhanced] operator[SEP] }
public static Optional<MultifactorAuthenticationProvider> resolveProvider(final Map<String, MultifactorAuthenticationProvider> providers, final Collection<String> requestMfaMethod) { return providers.values() .stream() .filter(p -> requestMfaMethod.stream().filter(Objects::nonNull).anyMatch(p::matches)) .findFirst(); }
class class_name[name] begin[{] method[resolveProvider, return_type[type[Optional]], modifier[public static], parameter[providers, requestMfaMethod]] begin[{] return[call[providers.values, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Optional] operator[<] identifier[MultifactorAuthenticationProvider] operator[>] identifier[resolveProvider] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[MultifactorAuthenticationProvider] operator[>] identifier[providers] , Keyword[final] identifier[Collection] operator[<] identifier[String] operator[>] identifier[requestMfaMethod] operator[SEP] { Keyword[return] identifier[providers] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[p] operator[->] identifier[requestMfaMethod] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[Objects] operator[::] identifier[nonNull] operator[SEP] operator[SEP] identifier[anyMatch] operator[SEP] identifier[p] operator[::] identifier[matches] operator[SEP] operator[SEP] operator[SEP] identifier[findFirst] operator[SEP] operator[SEP] operator[SEP] }
private void processSplitPage(List<BTreePage> splitResult, PageModificationContext context) { PageWrapper originalPage = context.getPageWrapper(); for (int i = 0; i < splitResult.size(); i++) { val page = splitResult.get(i); ByteArraySegment newPageKey; long newOffset; long minOffset; PageWrapper processedPage; if (i == 0) { // The original page will be replaced by the first split. Nothing changes about its pointer key. originalPage.setPage(page); newPageKey = originalPage.getPageKey(); context.getPageCollection().complete(originalPage); processedPage = originalPage; } else { // Insert the new pages and assign them new virtual offsets. Each page will use its first // Key as a Page Key. newPageKey = page.getKeyAt(0); processedPage = PageWrapper.wrapNew(page, originalPage.getParent(), new PagePointer(newPageKey, PagePointer.NO_OFFSET, page.getLength())); context.getPageCollection().insert(processedPage); context.getPageCollection().complete(processedPage); } // Fetch new offset, and update minimum offsets. newOffset = processedPage.getOffset(); minOffset = calculateMinOffset(processedPage); processedPage.setMinOffset(minOffset); // Record changes. context.updatePagePointer(new PagePointer(newPageKey, newOffset, page.getLength(), minOffset)); } }
class class_name[name] begin[{] method[processSplitPage, return_type[void], modifier[private], parameter[splitResult, context]] begin[{] local_variable[type[PageWrapper], originalPage] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=splitResult, selectors=[], type_arguments=None), name=page)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=newPageKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArraySegment, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=newOffset)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=minOffset)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=processedPage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PageWrapper, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newPageKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getKeyAt, postfix_operators=[], prefix_operators=[], qualifier=page, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=processedPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=page, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=originalPage, selectors=[], type_arguments=None), ClassCreator(arguments=[MemberReference(member=newPageKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=NO_OFFSET, postfix_operators=[], prefix_operators=[], qualifier=PagePointer, selectors=[]), MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=page, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PagePointer, sub_type=None))], member=wrapNew, postfix_operators=[], prefix_operators=[], qualifier=PageWrapper, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getPageCollection, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=processedPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getPageCollection, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=processedPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=complete, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=page, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setPage, postfix_operators=[], prefix_operators=[], qualifier=originalPage, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=newPageKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getPageKey, postfix_operators=[], prefix_operators=[], qualifier=originalPage, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getPageCollection, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[MemberReference(member=originalPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=complete, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=processedPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=originalPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=newOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getOffset, postfix_operators=[], prefix_operators=[], qualifier=processedPage, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=minOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=processedPage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=calculateMinOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=minOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMinOffset, postfix_operators=[], prefix_operators=[], qualifier=processedPage, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=newPageKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=page, selectors=[], type_arguments=None), MemberReference(member=minOffset, 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=PagePointer, sub_type=None))], member=updatePagePointer, postfix_operators=[], prefix_operators=[], qualifier=context, 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=splitResult, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[processSplitPage] operator[SEP] identifier[List] operator[<] identifier[BTreePage] operator[>] identifier[splitResult] , identifier[PageModificationContext] identifier[context] operator[SEP] { identifier[PageWrapper] identifier[originalPage] operator[=] identifier[context] operator[SEP] identifier[getPageWrapper] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[splitResult] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[val] identifier[page] operator[=] identifier[splitResult] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ByteArraySegment] identifier[newPageKey] operator[SEP] Keyword[long] identifier[newOffset] operator[SEP] Keyword[long] identifier[minOffset] operator[SEP] identifier[PageWrapper] identifier[processedPage] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] Other[0] operator[SEP] { identifier[originalPage] operator[SEP] identifier[setPage] operator[SEP] identifier[page] operator[SEP] operator[SEP] identifier[newPageKey] operator[=] identifier[originalPage] operator[SEP] identifier[getPageKey] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[getPageCollection] operator[SEP] operator[SEP] operator[SEP] identifier[complete] operator[SEP] identifier[originalPage] operator[SEP] operator[SEP] identifier[processedPage] operator[=] identifier[originalPage] operator[SEP] } Keyword[else] { identifier[newPageKey] operator[=] identifier[page] operator[SEP] identifier[getKeyAt] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[processedPage] operator[=] identifier[PageWrapper] operator[SEP] identifier[wrapNew] operator[SEP] identifier[page] , identifier[originalPage] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] , Keyword[new] identifier[PagePointer] operator[SEP] identifier[newPageKey] , identifier[PagePointer] operator[SEP] identifier[NO_OFFSET] , identifier[page] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[getPageCollection] operator[SEP] operator[SEP] operator[SEP] identifier[insert] operator[SEP] identifier[processedPage] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[getPageCollection] operator[SEP] operator[SEP] operator[SEP] identifier[complete] operator[SEP] identifier[processedPage] operator[SEP] operator[SEP] } identifier[newOffset] operator[=] identifier[processedPage] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] operator[SEP] identifier[minOffset] operator[=] identifier[calculateMinOffset] operator[SEP] identifier[processedPage] operator[SEP] operator[SEP] identifier[processedPage] operator[SEP] identifier[setMinOffset] operator[SEP] identifier[minOffset] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[updatePagePointer] operator[SEP] Keyword[new] identifier[PagePointer] operator[SEP] identifier[newPageKey] , identifier[newOffset] , identifier[page] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] , identifier[minOffset] operator[SEP] operator[SEP] operator[SEP] } }
public static final <X> Function<X,Boolean> isNullBy(final IFunction<X,?> by) { return FnFunc.chain(by, IS_NULL); }
class class_name[name] begin[{] method[isNullBy, return_type[type[Function]], modifier[final public static], parameter[by]] begin[{] return[call[FnFunc.chain, parameter[member[.by], member[.IS_NULL]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] operator[<] identifier[X] operator[>] identifier[Function] operator[<] identifier[X] , identifier[Boolean] operator[>] identifier[isNullBy] operator[SEP] Keyword[final] identifier[IFunction] operator[<] identifier[X] , operator[?] operator[>] identifier[by] operator[SEP] { Keyword[return] identifier[FnFunc] operator[SEP] identifier[chain] operator[SEP] identifier[by] , identifier[IS_NULL] operator[SEP] operator[SEP] }
public String getAsString(SizeUnit...sizeUnits) { if(sizeUnits == null || sizeUnits.length == 0) return toString(); return getAsString(CollectionsUtils.toEnumSet(SizeUnit.class, sizeUnits)); }
class class_name[name] begin[{] method[getAsString, return_type[type[String]], modifier[public], parameter[sizeUnits]] begin[{] if[binary_operation[binary_operation[member[.sizeUnits], ==, literal[null]], ||, binary_operation[member[sizeUnits.length], ==, literal[0]]]] begin[{] return[call[.toString, parameter[]]] else begin[{] None end[}] return[call[.getAsString, parameter[call[CollectionsUtils.toEnumSet, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SizeUnit, sub_type=None)), member[.sizeUnits]]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getAsString] operator[SEP] identifier[SizeUnit] operator[...] identifier[sizeUnits] operator[SEP] { Keyword[if] operator[SEP] identifier[sizeUnits] operator[==] Other[null] operator[||] identifier[sizeUnits] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[return] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getAsString] operator[SEP] identifier[CollectionsUtils] operator[SEP] identifier[toEnumSet] operator[SEP] identifier[SizeUnit] operator[SEP] Keyword[class] , identifier[sizeUnits] operator[SEP] operator[SEP] operator[SEP] }
protected static String getUserNames(Set<String> ids, String andLocalized) { List<String> userNames = new ArrayList<String>(); for (String id : ids) { CmsSessionInfo session = OpenCms.getSessionManager().getSessionInfo(new CmsUUID(id)); try { String name = A_CmsUI.getCmsObject().readUser(session.getUserId()).getName(); if (!userNames.contains(name)) { userNames.add(name); } } catch (CmsException e) { LOG.error("Unable to read user information", e); } } Iterator<String> iterator = userNames.iterator(); String res = ""; while (iterator.hasNext()) { res += iterator.next(); if (iterator.hasNext()) { res += ", "; } } int lastPosSeperation = res.lastIndexOf(", "); return lastPosSeperation == -1 ? res : res.substring(0, lastPosSeperation) + " " + andLocalized + " " + res.substring(lastPosSeperation + 2, res.length()); }
class class_name[name] begin[{] method[getUserNames, return_type[type[String]], modifier[static protected], parameter[ids, andLocalized]] begin[{] local_variable[type[List], userNames] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSessionManager, postfix_operators=[], prefix_operators=[], qualifier=OpenCms, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=id, 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=CmsUUID, sub_type=None))], member=getSessionInfo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=session)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsSessionInfo, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCmsObject, postfix_operators=[], prefix_operators=[], qualifier=A_CmsUI, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getUserId, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None)], member=readUser, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=userNames, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=userNames, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to read user information"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[Iterator], iterator] local_variable[type[String], res] while[call[iterator.hasNext, parameter[]]] begin[{] assign[member[.res], call[iterator.next, parameter[]]] if[call[iterator.hasNext, parameter[]]] begin[{] assign[member[.res], literal[", "]] else begin[{] None end[}] end[}] local_variable[type[int], lastPosSeperation] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=lastPosSeperation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), if_false=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=lastPosSeperation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MemberReference(member=andLocalized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=lastPosSeperation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None), operator=+), if_true=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[protected] Keyword[static] identifier[String] identifier[getUserNames] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[ids] , identifier[String] identifier[andLocalized] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[userNames] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[id] operator[:] identifier[ids] operator[SEP] { identifier[CmsSessionInfo] identifier[session] operator[=] identifier[OpenCms] operator[SEP] identifier[getSessionManager] operator[SEP] operator[SEP] operator[SEP] identifier[getSessionInfo] operator[SEP] Keyword[new] identifier[CmsUUID] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[String] identifier[name] operator[=] identifier[A_CmsUI] operator[SEP] identifier[getCmsObject] operator[SEP] operator[SEP] operator[SEP] identifier[readUser] operator[SEP] identifier[session] operator[SEP] identifier[getUserId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[userNames] operator[SEP] identifier[contains] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[userNames] operator[SEP] identifier[add] operator[SEP] identifier[name] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } identifier[Iterator] operator[<] identifier[String] operator[>] identifier[iterator] operator[=] identifier[userNames] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[res] operator[=] literal[String] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[res] operator[+=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[res] operator[+=] literal[String] operator[SEP] } } Keyword[int] identifier[lastPosSeperation] operator[=] identifier[res] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[lastPosSeperation] operator[==] operator[-] Other[1] operator[?] identifier[res] operator[:] identifier[res] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[lastPosSeperation] operator[SEP] operator[+] literal[String] operator[+] identifier[andLocalized] operator[+] literal[String] operator[+] identifier[res] operator[SEP] identifier[substring] operator[SEP] identifier[lastPosSeperation] operator[+] Other[2] , identifier[res] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static SampleCount valueOf(final String countAndRate) { if (countAndRate == null) return null; final String[] parts = countAndRate.split("@"); if (parts.length == 2) { final long samples = Long.parseLong(parts[0]); final Timebase timebase = Timebase.getInstance(parts[1]); return new SampleCount(samples, timebase); } else { throw new IllegalArgumentException("Invalid Vidispine sample count: " + countAndRate + " expected a single @ separating sample count and rate."); } }
class class_name[name] begin[{] method[valueOf, return_type[type[SampleCount]], modifier[public static], parameter[countAndRate]] begin[{] if[binary_operation[member[.countAndRate], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], parts] if[binary_operation[member[parts.length], ==, literal[2]]] begin[{] local_variable[type[long], samples] local_variable[type[Timebase], timebase] return[ClassCreator(arguments=[MemberReference(member=samples, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timebase, 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=SampleCount, sub_type=None))] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid Vidispine sample count: "), operandr=MemberReference(member=countAndRate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" expected a single @ separating sample count and rate."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[SampleCount] identifier[valueOf] operator[SEP] Keyword[final] identifier[String] identifier[countAndRate] operator[SEP] { Keyword[if] operator[SEP] identifier[countAndRate] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[countAndRate] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] { Keyword[final] Keyword[long] identifier[samples] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] identifier[parts] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Timebase] identifier[timebase] operator[=] identifier[Timebase] operator[SEP] identifier[getInstance] operator[SEP] identifier[parts] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[SampleCount] operator[SEP] identifier[samples] , identifier[timebase] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[countAndRate] operator[+] literal[String] operator[SEP] operator[SEP] } }
public static <T> UnmodifiableIterator<T> filter( final Iterator<T> unfiltered, final Predicate<? super T> predicate) { checkNotNull(unfiltered); checkNotNull(predicate); return new AbstractIterator<T>() { @Override protected T computeNext() { while (unfiltered.hasNext()) { T element = unfiltered.next(); if (predicate.apply(element)) { return element; } } return endOfData(); } }; }
class class_name[name] begin[{] method[filter, return_type[type[UnmodifiableIterator]], modifier[public static], parameter[unfiltered, predicate]] begin[{] call[.checkNotNull, parameter[member[.unfiltered]]] call[.checkNotNull, parameter[member[.predicate]]] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=unfiltered, selectors=[], type_arguments=None), name=element)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=predicate, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=unfiltered, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=endOfData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'protected'}, name=computeNext, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=AbstractIterator, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[UnmodifiableIterator] operator[<] identifier[T] operator[>] identifier[filter] operator[SEP] Keyword[final] identifier[Iterator] operator[<] identifier[T] operator[>] identifier[unfiltered] , Keyword[final] identifier[Predicate] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[predicate] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[unfiltered] operator[SEP] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[predicate] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[AbstractIterator] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[protected] identifier[T] identifier[computeNext] operator[SEP] operator[SEP] { Keyword[while] operator[SEP] identifier[unfiltered] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[T] identifier[element] operator[=] identifier[unfiltered] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[predicate] operator[SEP] identifier[apply] operator[SEP] identifier[element] operator[SEP] operator[SEP] { Keyword[return] identifier[element] operator[SEP] } } Keyword[return] identifier[endOfData] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
public BaseField setupField(int iFieldSeq) { BaseField field = null; if (iFieldSeq == 0) field = new ReportScreenRecord_ReportDate(this, REPORT_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 1) field = new ReportScreenRecord_ReportTime(this, REPORT_TIME, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 2) field = new ReportScreenRecord_ReportUserID(this, REPORT_USER_ID, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 3) field = new ShortField(this, REPORT_PAGE, Constants.DEFAULT_FIELD_LENGTH, null, new Short((short)1)); if (iFieldSeq == 4) field = new IntegerField(this, REPORT_COUNT, Constants.DEFAULT_FIELD_LENGTH, null, new Integer(0)); if (iFieldSeq == 5) field = new CurrencyField(this, REPORT_TOTAL, Constants.DEFAULT_FIELD_LENGTH, null, new Double(0)); if (iFieldSeq == 6) field = new IntegerField(this, REPORT_KEY_AREA, Constants.DEFAULT_FIELD_LENGTH, null, null); if (field == null) field = super.setupField(iFieldSeq); return field; }
class class_name[name] begin[{] method[setupField, return_type[type[BaseField]], modifier[public], parameter[iFieldSeq]] begin[{] local_variable[type[BaseField], field] if[binary_operation[member[.iFieldSeq], ==, literal[0]]] begin[{] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=REPORT_DATE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReportScreenRecord_ReportDate, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.iFieldSeq], ==, literal[1]]] begin[{] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=REPORT_TIME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReportScreenRecord_ReportTime, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.iFieldSeq], ==, literal[2]]] begin[{] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=REPORT_USER_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReportScreenRecord_ReportUserID, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.iFieldSeq], ==, literal[3]]] begin[{] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=REPORT_PAGE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassCreator(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), type=BasicType(dimensions=[], name=short))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ShortField, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.iFieldSeq], ==, literal[4]]] begin[{] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=REPORT_COUNT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntegerField, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.iFieldSeq], ==, literal[5]]] begin[{] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=REPORT_TOTAL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CurrencyField, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.iFieldSeq], ==, literal[6]]] begin[{] assign[member[.field], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=REPORT_KEY_AREA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DEFAULT_FIELD_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IntegerField, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.field], ==, literal[null]]] begin[{] assign[member[.field], SuperMethodInvocation(arguments=[MemberReference(member=iFieldSeq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setupField, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] else begin[{] None end[}] return[member[.field]] end[}] END[}]
Keyword[public] identifier[BaseField] identifier[setupField] operator[SEP] Keyword[int] identifier[iFieldSeq] operator[SEP] { identifier[BaseField] identifier[field] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[0] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[ReportScreenRecord_ReportDate] operator[SEP] Keyword[this] , identifier[REPORT_DATE] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[1] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[ReportScreenRecord_ReportTime] operator[SEP] Keyword[this] , identifier[REPORT_TIME] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[2] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[ReportScreenRecord_ReportUserID] operator[SEP] Keyword[this] , identifier[REPORT_USER_ID] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[3] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[ShortField] operator[SEP] Keyword[this] , identifier[REPORT_PAGE] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Keyword[new] identifier[Short] operator[SEP] operator[SEP] Keyword[short] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[4] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[IntegerField] operator[SEP] Keyword[this] , identifier[REPORT_COUNT] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Keyword[new] identifier[Integer] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[5] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[CurrencyField] operator[SEP] Keyword[this] , identifier[REPORT_TOTAL] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Keyword[new] identifier[Double] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iFieldSeq] operator[==] Other[6] operator[SEP] identifier[field] operator[=] Keyword[new] identifier[IntegerField] operator[SEP] Keyword[this] , identifier[REPORT_KEY_AREA] , identifier[Constants] operator[SEP] identifier[DEFAULT_FIELD_LENGTH] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] identifier[field] operator[=] Keyword[super] operator[SEP] identifier[setupField] operator[SEP] identifier[iFieldSeq] operator[SEP] operator[SEP] Keyword[return] identifier[field] operator[SEP] }
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); for (ResourceRoot resourceRoot : DeploymentUtils.allResourceRoots(deploymentUnit)) { ResourceRootIndexer.indexResourceRoot(resourceRoot); } }
class class_name[name] begin[{] method[deploy, return_type[void], modifier[public], parameter[phaseContext]] begin[{] local_variable[type[DeploymentUnit], deploymentUnit] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourceRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexResourceRoot, postfix_operators=[], prefix_operators=[], qualifier=ResourceRootIndexer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=deploymentUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=allResourceRoots, postfix_operators=[], prefix_operators=[], qualifier=DeploymentUtils, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=resourceRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceRoot, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[deploy] operator[SEP] identifier[DeploymentPhaseContext] identifier[phaseContext] operator[SEP] Keyword[throws] identifier[DeploymentUnitProcessingException] { Keyword[final] identifier[DeploymentUnit] identifier[deploymentUnit] operator[=] identifier[phaseContext] operator[SEP] identifier[getDeploymentUnit] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ResourceRoot] identifier[resourceRoot] operator[:] identifier[DeploymentUtils] operator[SEP] identifier[allResourceRoots] operator[SEP] identifier[deploymentUnit] operator[SEP] operator[SEP] { identifier[ResourceRootIndexer] operator[SEP] identifier[indexResourceRoot] operator[SEP] identifier[resourceRoot] operator[SEP] operator[SEP] } }
public void download() { DataKeeperService service = DataKeeperUtils.getService(); setDocumentId(Integer.parseInt(FacesUtils.getRequest().getParameter("documentId"))); DocumentInfo document = service.findDocumentByDocumentId(getDocumentId()); final HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance() .getExternalContext().getResponse(); ServletOutputStream out = null; try { out = response.getOutputStream(); out.write(document.getData(), 0, 4096); } catch (IOException e) { } finally { if (out != null) { try { out.flush(); out.close(); } catch (IOException e) { } } } FacesContext.getCurrentInstance().responseComplete(); }
class class_name[name] begin[{] method[download, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[DataKeeperService], service] call[.setDocumentId, parameter[call[Integer.parseInt, parameter[call[FacesUtils.getRequest, parameter[]]]]]] local_variable[type[DocumentInfo], document] local_variable[type[HttpServletResponse], response] local_variable[type[ServletOutputStream], out] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getOutputStream, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=document, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4096)], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=out, 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=flush, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)]))], label=None, resources=None) call[FacesContext.getCurrentInstance, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[download] operator[SEP] operator[SEP] { identifier[DataKeeperService] identifier[service] operator[=] identifier[DataKeeperUtils] operator[SEP] identifier[getService] operator[SEP] operator[SEP] operator[SEP] identifier[setDocumentId] operator[SEP] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[FacesUtils] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] identifier[getParameter] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DocumentInfo] identifier[document] operator[=] identifier[service] operator[SEP] identifier[findDocumentByDocumentId] operator[SEP] identifier[getDocumentId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[HttpServletResponse] identifier[response] operator[=] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[FacesContext] operator[SEP] identifier[getCurrentInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getExternalContext] operator[SEP] operator[SEP] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] operator[SEP] identifier[ServletOutputStream] identifier[out] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[out] operator[=] identifier[response] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[document] operator[SEP] identifier[getData] operator[SEP] operator[SEP] , Other[0] , Other[4096] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { } Keyword[finally] { Keyword[if] operator[SEP] identifier[out] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { } } } identifier[FacesContext] operator[SEP] identifier[getCurrentInstance] operator[SEP] operator[SEP] operator[SEP] identifier[responseComplete] operator[SEP] operator[SEP] operator[SEP] }
JobSubmissionEventImpl.Builder getJobSubmissionBuilder(final Configuration driverConfiguration) throws InjectionException, IOException { final Injector injector = Tang.Factory.getTang().newInjector(driverConfiguration); final boolean preserveEvaluators = injector.getNamedInstance(ResourceManagerPreserveEvaluators.class); final int maxAppSubmissions = injector.getNamedInstance(MaxApplicationSubmissions.class); final JobSubmissionEventImpl.Builder jbuilder = JobSubmissionEventImpl.newBuilder() .setIdentifier(returnOrGenerateDriverId(injector.getNamedInstance(DriverIdentifier.class))) .setDriverMemory(injector.getNamedInstance(DriverMemory.class)) .setDriverCpuCores(injector.getNamedInstance(DriverCPUCores.class)) .setUserName(System.getProperty("user.name")) .setPreserveEvaluators(preserveEvaluators) .setMaxApplicationSubmissions(maxAppSubmissions) .setConfiguration(driverConfiguration); for (final String globalFileName : injector.getNamedInstance(JobGlobalFiles.class)) { LOG.log(Level.FINEST, "Adding global file: {0}", globalFileName); jbuilder.addGlobalFile(getFileResourceProto(globalFileName, FileType.PLAIN)); } for (final String globalLibraryName : injector.getNamedInstance(JobGlobalLibraries.class)) { LOG.log(Level.FINEST, "Adding global library: {0}", globalLibraryName); jbuilder.addGlobalFile(getFileResourceProto(globalLibraryName, FileType.LIB)); } for (final String localFileName : injector.getNamedInstance(DriverLocalFiles.class)) { LOG.log(Level.FINEST, "Adding local file: {0}", localFileName); jbuilder.addLocalFile(getFileResourceProto(localFileName, FileType.PLAIN)); } for (final String localLibraryName : injector.getNamedInstance(DriverLocalLibraries.class)) { LOG.log(Level.FINEST, "Adding local library: {0}", localLibraryName); jbuilder.addLocalFile(getFileResourceProto(localLibraryName, FileType.LIB)); } return jbuilder; }
class class_name[name] begin[{] method[getJobSubmissionBuilder, return_type[type[JobSubmissionEventImpl]], modifier[default], parameter[driverConfiguration]] begin[{] local_variable[type[Injector], injector] local_variable[type[boolean], preserveEvaluators] local_variable[type[int], maxAppSubmissions] local_variable[type[JobSubmissionEventImpl], jbuilder] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINEST, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Adding global file: {0}"), MemberReference(member=globalFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=globalFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PLAIN, postfix_operators=[], prefix_operators=[], qualifier=FileType, selectors=[])], member=getFileResourceProto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addGlobalFile, postfix_operators=[], prefix_operators=[], qualifier=jbuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JobGlobalFiles, sub_type=None))], member=getNamedInstance, postfix_operators=[], prefix_operators=[], qualifier=injector, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=globalFileName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINEST, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Adding global library: {0}"), MemberReference(member=globalLibraryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=globalLibraryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LIB, postfix_operators=[], prefix_operators=[], qualifier=FileType, selectors=[])], member=getFileResourceProto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addGlobalFile, postfix_operators=[], prefix_operators=[], qualifier=jbuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JobGlobalLibraries, sub_type=None))], member=getNamedInstance, postfix_operators=[], prefix_operators=[], qualifier=injector, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=globalLibraryName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINEST, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Adding local file: {0}"), MemberReference(member=localFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=localFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PLAIN, postfix_operators=[], prefix_operators=[], qualifier=FileType, selectors=[])], member=getFileResourceProto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addLocalFile, postfix_operators=[], prefix_operators=[], qualifier=jbuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DriverLocalFiles, sub_type=None))], member=getNamedInstance, postfix_operators=[], prefix_operators=[], qualifier=injector, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=localFileName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINEST, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Adding local library: {0}"), MemberReference(member=localLibraryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=localLibraryName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LIB, postfix_operators=[], prefix_operators=[], qualifier=FileType, selectors=[])], member=getFileResourceProto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addLocalFile, postfix_operators=[], prefix_operators=[], qualifier=jbuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DriverLocalLibraries, sub_type=None))], member=getNamedInstance, postfix_operators=[], prefix_operators=[], qualifier=injector, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=localLibraryName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.jbuilder]] end[}] END[}]
identifier[JobSubmissionEventImpl] operator[SEP] identifier[Builder] identifier[getJobSubmissionBuilder] operator[SEP] Keyword[final] identifier[Configuration] identifier[driverConfiguration] operator[SEP] Keyword[throws] identifier[InjectionException] , identifier[IOException] { Keyword[final] identifier[Injector] identifier[injector] operator[=] identifier[Tang] operator[SEP] identifier[Factory] operator[SEP] identifier[getTang] operator[SEP] operator[SEP] operator[SEP] identifier[newInjector] operator[SEP] identifier[driverConfiguration] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[preserveEvaluators] operator[=] identifier[injector] operator[SEP] identifier[getNamedInstance] operator[SEP] identifier[ResourceManagerPreserveEvaluators] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[maxAppSubmissions] operator[=] identifier[injector] operator[SEP] identifier[getNamedInstance] operator[SEP] identifier[MaxApplicationSubmissions] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[final] identifier[JobSubmissionEventImpl] operator[SEP] identifier[Builder] identifier[jbuilder] operator[=] identifier[JobSubmissionEventImpl] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setIdentifier] operator[SEP] identifier[returnOrGenerateDriverId] operator[SEP] identifier[injector] operator[SEP] identifier[getNamedInstance] operator[SEP] identifier[DriverIdentifier] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setDriverMemory] operator[SEP] identifier[injector] operator[SEP] identifier[getNamedInstance] operator[SEP] identifier[DriverMemory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[setDriverCpuCores] operator[SEP] identifier[injector] operator[SEP] identifier[getNamedInstance] operator[SEP] identifier[DriverCPUCores] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[setUserName] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[setPreserveEvaluators] operator[SEP] identifier[preserveEvaluators] operator[SEP] operator[SEP] identifier[setMaxApplicationSubmissions] operator[SEP] identifier[maxAppSubmissions] operator[SEP] operator[SEP] identifier[setConfiguration] operator[SEP] identifier[driverConfiguration] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[globalFileName] operator[:] identifier[injector] operator[SEP] identifier[getNamedInstance] operator[SEP] identifier[JobGlobalFiles] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] , identifier[globalFileName] operator[SEP] operator[SEP] identifier[jbuilder] operator[SEP] identifier[addGlobalFile] operator[SEP] identifier[getFileResourceProto] operator[SEP] identifier[globalFileName] , identifier[FileType] operator[SEP] identifier[PLAIN] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[globalLibraryName] operator[:] identifier[injector] operator[SEP] identifier[getNamedInstance] operator[SEP] identifier[JobGlobalLibraries] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] , identifier[globalLibraryName] operator[SEP] operator[SEP] identifier[jbuilder] operator[SEP] identifier[addGlobalFile] operator[SEP] identifier[getFileResourceProto] operator[SEP] identifier[globalLibraryName] , identifier[FileType] operator[SEP] identifier[LIB] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[localFileName] operator[:] identifier[injector] operator[SEP] identifier[getNamedInstance] operator[SEP] identifier[DriverLocalFiles] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] , identifier[localFileName] operator[SEP] operator[SEP] identifier[jbuilder] operator[SEP] identifier[addLocalFile] operator[SEP] identifier[getFileResourceProto] operator[SEP] identifier[localFileName] , identifier[FileType] operator[SEP] identifier[PLAIN] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[localLibraryName] operator[:] identifier[injector] operator[SEP] identifier[getNamedInstance] operator[SEP] identifier[DriverLocalLibraries] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] , literal[String] , identifier[localLibraryName] operator[SEP] operator[SEP] identifier[jbuilder] operator[SEP] identifier[addLocalFile] operator[SEP] identifier[getFileResourceProto] operator[SEP] identifier[localLibraryName] , identifier[FileType] operator[SEP] identifier[LIB] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[jbuilder] operator[SEP] }
protected final void resubmit() throws Interrupt { final String cid = engine.createUUID(); engine.registerCallbacks(this, WaitMode.ALL, 0, cid); Acknowledge ack = createCheckpointAcknowledge(); engine.notify(new Response<Object>(cid, null, null), ack); registerCheckpointAcknowledge(ack); updateLastWaitStackTrace(); }
class class_name[name] begin[{] method[resubmit, return_type[void], modifier[final protected], parameter[]] begin[{] local_variable[type[String], cid] call[engine.registerCallbacks, parameter[THIS[], member[WaitMode.ALL], literal[0], member[.cid]]] local_variable[type[Acknowledge], ack] call[engine.notify, parameter[ClassCreator(arguments=[MemberReference(member=cid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], 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=Object, sub_type=None))], dimensions=None, name=Response, sub_type=None)), member[.ack]]] call[.registerCheckpointAcknowledge, parameter[member[.ack]]] call[.updateLastWaitStackTrace, parameter[]] end[}] END[}]
Keyword[protected] Keyword[final] Keyword[void] identifier[resubmit] operator[SEP] operator[SEP] Keyword[throws] identifier[Interrupt] { Keyword[final] identifier[String] identifier[cid] operator[=] identifier[engine] operator[SEP] identifier[createUUID] operator[SEP] operator[SEP] operator[SEP] identifier[engine] operator[SEP] identifier[registerCallbacks] operator[SEP] Keyword[this] , identifier[WaitMode] operator[SEP] identifier[ALL] , Other[0] , identifier[cid] operator[SEP] operator[SEP] identifier[Acknowledge] identifier[ack] operator[=] identifier[createCheckpointAcknowledge] operator[SEP] operator[SEP] operator[SEP] identifier[engine] operator[SEP] identifier[notify] operator[SEP] Keyword[new] identifier[Response] operator[<] identifier[Object] operator[>] operator[SEP] identifier[cid] , Other[null] , Other[null] operator[SEP] , identifier[ack] operator[SEP] operator[SEP] identifier[registerCheckpointAcknowledge] operator[SEP] identifier[ack] operator[SEP] operator[SEP] identifier[updateLastWaitStackTrace] operator[SEP] operator[SEP] operator[SEP] }
public static String datetimeToCustomString(Date datetime, String formatWay) { return datetimeToCustomString(new SimpleDateFormat(formatWay), datetime); }
class class_name[name] begin[{] method[datetimeToCustomString, return_type[type[String]], modifier[public static], parameter[datetime, formatWay]] begin[{] return[call[.datetimeToCustomString, parameter[ClassCreator(arguments=[MemberReference(member=formatWay, 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=SimpleDateFormat, sub_type=None)), member[.datetime]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[datetimeToCustomString] operator[SEP] identifier[Date] identifier[datetime] , identifier[String] identifier[formatWay] operator[SEP] { Keyword[return] identifier[datetimeToCustomString] operator[SEP] Keyword[new] identifier[SimpleDateFormat] operator[SEP] identifier[formatWay] operator[SEP] , identifier[datetime] operator[SEP] operator[SEP] }
boolean remove(K key, long value) { AtomicLong atomic = map.get(key); if (atomic == null) { return false; } long oldValue = atomic.get(); if (oldValue != value) { return false; } if (oldValue == 0L || atomic.compareAndSet(oldValue, 0L)) { // only remove after setting to zero, to avoid concurrent updates map.remove(key, atomic); // succeed even if the remove fails, since the value was already adjusted return true; } // value changed return false; }
class class_name[name] begin[{] method[remove, return_type[type[boolean]], modifier[default], parameter[key, value]] begin[{] local_variable[type[AtomicLong], atomic] if[binary_operation[member[.atomic], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[long], oldValue] if[binary_operation[member[.oldValue], !=, member[.value]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.oldValue], ==, literal[0L]], ||, call[atomic.compareAndSet, parameter[member[.oldValue], literal[0L]]]]] begin[{] call[map.remove, parameter[member[.key], member[.atomic]]] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[boolean] identifier[remove] operator[SEP] identifier[K] identifier[key] , Keyword[long] identifier[value] operator[SEP] { identifier[AtomicLong] identifier[atomic] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[atomic] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[long] identifier[oldValue] operator[=] identifier[atomic] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldValue] operator[!=] identifier[value] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[oldValue] operator[==] Other[0L] operator[||] identifier[atomic] operator[SEP] identifier[compareAndSet] operator[SEP] identifier[oldValue] , Other[0L] operator[SEP] operator[SEP] { identifier[map] operator[SEP] identifier[remove] operator[SEP] identifier[key] , identifier[atomic] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
static void logE(String eventKey, String msg) { Log.e(TAG, toLogStr(eventKey, msg)); }
class class_name[name] begin[{] method[logE, return_type[void], modifier[static], parameter[eventKey, msg]] begin[{] call[Log.e, parameter[member[.TAG], call[.toLogStr, parameter[member[.eventKey], member[.msg]]]]] end[}] END[}]
Keyword[static] Keyword[void] identifier[logE] operator[SEP] identifier[String] identifier[eventKey] , identifier[String] identifier[msg] operator[SEP] { identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[TAG] , identifier[toLogStr] operator[SEP] identifier[eventKey] , identifier[msg] operator[SEP] operator[SEP] operator[SEP] }
public void add(int index, Object element) { if (index == size()) { add(element); //Add to the end of this. } //If index > size() an exception should be thrown with a slightly //different message than the exception thrown by getInternal. else if (index > size()) { throw new IndexOutOfBoundsException("Index out of bounds: " + index + " > " + size()); } else { Node current = getInternal(index); Node newNext = new Node(current.data, current.next); current.data = element; current.next = newNext; elementCount++; //If they inserted at the last valid index, then a new last element //was created, therfore update the last pointer if (last == current) { last = newNext; } } }
class class_name[name] begin[{] method[add, return_type[void], modifier[public], parameter[index, element]] begin[{] if[binary_operation[member[.index], ==, call[.size, parameter[]]]] begin[{] call[.add, parameter[member[.element]]] else begin[{] if[binary_operation[member[.index], >, call[.size, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Index out of bounds: "), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" > "), operator=+), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None) else begin[{] local_variable[type[Node], current] local_variable[type[Node], newNext] assign[member[current.data], member[.element]] assign[member[current.next], member[.newNext]] member[.elementCount] if[binary_operation[member[.last], ==, member[.current]]] begin[{] assign[member[.last], member[.newNext]] else begin[{] None end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[add] operator[SEP] Keyword[int] identifier[index] , identifier[Object] identifier[element] operator[SEP] { Keyword[if] operator[SEP] identifier[index] operator[==] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[add] operator[SEP] identifier[element] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[index] operator[>] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] literal[String] operator[+] identifier[index] operator[+] literal[String] operator[+] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[Node] identifier[current] operator[=] identifier[getInternal] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[Node] identifier[newNext] operator[=] Keyword[new] identifier[Node] operator[SEP] identifier[current] operator[SEP] identifier[data] , identifier[current] operator[SEP] identifier[next] operator[SEP] operator[SEP] identifier[current] operator[SEP] identifier[data] operator[=] identifier[element] operator[SEP] identifier[current] operator[SEP] identifier[next] operator[=] identifier[newNext] operator[SEP] identifier[elementCount] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[last] operator[==] identifier[current] operator[SEP] { identifier[last] operator[=] identifier[newNext] operator[SEP] } } }
public boolean printData(PrintWriter out, int iHtmlAttributes) { boolean bFieldsFound = false; Record recMenu = ((BaseMenuScreen)this.getScreenField()).getMainRecord(); String strCellFormat = this.getHtmlString(recMenu); XMLParser parser = ((BaseMenuScreen)this.getScreenField()).getXMLParser(recMenu); parser.parseHtmlData(out, strCellFormat); parser.free(); parser = null; return bFieldsFound; }
class class_name[name] begin[{] method[printData, return_type[type[boolean]], modifier[public], parameter[out, iHtmlAttributes]] begin[{] local_variable[type[boolean], bFieldsFound] local_variable[type[Record], recMenu] local_variable[type[String], strCellFormat] local_variable[type[XMLParser], parser] call[parser.parseHtmlData, parameter[member[.out], member[.strCellFormat]]] call[parser.free, parameter[]] assign[member[.parser], literal[null]] return[member[.bFieldsFound]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[printData] operator[SEP] identifier[PrintWriter] identifier[out] , Keyword[int] identifier[iHtmlAttributes] operator[SEP] { Keyword[boolean] identifier[bFieldsFound] operator[=] literal[boolean] operator[SEP] identifier[Record] identifier[recMenu] operator[=] operator[SEP] operator[SEP] identifier[BaseMenuScreen] operator[SEP] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[strCellFormat] operator[=] Keyword[this] operator[SEP] identifier[getHtmlString] operator[SEP] identifier[recMenu] operator[SEP] operator[SEP] identifier[XMLParser] identifier[parser] operator[=] operator[SEP] operator[SEP] identifier[BaseMenuScreen] operator[SEP] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getXMLParser] operator[SEP] identifier[recMenu] operator[SEP] operator[SEP] identifier[parser] operator[SEP] identifier[parseHtmlData] operator[SEP] identifier[out] , identifier[strCellFormat] operator[SEP] operator[SEP] identifier[parser] operator[SEP] identifier[free] operator[SEP] operator[SEP] operator[SEP] identifier[parser] operator[=] Other[null] operator[SEP] Keyword[return] identifier[bFieldsFound] operator[SEP] }
private void sendAction(Context context, String action) { Intent intent = new Intent(context, PlaybackService.class); intent.setAction(action); LocalBroadcastManager.getInstance(context).sendBroadcast(intent); }
class class_name[name] begin[{] method[sendAction, return_type[void], modifier[private], parameter[context, action]] begin[{] local_variable[type[Intent], intent] call[intent.setAction, parameter[member[.action]]] call[LocalBroadcastManager.getInstance, parameter[member[.context]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[sendAction] operator[SEP] identifier[Context] identifier[context] , identifier[String] identifier[action] operator[SEP] { identifier[Intent] identifier[intent] operator[=] Keyword[new] identifier[Intent] operator[SEP] identifier[context] , identifier[PlaybackService] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[intent] operator[SEP] identifier[setAction] operator[SEP] identifier[action] operator[SEP] operator[SEP] identifier[LocalBroadcastManager] operator[SEP] identifier[getInstance] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[sendBroadcast] operator[SEP] identifier[intent] operator[SEP] operator[SEP] }
static <E extends Entity> String getSqlSort(EntityType entityType, Query<E> q) { StringBuilder sortSql = new StringBuilder(); // https://www.postgresql.org/docs/9.6/static/queries-limit.html // When using LIMIT, it is important to use an ORDER BY clause that constrains the result rows // into a unique order. // Otherwise you will get an unpredictable subset of the query's rows. You might be asking for // the tenth through twentieth rows, // but tenth through twentieth in what ordering? The ordering is unknown, unless you specified // ORDER BY. Sort sort; if (q.getSort() != null && !hasUniqueSortAttribute(entityType, q.getSort())) { LOG.debug("Query with sort without unique attribute detected: {}", q); sort = new Sort(q.getSort()); sort.on(entityType.getIdAttribute().getName()); } else if (q.getSort() == null) { LOG.debug("Query without sort detected: {}", q); sort = new Sort(entityType.getIdAttribute().getName()); } else { sort = q.getSort(); } for (Sort.Order o : sort) { Attribute attr = entityType.getAttribute(o.getAttr()); sortSql.append(", ").append(getColumnName(attr)); if (o.getDirection().equals(Sort.Direction.DESC)) { sortSql.append(" DESC"); } else { sortSql.append(" ASC"); } } if (sortSql.length() > 0) { sortSql = new StringBuilder("ORDER BY ").append(sortSql.substring(2)); } return sortSql.toString(); }
class class_name[name] begin[{] method[getSqlSort, return_type[type[String]], modifier[static], parameter[entityType, q]] begin[{] local_variable[type[StringBuilder], sortSql] local_variable[type[Sort], sort] if[binary_operation[binary_operation[call[q.getSort, parameter[]], !=, literal[null]], &&, call[.hasUniqueSortAttribute, parameter[member[.entityType], call[q.getSort, parameter[]]]]]] begin[{] call[LOG.debug, parameter[literal["Query with sort without unique attribute detected: {}"], member[.q]]] assign[member[.sort], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getSort, postfix_operators=[], prefix_operators=[], qualifier=q, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Sort, sub_type=None))] call[sort.on, parameter[call[entityType.getIdAttribute, parameter[]]]] else begin[{] if[binary_operation[call[q.getSort, parameter[]], ==, literal[null]]] begin[{] call[LOG.debug, parameter[literal["Query without sort detected: {}"], member[.q]]] assign[member[.sort], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getIdAttribute, postfix_operators=[], prefix_operators=[], qualifier=entityType, selectors=[MethodInvocation(arguments=[], member=getName, 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=Sort, sub_type=None))] else begin[{] assign[member[.sort], call[q.getSort, parameter[]]] end[}] end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAttr, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[], type_arguments=None)], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=entityType, selectors=[], type_arguments=None), name=attr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sortSql, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=attr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getDirection, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[MethodInvocation(arguments=[MemberReference(member=DESC, postfix_operators=[], prefix_operators=[], qualifier=Sort.Direction, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ASC")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sortSql, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" DESC")], member=append, postfix_operators=[], prefix_operators=[], qualifier=sortSql, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=sort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Sort, sub_type=ReferenceType(arguments=None, dimensions=None, name=Order, sub_type=None)))), label=None) if[binary_operation[call[sortSql.length, parameter[]], >, literal[0]]] begin[{] assign[member[.sortSql], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ORDER BY ")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=sortSql, selectors=[], type_arguments=None)], 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))] else begin[{] None end[}] return[call[sortSql.toString, parameter[]]] end[}] END[}]
Keyword[static] operator[<] identifier[E] Keyword[extends] identifier[Entity] operator[>] identifier[String] identifier[getSqlSort] operator[SEP] identifier[EntityType] identifier[entityType] , identifier[Query] operator[<] identifier[E] operator[>] identifier[q] operator[SEP] { identifier[StringBuilder] identifier[sortSql] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[Sort] identifier[sort] operator[SEP] Keyword[if] operator[SEP] identifier[q] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] identifier[hasUniqueSortAttribute] operator[SEP] identifier[entityType] , identifier[q] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[q] operator[SEP] operator[SEP] identifier[sort] operator[=] Keyword[new] identifier[Sort] operator[SEP] identifier[q] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sort] operator[SEP] identifier[on] operator[SEP] identifier[entityType] operator[SEP] identifier[getIdAttribute] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[q] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[q] operator[SEP] operator[SEP] identifier[sort] operator[=] Keyword[new] identifier[Sort] operator[SEP] identifier[entityType] operator[SEP] identifier[getIdAttribute] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[sort] operator[=] identifier[q] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Sort] operator[SEP] identifier[Order] identifier[o] operator[:] identifier[sort] operator[SEP] { identifier[Attribute] identifier[attr] operator[=] identifier[entityType] operator[SEP] identifier[getAttribute] operator[SEP] identifier[o] operator[SEP] identifier[getAttr] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sortSql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getColumnName] operator[SEP] identifier[attr] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[SEP] identifier[getDirection] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[Sort] operator[SEP] identifier[Direction] operator[SEP] identifier[DESC] operator[SEP] operator[SEP] { identifier[sortSql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[sortSql] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[sortSql] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[sortSql] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[sortSql] operator[SEP] identifier[substring] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[sortSql] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public Legislators searchByStateTerm( String state, String term ) throws OpenStatesException { return api.query( new MethodMap("legislators"), new ArgMap( "state", state, "term", term ), Legislators.class ); }
class class_name[name] begin[{] method[searchByStateTerm, return_type[type[Legislators]], modifier[public], parameter[state, term]] begin[{] return[call[api.query, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="legislators")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MethodMap, sub_type=None)), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="state"), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="term"), MemberReference(member=term, 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=ArgMap, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Legislators, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Legislators] identifier[searchByStateTerm] operator[SEP] identifier[String] identifier[state] , identifier[String] identifier[term] operator[SEP] Keyword[throws] identifier[OpenStatesException] { Keyword[return] identifier[api] operator[SEP] identifier[query] operator[SEP] Keyword[new] identifier[MethodMap] operator[SEP] literal[String] operator[SEP] , Keyword[new] identifier[ArgMap] operator[SEP] literal[String] , identifier[state] , literal[String] , identifier[term] operator[SEP] , identifier[Legislators] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public static String slurpFileNoExceptions(String filename) { try { return slurpFile(filename); } catch (Exception e) { e.printStackTrace(); return null; } }
class class_name[name] begin[{] method[slurpFileNoExceptions, return_type[type[String]], modifier[public static], parameter[filename]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=filename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=slurpFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[slurpFileNoExceptions] operator[SEP] identifier[String] identifier[filename] operator[SEP] { Keyword[try] { Keyword[return] identifier[slurpFile] operator[SEP] identifier[filename] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public Type.Callable selectLambda(Type target, Expr expr, Environment environment) { Type.Callable type = asType(expr.getType(), Type.Callable.class); // Construct the default case for matching against any Type.Callable anyType = new Type.Function(type.getParameters(), TUPLE_ANY); // Create the filter itself AbstractTypeFilter<Type.Callable> filter = new AbstractTypeFilter<>(Type.Callable.class, anyType); // return selectCandidate(filter.apply(target), type, environment); }
class class_name[name] begin[{] method[selectLambda, return_type[type[Type]], modifier[public], parameter[target, expr, environment]] begin[{] local_variable[type[Type], type] local_variable[type[Type], anyType] local_variable[type[AbstractTypeFilter], filter] return[call[.selectCandidate, parameter[call[filter.apply, parameter[member[.target]]], member[.type], member[.environment]]]] end[}] END[}]
Keyword[public] identifier[Type] operator[SEP] identifier[Callable] identifier[selectLambda] operator[SEP] identifier[Type] identifier[target] , identifier[Expr] identifier[expr] , identifier[Environment] identifier[environment] operator[SEP] { identifier[Type] operator[SEP] identifier[Callable] identifier[type] operator[=] identifier[asType] operator[SEP] identifier[expr] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[Type] operator[SEP] identifier[Callable] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Type] operator[SEP] identifier[Callable] identifier[anyType] operator[=] Keyword[new] identifier[Type] operator[SEP] identifier[Function] operator[SEP] identifier[type] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] , identifier[TUPLE_ANY] operator[SEP] operator[SEP] identifier[AbstractTypeFilter] operator[<] identifier[Type] operator[SEP] identifier[Callable] operator[>] identifier[filter] operator[=] Keyword[new] identifier[AbstractTypeFilter] operator[<] operator[>] operator[SEP] identifier[Type] operator[SEP] identifier[Callable] operator[SEP] Keyword[class] , identifier[anyType] operator[SEP] operator[SEP] Keyword[return] identifier[selectCandidate] operator[SEP] identifier[filter] operator[SEP] identifier[apply] operator[SEP] identifier[target] operator[SEP] , identifier[type] , identifier[environment] operator[SEP] operator[SEP] }
public void dereferenceSubscriptionConsumerDispatcher( ConsumerDispatcher cd, boolean isNonDurable, boolean callProxyCode) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "dereferenceSubscriptionConsumerDispatcher", new Object[] { cd, new Boolean(isNonDurable), new Boolean(callProxyCode) }); try { _subscriptionIndex.remove(cd); // Remove all entries for the consumerDispatcher from the matchspace SelectionCriteria[] selCriteria = cd.getConsumerDispatcherState().getSelectionCriteriaList(); if (selCriteria != null) { for (int i = 0; i < selCriteria.length; i++) { // Remove the CD from the MatchSpace _messageProcessor .getMessageProcessorMatching() .removeConsumerDispatcherMatchTarget(cd, selCriteria[i]); } } // 166833.2 // Calls to the proxy code only need to occur on a non durable delete // subscription, or a createDurableSubscription rolled back. // It won't be called in the case that a durableSubscription. // eventCommittedRemove as the proxy message will have already been sent. //716917 //isNonDurable was passed insted of callProxyCode //Due to which always false was being passed when we had durable subscriber, hence //the unsubscribe events was not being sent to neighbouring ME's when durable subscriber was unsubscribed //Its an Fix to 166833.2 // sanjay liberty change // if (callProxyCode) // _messageProcessor.getProxyHandler().unsubscribeEvent( // cd.getConsumerDispatcherState(), // null, // callProxyCode); // // // 175488 if (isNonDurable) { // Need to attempt cleanup of the subscription. If it cant be completed // now, it will be attempted by the asynch-deletion thread at a later // time. try { //remove the CD from ME wide hash map maintained for non durable shared consumers in Destination Manager. // All non-durable shared consumer's subscriberID do not start with _NON_DURABLE_NON_SHARED if (!(cd.getConsumerDispatcherState().getSubscriberID().contains("_NON_DURABLE_NON_SHARED"))) _destinationManager.getNondurableSharedSubscriptions().remove(cd.getConsumerDispatcherState().getSubscriberID()); // Find the subscription in the topicspace itemstream final SubscriptionItemStream subscription = ( SubscriptionItemStream) _pubsubMessageItemStream .findFirstMatchingReferenceStream( new SubscriptionFilter(cd)); // Remove any items on the subscription reference stream, and remove the stream itself if (subscription != null) { //Mark the subscription as requiring deletion subscription.markAsToBeDeleted(); //Drive the deletion of the subscription now. It may not be possible to //complete it now if there are indoubt messages on the subscription, in //which case the commit/backout of those messages will drive the delete. subscription.deleteIfPossible(true); } } catch (MessageStoreException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.dereferenceSubscriptionConsumerDispatcher", "1:1835:1.35.2.4", this); SibTr.exception(tc, e); SibTr.error( tc, "INTERNAL_MESSAGING_ERROR_CWSIP0003", new Object[] { "com.ibm.ws.sib.processor.impl.destination.PubSubRealization", "1:1844:1.35.2.4", e, cd.getConsumerDispatcherState().getSubscriberID() }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "dereferenceSubscriptionConsumerDispatcher"); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0003", new Object[] { "com.ibm.ws.sib.processor.impl.destination.PubSubRealization", "1:1856:1.35.2.4", e, cd.getConsumerDispatcherState().getSubscriberID() }, null), e); } } // end of 175488 } catch (SIException e) { // Exceptions should not be thrown by proxy handler code FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.dereferenceSubscriptionConsumerDispatcher", "1:1869:1.35.2.4", this); SibTr.exception(tc, e); SibTr.error( tc, "INTERNAL_MESSAGING_ERROR_CWSIP0003", new Object[] { "com.ibm.ws.sib.processor.impl.destination.PubSubRealization", "1:1878:1.35.2.4", e, cd.getConsumerDispatcherState().getSubscriberID() }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "dereferenceSubscriptionConsumerDispatcher"); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0003", new Object[] { "com.ibm.ws.sib.processor.impl.destination.PubSubRealization", "1:1890:1.35.2.4", e, cd.getConsumerDispatcherState().getSubscriberID() }, null), e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "dereferenceSubscriptionConsumerDispatcher"); }
class class_name[name] begin[{] method[dereferenceSubscriptionConsumerDispatcher, return_type[void], modifier[public], parameter[cd, isNonDurable, callProxyCode]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["dereferenceSubscriptionConsumerDispatcher"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=cd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=isNonDurable, 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=Boolean, sub_type=None)), ClassCreator(arguments=[MemberReference(member=callProxyCode, 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=Boolean, sub_type=None))]), 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=[MemberReference(member=cd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=_subscriptionIndex, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getConsumerDispatcherState, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[MethodInvocation(arguments=[], member=getSelectionCriteriaList, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=selCriteria)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=SelectionCriteria, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=selCriteria, 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=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getMessageProcessorMatching, postfix_operators=[], prefix_operators=[], qualifier=_messageProcessor, selectors=[MethodInvocation(arguments=[MemberReference(member=cd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=selCriteria, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=removeConsumerDispatcherMatchTarget, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=selCriteria, 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)])), IfStatement(condition=MemberReference(member=isNonDurable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=getConsumerDispatcherState, postfix_operators=[], prefix_operators=['!'], qualifier=cd, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=getNondurableSharedSubscriptions, postfix_operators=[], prefix_operators=[], qualifier=_destinationManager, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConsumerDispatcherState, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[MethodInvocation(arguments=[], member=getSubscriberID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=cd, 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=SubscriptionFilter, sub_type=None))], member=findFirstMatchingReferenceStream, postfix_operators=[], prefix_operators=[], qualifier=_pubsubMessageItemStream, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SubscriptionItemStream, sub_type=None)), name=subscription)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SubscriptionItemStream, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=subscription, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=markAsToBeDeleted, postfix_operators=[], prefix_operators=[], qualifier=subscription, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=deleteIfPossible, postfix_operators=[], prefix_operators=[], qualifier=subscription, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.destination.PubSubRealization.dereferenceSubscriptionConsumerDispatcher"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:1835:1.35.2.4"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], 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=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=SibTr, 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="INTERNAL_MESSAGING_ERROR_CWSIP0003"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.destination.PubSubRealization"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:1844:1.35.2.4"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getConsumerDispatcherState, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[MethodInvocation(arguments=[], member=getSubscriberID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=SibTr, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dereferenceSubscriptionConsumerDispatcher")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTERNAL_MESSAGING_ERROR_CWSIP0003"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.destination.PubSubRealization"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:1856:1.35.2.4"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getConsumerDispatcherState, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[MethodInvocation(arguments=[], member=getSubscriberID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIResourceException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MessageStoreException']))], finally_block=None, label=None, resources=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.destination.PubSubRealization.dereferenceSubscriptionConsumerDispatcher"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:1869:1.35.2.4"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], 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=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exception, postfix_operators=[], prefix_operators=[], qualifier=SibTr, 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="INTERNAL_MESSAGING_ERROR_CWSIP0003"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.destination.PubSubRealization"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:1878:1.35.2.4"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getConsumerDispatcherState, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[MethodInvocation(arguments=[], member=getSubscriberID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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=SibTr, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dereferenceSubscriptionConsumerDispatcher")], member=exit, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INTERNAL_MESSAGING_ERROR_CWSIP0003"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.sib.processor.impl.destination.PubSubRealization"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:1890:1.35.2.4"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getConsumerDispatcherState, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[MethodInvocation(arguments=[], member=getSubscriberID, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getFormattedMessage, postfix_operators=[], prefix_operators=[], qualifier=nls, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SIResourceException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SIException']))], finally_block=None, label=None, resources=None) if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["dereferenceSubscriptionConsumerDispatcher"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[dereferenceSubscriptionConsumerDispatcher] operator[SEP] identifier[ConsumerDispatcher] identifier[cd] , Keyword[boolean] identifier[isNonDurable] , Keyword[boolean] identifier[callProxyCode] operator[SEP] Keyword[throws] 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[cd] , Keyword[new] identifier[Boolean] operator[SEP] identifier[isNonDurable] operator[SEP] , Keyword[new] identifier[Boolean] operator[SEP] identifier[callProxyCode] operator[SEP] } operator[SEP] operator[SEP] Keyword[try] { identifier[_subscriptionIndex] operator[SEP] identifier[remove] operator[SEP] identifier[cd] operator[SEP] operator[SEP] identifier[SelectionCriteria] operator[SEP] operator[SEP] identifier[selCriteria] operator[=] identifier[cd] operator[SEP] identifier[getConsumerDispatcherState] operator[SEP] operator[SEP] operator[SEP] identifier[getSelectionCriteriaList] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selCriteria] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[selCriteria] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[_messageProcessor] operator[SEP] identifier[getMessageProcessorMatching] operator[SEP] operator[SEP] operator[SEP] identifier[removeConsumerDispatcherMatchTarget] operator[SEP] identifier[cd] , identifier[selCriteria] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[isNonDurable] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[cd] operator[SEP] identifier[getConsumerDispatcherState] operator[SEP] operator[SEP] operator[SEP] identifier[getSubscriberID] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[_destinationManager] operator[SEP] identifier[getNondurableSharedSubscriptions] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[cd] operator[SEP] identifier[getConsumerDispatcherState] operator[SEP] operator[SEP] operator[SEP] identifier[getSubscriberID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[SubscriptionItemStream] identifier[subscription] operator[=] operator[SEP] identifier[SubscriptionItemStream] operator[SEP] identifier[_pubsubMessageItemStream] operator[SEP] identifier[findFirstMatchingReferenceStream] operator[SEP] Keyword[new] identifier[SubscriptionFilter] operator[SEP] identifier[cd] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[subscription] operator[!=] Other[null] operator[SEP] { identifier[subscription] operator[SEP] identifier[markAsToBeDeleted] operator[SEP] operator[SEP] operator[SEP] identifier[subscription] operator[SEP] identifier[deleteIfPossible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[MessageStoreException] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] , literal[String] , identifier[e] , identifier[cd] operator[SEP] identifier[getConsumerDispatcherState] operator[SEP] operator[SEP] operator[SEP] identifier[getSubscriberID] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SIResourceException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] , literal[String] , identifier[e] , identifier[cd] operator[SEP] identifier[getConsumerDispatcherState] operator[SEP] operator[SEP] operator[SEP] identifier[getSubscriberID] operator[SEP] operator[SEP] } , Other[null] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[SIException] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exception] operator[SEP] identifier[tc] , identifier[e] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] , literal[String] , identifier[e] , identifier[cd] operator[SEP] identifier[getConsumerDispatcherState] operator[SEP] operator[SEP] operator[SEP] identifier[getSubscriberID] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[SIResourceException] operator[SEP] identifier[nls] operator[SEP] identifier[getFormattedMessage] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] , literal[String] , identifier[e] , identifier[cd] operator[SEP] identifier[getConsumerDispatcherState] operator[SEP] operator[SEP] operator[SEP] identifier[getSubscriberID] operator[SEP] operator[SEP] } , Other[null] operator[SEP] , identifier[e] 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] }
@SuppressWarnings("unchecked") public Specification createSpecification(Specification specification, String identifier) throws GreenPepperServerException { Vector params = CollectionUtil.toVector(specification.marshallize()); log.debug("Creating Specification: " + specification.getName()); Vector<Object> specificationParams = (Vector<Object>)execute(XmlRpcMethodName.createSpecification, params, identifier); return XmlRpcDataMarshaller.toSpecification(specificationParams); }
class class_name[name] begin[{] method[createSpecification, return_type[type[Specification]], modifier[public], parameter[specification, identifier]] begin[{] local_variable[type[Vector], params] call[log.debug, parameter[binary_operation[literal["Creating Specification: "], +, call[specification.getName, parameter[]]]]] local_variable[type[Vector], specificationParams] return[call[XmlRpcDataMarshaller.toSpecification, parameter[member[.specificationParams]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Specification] identifier[createSpecification] operator[SEP] identifier[Specification] identifier[specification] , identifier[String] identifier[identifier] operator[SEP] Keyword[throws] identifier[GreenPepperServerException] { identifier[Vector] identifier[params] operator[=] identifier[CollectionUtil] operator[SEP] identifier[toVector] operator[SEP] identifier[specification] operator[SEP] identifier[marshallize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[specification] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Vector] operator[<] identifier[Object] operator[>] identifier[specificationParams] operator[=] operator[SEP] identifier[Vector] operator[<] identifier[Object] operator[>] operator[SEP] identifier[execute] operator[SEP] identifier[XmlRpcMethodName] operator[SEP] identifier[createSpecification] , identifier[params] , identifier[identifier] operator[SEP] operator[SEP] Keyword[return] identifier[XmlRpcDataMarshaller] operator[SEP] identifier[toSpecification] operator[SEP] identifier[specificationParams] operator[SEP] operator[SEP] }
@Override public int compareTo(EigenPair o) { if(this.eigenvalue < o.eigenvalue) { return -1; } if(this.eigenvalue > o.eigenvalue) { return +1; } return 0; }
class class_name[name] begin[{] method[compareTo, return_type[type[int]], modifier[public], parameter[o]] begin[{] if[binary_operation[THIS[member[None.eigenvalue]], <, member[o.eigenvalue]]] begin[{] return[literal[1]] else begin[{] None end[}] if[binary_operation[THIS[member[None.eigenvalue]], >, member[o.eigenvalue]]] begin[{] return[literal[1]] else begin[{] None end[}] return[literal[0]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compareTo] operator[SEP] identifier[EigenPair] identifier[o] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[eigenvalue] operator[<] identifier[o] operator[SEP] identifier[eigenvalue] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[eigenvalue] operator[>] identifier[o] operator[SEP] identifier[eigenvalue] operator[SEP] { Keyword[return] operator[+] Other[1] operator[SEP] } Keyword[return] Other[0] operator[SEP] }
public static byte[] serialize(Object obj) { return org.apache.heron.api.utils.Utils.serialize(obj); }
class class_name[name] begin[{] method[serialize, return_type[type[byte]], modifier[public static], parameter[obj]] begin[{] return[call[org.apache.heron.api.utils.Utils.serialize, parameter[member[.obj]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[serialize] operator[SEP] identifier[Object] identifier[obj] operator[SEP] { Keyword[return] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[heron] operator[SEP] identifier[api] operator[SEP] identifier[utils] operator[SEP] identifier[Utils] operator[SEP] identifier[serialize] operator[SEP] identifier[obj] operator[SEP] operator[SEP] }
public IndexedSet<T> involvedTransactions() { IndexedSet<T> res = allTransactions.empty(); res.indices().addAll(matrix.involvedRows()); return res; }
class class_name[name] begin[{] method[involvedTransactions, return_type[type[IndexedSet]], modifier[public], parameter[]] begin[{] local_variable[type[IndexedSet], res] call[res.indices, parameter[]] return[member[.res]] end[}] END[}]
Keyword[public] identifier[IndexedSet] operator[<] identifier[T] operator[>] identifier[involvedTransactions] operator[SEP] operator[SEP] { identifier[IndexedSet] operator[<] identifier[T] operator[>] identifier[res] operator[=] identifier[allTransactions] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[indices] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] identifier[matrix] operator[SEP] identifier[involvedRows] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[res] operator[SEP] }
public PubsubFuture<List<ReceivedMessage>> pull(final String project, final String subscription) { return pull(project, subscription, DEFAULT_PULL_RETURN_IMMEDIATELY, DEFAULT_PULL_MAX_MESSAGES); }
class class_name[name] begin[{] method[pull, return_type[type[PubsubFuture]], modifier[public], parameter[project, subscription]] begin[{] return[call[.pull, parameter[member[.project], member[.subscription], member[.DEFAULT_PULL_RETURN_IMMEDIATELY], member[.DEFAULT_PULL_MAX_MESSAGES]]]] end[}] END[}]
Keyword[public] identifier[PubsubFuture] operator[<] identifier[List] operator[<] identifier[ReceivedMessage] operator[>] operator[>] identifier[pull] operator[SEP] Keyword[final] identifier[String] identifier[project] , Keyword[final] identifier[String] identifier[subscription] operator[SEP] { Keyword[return] identifier[pull] operator[SEP] identifier[project] , identifier[subscription] , identifier[DEFAULT_PULL_RETURN_IMMEDIATELY] , identifier[DEFAULT_PULL_MAX_MESSAGES] operator[SEP] operator[SEP] }
public ApiResponse<List<CharacterAssetsNamesResponse>> postCharactersCharacterIdAssetsNamesWithHttpInfo( Integer characterId, List<Long> requestBody, String datasource, String token) throws ApiException { com.squareup.okhttp.Call call = postCharactersCharacterIdAssetsNamesValidateBeforeCall(characterId, requestBody, datasource, token, null); Type localVarReturnType = new TypeToken<List<CharacterAssetsNamesResponse>>() { }.getType(); return apiClient.execute(call, localVarReturnType); }
class class_name[name] begin[{] method[postCharactersCharacterIdAssetsNamesWithHttpInfo, return_type[type[ApiResponse]], modifier[public], parameter[characterId, requestBody, datasource, token]] begin[{] local_variable[type[com], call] local_variable[type[Type], localVarReturnType] return[call[apiClient.execute, parameter[member[.call], member[.localVarReturnType]]]] end[}] END[}]
Keyword[public] identifier[ApiResponse] operator[<] identifier[List] operator[<] identifier[CharacterAssetsNamesResponse] operator[>] operator[>] identifier[postCharactersCharacterIdAssetsNamesWithHttpInfo] operator[SEP] identifier[Integer] identifier[characterId] , identifier[List] operator[<] identifier[Long] operator[>] identifier[requestBody] , identifier[String] identifier[datasource] , identifier[String] identifier[token] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[postCharactersCharacterIdAssetsNamesValidateBeforeCall] operator[SEP] identifier[characterId] , identifier[requestBody] , identifier[datasource] , identifier[token] , Other[null] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[List] operator[<] identifier[CharacterAssetsNamesResponse] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[apiClient] operator[SEP] identifier[execute] operator[SEP] identifier[call] , identifier[localVarReturnType] operator[SEP] operator[SEP] }
public Pattern<T, F> times(int from, int to) { checkIfNoNotPattern(); checkIfQuantifierApplied(); this.quantifier = Quantifier.times(quantifier.getConsumingStrategy()); if (from == 0) { this.quantifier.optional(); from = 1; } this.times = Times.of(from, to); return this; }
class class_name[name] begin[{] method[times, return_type[type[Pattern]], modifier[public], parameter[from, to]] begin[{] call[.checkIfNoNotPattern, parameter[]] call[.checkIfQuantifierApplied, parameter[]] assign[THIS[member[None.quantifier]], call[Quantifier.times, parameter[call[quantifier.getConsumingStrategy, parameter[]]]]] if[binary_operation[member[.from], ==, literal[0]]] begin[{] THIS[member[None.quantifier]call[None.optional, parameter[]]] assign[member[.from], literal[1]] else begin[{] None end[}] assign[THIS[member[None.times]], call[Times.of, parameter[member[.from], member[.to]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Pattern] operator[<] identifier[T] , identifier[F] operator[>] identifier[times] operator[SEP] Keyword[int] identifier[from] , Keyword[int] identifier[to] operator[SEP] { identifier[checkIfNoNotPattern] operator[SEP] operator[SEP] operator[SEP] identifier[checkIfQuantifierApplied] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[quantifier] operator[=] identifier[Quantifier] operator[SEP] identifier[times] operator[SEP] identifier[quantifier] operator[SEP] identifier[getConsumingStrategy] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[from] operator[==] Other[0] operator[SEP] { Keyword[this] operator[SEP] identifier[quantifier] operator[SEP] identifier[optional] operator[SEP] operator[SEP] operator[SEP] identifier[from] operator[=] Other[1] operator[SEP] } Keyword[this] operator[SEP] identifier[times] operator[=] identifier[Times] operator[SEP] identifier[of] operator[SEP] identifier[from] , identifier[to] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public FluentMatchingR<T, R> orElse(Function<T, R> function) { patterns.add(Pattern.of(t -> true, function::apply)); return this; }
class class_name[name] begin[{] method[orElse, return_type[type[FluentMatchingR]], modifier[public], parameter[function]] begin[{] call[patterns.add, parameter[call[Pattern.of, parameter[LambdaExpression(body=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), parameters=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), MethodReference(expression=MemberReference(member=function, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=apply, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[FluentMatchingR] operator[<] identifier[T] , identifier[R] operator[>] identifier[orElse] operator[SEP] identifier[Function] operator[<] identifier[T] , identifier[R] operator[>] identifier[function] operator[SEP] { identifier[patterns] operator[SEP] identifier[add] operator[SEP] identifier[Pattern] operator[SEP] identifier[of] operator[SEP] identifier[t] operator[->] literal[boolean] , identifier[function] operator[::] identifier[apply] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static Collection<List<String>> unorderedUntypedDependencyObjectify(Tree t, HeadFinder hf, TreeTransformer collinizer) { return dependencyObjectify(t, hf, collinizer, new UnorderedUntypedDependencyTyper(hf)); }
class class_name[name] begin[{] method[unorderedUntypedDependencyObjectify, return_type[type[Collection]], modifier[public static], parameter[t, hf, collinizer]] begin[{] return[call[.dependencyObjectify, parameter[member[.t], member[.hf], member[.collinizer], ClassCreator(arguments=[MemberReference(member=hf, 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=UnorderedUntypedDependencyTyper, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Collection] operator[<] identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[unorderedUntypedDependencyObjectify] operator[SEP] identifier[Tree] identifier[t] , identifier[HeadFinder] identifier[hf] , identifier[TreeTransformer] identifier[collinizer] operator[SEP] { Keyword[return] identifier[dependencyObjectify] operator[SEP] identifier[t] , identifier[hf] , identifier[collinizer] , Keyword[new] identifier[UnorderedUntypedDependencyTyper] operator[SEP] identifier[hf] operator[SEP] operator[SEP] operator[SEP] }
public final boolean isPacked() { OptionElement packedOption = OptionElement.findByName(options(), "packed"); return packedOption != null && "true".equals(packedOption.value()); }
class class_name[name] begin[{] method[isPacked, return_type[type[boolean]], modifier[final public], parameter[]] begin[{] local_variable[type[OptionElement], packedOption] return[binary_operation[binary_operation[member[.packedOption], !=, literal[null]], &&, literal["true"]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[boolean] identifier[isPacked] operator[SEP] operator[SEP] { identifier[OptionElement] identifier[packedOption] operator[=] identifier[OptionElement] operator[SEP] identifier[findByName] operator[SEP] identifier[options] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[packedOption] operator[!=] Other[null] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[packedOption] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public URI attachmentUri(String documentId, String attachmentId) { String base_uri = String.format( "%s/%s/%s", this.rootUriString, this.encodeId(documentId), this.encodeId(attachmentId) ); return uriFor(base_uri); }
class class_name[name] begin[{] method[attachmentUri, return_type[type[URI]], modifier[public], parameter[documentId, attachmentId]] begin[{] local_variable[type[String], base_uri] return[call[.uriFor, parameter[member[.base_uri]]]] end[}] END[}]
Keyword[public] identifier[URI] identifier[attachmentUri] operator[SEP] identifier[String] identifier[documentId] , identifier[String] identifier[attachmentId] operator[SEP] { identifier[String] identifier[base_uri] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[rootUriString] , Keyword[this] operator[SEP] identifier[encodeId] operator[SEP] identifier[documentId] operator[SEP] , Keyword[this] operator[SEP] identifier[encodeId] operator[SEP] identifier[attachmentId] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[uriFor] operator[SEP] identifier[base_uri] operator[SEP] operator[SEP] }
public void setDestination(String destination) { if (tc.isEntryEnabled()) SibTr.entry(tc, "setDestination", destination); this.destination = destination; if (tc.isEntryEnabled()) SibTr.exit(tc, "setDestination"); }
class class_name[name] begin[{] method[setDestination, return_type[void], modifier[public], parameter[destination]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["setDestination"], member[.destination]]] else begin[{] None end[}] assign[THIS[member[None.destination]], member[.destination]] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["setDestination"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setDestination] operator[SEP] identifier[String] identifier[destination] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , identifier[destination] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[destination] operator[=] identifier[destination] operator[SEP] Keyword[if] operator[SEP] 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 INDArray getArray() { //start a subscriber that can send us ndarrays if (subscriber == null) { running = new AtomicBoolean(true); subscriber = AeronNDArraySubscriber.startSubscriber(aeron, subscriberHost, subscriberPort, this, subscriberStream, running); log.debug("Started parameter server client on " + subscriber.connectionUrl()); } if (arr == null) arr = new AtomicReference<>(none); log.debug("Parameter server client retrieving url from " + ndarrayRetrieveUrl); //note here that this is the "master url" String[] split = ndarrayRetrieveUrl.split(":"); //The response daemon is always the master daemon's port + 1 //A "master daemon" is one that holds both the //parameter averaging daemon AND the response daemon for being able to send //the "current state ndarray" int port = Integer.parseInt(split[1]); int streamToPublish = Integer.parseInt(split[2]); //the channel here is the master node host with the port + 1 //pointing at the response node where we can request ndarrays to be sent to //the listening daemon String channel = AeronUtil.aeronChannel(split[0], port); //publish the address of our subscriber //note here that we send the ndarray send url, because the //master also hosts try (HostPortPublisher hostPortPublisher = HostPortPublisher.builder().channel(channel).aeron(aeron) //note here that we send our subscriber's listening information .streamId(streamToPublish) .uriToSend(AeronConnectionInformation .of(subscriberHost, subscriberPort, subscriberStream) .toString()) .build()) { hostPortPublisher.send(); log.debug("Sent subscriber information " + AeronConnectionInformation .of(subscriberHost, subscriberPort, subscriberStream).toString()); //wait for array to be available while (arr.get() == none) { Thread.sleep(1000); log.info("Waiting on array to be updated."); } } catch (Exception e) { log.error("Error with publishing", e); } INDArray arr2 = arr.get(); arr.set(none); return arr2; }
class class_name[name] begin[{] method[getArray, return_type[type[INDArray]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.subscriber], ==, literal[null]]] begin[{] assign[member[.running], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AtomicBoolean, sub_type=None))] assign[member[.subscriber], call[AeronNDArraySubscriber.startSubscriber, parameter[member[.aeron], member[.subscriberHost], member[.subscriberPort], THIS[], member[.subscriberStream], member[.running]]]] call[log.debug, parameter[binary_operation[literal["Started parameter server client on "], +, call[subscriber.connectionUrl, parameter[]]]]] else begin[{] None end[}] if[binary_operation[member[.arr], ==, literal[null]]] begin[{] assign[member[.arr], ClassCreator(arguments=[MemberReference(member=none, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=AtomicReference, sub_type=None))] else begin[{] None end[}] call[log.debug, parameter[binary_operation[literal["Parameter server client retrieving url from "], +, member[.ndarrayRetrieveUrl]]]] local_variable[type[String], split] local_variable[type[int], port] local_variable[type[int], streamToPublish] local_variable[type[String], channel] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=send, postfix_operators=[], prefix_operators=[], qualifier=hostPortPublisher, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Sent subscriber information "), operandr=MethodInvocation(arguments=[MemberReference(member=subscriberHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subscriberPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subscriberStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=AeronConnectionInformation, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Waiting on array to be updated.")], member=info, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=arr, selectors=[], type_arguments=None), operandr=MemberReference(member=none, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error with publishing"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=hostPortPublisher, type=ReferenceType(arguments=None, dimensions=[], name=HostPortPublisher, sub_type=None), value=MethodInvocation(arguments=[], member=builder, postfix_operators=[], prefix_operators=[], qualifier=HostPortPublisher, selectors=[MethodInvocation(arguments=[MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=channel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=aeron, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=aeron, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=streamToPublish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=streamId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=subscriberHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subscriberPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subscriberStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=of, postfix_operators=[], prefix_operators=[], qualifier=AeronConnectionInformation, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=uriToSend, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))]) local_variable[type[INDArray], arr2] call[arr.set, parameter[member[.none]]] return[member[.arr2]] end[}] END[}]
Keyword[public] identifier[INDArray] identifier[getArray] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[subscriber] operator[==] Other[null] operator[SEP] { identifier[running] operator[=] Keyword[new] identifier[AtomicBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[subscriber] operator[=] identifier[AeronNDArraySubscriber] operator[SEP] identifier[startSubscriber] operator[SEP] identifier[aeron] , identifier[subscriberHost] , identifier[subscriberPort] , Keyword[this] , identifier[subscriberStream] , identifier[running] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[subscriber] operator[SEP] identifier[connectionUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[arr] operator[==] Other[null] operator[SEP] identifier[arr] operator[=] Keyword[new] identifier[AtomicReference] operator[<] operator[>] operator[SEP] identifier[none] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[ndarrayRetrieveUrl] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[split] operator[=] identifier[ndarrayRetrieveUrl] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[port] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[split] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[streamToPublish] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[split] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[channel] operator[=] identifier[AeronUtil] operator[SEP] identifier[aeronChannel] operator[SEP] identifier[split] operator[SEP] Other[0] operator[SEP] , identifier[port] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[HostPortPublisher] identifier[hostPortPublisher] operator[=] identifier[HostPortPublisher] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[channel] operator[SEP] identifier[channel] operator[SEP] operator[SEP] identifier[aeron] operator[SEP] identifier[aeron] operator[SEP] operator[SEP] identifier[streamId] operator[SEP] identifier[streamToPublish] operator[SEP] operator[SEP] identifier[uriToSend] operator[SEP] identifier[AeronConnectionInformation] operator[SEP] identifier[of] operator[SEP] identifier[subscriberHost] , identifier[subscriberPort] , identifier[subscriberStream] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] { identifier[hostPortPublisher] operator[SEP] identifier[send] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[AeronConnectionInformation] operator[SEP] identifier[of] operator[SEP] identifier[subscriberHost] , identifier[subscriberPort] , identifier[subscriberStream] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[arr] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] identifier[none] operator[SEP] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[1000] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[INDArray] identifier[arr2] operator[=] identifier[arr] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[arr] operator[SEP] identifier[set] operator[SEP] identifier[none] operator[SEP] operator[SEP] Keyword[return] identifier[arr2] operator[SEP] }
public void check(ReconfigurationPlan p) throws SatConstraintViolationException { if (checkers.isEmpty()) { return; } checkModel(p.getOrigin(), true); if (!p.getActions().isEmpty()) { PriorityQueue<Action> starts = new PriorityQueue<>(p.getActions().size(), STARTS_CMP); PriorityQueue<Action> ends = new PriorityQueue<>(p.getActions().size(), ENDS_CMP); starts.addAll(p.getActions()); ends.addAll(p.getActions()); //Starts the actions int curMoment = starts.peek().getStart(); while (!starts.isEmpty() || !ends.isEmpty()) { Action a = ends.peek(); while (a != null && a.getEnd() == curMoment) { ends.remove(); startingEvent = false; visitAndThrowOnViolation(a); visitEvents(a, Action.Hook.POST); a = ends.peek(); } a = starts.peek(); while (a != null && a.getStart() == curMoment) { starts.remove(); startingEvent = true; visitEvents(a, Action.Hook.PRE); visitAndThrowOnViolation(a); a = starts.peek(); } int nextEnd = Integer.MAX_VALUE; if (!ends.isEmpty()) { nextEnd = ends.peek().getEnd(); } int nextStart = Integer.MAX_VALUE; if (!starts.isEmpty()) { nextStart = starts.peek().getStart(); } curMoment = Math.min(nextEnd, nextStart); } } Model mo = p.getResult(); if (mo == null) { throw new InconsistentSolutionException(p.getOrigin(), p, "The resulting reconfiguration plan is not applyable"); } checkModel(mo, false); }
class class_name[name] begin[{] method[check, return_type[void], modifier[public], parameter[p]] begin[{] if[call[checkers.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] call[.checkModel, parameter[call[p.getOrigin, parameter[]], literal[true]]] if[call[p.getActions, parameter[]]] begin[{] local_variable[type[PriorityQueue], starts] local_variable[type[PriorityQueue], ends] call[starts.addAll, parameter[call[p.getActions, parameter[]]]] call[ends.addAll, parameter[call[p.getActions, parameter[]]]] local_variable[type[int], curMoment] while[binary_operation[call[starts.isEmpty, parameter[]], ||, call[ends.isEmpty, parameter[]]]] begin[{] local_variable[type[Action], a] while[binary_operation[binary_operation[member[.a], !=, literal[null]], &&, binary_operation[call[a.getEnd, parameter[]], ==, member[.curMoment]]]] begin[{] call[ends.remove, parameter[]] assign[member[.startingEvent], literal[false]] call[.visitAndThrowOnViolation, parameter[member[.a]]] call[.visitEvents, parameter[member[.a], member[Action.Hook.POST]]] assign[member[.a], call[ends.peek, parameter[]]] end[}] assign[member[.a], call[starts.peek, parameter[]]] while[binary_operation[binary_operation[member[.a], !=, literal[null]], &&, binary_operation[call[a.getStart, parameter[]], ==, member[.curMoment]]]] begin[{] call[starts.remove, parameter[]] assign[member[.startingEvent], literal[true]] call[.visitEvents, parameter[member[.a], member[Action.Hook.PRE]]] call[.visitAndThrowOnViolation, parameter[member[.a]]] assign[member[.a], call[starts.peek, parameter[]]] end[}] local_variable[type[int], nextEnd] if[call[ends.isEmpty, parameter[]]] begin[{] assign[member[.nextEnd], call[ends.peek, parameter[]]] else begin[{] None end[}] local_variable[type[int], nextStart] if[call[starts.isEmpty, parameter[]]] begin[{] assign[member[.nextStart], call[starts.peek, parameter[]]] else begin[{] None end[}] assign[member[.curMoment], call[Math.min, parameter[member[.nextEnd], member[.nextStart]]]] end[}] else begin[{] None end[}] local_variable[type[Model], mo] if[binary_operation[member[.mo], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getOrigin, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The resulting reconfiguration plan is not applyable")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InconsistentSolutionException, sub_type=None)), label=None) else begin[{] None end[}] call[.checkModel, parameter[member[.mo], literal[false]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[check] operator[SEP] identifier[ReconfigurationPlan] identifier[p] operator[SEP] Keyword[throws] identifier[SatConstraintViolationException] { Keyword[if] operator[SEP] identifier[checkers] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[checkModel] operator[SEP] identifier[p] operator[SEP] identifier[getOrigin] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[p] operator[SEP] identifier[getActions] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[PriorityQueue] operator[<] identifier[Action] operator[>] identifier[starts] operator[=] Keyword[new] identifier[PriorityQueue] operator[<] operator[>] operator[SEP] identifier[p] operator[SEP] identifier[getActions] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[STARTS_CMP] operator[SEP] operator[SEP] identifier[PriorityQueue] operator[<] identifier[Action] operator[>] identifier[ends] operator[=] Keyword[new] identifier[PriorityQueue] operator[<] operator[>] operator[SEP] identifier[p] operator[SEP] identifier[getActions] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[ENDS_CMP] operator[SEP] operator[SEP] identifier[starts] operator[SEP] identifier[addAll] operator[SEP] identifier[p] operator[SEP] identifier[getActions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ends] operator[SEP] identifier[addAll] operator[SEP] identifier[p] operator[SEP] identifier[getActions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[curMoment] operator[=] identifier[starts] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[starts] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] operator[!] identifier[ends] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Action] identifier[a] operator[=] identifier[ends] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[a] operator[!=] Other[null] operator[&&] identifier[a] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[==] identifier[curMoment] operator[SEP] { identifier[ends] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[startingEvent] operator[=] literal[boolean] operator[SEP] identifier[visitAndThrowOnViolation] operator[SEP] identifier[a] operator[SEP] operator[SEP] identifier[visitEvents] operator[SEP] identifier[a] , identifier[Action] operator[SEP] identifier[Hook] operator[SEP] identifier[POST] operator[SEP] operator[SEP] identifier[a] operator[=] identifier[ends] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] } identifier[a] operator[=] identifier[starts] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[a] operator[!=] Other[null] operator[&&] identifier[a] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[==] identifier[curMoment] operator[SEP] { identifier[starts] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[startingEvent] operator[=] literal[boolean] operator[SEP] identifier[visitEvents] operator[SEP] identifier[a] , identifier[Action] operator[SEP] identifier[Hook] operator[SEP] identifier[PRE] operator[SEP] operator[SEP] identifier[visitAndThrowOnViolation] operator[SEP] identifier[a] operator[SEP] operator[SEP] identifier[a] operator[=] identifier[starts] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[nextEnd] operator[=] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ends] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[nextEnd] operator[=] identifier[ends] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[nextStart] operator[=] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[starts] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[nextStart] operator[=] identifier[starts] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] } identifier[curMoment] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[nextEnd] , identifier[nextStart] operator[SEP] operator[SEP] } } identifier[Model] identifier[mo] operator[=] identifier[p] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mo] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[InconsistentSolutionException] operator[SEP] identifier[p] operator[SEP] identifier[getOrigin] operator[SEP] operator[SEP] , identifier[p] , literal[String] operator[SEP] operator[SEP] } identifier[checkModel] operator[SEP] identifier[mo] , literal[boolean] operator[SEP] operator[SEP] }
static Graph toBeamGraph(IAtomContainer ac, int flavour) throws CDKException { int order = ac.getAtomCount(); GraphBuilder gb = GraphBuilder.create(order); Map<IAtom, Integer> indices = Maps.newHashMapWithExpectedSize(order); for (IAtom a : ac.atoms()) { indices.put(a, indices.size()); gb.add(toBeamAtom(a, flavour)); } for (IBond b : ac.bonds()) { gb.add(toBeamEdge(b, flavour, indices)); } // configure stereo-chemistry by encoding the stereo-elements if (SmiFlavor.isSet(flavour, SmiFlavor.Stereo)) { for (IStereoElement se : ac.stereoElements()) { if (SmiFlavor.isSet(flavour, SmiFlavor.StereoTetrahedral) && se instanceof ITetrahedralChirality) { addTetrahedralConfiguration((ITetrahedralChirality) se, gb, indices); } else if (SmiFlavor.isSet(flavour, SmiFlavor.StereoCisTrans) && se instanceof IDoubleBondStereochemistry) { addGeometricConfiguration((IDoubleBondStereochemistry) se, flavour, gb, indices); } else if (SmiFlavor.isSet(flavour, SmiFlavor.StereoExTetrahedral) && se instanceof ExtendedTetrahedral) { addExtendedTetrahedralConfiguration((ExtendedTetrahedral) se, gb, indices); } else if (SmiFlavor.isSet(flavour, SmiFlavor.StereoExCisTrans) && se instanceof ExtendedCisTrans) { addExtendedCisTransConfig((ExtendedCisTrans) se, gb, indices, ac); } } } return gb.build(); }
class class_name[name] begin[{] method[toBeamGraph, return_type[type[Graph]], modifier[static], parameter[ac, flavour]] begin[{] local_variable[type[int], order] local_variable[type[GraphBuilder], gb] local_variable[type[Map], indices] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=indices, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=indices, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=flavour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toBeamAtom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=gb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=atoms, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=a)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IAtom, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=flavour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toBeamEdge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=gb, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=bonds, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=b)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IBond, sub_type=None))), label=None) if[call[SmiFlavor.isSet, parameter[member[.flavour], member[SmiFlavor.Stereo]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=flavour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=StereoTetrahedral, postfix_operators=[], prefix_operators=[], qualifier=SmiFlavor, selectors=[])], member=isSet, postfix_operators=[], prefix_operators=[], qualifier=SmiFlavor, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ITetrahedralChirality, sub_type=None), operator=instanceof), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=flavour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=StereoCisTrans, postfix_operators=[], prefix_operators=[], qualifier=SmiFlavor, selectors=[])], member=isSet, postfix_operators=[], prefix_operators=[], qualifier=SmiFlavor, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=IDoubleBondStereochemistry, sub_type=None), operator=instanceof), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=flavour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=StereoExTetrahedral, postfix_operators=[], prefix_operators=[], qualifier=SmiFlavor, selectors=[])], member=isSet, postfix_operators=[], prefix_operators=[], qualifier=SmiFlavor, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ExtendedTetrahedral, sub_type=None), operator=instanceof), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=flavour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=StereoExCisTrans, postfix_operators=[], prefix_operators=[], qualifier=SmiFlavor, selectors=[])], member=isSet, postfix_operators=[], prefix_operators=[], qualifier=SmiFlavor, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ExtendedCisTrans, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ExtendedCisTrans, sub_type=None)), MemberReference(member=gb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ac, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addExtendedCisTransConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ExtendedTetrahedral, sub_type=None)), MemberReference(member=gb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addExtendedTetrahedralConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IDoubleBondStereochemistry, sub_type=None)), MemberReference(member=flavour, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addGeometricConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=se, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ITetrahedralChirality, sub_type=None)), MemberReference(member=gb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addTetrahedralConfiguration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=stereoElements, postfix_operators=[], prefix_operators=[], qualifier=ac, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=se)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IStereoElement, sub_type=None))), label=None) else begin[{] None end[}] return[call[gb.build, parameter[]]] end[}] END[}]
Keyword[static] identifier[Graph] identifier[toBeamGraph] operator[SEP] identifier[IAtomContainer] identifier[ac] , Keyword[int] identifier[flavour] operator[SEP] Keyword[throws] identifier[CDKException] { Keyword[int] identifier[order] operator[=] identifier[ac] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] identifier[GraphBuilder] identifier[gb] operator[=] identifier[GraphBuilder] operator[SEP] identifier[create] operator[SEP] identifier[order] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[IAtom] , identifier[Integer] operator[>] identifier[indices] operator[=] identifier[Maps] operator[SEP] identifier[newHashMapWithExpectedSize] operator[SEP] identifier[order] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[IAtom] identifier[a] operator[:] identifier[ac] operator[SEP] identifier[atoms] operator[SEP] operator[SEP] operator[SEP] { identifier[indices] operator[SEP] identifier[put] operator[SEP] identifier[a] , identifier[indices] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[gb] operator[SEP] identifier[add] operator[SEP] identifier[toBeamAtom] operator[SEP] identifier[a] , identifier[flavour] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[IBond] identifier[b] operator[:] identifier[ac] operator[SEP] identifier[bonds] operator[SEP] operator[SEP] operator[SEP] { identifier[gb] operator[SEP] identifier[add] operator[SEP] identifier[toBeamEdge] operator[SEP] identifier[b] , identifier[flavour] , identifier[indices] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[SmiFlavor] operator[SEP] identifier[isSet] operator[SEP] identifier[flavour] , identifier[SmiFlavor] operator[SEP] identifier[Stereo] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[IStereoElement] identifier[se] operator[:] identifier[ac] operator[SEP] identifier[stereoElements] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[SmiFlavor] operator[SEP] identifier[isSet] operator[SEP] identifier[flavour] , identifier[SmiFlavor] operator[SEP] identifier[StereoTetrahedral] operator[SEP] operator[&&] identifier[se] Keyword[instanceof] identifier[ITetrahedralChirality] operator[SEP] { identifier[addTetrahedralConfiguration] operator[SEP] operator[SEP] identifier[ITetrahedralChirality] operator[SEP] identifier[se] , identifier[gb] , identifier[indices] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[SmiFlavor] operator[SEP] identifier[isSet] operator[SEP] identifier[flavour] , identifier[SmiFlavor] operator[SEP] identifier[StereoCisTrans] operator[SEP] operator[&&] identifier[se] Keyword[instanceof] identifier[IDoubleBondStereochemistry] operator[SEP] { identifier[addGeometricConfiguration] operator[SEP] operator[SEP] identifier[IDoubleBondStereochemistry] operator[SEP] identifier[se] , identifier[flavour] , identifier[gb] , identifier[indices] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[SmiFlavor] operator[SEP] identifier[isSet] operator[SEP] identifier[flavour] , identifier[SmiFlavor] operator[SEP] identifier[StereoExTetrahedral] operator[SEP] operator[&&] identifier[se] Keyword[instanceof] identifier[ExtendedTetrahedral] operator[SEP] { identifier[addExtendedTetrahedralConfiguration] operator[SEP] operator[SEP] identifier[ExtendedTetrahedral] operator[SEP] identifier[se] , identifier[gb] , identifier[indices] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[SmiFlavor] operator[SEP] identifier[isSet] operator[SEP] identifier[flavour] , identifier[SmiFlavor] operator[SEP] identifier[StereoExCisTrans] operator[SEP] operator[&&] identifier[se] Keyword[instanceof] identifier[ExtendedCisTrans] operator[SEP] { identifier[addExtendedCisTransConfig] operator[SEP] operator[SEP] identifier[ExtendedCisTrans] operator[SEP] identifier[se] , identifier[gb] , identifier[indices] , identifier[ac] operator[SEP] operator[SEP] } } } Keyword[return] identifier[gb] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public void addActionConstraint(final WButton button, final ActionConstraint constraint) { if (button.getParent() != actions) { throw new IllegalArgumentException( "Can only add a constraint to a button which is in this table's actions"); } getOrCreateComponentModel().addActionConstraint(button, constraint); }
class class_name[name] begin[{] method[addActionConstraint, return_type[void], modifier[public], parameter[button, constraint]] begin[{] if[binary_operation[call[button.getParent, parameter[]], !=, member[.actions]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can only add a constraint to a button which is in this table's actions")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[.getOrCreateComponentModel, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addActionConstraint] operator[SEP] Keyword[final] identifier[WButton] identifier[button] , Keyword[final] identifier[ActionConstraint] identifier[constraint] operator[SEP] { Keyword[if] operator[SEP] identifier[button] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[!=] identifier[actions] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[getOrCreateComponentModel] operator[SEP] operator[SEP] operator[SEP] identifier[addActionConstraint] operator[SEP] identifier[button] , identifier[constraint] operator[SEP] operator[SEP] }
@Override public Parser newFixedLengthParser(final Connection con, final InputStream dataSourceStream, final String dataDefinition) { throw new UnsupportedOperationException("Not supported..."); }
class class_name[name] begin[{] method[newFixedLengthParser, return_type[type[Parser]], modifier[public], parameter[con, dataSourceStream, dataDefinition]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not supported...")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Parser] identifier[newFixedLengthParser] operator[SEP] Keyword[final] identifier[Connection] identifier[con] , Keyword[final] identifier[InputStream] identifier[dataSourceStream] , Keyword[final] identifier[String] identifier[dataDefinition] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public boolean peekAndConsumeMore() { Token nextToken = tokenSource.peek(); if ((nextToken.kind == ATOM) && ";".equals(nextToken.image)) { try { consumeToken(ATOM); } catch (SourceCodeException e) { // If the peek ahead kind can not be consumed then something strange has gone wrong so report this // as a bug rather than try to recover from it. throw new IllegalStateException(e); } return true; } else { return false; } }
class class_name[name] begin[{] method[peekAndConsumeMore, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[Token], nextToken] if[binary_operation[binary_operation[member[nextToken.kind], ==, member[.ATOM]], &&, literal[";"]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ATOM, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=consumeToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SourceCodeException']))], finally_block=None, label=None, resources=None) return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[peekAndConsumeMore] operator[SEP] operator[SEP] { identifier[Token] identifier[nextToken] operator[=] identifier[tokenSource] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[nextToken] operator[SEP] identifier[kind] operator[==] identifier[ATOM] operator[SEP] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[nextToken] operator[SEP] identifier[image] operator[SEP] operator[SEP] { Keyword[try] { identifier[consumeToken] operator[SEP] identifier[ATOM] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SourceCodeException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } }
public static void rcvXAOpen(CommsByteBuffer request, Conversation conversation, int requestNumber, boolean allocatedFromBufferPool, boolean partOfExchange) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "rcvXAOpen", new Object[] { request, conversation, ""+requestNumber, ""+allocatedFromBufferPool, ""+partOfExchange }); short connectionObjectId = request.getShort(); int clientTransactionId = request.getInt(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { SibTr.debug(tc, "Connection Object ID", connectionObjectId); SibTr.debug(tc, "Transaction ID", clientTransactionId); } try { conversation.send(poolManager.allocate(), JFapChannelConstants.SEG_XAOPEN_R, requestNumber, JFapChannelConstants.PRIORITY_MEDIUM, true, ThrottlingPolicy.BLOCK_THREAD, null); } catch (SIException e) { FFDCFilter.processException(e, CLASS_NAME + ".rcvXAOpen", CommsConstants.STATICCATXATRANSACTION_XAOPEN_01); SibTr.error(tc, "COMMUNICATION_ERROR_SICO2027", e); } request.release(allocatedFromBufferPool); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "rcvXAOpen"); }
class class_name[name] begin[{] method[rcvXAOpen, return_type[void], modifier[public static], parameter[request, conversation, requestNumber, allocatedFromBufferPool, partOfExchange]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["rcvXAOpen"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=conversation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=requestNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=allocatedFromBufferPool, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operandr=MemberReference(member=partOfExchange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)]), 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[short], connectionObjectId] local_variable[type[int], clientTransactionId] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[SibTr.debug, parameter[member[.tc], literal["Connection Object ID"], member[.connectionObjectId]]] call[SibTr.debug, parameter[member[.tc], literal["Transaction ID"], member[.clientTransactionId]]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=allocate, postfix_operators=[], prefix_operators=[], qualifier=poolManager, selectors=[], type_arguments=None), MemberReference(member=SEG_XAOPEN_R, postfix_operators=[], prefix_operators=[], qualifier=JFapChannelConstants, selectors=[]), MemberReference(member=requestNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PRIORITY_MEDIUM, postfix_operators=[], prefix_operators=[], qualifier=JFapChannelConstants, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=BLOCK_THREAD, postfix_operators=[], prefix_operators=[], qualifier=ThrottlingPolicy, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=send, postfix_operators=[], prefix_operators=[], qualifier=conversation, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".rcvXAOpen"), operator=+), MemberReference(member=STATICCATXATRANSACTION_XAOPEN_01, postfix_operators=[], prefix_operators=[], qualifier=CommsConstants, selectors=[])], 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="COMMUNICATION_ERROR_SICO2027"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SIException']))], finally_block=None, label=None, resources=None) call[request.release, parameter[member[.allocatedFromBufferPool]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["rcvXAOpen"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[rcvXAOpen] operator[SEP] identifier[CommsByteBuffer] identifier[request] , identifier[Conversation] identifier[conversation] , Keyword[int] identifier[requestNumber] , Keyword[boolean] identifier[allocatedFromBufferPool] , Keyword[boolean] identifier[partOfExchange] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[request] , identifier[conversation] , literal[String] operator[+] identifier[requestNumber] , literal[String] operator[+] identifier[allocatedFromBufferPool] , literal[String] operator[+] identifier[partOfExchange] } operator[SEP] operator[SEP] Keyword[short] identifier[connectionObjectId] operator[=] identifier[request] operator[SEP] identifier[getShort] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[clientTransactionId] operator[=] identifier[request] operator[SEP] identifier[getInt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[connectionObjectId] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[clientTransactionId] operator[SEP] operator[SEP] } Keyword[try] { identifier[conversation] operator[SEP] identifier[send] operator[SEP] identifier[poolManager] operator[SEP] identifier[allocate] operator[SEP] operator[SEP] , identifier[JFapChannelConstants] operator[SEP] identifier[SEG_XAOPEN_R] , identifier[requestNumber] , identifier[JFapChannelConstants] operator[SEP] identifier[PRIORITY_MEDIUM] , literal[boolean] , identifier[ThrottlingPolicy] operator[SEP] identifier[BLOCK_THREAD] , Other[null] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SIException] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , identifier[CLASS_NAME] operator[+] literal[String] , identifier[CommsConstants] operator[SEP] identifier[STATICCATXATRANSACTION_XAOPEN_01] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[request] operator[SEP] identifier[release] operator[SEP] identifier[allocatedFromBufferPool] 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 static RaftConfiguration loadFromFile(String configFile) throws IOException { File config = new File(configFile); if (!config.exists() || !config.canRead()) { throw new IOException(String.format("%s cannot be opened", config)); } ObjectMapper mapper = new ObjectMapper(); // this method is called rarely, so creating one inline is nbd RaftConfiguration configuration = mapper.readValue(config, RaftConfiguration.class); return validate(configuration); }
class class_name[name] begin[{] method[loadFromFile, return_type[type[RaftConfiguration]], modifier[public static], parameter[configFile]] begin[{] local_variable[type[File], config] if[binary_operation[call[config.exists, parameter[]], ||, call[config.canRead, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s cannot be opened"), MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[ObjectMapper], mapper] local_variable[type[RaftConfiguration], configuration] return[call[.validate, parameter[member[.configuration]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[RaftConfiguration] identifier[loadFromFile] operator[SEP] identifier[String] identifier[configFile] operator[SEP] Keyword[throws] identifier[IOException] { identifier[File] identifier[config] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[configFile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[config] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[||] operator[!] identifier[config] operator[SEP] identifier[canRead] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[config] operator[SEP] operator[SEP] operator[SEP] } identifier[ObjectMapper] identifier[mapper] operator[=] Keyword[new] identifier[ObjectMapper] operator[SEP] operator[SEP] operator[SEP] identifier[RaftConfiguration] identifier[configuration] operator[=] identifier[mapper] operator[SEP] identifier[readValue] operator[SEP] identifier[config] , identifier[RaftConfiguration] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[validate] operator[SEP] identifier[configuration] operator[SEP] operator[SEP] }
private String getNamespace() { String namespace = getConfig(Config.namespace); if (StringUtils.isNotBlank(namespace)){ return namespace; } namespace = getContext().getConfiguration().getProperty("fabric8.namespace"); if (StringUtils.isNotBlank(namespace)){ return namespace; } namespace = System.getProperty("fabric8.namespace"); if (StringUtils.isNotBlank(namespace)){ return namespace; } return KubernetesHelper.getDefaultNamespace(); }
class class_name[name] begin[{] method[getNamespace, return_type[type[String]], modifier[private], parameter[]] begin[{] local_variable[type[String], namespace] if[call[StringUtils.isNotBlank, parameter[member[.namespace]]]] begin[{] return[member[.namespace]] else begin[{] None end[}] assign[member[.namespace], call[.getContext, parameter[]]] if[call[StringUtils.isNotBlank, parameter[member[.namespace]]]] begin[{] return[member[.namespace]] else begin[{] None end[}] assign[member[.namespace], call[System.getProperty, parameter[literal["fabric8.namespace"]]]] if[call[StringUtils.isNotBlank, parameter[member[.namespace]]]] begin[{] return[member[.namespace]] else begin[{] None end[}] return[call[KubernetesHelper.getDefaultNamespace, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[getNamespace] operator[SEP] operator[SEP] { identifier[String] identifier[namespace] operator[=] identifier[getConfig] operator[SEP] identifier[Config] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] { Keyword[return] identifier[namespace] operator[SEP] } identifier[namespace] operator[=] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] { Keyword[return] identifier[namespace] operator[SEP] } identifier[namespace] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] { Keyword[return] identifier[namespace] operator[SEP] } Keyword[return] identifier[KubernetesHelper] operator[SEP] identifier[getDefaultNamespace] operator[SEP] operator[SEP] operator[SEP] }
public void run() { // compare trees, and collect differences differences.addAll(MerkleTree.difference(r1.tree, r2.tree)); // choose a repair method based on the significance of the difference String format = String.format("[repair #%s] Endpoints %s and %s %%s for %s", desc.sessionId, r1.endpoint, r2.endpoint, desc.columnFamily); if (differences.isEmpty()) { logger.info(String.format(format, "are consistent")); // send back sync complete message MessagingService.instance().sendOneWay(new SyncComplete(desc, r1.endpoint, r2.endpoint, true).createMessage(), FBUtilities.getLocalAddress()); return; } // non-0 difference: perform streaming repair logger.info(String.format(format, "have " + differences.size() + " range(s) out of sync")); performStreamingRepair(); }
class class_name[name] begin[{] method[run, return_type[void], modifier[public], parameter[]] begin[{] call[differences.addAll, parameter[call[MerkleTree.difference, parameter[member[r1.tree], member[r2.tree]]]]] local_variable[type[String], format] if[call[differences.isEmpty, parameter[]]] begin[{] call[logger.info, parameter[call[String.format, parameter[member[.format], literal["are consistent"]]]]] call[MessagingService.instance, parameter[]] return[None] else begin[{] None end[}] call[logger.info, parameter[call[String.format, parameter[member[.format], binary_operation[binary_operation[literal["have "], +, call[differences.size, parameter[]]], +, literal[" range(s) out of sync"]]]]]] call[.performStreamingRepair, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[differences] operator[SEP] identifier[addAll] operator[SEP] identifier[MerkleTree] operator[SEP] identifier[difference] operator[SEP] identifier[r1] operator[SEP] identifier[tree] , identifier[r2] operator[SEP] identifier[tree] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[format] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[desc] operator[SEP] identifier[sessionId] , identifier[r1] operator[SEP] identifier[endpoint] , identifier[r2] operator[SEP] identifier[endpoint] , identifier[desc] operator[SEP] identifier[columnFamily] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[differences] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[format] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[MessagingService] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[sendOneWay] operator[SEP] Keyword[new] identifier[SyncComplete] operator[SEP] identifier[desc] , identifier[r1] operator[SEP] identifier[endpoint] , identifier[r2] operator[SEP] identifier[endpoint] , literal[boolean] operator[SEP] operator[SEP] identifier[createMessage] operator[SEP] operator[SEP] , identifier[FBUtilities] operator[SEP] identifier[getLocalAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[logger] operator[SEP] identifier[info] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[format] , literal[String] operator[+] identifier[differences] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[performStreamingRepair] operator[SEP] operator[SEP] operator[SEP] }
public Object process(BinaryEntry entry) { Object result = processEntry(entry); return result == NO_RESULT ? null : result; }
class class_name[name] begin[{] method[process, return_type[type[Object]], modifier[public], parameter[entry]] begin[{] local_variable[type[Object], result] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NO_RESULT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[Object] identifier[process] operator[SEP] identifier[BinaryEntry] identifier[entry] operator[SEP] { identifier[Object] identifier[result] operator[=] identifier[processEntry] operator[SEP] identifier[entry] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[==] identifier[NO_RESULT] operator[?] Other[null] operator[:] identifier[result] operator[SEP] }
public static Proxy asProxy(org.apache.maven.settings.Proxy proxy) { final Authentication authentication; if (proxy.getUsername() != null || proxy.getPassword() != null) { authentication = new AuthenticationBuilder().addUsername(proxy.getUsername()) .addPassword(proxy.getPassword()).build(); } else { authentication = null; } return new Proxy(proxy.getProtocol(), proxy.getHost(), proxy.getPort(), authentication); }
class class_name[name] begin[{] method[asProxy, return_type[type[Proxy]], modifier[public static], parameter[proxy]] begin[{] local_variable[type[Authentication], authentication] if[binary_operation[binary_operation[call[proxy.getUsername, parameter[]], !=, literal[null]], ||, binary_operation[call[proxy.getPassword, parameter[]], !=, literal[null]]]] begin[{] assign[member[.authentication], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getUsername, postfix_operators=[], prefix_operators=[], qualifier=proxy, selectors=[], type_arguments=None)], member=addUsername, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPassword, postfix_operators=[], prefix_operators=[], qualifier=proxy, selectors=[], type_arguments=None)], member=addPassword, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=AuthenticationBuilder, sub_type=None))] else begin[{] assign[member[.authentication], literal[null]] end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getProtocol, postfix_operators=[], prefix_operators=[], qualifier=proxy, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getHost, postfix_operators=[], prefix_operators=[], qualifier=proxy, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPort, postfix_operators=[], prefix_operators=[], qualifier=proxy, selectors=[], type_arguments=None), MemberReference(member=authentication, 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=Proxy, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Proxy] identifier[asProxy] operator[SEP] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[maven] operator[SEP] identifier[settings] operator[SEP] identifier[Proxy] identifier[proxy] operator[SEP] { Keyword[final] identifier[Authentication] identifier[authentication] operator[SEP] Keyword[if] operator[SEP] identifier[proxy] operator[SEP] identifier[getUsername] operator[SEP] operator[SEP] operator[!=] Other[null] operator[||] identifier[proxy] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[authentication] operator[=] Keyword[new] identifier[AuthenticationBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[addUsername] operator[SEP] identifier[proxy] operator[SEP] identifier[getUsername] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addPassword] operator[SEP] identifier[proxy] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[authentication] operator[=] Other[null] operator[SEP] } Keyword[return] Keyword[new] identifier[Proxy] operator[SEP] identifier[proxy] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] , identifier[proxy] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] , identifier[proxy] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] , identifier[authentication] operator[SEP] operator[SEP] }
private String readCellByType(Cell cell, CellType type) { String txt = ""; if (cell != null) { switch (type) { case NUMERIC: txt = dateOrNumberProcessing(cell); break; case STRING: txt = String.valueOf(cell.getRichStringCellValue()); logger.debug("CELL_TYPE_STRING: {}", txt); break; case FORMULA: txt = readCellByType(cell, cell.getCachedFormulaResultTypeEnum()); logger.debug("CELL_TYPE_FORMULA: {}", txt); break; case BLANK: logger.debug("CELL_TYPE_BLANK (we do nothing)"); break; default: logger.error(Messages.getMessage(EXCEL_DATA_PROVIDER_WRONG_CELL_TYPE_ERROR_MESSAGE), type); break; } } return txt; }
class class_name[name] begin[{] method[readCellByType, return_type[type[String]], modifier[private], parameter[cell, type]] begin[{] local_variable[type[String], txt] if[binary_operation[member[.cell], !=, literal[null]]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['NUMERIC'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=txt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=cell, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=dateOrNumberProcessing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['STRING'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=txt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRichStringCellValue, postfix_operators=[], prefix_operators=[], qualifier=cell, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CELL_TYPE_STRING: {}"), MemberReference(member=txt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['FORMULA'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=txt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=cell, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getCachedFormulaResultTypeEnum, postfix_operators=[], prefix_operators=[], qualifier=cell, selectors=[], type_arguments=None)], member=readCellByType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CELL_TYPE_FORMULA: {}"), MemberReference(member=txt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['BLANK'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CELL_TYPE_BLANK (we do nothing)")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=EXCEL_DATA_PROVIDER_WRONG_CELL_TYPE_ERROR_MESSAGE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[], type_arguments=None), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] return[member[.txt]] end[}] END[}]
Keyword[private] identifier[String] identifier[readCellByType] operator[SEP] identifier[Cell] identifier[cell] , identifier[CellType] identifier[type] operator[SEP] { identifier[String] identifier[txt] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[cell] operator[!=] Other[null] operator[SEP] { Keyword[switch] operator[SEP] identifier[type] operator[SEP] { Keyword[case] identifier[NUMERIC] operator[:] identifier[txt] operator[=] identifier[dateOrNumberProcessing] operator[SEP] identifier[cell] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[STRING] operator[:] identifier[txt] operator[=] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[cell] operator[SEP] identifier[getRichStringCellValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[txt] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[FORMULA] operator[:] identifier[txt] operator[=] identifier[readCellByType] operator[SEP] identifier[cell] , identifier[cell] operator[SEP] identifier[getCachedFormulaResultTypeEnum] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[txt] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[BLANK] operator[:] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[getMessage] operator[SEP] identifier[EXCEL_DATA_PROVIDER_WRONG_CELL_TYPE_ERROR_MESSAGE] operator[SEP] , identifier[type] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[return] identifier[txt] operator[SEP] }
public static <T> T readObjectFromFile(String filename) throws IOException, ClassNotFoundException { return ErasureUtils .<T> uncheckedCast(readObjectFromFile(new File(filename))); }
class class_name[name] begin[{] method[readObjectFromFile, return_type[type[T]], modifier[public static], parameter[filename]] begin[{] return[call[.ErasureUtils, parameter[call[.readObjectFromFile, parameter[ClassCreator(arguments=[MemberReference(member=filename, 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))]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[readObjectFromFile] operator[SEP] identifier[String] identifier[filename] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] { Keyword[return] identifier[ErasureUtils] operator[SEP] operator[<] identifier[T] operator[>] identifier[uncheckedCast] operator[SEP] identifier[readObjectFromFile] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[filename] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public String build(final UrlMapping mapping, final boolean encodeUrl, final RequestParameter... parameters) { List<UIParameter> list = new ArrayList<UIParameter>(); if(parameters != null) { for (RequestParameter param : parameters) { UIParameter p = new UIParameter(); if (param != null) { p.setValue(param.getName()); p.setValue(param.getValue()); } list.add(p); } } return build(mapping, false, list); }
class class_name[name] begin[{] method[build, return_type[type[String]], modifier[public], parameter[mapping, encodeUrl, parameters]] begin[{] local_variable[type[List], list] if[binary_operation[member[.parameters], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UIParameter, sub_type=None)), name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UIParameter, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=param, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=param, selectors=[], type_arguments=None)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=param)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RequestParameter, sub_type=None))), label=None) else begin[{] None end[}] return[call[.build, parameter[member[.mapping], literal[false], member[.list]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[build] operator[SEP] Keyword[final] identifier[UrlMapping] identifier[mapping] , Keyword[final] Keyword[boolean] identifier[encodeUrl] , Keyword[final] identifier[RequestParameter] operator[...] identifier[parameters] operator[SEP] { identifier[List] operator[<] identifier[UIParameter] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[UIParameter] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parameters] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[RequestParameter] identifier[param] operator[:] identifier[parameters] operator[SEP] { identifier[UIParameter] identifier[p] operator[=] Keyword[new] identifier[UIParameter] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[param] operator[!=] Other[null] operator[SEP] { identifier[p] operator[SEP] identifier[setValue] operator[SEP] identifier[param] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[p] operator[SEP] identifier[setValue] operator[SEP] identifier[param] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[p] operator[SEP] operator[SEP] } } Keyword[return] identifier[build] operator[SEP] identifier[mapping] , literal[boolean] , identifier[list] operator[SEP] operator[SEP] }
public void setName(String name) throws CmsIllegalArgumentException { if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_INDEXSOURCE_CREATE_MISSING_NAME_0)); } // already used? Don't test this at xml-configuration time (no manager) if (OpenCms.getRunLevel() > OpenCms.RUNLEVEL_2_INITIALIZING) { CmsSearchManager mngr = OpenCms.getSearchManager(); // don't test this if the indexsource is not new (widget invokes setName even if it was not changed) if (mngr.getIndexSource(name) != this) { if (mngr.getSearchIndexSources().keySet().contains(name)) { throw new CmsIllegalArgumentException( Messages.get().container(Messages.ERR_INDEXSOURCE_CREATE_INVALID_NAME_1, name)); } } } m_name = name; }
class class_name[name] begin[{] method[setName, return_type[void], modifier[public], parameter[name]] begin[{] if[call[CmsStringUtil.isEmptyOrWhitespaceOnly, parameter[member[.name]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_INDEXSOURCE_CREATE_MISSING_NAME_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=container, 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=CmsIllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[call[OpenCms.getRunLevel, parameter[]], >, member[OpenCms.RUNLEVEL_2_INITIALIZING]]] begin[{] local_variable[type[CmsSearchManager], mngr] if[binary_operation[call[mngr.getIndexSource, parameter[member[.name]]], !=, THIS[]]] begin[{] if[call[mngr.getSearchIndexSources, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[MemberReference(member=ERR_INDEXSOURCE_CREATE_INVALID_NAME_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=container, 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=CmsIllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] assign[member[.m_name], member[.name]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setName] operator[SEP] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[CmsIllegalArgumentException] { Keyword[if] operator[SEP] identifier[CmsStringUtil] operator[SEP] identifier[isEmptyOrWhitespaceOnly] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[CmsIllegalArgumentException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_INDEXSOURCE_CREATE_MISSING_NAME_0] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getRunLevel] operator[SEP] operator[SEP] operator[>] identifier[OpenCms] operator[SEP] identifier[RUNLEVEL_2_INITIALIZING] operator[SEP] { identifier[CmsSearchManager] identifier[mngr] operator[=] identifier[OpenCms] operator[SEP] identifier[getSearchManager] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mngr] operator[SEP] identifier[getIndexSource] operator[SEP] identifier[name] operator[SEP] operator[!=] Keyword[this] operator[SEP] { Keyword[if] operator[SEP] identifier[mngr] operator[SEP] identifier[getSearchIndexSources] operator[SEP] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[CmsIllegalArgumentException] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_INDEXSOURCE_CREATE_INVALID_NAME_1] , identifier[name] operator[SEP] operator[SEP] operator[SEP] } } } identifier[m_name] operator[=] identifier[name] operator[SEP] }
private S3Object decipherWithInstFileSuffix(GetObjectRequest req, long[] desiredRange, long[] cryptoRange, S3Object retrieved, String instFileSuffix) { final S3ObjectId id = req.getS3ObjectId(); // Check if encrypted info is in an instruction file final S3ObjectWrapper ifile = fetchInstructionFile(id, instFileSuffix); if (ifile == null) { throw new SdkClientException("Instruction file with suffix " + instFileSuffix + " is not found for " + retrieved); } try { return decipherWithInstructionFile(req, desiredRange, cryptoRange, new S3ObjectWrapper(retrieved, id), ifile); } finally { closeQuietly(ifile, log); } }
class class_name[name] begin[{] method[decipherWithInstFileSuffix, return_type[type[S3Object]], modifier[private], parameter[req, desiredRange, cryptoRange, retrieved, instFileSuffix]] begin[{] local_variable[type[S3ObjectId], id] local_variable[type[S3ObjectWrapper], ifile] if[binary_operation[member[.ifile], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Instruction file with suffix "), operandr=MemberReference(member=instFileSuffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not found for "), operator=+), operandr=MemberReference(member=retrieved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=desiredRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cryptoRange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=retrieved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, 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=S3ObjectWrapper, sub_type=None)), MemberReference(member=ifile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decipherWithInstructionFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ifile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[private] identifier[S3Object] identifier[decipherWithInstFileSuffix] operator[SEP] identifier[GetObjectRequest] identifier[req] , Keyword[long] operator[SEP] operator[SEP] identifier[desiredRange] , Keyword[long] operator[SEP] operator[SEP] identifier[cryptoRange] , identifier[S3Object] identifier[retrieved] , identifier[String] identifier[instFileSuffix] operator[SEP] { Keyword[final] identifier[S3ObjectId] identifier[id] operator[=] identifier[req] operator[SEP] identifier[getS3ObjectId] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[S3ObjectWrapper] identifier[ifile] operator[=] identifier[fetchInstructionFile] operator[SEP] identifier[id] , identifier[instFileSuffix] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ifile] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[instFileSuffix] operator[+] literal[String] operator[+] identifier[retrieved] operator[SEP] operator[SEP] } Keyword[try] { Keyword[return] identifier[decipherWithInstructionFile] operator[SEP] identifier[req] , identifier[desiredRange] , identifier[cryptoRange] , Keyword[new] identifier[S3ObjectWrapper] operator[SEP] identifier[retrieved] , identifier[id] operator[SEP] , identifier[ifile] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeQuietly] operator[SEP] identifier[ifile] , identifier[log] operator[SEP] operator[SEP] } }
public void synchronizeUserOrganizationMembership(DbSession dbSession, UserDto user, ALM alm, Set<String> organizationAlmIds) { Set<String> userOrganizationUuids = dbClient.organizationMemberDao().selectOrganizationUuidsByUser(dbSession, user.getId()); Set<String> userOrganizationUuidsWithMembersSyncEnabled = dbClient.organizationAlmBindingDao().selectByOrganizationUuids(dbSession, userOrganizationUuids).stream() .filter(OrganizationAlmBindingDto::isMembersSyncEnable) .map(OrganizationAlmBindingDto::getOrganizationUuid) .collect(toSet()); Set<String> almOrganizationUuidsWithMembersSyncEnabled = dbClient.organizationAlmBindingDao().selectByOrganizationAlmIds(dbSession, alm, organizationAlmIds).stream() .filter(OrganizationAlmBindingDto::isMembersSyncEnable) .map(OrganizationAlmBindingDto::getOrganizationUuid) .collect(toSet()); Set<String> organizationUuidsToBeAdded = difference(almOrganizationUuidsWithMembersSyncEnabled, userOrganizationUuidsWithMembersSyncEnabled); Set<String> organizationUuidsToBeRemoved = difference(userOrganizationUuidsWithMembersSyncEnabled, almOrganizationUuidsWithMembersSyncEnabled); Map<String, OrganizationDto> allOrganizationsByUuid = dbClient.organizationDao().selectByUuids(dbSession, union(organizationUuidsToBeAdded, organizationUuidsToBeRemoved)) .stream() .collect(uniqueIndex(OrganizationDto::getUuid)); allOrganizationsByUuid.entrySet().stream() .filter(entry -> organizationUuidsToBeAdded.contains(entry.getKey())) .forEach(entry -> addMemberInDb(dbSession, entry.getValue(), user)); allOrganizationsByUuid.entrySet().stream() .filter(entry -> organizationUuidsToBeRemoved.contains(entry.getKey())) .forEach(entry -> removeMemberInDb(dbSession, entry.getValue(), user)); }
class class_name[name] begin[{] method[synchronizeUserOrganizationMembership, return_type[void], modifier[public], parameter[dbSession, user, alm, organizationAlmIds]] begin[{] local_variable[type[Set], userOrganizationUuids] local_variable[type[Set], userOrganizationUuidsWithMembersSyncEnabled] local_variable[type[Set], almOrganizationUuidsWithMembersSyncEnabled] local_variable[type[Set], organizationUuidsToBeAdded] local_variable[type[Set], organizationUuidsToBeRemoved] local_variable[type[Map], allOrganizationsByUuid] call[allOrganizationsByUuid.entrySet, parameter[]] call[allOrganizationsByUuid.entrySet, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[synchronizeUserOrganizationMembership] operator[SEP] identifier[DbSession] identifier[dbSession] , identifier[UserDto] identifier[user] , identifier[ALM] identifier[alm] , identifier[Set] operator[<] identifier[String] operator[>] identifier[organizationAlmIds] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[userOrganizationUuids] operator[=] identifier[dbClient] operator[SEP] identifier[organizationMemberDao] operator[SEP] operator[SEP] operator[SEP] identifier[selectOrganizationUuidsByUser] operator[SEP] identifier[dbSession] , identifier[user] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[userOrganizationUuidsWithMembersSyncEnabled] operator[=] identifier[dbClient] operator[SEP] identifier[organizationAlmBindingDao] operator[SEP] operator[SEP] operator[SEP] identifier[selectByOrganizationUuids] operator[SEP] identifier[dbSession] , identifier[userOrganizationUuids] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[OrganizationAlmBindingDto] operator[::] identifier[isMembersSyncEnable] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[OrganizationAlmBindingDto] operator[::] identifier[getOrganizationUuid] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[toSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[almOrganizationUuidsWithMembersSyncEnabled] operator[=] identifier[dbClient] operator[SEP] identifier[organizationAlmBindingDao] operator[SEP] operator[SEP] operator[SEP] identifier[selectByOrganizationAlmIds] operator[SEP] identifier[dbSession] , identifier[alm] , identifier[organizationAlmIds] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[OrganizationAlmBindingDto] operator[::] identifier[isMembersSyncEnable] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[OrganizationAlmBindingDto] operator[::] identifier[getOrganizationUuid] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[toSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[organizationUuidsToBeAdded] operator[=] identifier[difference] operator[SEP] identifier[almOrganizationUuidsWithMembersSyncEnabled] , identifier[userOrganizationUuidsWithMembersSyncEnabled] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[organizationUuidsToBeRemoved] operator[=] identifier[difference] operator[SEP] identifier[userOrganizationUuidsWithMembersSyncEnabled] , identifier[almOrganizationUuidsWithMembersSyncEnabled] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[OrganizationDto] operator[>] identifier[allOrganizationsByUuid] operator[=] identifier[dbClient] operator[SEP] identifier[organizationDao] operator[SEP] operator[SEP] operator[SEP] identifier[selectByUuids] operator[SEP] identifier[dbSession] , identifier[union] operator[SEP] identifier[organizationUuidsToBeAdded] , identifier[organizationUuidsToBeRemoved] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[uniqueIndex] operator[SEP] identifier[OrganizationDto] operator[::] identifier[getUuid] operator[SEP] operator[SEP] operator[SEP] identifier[allOrganizationsByUuid] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[entry] operator[->] identifier[organizationUuidsToBeAdded] operator[SEP] identifier[contains] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[entry] operator[->] identifier[addMemberInDb] operator[SEP] identifier[dbSession] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[user] operator[SEP] operator[SEP] operator[SEP] identifier[allOrganizationsByUuid] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[entry] operator[->] identifier[organizationUuidsToBeRemoved] operator[SEP] identifier[contains] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[entry] operator[->] identifier[removeMemberInDb] operator[SEP] identifier[dbSession] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[user] operator[SEP] operator[SEP] operator[SEP] }
public static DMatrix3x3 transpose( DMatrix3x3 input , DMatrix3x3 output ) { if( input == null ) input = new DMatrix3x3(); output.a11 = input.a11; output.a12 = input.a21; output.a13 = input.a31; output.a21 = input.a12; output.a22 = input.a22; output.a23 = input.a32; output.a31 = input.a13; output.a32 = input.a23; output.a33 = input.a33; return output; }
class class_name[name] begin[{] method[transpose, return_type[type[DMatrix3x3]], modifier[public static], parameter[input, output]] begin[{] if[binary_operation[member[.input], ==, literal[null]]] begin[{] assign[member[.input], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DMatrix3x3, sub_type=None))] else begin[{] None end[}] assign[member[output.a11], member[input.a11]] assign[member[output.a12], member[input.a21]] assign[member[output.a13], member[input.a31]] assign[member[output.a21], member[input.a12]] assign[member[output.a22], member[input.a22]] assign[member[output.a23], member[input.a32]] assign[member[output.a31], member[input.a13]] assign[member[output.a32], member[input.a23]] assign[member[output.a33], member[input.a33]] return[member[.output]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DMatrix3x3] identifier[transpose] operator[SEP] identifier[DMatrix3x3] identifier[input] , identifier[DMatrix3x3] identifier[output] operator[SEP] { Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[SEP] identifier[input] operator[=] Keyword[new] identifier[DMatrix3x3] operator[SEP] operator[SEP] operator[SEP] identifier[output] operator[SEP] identifier[a11] operator[=] identifier[input] operator[SEP] identifier[a11] operator[SEP] identifier[output] operator[SEP] identifier[a12] operator[=] identifier[input] operator[SEP] identifier[a21] operator[SEP] identifier[output] operator[SEP] identifier[a13] operator[=] identifier[input] operator[SEP] identifier[a31] operator[SEP] identifier[output] operator[SEP] identifier[a21] operator[=] identifier[input] operator[SEP] identifier[a12] operator[SEP] identifier[output] operator[SEP] identifier[a22] operator[=] identifier[input] operator[SEP] identifier[a22] operator[SEP] identifier[output] operator[SEP] identifier[a23] operator[=] identifier[input] operator[SEP] identifier[a32] operator[SEP] identifier[output] operator[SEP] identifier[a31] operator[=] identifier[input] operator[SEP] identifier[a13] operator[SEP] identifier[output] operator[SEP] identifier[a32] operator[=] identifier[input] operator[SEP] identifier[a23] operator[SEP] identifier[output] operator[SEP] identifier[a33] operator[=] identifier[input] operator[SEP] identifier[a33] operator[SEP] Keyword[return] identifier[output] operator[SEP] }
protected Boolean hasRoleName(ActionBean bean, Method handler, String roleName) { // Let our superclass check if the user has the required role. return super.hasRole(bean, handler, roleName); }
class class_name[name] begin[{] method[hasRoleName, return_type[type[Boolean]], modifier[protected], parameter[bean, handler, roleName]] begin[{] return[SuperMethodInvocation(arguments=[MemberReference(member=bean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=roleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasRole, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
Keyword[protected] identifier[Boolean] identifier[hasRoleName] operator[SEP] identifier[ActionBean] identifier[bean] , identifier[Method] identifier[handler] , identifier[String] identifier[roleName] operator[SEP] { Keyword[return] Keyword[super] operator[SEP] identifier[hasRole] operator[SEP] identifier[bean] , identifier[handler] , identifier[roleName] operator[SEP] operator[SEP] }
@Override public void beforeCompletion() { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2 if (isTraceOn) // d527372 { if (tc.isEntryEnabled()) Tr.entry(tc, "beforeCompletion", new Object[] { Boolean.valueOf(globalTransaction), this, Boolean.valueOf(isActivitySessionCompleting) }); if (TETxLifeCycleInfo.isTraceEnabled()) // PQ74774 { // PQ74774 String tid = getTxId(); if (tid != null) { if (globalTransaction) { TETxLifeCycleInfo.traceGlobalTxBeforeCompletion (tid, "Global/User Tx BeforeCompletion"); } else { TETxLifeCycleInfo.traceLocalTxBeforeCompletion (tid, "Local Tx BeforeCompletion"); } } } // PQ74774 } //d139562.11 if (finderSyncList != null) // d173022.12 { // d173022.12 int numberofCallers = finderSyncList.size(); for (int i = 0; i < numberofCallers; ++i) { finderSyncList.get(i).beforeCompletion(); } } // d173022.12 if (ivBeanOsEnlistedInTx) { //d173022.2 origLock = true;//d115597 set the origLock flag to true because beforeCompletion entered EJBThreadData threadData = EJSContainer.getThreadData(); // d630940 BeanO beanO = null; boolean popCallbackBeanO = false; ComponentMetaData prevCMD = null; boolean resetCMD = false; ClassLoader prevClassLoader = null; Object origClassLoader = ThreadContextAccessor.UNCHANGED; try { // Process beans in a loop to allow beforeCompletion callbacks to // enlist additional beans. We limit the number of iterations to // detect infinite loops. d115597 int iterationCount = 0; for (ArrayList<BeanO> iterationBeanOs = beanOList; iterationBeanOs != null; iterationBeanOs = tempList, tempList = null) { if (iterationCount++ > MAX_ENLISTMENT_ITERATIONS) { beanO = null; throw new RuntimeException("Exceeded " + MAX_ENLISTMENT_ITERATIONS + " enlistment iterations in beforeCompletion"); } //-------------------------------------------------------------- // d115597 // Imposes an order in which the beforeCompletion callbacks // will be fired on the beans. // beforeCompletion is called on beans in the order they were // enlisted. This is true for beans enlisted after beforeCompletion // has begun as well. // d115597 //-------------------------------------------------------------- for (int i = 0, size = iterationBeanOs.size(); i < size; i++) { beanO = iterationBeanOs.get(i); BeanMetaData bmd = beanO.home.beanMetaData; // Process all beans if the activity session is completing. // Only process entity beans if this is a checkpoint. // // d126930.3 // By default isActivitySessionCompleting is set to true even if there // is no activitySession present. This simply means we follow the normal // ContainerTx logic for ending a transaction. if (isActivitySessionCompleting || bmd.isEntityBean()) { // Update the thread callback bean. threadData.pushCallbackBeanO(beanO); // d168509, d630940 popCallbackBeanO = true; // Update the thread CMD if it's not the same as the // previous bean. if (bmd != prevCMD) { if (resetCMD) { cmdAccessor.endContext(); } cmdAccessor.beginContext(bmd); prevCMD = bmd; resetCMD = true; // Update the class loader if it's not the same as the // previous bean. PK51366, PK83186 ClassLoader classLoader = bmd.ivContextClassLoader; // F85059 if (classLoader != prevClassLoader) { prevClassLoader = classLoader; origClassLoader = EJBThreadData.svThreadContextAccessor.repushContextClassLoaderForUnprivileged(origClassLoader, classLoader); } } // d126930.3 // EJB 2.0 beans may have sticky local transactions (i.e. // local tx boundary = ActivitySession). We need to assure // the correct ComponentMetaData and local tx context is // on thread in this case. Note that EJB 1.1 beans may not // have local tx boundary = ActivitySession. This is enforced // by a check in BeanMetaData if (isActivitySessionCompleting && (globalTransaction || bmd._localTran.getBoundary() == LocalTransactionSettings.BOUNDARY_ACTIVITY_SESSION)) { beanO.beforeCompletion(); } else { TxContextChange changedContext = uowCtrl.setupLocalTxContext(beanO.getId()); try { if (isActivitySessionCompleting) { beanO.beforeCompletion(); } else { //------------------------------------------------------------- // Special case added for mid-activitySession checkpoint. // Entity beans enlisted in local transactions must be stored // to flush any in-memory updates out to the backing store // (ie. checkpoint them). For other bean types, we do // nothing on mid-activitySession checkpoint. The local // transaction service will make setCompleting = false calls to // the containerSynchronization interface at checkpoint. Also, // beforeCompletion and afterCompletion will be called. We // have special code both here, and in afterCompletion, so that // the beans' states do not change. We just store them. // ------------------------------------------------------------ beanO.store(); } } finally { uowCtrl.teardownLocalTxContext(changedContext); } } popCallbackBeanO = false; threadData.popCallbackBeanO(); } } } } catch (Throwable t) { FFDCFilter.processException(t, CLASS_NAME + ".beforeCompletion", "562", this); if (isTraceOn && tc.isEventEnabled()) // d144064 Tr.event(tc, "Exception during beforeCompletion(): rolling back", new Object[] { beanO, t }); // Destroy the beanO, too late to delist. Destroying it should // take care of the state when the transaction is rolled back. // Note there may not be a beanO, if the exception is container // detecting a loop condition - not a bean exception. d160910 if (beanO != null) beanO.destroy(); ivContainer.uowCtrl.setRollbackOnly(); // Log the exception ExceptionUtil.logException(tc, t, null, beanO); // Save the first exception that occurs during commit // processing to nest in TransactionRolledBackException. PQ90221 if (ivPostProcessingException == null) ivPostProcessingException = t; // Inform the transaction manager that the beforeCompletion // failed. Else, the tran engine might continue to fire // beforeCompletion callbacks on other participants throw new RuntimeException("", t); //253963 } finally { EJBThreadData.svThreadContextAccessor.popContextClassLoaderForUnprivileged(origClassLoader); if (resetCMD) { cmdAccessor.endContext(); } if (popCallbackBeanO) { threadData.popCallbackBeanO(); } } } if (isActivitySessionCompleting) { //-------------------------------------------------------------- // The before completion callbacks on the beans may result // in more beans getting enlisted in this transaction, so we don't // change the state to PREPARING until all beans are prepared. //-------------------------------------------------------------- becomePreparing(); } // Now that all of the beans have been successfully stored, call // before completion on the PM transaction listener. d134692 if (txListener != null) { try { if (isTraceOn && tc.isDebugEnabled()) // d144064 Tr.debug(tc, "Calling txListener.beforeCompletion()"); txListener.beforeCompletion(); } catch (Throwable e) { FFDCFilter.processException(e, CLASS_NAME + ".beforeCompletion", "734", this); if (ivPostProcessingException == null) { //253963 ivPostProcessingException = e; //253963 } throw new RuntimeException("txListener exception" + e.toString()); } } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "beforeCompletion"); // d144064 }
class class_name[name] begin[{] method[beforeCompletion, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[boolean], isTraceOn] if[member[.isTraceOn]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[Tr.entry, parameter[member[.tc], literal["beforeCompletion"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MethodInvocation(arguments=[MemberReference(member=globalTransaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[MemberReference(member=isActivitySessionCompleting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] if[call[TETxLifeCycleInfo.isTraceEnabled, parameter[]]] begin[{] local_variable[type[String], tid] if[binary_operation[member[.tid], !=, literal[null]]] begin[{] if[member[.globalTransaction]] begin[{] call[TETxLifeCycleInfo.traceGlobalTxBeforeCompletion, parameter[member[.tid], literal["Global/User Tx BeforeCompletion"]]] else begin[{] call[TETxLifeCycleInfo.traceLocalTxBeforeCompletion, parameter[member[.tid], literal["Local Tx BeforeCompletion"]]] end[}] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.finderSyncList], !=, literal[null]]] begin[{] local_variable[type[int], numberofCallers] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=finderSyncList, selectors=[MethodInvocation(arguments=[], member=beforeCompletion, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberofCallers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] if[member[.ivBeanOsEnlistedInTx]] begin[{] assign[member[.origLock], literal[true]] local_variable[type[EJBThreadData], threadData] local_variable[type[BeanO], beanO] local_variable[type[boolean], popCallbackBeanO] local_variable[type[ComponentMetaData], prevCMD] local_variable[type[boolean], resetCMD] local_variable[type[ClassLoader], prevClassLoader] local_variable[type[Object], origClassLoader] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=iterationCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=iterationCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_ENLISTMENT_ITERATIONS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=beanO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exceeded "), operandr=MemberReference(member=MAX_ENLISTMENT_ITERATIONS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" enlistment iterations in beforeCompletion"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=beanO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=iterationBeanOs, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=beanMetaData, postfix_operators=[], prefix_operators=[], qualifier=beanO.home, selectors=[]), name=bmd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BeanMetaData, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isActivitySessionCompleting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isEntityBean, postfix_operators=[], prefix_operators=[], qualifier=bmd, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=beanO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushCallbackBeanO, postfix_operators=[], prefix_operators=[], qualifier=threadData, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=popCallbackBeanO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bmd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=prevCMD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=resetCMD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=endContext, postfix_operators=[], prefix_operators=[], qualifier=cmdAccessor, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bmd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=beginContext, postfix_operators=[], prefix_operators=[], qualifier=cmdAccessor, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevCMD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=bmd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=resetCMD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=ivContextClassLoader, postfix_operators=[], prefix_operators=[], qualifier=bmd, selectors=[]), name=classLoader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=classLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=prevClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prevClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=classLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=origClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=origClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=repushContextClassLoaderForUnprivileged, postfix_operators=[], prefix_operators=[], qualifier=EJBThreadData.svThreadContextAccessor, selectors=[], type_arguments=None)), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isActivitySessionCompleting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=globalTransaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getBoundary, postfix_operators=[], prefix_operators=[], qualifier=bmd._localTran, selectors=[], type_arguments=None), operandr=MemberReference(member=BOUNDARY_ACTIVITY_SESSION, postfix_operators=[], prefix_operators=[], qualifier=LocalTransactionSettings, selectors=[]), operator===), operator=||), operator=&&), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=beanO, selectors=[], type_arguments=None)], member=setupLocalTxContext, postfix_operators=[], prefix_operators=[], qualifier=uowCtrl, selectors=[], type_arguments=None), name=changedContext)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TxContextChange, sub_type=None)), TryStatement(block=[IfStatement(condition=MemberReference(member=isActivitySessionCompleting, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=store, postfix_operators=[], prefix_operators=[], qualifier=beanO, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=beforeCompletion, postfix_operators=[], prefix_operators=[], qualifier=beanO, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=changedContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=teardownLocalTxContext, postfix_operators=[], prefix_operators=[], qualifier=uowCtrl, selectors=[], type_arguments=None), label=None)], label=None, resources=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=beforeCompletion, postfix_operators=[], prefix_operators=[], qualifier=beanO, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=popCallbackBeanO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=popCallbackBeanO, postfix_operators=[], prefix_operators=[], qualifier=threadData, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=iterationBeanOs, selectors=[], type_arguments=None), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=iterationBeanOs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=beanOList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=iterationBeanOs)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BeanO, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=iterationBeanOs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tempList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), Assignment(expressionl=MemberReference(member=tempList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".beforeCompletion"), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="562"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception during beforeCompletion(): rolling back"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=beanO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=t, 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=event, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=beanO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=destroy, postfix_operators=[], prefix_operators=[], qualifier=beanO, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=setRollbackOnly, postfix_operators=[], prefix_operators=[], qualifier=ivContainer.uowCtrl, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=beanO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logException, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtil, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ivPostProcessingException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=ivPostProcessingException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), 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=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=origClassLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=popContextClassLoaderForUnprivileged, postfix_operators=[], prefix_operators=[], qualifier=EJBThreadData.svThreadContextAccessor, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=resetCMD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=endContext, postfix_operators=[], prefix_operators=[], qualifier=cmdAccessor, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MemberReference(member=popCallbackBeanO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=popCallbackBeanO, postfix_operators=[], prefix_operators=[], qualifier=threadData, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) else begin[{] None end[}] if[member[.isActivitySessionCompleting]] begin[{] call[.becomePreparing, parameter[]] else begin[{] None end[}] if[binary_operation[member[.txListener], !=, literal[null]]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Calling txListener.beforeCompletion()")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=beforeCompletion, postfix_operators=[], prefix_operators=[], qualifier=txListener, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".beforeCompletion"), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="734"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ivPostProcessingException, 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=ivPostProcessingException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="txListener exception"), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["beforeCompletion"]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[beforeCompletion] operator[SEP] operator[SEP] { Keyword[final] Keyword[boolean] identifier[isTraceOn] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[globalTransaction] operator[SEP] , Keyword[this] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[isActivitySessionCompleting] operator[SEP] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TETxLifeCycleInfo] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[tid] operator[=] identifier[getTxId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tid] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[globalTransaction] operator[SEP] { identifier[TETxLifeCycleInfo] operator[SEP] identifier[traceGlobalTxBeforeCompletion] operator[SEP] identifier[tid] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[TETxLifeCycleInfo] operator[SEP] identifier[traceLocalTxBeforeCompletion] operator[SEP] identifier[tid] , literal[String] operator[SEP] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[finderSyncList] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[numberofCallers] operator[=] identifier[finderSyncList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numberofCallers] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[finderSyncList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[beforeCompletion] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[ivBeanOsEnlistedInTx] operator[SEP] { identifier[origLock] operator[=] literal[boolean] operator[SEP] identifier[EJBThreadData] identifier[threadData] operator[=] identifier[EJSContainer] operator[SEP] identifier[getThreadData] operator[SEP] operator[SEP] operator[SEP] identifier[BeanO] identifier[beanO] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[popCallbackBeanO] operator[=] literal[boolean] operator[SEP] identifier[ComponentMetaData] identifier[prevCMD] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[resetCMD] operator[=] literal[boolean] operator[SEP] identifier[ClassLoader] identifier[prevClassLoader] operator[=] Other[null] operator[SEP] identifier[Object] identifier[origClassLoader] operator[=] identifier[ThreadContextAccessor] operator[SEP] identifier[UNCHANGED] operator[SEP] Keyword[try] { Keyword[int] identifier[iterationCount] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[ArrayList] operator[<] identifier[BeanO] operator[>] identifier[iterationBeanOs] operator[=] identifier[beanOList] operator[SEP] identifier[iterationBeanOs] operator[!=] Other[null] operator[SEP] identifier[iterationBeanOs] operator[=] identifier[tempList] , identifier[tempList] operator[=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[iterationCount] operator[++] operator[>] identifier[MAX_ENLISTMENT_ITERATIONS] operator[SEP] { identifier[beanO] operator[=] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[MAX_ENLISTMENT_ITERATIONS] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[size] operator[=] identifier[iterationBeanOs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[beanO] operator[=] identifier[iterationBeanOs] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[BeanMetaData] identifier[bmd] operator[=] identifier[beanO] operator[SEP] identifier[home] operator[SEP] identifier[beanMetaData] operator[SEP] Keyword[if] operator[SEP] identifier[isActivitySessionCompleting] operator[||] identifier[bmd] operator[SEP] identifier[isEntityBean] operator[SEP] operator[SEP] operator[SEP] { identifier[threadData] operator[SEP] identifier[pushCallbackBeanO] operator[SEP] identifier[beanO] operator[SEP] operator[SEP] identifier[popCallbackBeanO] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[bmd] operator[!=] identifier[prevCMD] operator[SEP] { Keyword[if] operator[SEP] identifier[resetCMD] operator[SEP] { identifier[cmdAccessor] operator[SEP] identifier[endContext] operator[SEP] operator[SEP] operator[SEP] } identifier[cmdAccessor] operator[SEP] identifier[beginContext] operator[SEP] identifier[bmd] operator[SEP] operator[SEP] identifier[prevCMD] operator[=] identifier[bmd] operator[SEP] identifier[resetCMD] operator[=] literal[boolean] operator[SEP] identifier[ClassLoader] identifier[classLoader] operator[=] identifier[bmd] operator[SEP] identifier[ivContextClassLoader] operator[SEP] Keyword[if] operator[SEP] identifier[classLoader] operator[!=] identifier[prevClassLoader] operator[SEP] { identifier[prevClassLoader] operator[=] identifier[classLoader] operator[SEP] identifier[origClassLoader] operator[=] identifier[EJBThreadData] operator[SEP] identifier[svThreadContextAccessor] operator[SEP] identifier[repushContextClassLoaderForUnprivileged] operator[SEP] identifier[origClassLoader] , identifier[classLoader] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[isActivitySessionCompleting] operator[&&] operator[SEP] identifier[globalTransaction] operator[||] identifier[bmd] operator[SEP] identifier[_localTran] operator[SEP] identifier[getBoundary] operator[SEP] operator[SEP] operator[==] identifier[LocalTransactionSettings] operator[SEP] identifier[BOUNDARY_ACTIVITY_SESSION] operator[SEP] operator[SEP] { identifier[beanO] operator[SEP] identifier[beforeCompletion] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[TxContextChange] identifier[changedContext] operator[=] identifier[uowCtrl] operator[SEP] identifier[setupLocalTxContext] operator[SEP] identifier[beanO] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[isActivitySessionCompleting] operator[SEP] { identifier[beanO] operator[SEP] identifier[beforeCompletion] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[beanO] operator[SEP] identifier[store] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[uowCtrl] operator[SEP] identifier[teardownLocalTxContext] operator[SEP] identifier[changedContext] operator[SEP] operator[SEP] } } identifier[popCallbackBeanO] operator[=] literal[boolean] operator[SEP] identifier[threadData] operator[SEP] identifier[popCallbackBeanO] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[t] , identifier[CLASS_NAME] operator[+] literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[beanO] , identifier[t] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[beanO] operator[!=] Other[null] operator[SEP] identifier[beanO] operator[SEP] identifier[destroy] operator[SEP] operator[SEP] operator[SEP] identifier[ivContainer] operator[SEP] identifier[uowCtrl] operator[SEP] identifier[setRollbackOnly] operator[SEP] operator[SEP] operator[SEP] identifier[ExceptionUtil] operator[SEP] identifier[logException] operator[SEP] identifier[tc] , identifier[t] , Other[null] , identifier[beanO] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ivPostProcessingException] operator[==] Other[null] operator[SEP] identifier[ivPostProcessingException] operator[=] identifier[t] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP] } Keyword[finally] { identifier[EJBThreadData] operator[SEP] identifier[svThreadContextAccessor] operator[SEP] identifier[popContextClassLoaderForUnprivileged] operator[SEP] identifier[origClassLoader] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resetCMD] operator[SEP] { identifier[cmdAccessor] operator[SEP] identifier[endContext] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[popCallbackBeanO] operator[SEP] { identifier[threadData] operator[SEP] identifier[popCallbackBeanO] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[isActivitySessionCompleting] operator[SEP] { identifier[becomePreparing] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[txListener] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[isTraceOn] 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[SEP] operator[SEP] identifier[txListener] operator[SEP] identifier[beforeCompletion] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[e] , identifier[CLASS_NAME] operator[+] literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ivPostProcessingException] operator[==] Other[null] operator[SEP] { identifier[ivPostProcessingException] operator[=] identifier[e] operator[SEP] } Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public static String getQuotedQualifiedTableName(String schema, String tableName, String qC) { String quotedTableName = String.format(OffsetQueryUtil.QUOTED_NAME, qC, tableName, qC); return StringUtils.isEmpty(schema) ? quotedTableName: String.format(OffsetQueryUtil.QUOTED_NAME, qC, schema, qC) + "." + quotedTableName ; }
class class_name[name] begin[{] method[getQuotedQualifiedTableName, return_type[type[String]], modifier[public static], parameter[schema, tableName, qC]] begin[{] local_variable[type[String], quotedTableName] return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), if_false=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=QUOTED_NAME, postfix_operators=[], prefix_operators=[], qualifier=OffsetQueryUtil, selectors=[]), MemberReference(member=qC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=qC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), operandr=MemberReference(member=quotedTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), if_true=MemberReference(member=quotedTableName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getQuotedQualifiedTableName] operator[SEP] identifier[String] identifier[schema] , identifier[String] identifier[tableName] , identifier[String] identifier[qC] operator[SEP] { identifier[String] identifier[quotedTableName] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[OffsetQueryUtil] operator[SEP] identifier[QUOTED_NAME] , identifier[qC] , identifier[tableName] , identifier[qC] operator[SEP] operator[SEP] Keyword[return] identifier[StringUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[schema] operator[SEP] operator[?] identifier[quotedTableName] operator[:] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[OffsetQueryUtil] operator[SEP] identifier[QUOTED_NAME] , identifier[qC] , identifier[schema] , identifier[qC] operator[SEP] operator[+] literal[String] operator[+] identifier[quotedTableName] operator[SEP] }
public JSONObject sameHqDeleteBySign(String contSign, HashMap<String, String> options) { AipRequest request = new AipRequest(); preOperation(request); request.addBody("cont_sign", contSign); if (options != null) { request.addBody(options); } request.setUri(ImageSearchConsts.SAME_HQ_DELETE); postOperation(request); return requestServer(request); }
class class_name[name] begin[{] method[sameHqDeleteBySign, return_type[type[JSONObject]], modifier[public], parameter[contSign, options]] begin[{] local_variable[type[AipRequest], request] call[.preOperation, parameter[member[.request]]] call[request.addBody, parameter[literal["cont_sign"], member[.contSign]]] if[binary_operation[member[.options], !=, literal[null]]] begin[{] call[request.addBody, parameter[member[.options]]] else begin[{] None end[}] call[request.setUri, parameter[member[ImageSearchConsts.SAME_HQ_DELETE]]] call[.postOperation, parameter[member[.request]]] return[call[.requestServer, parameter[member[.request]]]] end[}] END[}]
Keyword[public] identifier[JSONObject] identifier[sameHqDeleteBySign] operator[SEP] identifier[String] identifier[contSign] , identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[options] operator[SEP] { identifier[AipRequest] identifier[request] operator[=] Keyword[new] identifier[AipRequest] operator[SEP] operator[SEP] operator[SEP] identifier[preOperation] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[addBody] operator[SEP] literal[String] , identifier[contSign] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[options] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addBody] operator[SEP] identifier[options] operator[SEP] operator[SEP] } identifier[request] operator[SEP] identifier[setUri] operator[SEP] identifier[ImageSearchConsts] operator[SEP] identifier[SAME_HQ_DELETE] operator[SEP] operator[SEP] identifier[postOperation] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[requestServer] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void close() throws IOException { if(com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable(Level.FINE)){ // PM12137 logger.logp(Level.FINE, CLASS_NAME, "close", "this=["+this+"]"); // PM12137 } // PM12137 if (writer != null) { writer.close(); } else { //PK33136 closed = true; strBuffer = null; //PK33136 } }
class class_name[name] begin[{] method[close, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[call[com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[logger.isLoggable, parameter[member[Level.FINE]]]]] begin[{] call[logger.logp, parameter[member[Level.FINE], member[.CLASS_NAME], literal["close"], binary_operation[binary_operation[literal["this=["], +, THIS[]], +, literal["]"]]]] else begin[{] None end[}] if[binary_operation[member[.writer], !=, literal[null]]] begin[{] call[writer.close, parameter[]] else begin[{] assign[member[.closed], literal[true]] assign[member[.strBuffer], literal[null]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ejs] operator[SEP] identifier[ras] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[+] Keyword[this] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[writer] operator[!=] Other[null] operator[SEP] { identifier[writer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[closed] operator[=] literal[boolean] operator[SEP] identifier[strBuffer] operator[=] Other[null] operator[SEP] } }
private void debugLogEnd(String operationType, Long OriginTimeInMs, Long RequestStartTimeInMs, Long ResponseReceivedTimeInMs, String keyString, int numVectorClockEntries) { long durationInMs = ResponseReceivedTimeInMs - RequestStartTimeInMs; logger.debug("Received a response from voldemort server for Operation Type: " + operationType + " , For key(s): " + keyString + " , Store: " + this.storeName + " , Origin time of request (in ms): " + OriginTimeInMs + " , Response received at time (in ms): " + ResponseReceivedTimeInMs + " . Request sent at(in ms): " + RequestStartTimeInMs + " , Num vector clock entries: " + numVectorClockEntries + " , Duration from CoordinatorFatClient back to CoordinatorFatClient(in ms): " + durationInMs); }
class class_name[name] begin[{] method[debugLogEnd, return_type[void], modifier[private], parameter[operationType, OriginTimeInMs, RequestStartTimeInMs, ResponseReceivedTimeInMs, keyString, numVectorClockEntries]] begin[{] local_variable[type[long], durationInMs] call[logger.debug, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Received a response from voldemort server for Operation Type: "], +, member[.operationType]], +, literal[" , For key(s): "]], +, member[.keyString]], +, literal[" , Store: "]], +, THIS[member[None.storeName]]], +, literal[" , Origin time of request (in ms): "]], +, member[.OriginTimeInMs]], +, literal[" , Response received at time (in ms): "]], +, member[.ResponseReceivedTimeInMs]], +, literal[" . Request sent at(in ms): "]], +, member[.RequestStartTimeInMs]], +, literal[" , Num vector clock entries: "]], +, member[.numVectorClockEntries]], +, literal[" , Duration from CoordinatorFatClient back to CoordinatorFatClient(in ms): "]], +, member[.durationInMs]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[debugLogEnd] operator[SEP] identifier[String] identifier[operationType] , identifier[Long] identifier[OriginTimeInMs] , identifier[Long] identifier[RequestStartTimeInMs] , identifier[Long] identifier[ResponseReceivedTimeInMs] , identifier[String] identifier[keyString] , Keyword[int] identifier[numVectorClockEntries] operator[SEP] { Keyword[long] identifier[durationInMs] operator[=] identifier[ResponseReceivedTimeInMs] operator[-] identifier[RequestStartTimeInMs] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[operationType] operator[+] literal[String] operator[+] identifier[keyString] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[storeName] operator[+] literal[String] operator[+] identifier[OriginTimeInMs] operator[+] literal[String] operator[+] identifier[ResponseReceivedTimeInMs] operator[+] literal[String] operator[+] identifier[RequestStartTimeInMs] operator[+] literal[String] operator[+] identifier[numVectorClockEntries] operator[+] literal[String] operator[+] identifier[durationInMs] operator[SEP] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.IMAGE_RESOLUTION__XBASE: return getXBase(); case AfplibPackage.IMAGE_RESOLUTION__YBASE: return getYBase(); case AfplibPackage.IMAGE_RESOLUTION__XRESOL: return getXResol(); case AfplibPackage.IMAGE_RESOLUTION__YRESOL: return getYResol(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=IMAGE_RESOLUTION__XBASE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getXBase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=IMAGE_RESOLUTION__YBASE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getYBase, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=IMAGE_RESOLUTION__XRESOL, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getXResol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=IMAGE_RESOLUTION__YRESOL, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getYResol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[IMAGE_RESOLUTION__XBASE] operator[:] Keyword[return] identifier[getXBase] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[IMAGE_RESOLUTION__YBASE] operator[:] Keyword[return] identifier[getYBase] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[IMAGE_RESOLUTION__XRESOL] operator[:] Keyword[return] identifier[getXResol] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[IMAGE_RESOLUTION__YRESOL] operator[:] Keyword[return] identifier[getYResol] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
public static Properties parseArgs(Class<?> caller, String[] args) throws IOException { try { // Parse command-line options CommandLine cmd = new DefaultParser().parse(options(), args); if (cmd.hasOption(HELP_OPTION.getOpt())) { printUsage(caller); System.exit(0); } if (!cmd.hasOption(SYS_CONFIG_OPTION.getLongOpt()) || !cmd.hasOption(JOB_CONFIG_OPTION.getLongOpt())) { printUsage(caller); System.exit(1); } // Load system and job configuration properties Properties sysConfig = JobConfigurationUtils.fileToProperties(cmd.getOptionValue(SYS_CONFIG_OPTION.getLongOpt())); Properties jobConfig = JobConfigurationUtils.fileToProperties(cmd.getOptionValue(JOB_CONFIG_OPTION.getLongOpt())); return JobConfigurationUtils.combineSysAndJobProperties(sysConfig, jobConfig); } catch (ParseException | ConfigurationException e) { throw new IOException(e); } }
class class_name[name] begin[{] method[parseArgs, return_type[type[Properties]], modifier[public static], parameter[caller, args]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=DefaultParser, sub_type=None)), name=cmd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommandLine, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOpt, postfix_operators=[], prefix_operators=[], qualifier=HELP_OPTION, selectors=[], type_arguments=None)], member=hasOption, postfix_operators=[], prefix_operators=[], qualifier=cmd, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=caller, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printUsage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLongOpt, postfix_operators=[], prefix_operators=[], qualifier=SYS_CONFIG_OPTION, selectors=[], type_arguments=None)], member=hasOption, postfix_operators=[], prefix_operators=['!'], qualifier=cmd, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLongOpt, postfix_operators=[], prefix_operators=[], qualifier=JOB_CONFIG_OPTION, selectors=[], type_arguments=None)], member=hasOption, postfix_operators=[], prefix_operators=['!'], qualifier=cmd, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=caller, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printUsage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLongOpt, postfix_operators=[], prefix_operators=[], qualifier=SYS_CONFIG_OPTION, selectors=[], type_arguments=None)], member=getOptionValue, postfix_operators=[], prefix_operators=[], qualifier=cmd, selectors=[], type_arguments=None)], member=fileToProperties, postfix_operators=[], prefix_operators=[], qualifier=JobConfigurationUtils, selectors=[], type_arguments=None), name=sysConfig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLongOpt, postfix_operators=[], prefix_operators=[], qualifier=JOB_CONFIG_OPTION, selectors=[], type_arguments=None)], member=getOptionValue, postfix_operators=[], prefix_operators=[], qualifier=cmd, selectors=[], type_arguments=None)], member=fileToProperties, postfix_operators=[], prefix_operators=[], qualifier=JobConfigurationUtils, selectors=[], type_arguments=None), name=jobConfig)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Properties, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=sysConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jobConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=combineSysAndJobProperties, postfix_operators=[], prefix_operators=[], qualifier=JobConfigurationUtils, 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException', 'ConfigurationException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Properties] identifier[parseArgs] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[caller] , identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[try] { identifier[CommandLine] identifier[cmd] operator[=] Keyword[new] identifier[DefaultParser] operator[SEP] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[options] operator[SEP] operator[SEP] , identifier[args] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmd] operator[SEP] identifier[hasOption] operator[SEP] identifier[HELP_OPTION] operator[SEP] identifier[getOpt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[printUsage] operator[SEP] identifier[caller] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[cmd] operator[SEP] identifier[hasOption] operator[SEP] identifier[SYS_CONFIG_OPTION] operator[SEP] identifier[getLongOpt] operator[SEP] operator[SEP] operator[SEP] operator[||] operator[!] identifier[cmd] operator[SEP] identifier[hasOption] operator[SEP] identifier[JOB_CONFIG_OPTION] operator[SEP] identifier[getLongOpt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[printUsage] operator[SEP] identifier[caller] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[1] operator[SEP] operator[SEP] } identifier[Properties] identifier[sysConfig] operator[=] identifier[JobConfigurationUtils] operator[SEP] identifier[fileToProperties] operator[SEP] identifier[cmd] operator[SEP] identifier[getOptionValue] operator[SEP] identifier[SYS_CONFIG_OPTION] operator[SEP] identifier[getLongOpt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Properties] identifier[jobConfig] operator[=] identifier[JobConfigurationUtils] operator[SEP] identifier[fileToProperties] operator[SEP] identifier[cmd] operator[SEP] identifier[getOptionValue] operator[SEP] identifier[JOB_CONFIG_OPTION] operator[SEP] identifier[getLongOpt] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[JobConfigurationUtils] operator[SEP] identifier[combineSysAndJobProperties] operator[SEP] identifier[sysConfig] , identifier[jobConfig] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ParseException] operator[|] identifier[ConfigurationException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
@Override public boolean isAuthzInfoAvailableForApp(String appName) { if (roles != null && !roles.isEmpty()) return true; else return false; }
class class_name[name] begin[{] method[isAuthzInfoAvailableForApp, return_type[type[boolean]], modifier[public], parameter[appName]] begin[{] if[binary_operation[binary_operation[member[.roles], !=, literal[null]], &&, call[roles.isEmpty, parameter[]]]] begin[{] return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isAuthzInfoAvailableForApp] operator[SEP] identifier[String] identifier[appName] operator[SEP] { Keyword[if] operator[SEP] identifier[roles] operator[!=] Other[null] operator[&&] operator[!] identifier[roles] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[else] Keyword[return] literal[boolean] operator[SEP] }
public Message copy(boolean copy_buffer, short starting_id, short ... copy_only_ids) { Message retval=copy(copy_buffer, false); for(Map.Entry<Short,Header> entry: getHeaders().entrySet()) { short id=entry.getKey(); if(id >= starting_id || Util.containsId(id, copy_only_ids)) retval.putHeader(id, entry.getValue()); } return retval; }
class class_name[name] begin[{] method[copy, return_type[type[Message]], modifier[public], parameter[copy_buffer, starting_id, copy_only_ids]] begin[{] local_variable[type[Message], retval] 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=id)], modifiers=set(), type=BasicType(dimensions=[], name=short)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=starting_id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=copy_only_ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsId, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=putHeader, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getHeaders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=entrySet, 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=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Short, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Header, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[member[.retval]] end[}] END[}]
Keyword[public] identifier[Message] identifier[copy] operator[SEP] Keyword[boolean] identifier[copy_buffer] , Keyword[short] identifier[starting_id] , Keyword[short] operator[...] identifier[copy_only_ids] operator[SEP] { identifier[Message] identifier[retval] operator[=] identifier[copy] operator[SEP] identifier[copy_buffer] , literal[boolean] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Short] , identifier[Header] operator[>] identifier[entry] operator[:] identifier[getHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[short] identifier[id] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] operator[>=] identifier[starting_id] operator[||] identifier[Util] operator[SEP] identifier[containsId] operator[SEP] identifier[id] , identifier[copy_only_ids] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[putHeader] operator[SEP] identifier[id] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[retval] operator[SEP] }
private void updateInterval() { intervalMillis = getCombinedValue(endDate, endTime) - getCombinedValue(startDate, startTime); // if this is zero, most likely the times aren't set and the // dates are the same. in this case we don't really want a // zero interval. if we *really* want a zero interval, the // default would be zero so this is safe. if (intervalMillis == 0) { intervalMillis = defaultIntervalMillis; } }
class class_name[name] begin[{] method[updateInterval, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.intervalMillis], binary_operation[call[.getCombinedValue, parameter[member[.endDate], member[.endTime]]], -, call[.getCombinedValue, parameter[member[.startDate], member[.startTime]]]]] if[binary_operation[member[.intervalMillis], ==, literal[0]]] begin[{] assign[member[.intervalMillis], member[.defaultIntervalMillis]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[updateInterval] operator[SEP] operator[SEP] { identifier[intervalMillis] operator[=] identifier[getCombinedValue] operator[SEP] identifier[endDate] , identifier[endTime] operator[SEP] operator[-] identifier[getCombinedValue] operator[SEP] identifier[startDate] , identifier[startTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[intervalMillis] operator[==] Other[0] operator[SEP] { identifier[intervalMillis] operator[=] identifier[defaultIntervalMillis] operator[SEP] } }