code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
@Override public void visitClassContext(ClassContext classContext) { try { JavaClass cls = classContext.getJavaClass(); JavaClass[] superClasses = cls.getSuperClasses(); for (JavaClass superCls : superClasses) { if (tagClasses.contains(superCls.getClassName())) { attributes = getAttributes(cls); if (!attributes.isEmpty()) { methodWrites = new HashMap<>(); fieldAnnotations = new HashMap<>(); super.visitClassContext(classContext); reportBugs(); } break; } } } catch (ClassNotFoundException cnfe) { bugReporter.reportMissingClass(cnfe); } finally { attributes = null; methodWrites = null; fieldAnnotations = null; } }
class class_name[name] begin[{] method[visitClassContext, return_type[void], modifier[public], parameter[classContext]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getJavaClass, postfix_operators=[], prefix_operators=[], qualifier=classContext, selectors=[], type_arguments=None), name=cls)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JavaClass, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSuperClasses, postfix_operators=[], prefix_operators=[], qualifier=cls, selectors=[], type_arguments=None), name=superClasses)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=JavaClass, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=superCls, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=tagClasses, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=cls, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=attributes, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=methodWrites, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fieldAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))), label=None), StatementExpression(expression=SuperMethodInvocation(arguments=[MemberReference(member=classContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitClassContext, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=reportBugs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=superClasses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=superCls)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JavaClass, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cnfe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportMissingClass, postfix_operators=[], prefix_operators=[], qualifier=bugReporter, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cnfe, types=['ClassNotFoundException']))], finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=methodWrites, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fieldAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[visitClassContext] operator[SEP] identifier[ClassContext] identifier[classContext] operator[SEP] { Keyword[try] { identifier[JavaClass] identifier[cls] operator[=] identifier[classContext] operator[SEP] identifier[getJavaClass] operator[SEP] operator[SEP] operator[SEP] identifier[JavaClass] operator[SEP] operator[SEP] identifier[superClasses] operator[=] identifier[cls] operator[SEP] identifier[getSuperClasses] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[JavaClass] identifier[superCls] operator[:] identifier[superClasses] operator[SEP] { Keyword[if] operator[SEP] identifier[tagClasses] operator[SEP] identifier[contains] operator[SEP] identifier[superCls] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[attributes] operator[=] identifier[getAttributes] operator[SEP] identifier[cls] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[attributes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[methodWrites] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[fieldAnnotations] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[visitClassContext] operator[SEP] identifier[classContext] operator[SEP] operator[SEP] identifier[reportBugs] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[cnfe] operator[SEP] { identifier[bugReporter] operator[SEP] identifier[reportMissingClass] operator[SEP] identifier[cnfe] operator[SEP] operator[SEP] } Keyword[finally] { identifier[attributes] operator[=] Other[null] operator[SEP] identifier[methodWrites] operator[=] Other[null] operator[SEP] identifier[fieldAnnotations] operator[=] Other[null] operator[SEP] } }
private void writeAllEnvelopes(boolean reuse) { // perform remove of m:n indirection table entries first performM2NUnlinkEntries(); Iterator iter; // using clone to avoid ConcurentModificationException iter = ((List) mvOrderOfIds.clone()).iterator(); while(iter.hasNext()) { ObjectEnvelope mod = (ObjectEnvelope) mhtObjectEnvelopes.get(iter.next()); boolean insert = false; if(needsCommit) { insert = mod.needsInsert(); mod.getModificationState().commit(mod); if(reuse && insert) { getTransaction().doSingleLock(mod.getClassDescriptor(), mod.getObject(), mod.getIdentity(), Transaction.WRITE); } } /* arminw: important to call this cleanup method for each registered ObjectEnvelope, because this method will e.g. remove proxy listener objects for registered objects. */ mod.cleanup(reuse, insert); } // add m:n indirection table entries performM2NLinkEntries(); }
class class_name[name] begin[{] method[writeAllEnvelopes, return_type[void], modifier[private], parameter[reuse]] begin[{] call[.performM2NUnlinkEntries, parameter[]] local_variable[type[Iterator], iter] assign[member[.iter], Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=mvOrderOfIds, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None))] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[ObjectEnvelope], mod] local_variable[type[boolean], insert] if[member[.needsCommit]] begin[{] assign[member[.insert], call[mod.needsInsert, parameter[]]] call[mod.getModificationState, parameter[]] if[binary_operation[member[.reuse], &&, member[.insert]]] begin[{] call[.getTransaction, parameter[]] else begin[{] None end[}] else begin[{] None end[}] call[mod.cleanup, parameter[member[.reuse], member[.insert]]] end[}] call[.performM2NLinkEntries, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[writeAllEnvelopes] operator[SEP] Keyword[boolean] identifier[reuse] operator[SEP] { identifier[performM2NUnlinkEntries] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] identifier[iter] operator[SEP] identifier[iter] operator[=] operator[SEP] operator[SEP] identifier[List] operator[SEP] identifier[mvOrderOfIds] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[ObjectEnvelope] identifier[mod] operator[=] operator[SEP] identifier[ObjectEnvelope] operator[SEP] identifier[mhtObjectEnvelopes] operator[SEP] identifier[get] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[insert] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[needsCommit] operator[SEP] { identifier[insert] operator[=] identifier[mod] operator[SEP] identifier[needsInsert] operator[SEP] operator[SEP] operator[SEP] identifier[mod] operator[SEP] identifier[getModificationState] operator[SEP] operator[SEP] operator[SEP] identifier[commit] operator[SEP] identifier[mod] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reuse] operator[&&] identifier[insert] operator[SEP] { identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[doSingleLock] operator[SEP] identifier[mod] operator[SEP] identifier[getClassDescriptor] operator[SEP] operator[SEP] , identifier[mod] operator[SEP] identifier[getObject] operator[SEP] operator[SEP] , identifier[mod] operator[SEP] identifier[getIdentity] operator[SEP] operator[SEP] , identifier[Transaction] operator[SEP] identifier[WRITE] operator[SEP] operator[SEP] } } identifier[mod] operator[SEP] identifier[cleanup] operator[SEP] identifier[reuse] , identifier[insert] operator[SEP] operator[SEP] } identifier[performM2NLinkEntries] operator[SEP] operator[SEP] operator[SEP] }
public Collection<String> getSampleLicense(Locale locale) throws InstallException { Collection<String> licenses = new ArrayList<String>(); for (List<List<RepositoryResource>> targetList : getResolveDirector().getInstallResources().values()) { for (List<RepositoryResource> mrList : targetList) { for (RepositoryResource mr : mrList) { ResourceType type = mr.getType(); if (type.equals(ResourceType.PRODUCTSAMPLE) || type.equals(ResourceType.OPENSOURCE)) { try { AttachmentResource lar = mr.getLicenseAgreement(locale); if (lar != null) licenses.add(InstallLicenseImpl.getLicense(lar)); } catch (RepositoryException e) { throw ExceptionUtils.createByKey(e, "ERROR_FAILED_TO_GET_ASSET_LICENSE", mr.getName()); } } } } } return licenses; }
class class_name[name] begin[{] method[getSampleLicense, return_type[type[Collection]], modifier[public], parameter[locale]] begin[{] local_variable[type[Collection], licenses] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=mr, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=PRODUCTSAMPLE, postfix_operators=[], prefix_operators=[], qualifier=ResourceType, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=OPENSOURCE, postfix_operators=[], prefix_operators=[], qualifier=ResourceType, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=locale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLicenseAgreement, postfix_operators=[], prefix_operators=[], qualifier=mr, selectors=[], type_arguments=None), name=lar)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AttachmentResource, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=lar, 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=[MethodInvocation(arguments=[MemberReference(member=lar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLicense, postfix_operators=[], prefix_operators=[], qualifier=InstallLicenseImpl, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=licenses, selectors=[], type_arguments=None), label=None))], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ERROR_FAILED_TO_GET_ASSET_LICENSE"), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=mr, selectors=[], type_arguments=None)], member=createByKey, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RepositoryException']))], finally_block=None, label=None, resources=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=mrList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=mr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RepositoryResource, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=targetList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=mrList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RepositoryResource, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getResolveDirector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getInstallResources, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=targetList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=RepositoryResource, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) return[member[.licenses]] end[}] END[}]
Keyword[public] identifier[Collection] operator[<] identifier[String] operator[>] identifier[getSampleLicense] operator[SEP] identifier[Locale] identifier[locale] operator[SEP] Keyword[throws] identifier[InstallException] { identifier[Collection] operator[<] identifier[String] operator[>] identifier[licenses] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[RepositoryResource] operator[>] operator[>] identifier[targetList] operator[:] identifier[getResolveDirector] operator[SEP] operator[SEP] operator[SEP] identifier[getInstallResources] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[List] operator[<] identifier[RepositoryResource] operator[>] identifier[mrList] operator[:] identifier[targetList] operator[SEP] { Keyword[for] operator[SEP] identifier[RepositoryResource] identifier[mr] operator[:] identifier[mrList] operator[SEP] { identifier[ResourceType] identifier[type] operator[=] identifier[mr] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[ResourceType] operator[SEP] identifier[PRODUCTSAMPLE] operator[SEP] operator[||] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[ResourceType] operator[SEP] identifier[OPENSOURCE] operator[SEP] operator[SEP] { Keyword[try] { identifier[AttachmentResource] identifier[lar] operator[=] identifier[mr] operator[SEP] identifier[getLicenseAgreement] operator[SEP] identifier[locale] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lar] operator[!=] Other[null] operator[SEP] identifier[licenses] operator[SEP] identifier[add] operator[SEP] identifier[InstallLicenseImpl] operator[SEP] identifier[getLicense] operator[SEP] identifier[lar] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RepositoryException] identifier[e] operator[SEP] { Keyword[throw] identifier[ExceptionUtils] operator[SEP] identifier[createByKey] operator[SEP] identifier[e] , literal[String] , identifier[mr] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } } Keyword[return] identifier[licenses] operator[SEP] }
public void setBuffer(final String buffer) { initRandomBuffer(); byteBufferAry = Arrays.copyOf(buffer.getBytes(), MAX_PACKETBUFFER_LENGTH); }
class class_name[name] begin[{] method[setBuffer, return_type[void], modifier[public], parameter[buffer]] begin[{] call[.initRandomBuffer, parameter[]] assign[member[.byteBufferAry], call[Arrays.copyOf, parameter[call[buffer.getBytes, parameter[]], member[.MAX_PACKETBUFFER_LENGTH]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setBuffer] operator[SEP] Keyword[final] identifier[String] identifier[buffer] operator[SEP] { identifier[initRandomBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[byteBufferAry] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] identifier[buffer] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] , identifier[MAX_PACKETBUFFER_LENGTH] operator[SEP] operator[SEP] }
public SIMPTransactionManager getTxManager() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "getTxManager"); SibTr.exit(tc, "getTxManager", txManager); } return txManager; }
class class_name[name] begin[{] method[getTxManager, return_type[type[SIMPTransactionManager]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["getTxManager"]]] call[SibTr.exit, parameter[member[.tc], literal["getTxManager"], member[.txManager]]] else begin[{] None end[}] return[member[.txManager]] end[}] END[}]
Keyword[public] identifier[SIMPTransactionManager] identifier[getTxManager] 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] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[txManager] operator[SEP] operator[SEP] } Keyword[return] identifier[txManager] operator[SEP] }
@Nullable public ByteIterable get2(@NotNull final Transaction txn, @NotNull final ByteIterable second) { return this.second.get(txn, second); }
class class_name[name] begin[{] method[get2, return_type[type[ByteIterable]], modifier[public], parameter[txn, second]] begin[{] return[THIS[member[None.second]call[None.get, parameter[member[.txn], member[.second]]]]] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[public] identifier[ByteIterable] identifier[get2] operator[SEP] annotation[@] identifier[NotNull] Keyword[final] identifier[Transaction] identifier[txn] , annotation[@] identifier[NotNull] Keyword[final] identifier[ByteIterable] identifier[second] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[second] operator[SEP] identifier[get] operator[SEP] identifier[txn] , identifier[second] operator[SEP] operator[SEP] }
public static void main(String[] args) { boolean verbose = args.length == 1 && "-v".equals(args[0]); Version version = HBaseVersion.get(); System.out.println(version.getMajorVersion()); if (verbose) { System.out.println("versionString=" + getVersionString()); } }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] local_variable[type[boolean], verbose] local_variable[type[Version], version] call[System.out.println, parameter[call[version.getMajorVersion, parameter[]]]] if[member[.verbose]] begin[{] call[System.out.println, parameter[binary_operation[literal["versionString="], +, call[.getVersionString, parameter[]]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[boolean] identifier[verbose] operator[=] identifier[args] operator[SEP] identifier[length] operator[==] Other[1] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[Version] identifier[version] operator[=] identifier[HBaseVersion] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[version] operator[SEP] identifier[getMajorVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[verbose] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[getVersionString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public int getTcpcork() { if (isReference()) { final DistributerDef refDistributer = (DistributerDef) getCheckedRef(DistributerDef.class, "DistributerDef"); return refDistributer.getTcpcork(); } return this.tcpCork; }
class class_name[name] begin[{] method[getTcpcork, return_type[type[int]], modifier[public], parameter[]] begin[{] if[call[.isReference, parameter[]]] begin[{] local_variable[type[DistributerDef], refDistributer] return[call[refDistributer.getTcpcork, parameter[]]] else begin[{] None end[}] return[THIS[member[None.tcpCork]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getTcpcork] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isReference] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[DistributerDef] identifier[refDistributer] operator[=] operator[SEP] identifier[DistributerDef] operator[SEP] identifier[getCheckedRef] operator[SEP] identifier[DistributerDef] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[refDistributer] operator[SEP] identifier[getTcpcork] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] identifier[tcpCork] operator[SEP] }
public void setAcePermissionsAllowed(String acePermissionsAllowed) { try { m_acePermissionsAllowed = Integer.parseInt(acePermissionsAllowed); } catch (Throwable e) { m_throwable = e; } }
class class_name[name] begin[{] method[setAcePermissionsAllowed, return_type[void], modifier[public], parameter[acePermissionsAllowed]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_acePermissionsAllowed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=acePermissionsAllowed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=m_throwable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setAcePermissionsAllowed] operator[SEP] identifier[String] identifier[acePermissionsAllowed] operator[SEP] { Keyword[try] { identifier[m_acePermissionsAllowed] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[acePermissionsAllowed] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[m_throwable] operator[=] identifier[e] operator[SEP] } }
public static byte[] gzipCompress(String str, String encoding) { if (str == null || str.length() == 0) { return null; } ByteArrayOutputStream out = new ByteArrayOutputStream(); GZIPOutputStream gzip; try { gzip = new GZIPOutputStream(out); gzip.write(str.getBytes(encoding)); gzip.close(); } catch (IOException e) { } return out.toByteArray(); }
class class_name[name] begin[{] method[gzipCompress, return_type[type[byte]], modifier[public static], parameter[str, encoding]] begin[{] if[binary_operation[binary_operation[member[.str], ==, literal[null]], ||, binary_operation[call[str.length, parameter[]], ==, literal[0]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[ByteArrayOutputStream], out] local_variable[type[GZIPOutputStream], gzip] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=gzip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=out, 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=GZIPOutputStream, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=gzip, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=gzip, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) return[call[out.toByteArray, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[gzipCompress] operator[SEP] identifier[String] identifier[str] , identifier[String] identifier[encoding] operator[SEP] { Keyword[if] operator[SEP] identifier[str] operator[==] Other[null] operator[||] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[ByteArrayOutputStream] identifier[out] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[GZIPOutputStream] identifier[gzip] operator[SEP] Keyword[try] { identifier[gzip] operator[=] Keyword[new] identifier[GZIPOutputStream] operator[SEP] identifier[out] operator[SEP] operator[SEP] identifier[gzip] operator[SEP] identifier[write] operator[SEP] identifier[str] operator[SEP] identifier[getBytes] operator[SEP] identifier[encoding] operator[SEP] operator[SEP] operator[SEP] identifier[gzip] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { } Keyword[return] identifier[out] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] }
protected static Map<String, Object> getSessionAttributes(){ //TODO: cache session attributes map since this method can be called multiple times during a request. HttpSession session = RequestContext.getHttpRequest().getSession(true); Enumeration names = session.getAttributeNames(); Map<String, Object> values = new HashMap<>(); while (names.hasMoreElements()) { Object name = names.nextElement(); values.put(name.toString(), session.getAttribute(name.toString())); } return values; }
class class_name[name] begin[{] method[getSessionAttributes, return_type[type[Map]], modifier[static protected], parameter[]] begin[{] local_variable[type[HttpSession], session] local_variable[type[Enumeration], names] local_variable[type[Map], values] while[call[names.hasMoreElements, parameter[]]] begin[{] local_variable[type[Object], name] call[values.put, parameter[call[name.toString, parameter[]], call[session.getAttribute, parameter[call[name.toString, parameter[]]]]]] end[}] return[member[.values]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[getSessionAttributes] operator[SEP] operator[SEP] { identifier[HttpSession] identifier[session] operator[=] identifier[RequestContext] operator[SEP] identifier[getHttpRequest] operator[SEP] operator[SEP] operator[SEP] identifier[getSession] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[Enumeration] identifier[names] operator[=] identifier[session] operator[SEP] identifier[getAttributeNames] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[values] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[names] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[name] operator[=] identifier[names] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[put] operator[SEP] identifier[name] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[session] operator[SEP] identifier[getAttribute] operator[SEP] identifier[name] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[values] operator[SEP] }
public static double holtWintersSmoothing(FlatDataList flatDataList, int season_length, double alpha, double beta, double gamma, double dev_gamma) { int n = flatDataList.size(); // Calculate an initial trend level double trend1 = 0.0; for(int i = 0; i < season_length; ++i) { trend1 += flatDataList.getDouble(i); } trend1 /= season_length; double trend2 = 0.0; for(int i = season_length; i < 2*season_length; ++i) { trend2 += flatDataList.getDouble(i); } trend2 /= season_length; double initial_trend = (trend2 - trend1) / season_length; // Take the first value as the initial level double initial_level = flatDataList.getDouble(0); // Build index double[] index = new double[n]; for(int i = 0; i<n; ++i) { double val = flatDataList.getDouble(i); index[i] = val / (initial_level + (i + 1.0) * initial_trend); } // Build season buffer double[] season = new double[n+season_length]; double sum=0.0; for(int i = 0; i < season_length; ++i) { season[i] = (index[i] + index[i+season_length]) / 2; sum+=season[i]; } //index=null; // Normalise season double season_factor = season_length / sum; for(int i = 0; i < season_length; ++i) { season[i] *= season_factor; } double alpha_level = initial_level; double beta_trend = initial_trend; int i = 0; for(; i < n; ++i) { double value = flatDataList.getDouble(i); double temp_level = alpha_level; double temp_trend = beta_trend; alpha_level = alpha * value / season[i] + (1.0 - alpha) * (temp_level + temp_trend); beta_trend = beta * (alpha_level - temp_level) + ( 1.0 - beta ) * temp_trend; season[i + season_length] = gamma * value / alpha_level + (1.0 - gamma) * season[i]; } double holtWinterTplus1=alpha_level + beta_trend * season[i + 1]; return holtWinterTplus1; }
class class_name[name] begin[{] method[holtWintersSmoothing, return_type[type[double]], modifier[public static], parameter[flatDataList, season_length, alpha, beta, gamma, dev_gamma]] begin[{] local_variable[type[int], n] local_variable[type[double], trend1] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=trend1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=flatDataList, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=season_length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) assign[member[.trend1], member[.season_length]] local_variable[type[double], trend2] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=trend2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=flatDataList, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operandr=MemberReference(member=season_length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=season_length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) assign[member[.trend2], member[.season_length]] local_variable[type[double], initial_trend] local_variable[type[double], initial_level] local_variable[type[double], index] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=flatDataList, selectors=[], type_arguments=None), name=val)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=initial_level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operator=+), operandr=MemberReference(member=initial_trend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), operator=/)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[double], season] local_variable[type[double], sum] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=season, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=season_length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=season, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=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=season_length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[double], season_factor] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=season, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=*=, value=MemberReference(member=season_factor, 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=season_length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[double], alpha_level] local_variable[type[double], beta_trend] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDouble, postfix_operators=[], prefix_operators=[], qualifier=flatDataList, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=alpha_level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=temp_level)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=beta_trend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=temp_trend)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=alpha_level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=season, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=/), operandr=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operandr=MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=BinaryOperation(operandl=MemberReference(member=temp_level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=temp_trend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operator=*), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=beta_trend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=beta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=alpha_level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=temp_level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=*), operandr=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operandr=MemberReference(member=beta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=temp_trend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=season, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=season_length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=gamma, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=alpha_level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operandr=MemberReference(member=gamma, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=season, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=None, update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[double], holtWinterTplus1] return[member[.holtWinterTplus1]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[holtWintersSmoothing] operator[SEP] identifier[FlatDataList] identifier[flatDataList] , Keyword[int] identifier[season_length] , Keyword[double] identifier[alpha] , Keyword[double] identifier[beta] , Keyword[double] identifier[gamma] , Keyword[double] identifier[dev_gamma] operator[SEP] { Keyword[int] identifier[n] operator[=] identifier[flatDataList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[trend1] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[season_length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[trend1] operator[+=] identifier[flatDataList] operator[SEP] identifier[getDouble] operator[SEP] identifier[i] operator[SEP] operator[SEP] } identifier[trend1] operator[/=] identifier[season_length] operator[SEP] Keyword[double] identifier[trend2] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[season_length] operator[SEP] identifier[i] operator[<] Other[2] operator[*] identifier[season_length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[trend2] operator[+=] identifier[flatDataList] operator[SEP] identifier[getDouble] operator[SEP] identifier[i] operator[SEP] operator[SEP] } identifier[trend2] operator[/=] identifier[season_length] operator[SEP] Keyword[double] identifier[initial_trend] operator[=] operator[SEP] identifier[trend2] operator[-] identifier[trend1] operator[SEP] operator[/] identifier[season_length] operator[SEP] Keyword[double] identifier[initial_level] operator[=] identifier[flatDataList] operator[SEP] identifier[getDouble] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[index] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[double] identifier[val] operator[=] identifier[flatDataList] operator[SEP] identifier[getDouble] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[index] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[val] operator[/] operator[SEP] identifier[initial_level] operator[+] operator[SEP] identifier[i] operator[+] literal[Float] operator[SEP] operator[*] identifier[initial_trend] operator[SEP] operator[SEP] } Keyword[double] operator[SEP] operator[SEP] identifier[season] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[n] operator[+] identifier[season_length] operator[SEP] operator[SEP] Keyword[double] identifier[sum] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[season_length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[season] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[index] operator[SEP] identifier[i] operator[SEP] operator[+] identifier[index] operator[SEP] identifier[i] operator[+] identifier[season_length] operator[SEP] operator[SEP] operator[/] Other[2] operator[SEP] identifier[sum] operator[+=] identifier[season] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[double] identifier[season_factor] operator[=] identifier[season_length] operator[/] identifier[sum] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[season_length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[season] operator[SEP] identifier[i] operator[SEP] operator[*=] identifier[season_factor] operator[SEP] } Keyword[double] identifier[alpha_level] operator[=] identifier[initial_level] operator[SEP] Keyword[double] identifier[beta_trend] operator[=] identifier[initial_trend] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[double] identifier[value] operator[=] identifier[flatDataList] operator[SEP] identifier[getDouble] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[double] identifier[temp_level] operator[=] identifier[alpha_level] operator[SEP] Keyword[double] identifier[temp_trend] operator[=] identifier[beta_trend] operator[SEP] identifier[alpha_level] operator[=] identifier[alpha] operator[*] identifier[value] operator[/] identifier[season] operator[SEP] identifier[i] operator[SEP] operator[+] operator[SEP] literal[Float] operator[-] identifier[alpha] operator[SEP] operator[*] operator[SEP] identifier[temp_level] operator[+] identifier[temp_trend] operator[SEP] operator[SEP] identifier[beta_trend] operator[=] identifier[beta] operator[*] operator[SEP] identifier[alpha_level] operator[-] identifier[temp_level] operator[SEP] operator[+] operator[SEP] literal[Float] operator[-] identifier[beta] operator[SEP] operator[*] identifier[temp_trend] operator[SEP] identifier[season] operator[SEP] identifier[i] operator[+] identifier[season_length] operator[SEP] operator[=] identifier[gamma] operator[*] identifier[value] operator[/] identifier[alpha_level] operator[+] operator[SEP] literal[Float] operator[-] identifier[gamma] operator[SEP] operator[*] identifier[season] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[double] identifier[holtWinterTplus1] operator[=] identifier[alpha_level] operator[+] identifier[beta_trend] operator[*] identifier[season] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[holtWinterTplus1] operator[SEP] }
public static dnsnsecrec[] get(nitro_service service) throws Exception{ dnsnsecrec obj = new dnsnsecrec(); dnsnsecrec[] response = (dnsnsecrec[])obj.get_resources(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[dnsnsecrec]], modifier[public static], parameter[service]] begin[{] local_variable[type[dnsnsecrec], obj] local_variable[type[dnsnsecrec], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[dnsnsecrec] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] operator[SEP] Keyword[throws] identifier[Exception] { identifier[dnsnsecrec] identifier[obj] operator[=] Keyword[new] identifier[dnsnsecrec] operator[SEP] operator[SEP] operator[SEP] identifier[dnsnsecrec] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[dnsnsecrec] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
public void addConstantFactor(String factorName, Factor factor) { constantFactors.add(ReplicatedFactor.fromFactor(factor)); constantFactorNames.add(factorName); }
class class_name[name] begin[{] method[addConstantFactor, return_type[void], modifier[public], parameter[factorName, factor]] begin[{] call[constantFactors.add, parameter[call[ReplicatedFactor.fromFactor, parameter[member[.factor]]]]] call[constantFactorNames.add, parameter[member[.factorName]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addConstantFactor] operator[SEP] identifier[String] identifier[factorName] , identifier[Factor] identifier[factor] operator[SEP] { identifier[constantFactors] operator[SEP] identifier[add] operator[SEP] identifier[ReplicatedFactor] operator[SEP] identifier[fromFactor] operator[SEP] identifier[factor] operator[SEP] operator[SEP] operator[SEP] identifier[constantFactorNames] operator[SEP] identifier[add] operator[SEP] identifier[factorName] operator[SEP] operator[SEP] }
@Deprecated public static void writeMetadataFile(Configuration configuration, Path outputPath, List<Footer> footers, JobSummaryLevel level) throws IOException { Preconditions.checkArgument(level == JobSummaryLevel.ALL || level == JobSummaryLevel.COMMON_ONLY, "Unsupported level: " + level); FileSystem fs = outputPath.getFileSystem(configuration); outputPath = outputPath.makeQualified(fs); ParquetMetadata metadataFooter = mergeFooters(outputPath, footers); if (level == JobSummaryLevel.ALL) { writeMetadataFile(outputPath, metadataFooter, fs, PARQUET_METADATA_FILE); } metadataFooter.getBlocks().clear(); writeMetadataFile(outputPath, metadataFooter, fs, PARQUET_COMMON_METADATA_FILE); }
class class_name[name] begin[{] method[writeMetadataFile, return_type[void], modifier[public static], parameter[configuration, outputPath, footers, level]] begin[{] call[Preconditions.checkArgument, parameter[binary_operation[binary_operation[member[.level], ==, member[JobSummaryLevel.ALL]], ||, binary_operation[member[.level], ==, member[JobSummaryLevel.COMMON_ONLY]]], binary_operation[literal["Unsupported level: "], +, member[.level]]]] local_variable[type[FileSystem], fs] assign[member[.outputPath], call[outputPath.makeQualified, parameter[member[.fs]]]] local_variable[type[ParquetMetadata], metadataFooter] if[binary_operation[member[.level], ==, member[JobSummaryLevel.ALL]]] begin[{] call[.writeMetadataFile, parameter[member[.outputPath], member[.metadataFooter], member[.fs], member[.PARQUET_METADATA_FILE]]] else begin[{] None end[}] call[metadataFooter.getBlocks, parameter[]] call[.writeMetadataFile, parameter[member[.outputPath], member[.metadataFooter], member[.fs], member[.PARQUET_COMMON_METADATA_FILE]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] Keyword[void] identifier[writeMetadataFile] operator[SEP] identifier[Configuration] identifier[configuration] , identifier[Path] identifier[outputPath] , identifier[List] operator[<] identifier[Footer] operator[>] identifier[footers] , identifier[JobSummaryLevel] identifier[level] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[level] operator[==] identifier[JobSummaryLevel] operator[SEP] identifier[ALL] operator[||] identifier[level] operator[==] identifier[JobSummaryLevel] operator[SEP] identifier[COMMON_ONLY] , literal[String] operator[+] identifier[level] operator[SEP] operator[SEP] identifier[FileSystem] identifier[fs] operator[=] identifier[outputPath] operator[SEP] identifier[getFileSystem] operator[SEP] identifier[configuration] operator[SEP] operator[SEP] identifier[outputPath] operator[=] identifier[outputPath] operator[SEP] identifier[makeQualified] operator[SEP] identifier[fs] operator[SEP] operator[SEP] identifier[ParquetMetadata] identifier[metadataFooter] operator[=] identifier[mergeFooters] operator[SEP] identifier[outputPath] , identifier[footers] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[level] operator[==] identifier[JobSummaryLevel] operator[SEP] identifier[ALL] operator[SEP] { identifier[writeMetadataFile] operator[SEP] identifier[outputPath] , identifier[metadataFooter] , identifier[fs] , identifier[PARQUET_METADATA_FILE] operator[SEP] operator[SEP] } identifier[metadataFooter] operator[SEP] identifier[getBlocks] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[writeMetadataFile] operator[SEP] identifier[outputPath] , identifier[metadataFooter] , identifier[fs] , identifier[PARQUET_COMMON_METADATA_FILE] operator[SEP] operator[SEP] }
public OptionalThing<ActionMapping> findActionMapping(String actionName) { if (!initialized) { initialize(); } final ActionMapping mapping = actionMappingMap.get(actionName); if (mapping != null) { return OptionalThing.of(mapping); } if (ManagedHotdeploy.isHotdeploy()) { prepareActionComponent(actionName); // lazy load, put to the map } return OptionalThing.ofNullable(actionMappingMap.get(actionName), () -> { String msg = "Not found the action mapping for the action key: " + actionName; throw new IllegalStateException(msg); }); }
class class_name[name] begin[{] method[findActionMapping, return_type[type[OptionalThing]], modifier[public], parameter[actionName]] begin[{] if[member[.initialized]] begin[{] call[.initialize, parameter[]] else begin[{] None end[}] local_variable[type[ActionMapping], mapping] if[binary_operation[member[.mapping], !=, literal[null]]] begin[{] return[call[OptionalThing.of, parameter[member[.mapping]]]] else begin[{] None end[}] if[call[ManagedHotdeploy.isHotdeploy, parameter[]]] begin[{] call[.prepareActionComponent, parameter[member[.actionName]]] else begin[{] None end[}] return[call[OptionalThing.ofNullable, parameter[call[actionMappingMap.get, parameter[member[.actionName]]], LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not found the action mapping for the action key: "), operandr=MemberReference(member=actionName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, 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)], parameters=[])]]] end[}] END[}]
Keyword[public] identifier[OptionalThing] operator[<] identifier[ActionMapping] operator[>] identifier[findActionMapping] operator[SEP] identifier[String] identifier[actionName] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[initialized] operator[SEP] { identifier[initialize] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[ActionMapping] identifier[mapping] operator[=] identifier[actionMappingMap] operator[SEP] identifier[get] operator[SEP] identifier[actionName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mapping] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[OptionalThing] operator[SEP] identifier[of] operator[SEP] identifier[mapping] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ManagedHotdeploy] operator[SEP] identifier[isHotdeploy] operator[SEP] operator[SEP] operator[SEP] { identifier[prepareActionComponent] operator[SEP] identifier[actionName] operator[SEP] operator[SEP] } Keyword[return] identifier[OptionalThing] operator[SEP] identifier[ofNullable] operator[SEP] identifier[actionMappingMap] operator[SEP] identifier[get] operator[SEP] identifier[actionName] operator[SEP] , operator[SEP] operator[SEP] operator[->] { identifier[String] identifier[msg] operator[=] literal[String] operator[+] identifier[actionName] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] }
public static <V> ListenableFuture<V> whenAnyCompleteCancelOthers(Iterable<? extends ListenableFuture<? extends V>> futures) { requireNonNull(futures, "futures is null"); checkArgument(!isEmpty(futures), "futures is empty"); // wait for the first task to unblock and then cancel all futures to free up resources ListenableFuture<V> anyComplete = whenAnyComplete(futures); anyComplete.addListener( () -> { for (ListenableFuture<?> future : futures) { future.cancel(true); } }, directExecutor()); return anyComplete; }
class class_name[name] begin[{] method[whenAnyCompleteCancelOthers, return_type[type[ListenableFuture]], modifier[public static], parameter[futures]] begin[{] call[.requireNonNull, parameter[member[.futures], literal["futures is null"]]] call[.checkArgument, parameter[call[.isEmpty, parameter[member[.futures]]], literal["futures is empty"]]] local_variable[type[ListenableFuture], anyComplete] call[anyComplete.addListener, parameter[LambdaExpression(body=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=cancel, postfix_operators=[], prefix_operators=[], qualifier=future, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=futures, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=future)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ListenableFuture, sub_type=None))), label=None)], parameters=[]), call[.directExecutor, parameter[]]]] return[member[.anyComplete]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[V] operator[>] identifier[ListenableFuture] operator[<] identifier[V] operator[>] identifier[whenAnyCompleteCancelOthers] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[ListenableFuture] operator[<] operator[?] Keyword[extends] identifier[V] operator[>] operator[>] identifier[futures] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[futures] , literal[String] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] operator[!] identifier[isEmpty] operator[SEP] identifier[futures] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[ListenableFuture] operator[<] identifier[V] operator[>] identifier[anyComplete] operator[=] identifier[whenAnyComplete] operator[SEP] identifier[futures] operator[SEP] operator[SEP] identifier[anyComplete] operator[SEP] identifier[addListener] operator[SEP] operator[SEP] operator[SEP] operator[->] { Keyword[for] operator[SEP] identifier[ListenableFuture] operator[<] operator[?] operator[>] identifier[future] operator[:] identifier[futures] operator[SEP] { identifier[future] operator[SEP] identifier[cancel] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } } , identifier[directExecutor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[anyComplete] operator[SEP] }
@Override public <T extends ApiGameUser> List<T> in(ApiRoom room, Class<?> clazz) { Room sfsRoom = CommandUtil.getSfsRoom(room, extension); validateRoom(sfsRoom, room); return CommandUtil.getApiGameUserList(sfsRoom.getUserList(), clazz); }
class class_name[name] begin[{] method[in, return_type[type[List]], modifier[public], parameter[room, clazz]] begin[{] local_variable[type[Room], sfsRoom] call[.validateRoom, parameter[member[.sfsRoom], member[.room]]] return[call[CommandUtil.getApiGameUserList, parameter[call[sfsRoom.getUserList, parameter[]], member[.clazz]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[ApiGameUser] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[in] operator[SEP] identifier[ApiRoom] identifier[room] , identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] { identifier[Room] identifier[sfsRoom] operator[=] identifier[CommandUtil] operator[SEP] identifier[getSfsRoom] operator[SEP] identifier[room] , identifier[extension] operator[SEP] operator[SEP] identifier[validateRoom] operator[SEP] identifier[sfsRoom] , identifier[room] operator[SEP] operator[SEP] Keyword[return] identifier[CommandUtil] operator[SEP] identifier[getApiGameUserList] operator[SEP] identifier[sfsRoom] operator[SEP] identifier[getUserList] operator[SEP] operator[SEP] , identifier[clazz] operator[SEP] operator[SEP] }
@Override protected void sscal(long N, double a, INDArray X, int incx) { cblas_sscal((int) N, (float) a, (FloatPointer) X.data().addressPointer(), incx); }
class class_name[name] begin[{] method[sscal, return_type[void], modifier[protected], parameter[N, a, X, incx]] begin[{] call[.cblas_sscal, parameter[Cast(expression=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int)), Cast(expression=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=float)), Cast(expression=MethodInvocation(arguments=[], member=data, postfix_operators=[], prefix_operators=[], qualifier=X, selectors=[MethodInvocation(arguments=[], member=addressPointer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=FloatPointer, sub_type=None)), member[.incx]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[sscal] operator[SEP] Keyword[long] identifier[N] , Keyword[double] identifier[a] , identifier[INDArray] identifier[X] , Keyword[int] identifier[incx] operator[SEP] { identifier[cblas_sscal] operator[SEP] operator[SEP] Keyword[int] operator[SEP] identifier[N] , operator[SEP] Keyword[float] operator[SEP] identifier[a] , operator[SEP] identifier[FloatPointer] operator[SEP] identifier[X] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP] identifier[addressPointer] operator[SEP] operator[SEP] , identifier[incx] operator[SEP] operator[SEP] }
private void handleIO(final SelectionKey sk) { MemcachedNode node = (MemcachedNode) sk.attachment(); try { getLogger().debug("Handling IO for: %s (r=%s, w=%s, c=%s, op=%s)", sk, sk.isReadable(), sk.isWritable(), sk.isConnectable(), sk.attachment()); if (sk.isConnectable() && belongsToCluster(node)) { getLogger().debug("Connection state changed for %s", sk); final SocketChannel channel = node.getChannel(); if (channel.finishConnect()) { finishConnect(sk, node); } else { assert !channel.isConnected() : "connected"; } } else { handleReadsAndWrites(sk, node); } } catch (ClosedChannelException e) { if (!shutDown) { getLogger().info("Closed channel and not shutting down. Queueing" + " reconnect on %s", node, e); lostConnection(node); } } catch (ConnectException e) { getLogger().info("Reconnecting due to failure to connect to %s", node, e); queueReconnect(node); } catch (OperationException e) { node.setupForAuth(); getLogger().info("Reconnection due to exception handling a memcached " + "operation on %s. This may be due to an authentication failure.", node, e); lostConnection(node); } catch (Exception e) { node.setupForAuth(); getLogger().info("Reconnecting due to exception on %s", node, e); lostConnection(node); } node.fixupOps(); }
class class_name[name] begin[{] method[handleIO, return_type[void], modifier[private], parameter[sk]] begin[{] local_variable[type[MemcachedNode], node] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Handling IO for: %s (r=%s, w=%s, c=%s, op=%s)"), MemberReference(member=sk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=isReadable, postfix_operators=[], prefix_operators=[], qualifier=sk, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isWritable, postfix_operators=[], prefix_operators=[], qualifier=sk, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isConnectable, postfix_operators=[], prefix_operators=[], qualifier=sk, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=attachment, postfix_operators=[], prefix_operators=[], qualifier=sk, selectors=[], type_arguments=None)], member=debug, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isConnectable, postfix_operators=[], prefix_operators=[], qualifier=sk, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=belongsToCluster, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleReadsAndWrites, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Connection state changed for %s"), MemberReference(member=sk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), name=channel)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SocketChannel, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=finishConnect, postfix_operators=[], prefix_operators=[], qualifier=channel, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[AssertStatement(condition=MethodInvocation(arguments=[], member=isConnected, postfix_operators=[], prefix_operators=['!'], qualifier=channel, selectors=[], type_arguments=None), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="connected"))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=finishConnect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[IfStatement(condition=MemberReference(member=shutDown, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Closed channel and not shutting down. Queueing"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" reconnect on %s"), operator=+), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lostConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClosedChannelException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Reconnecting due to failure to connect to %s"), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=queueReconnect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ConnectException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=setupForAuth, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Reconnection due to exception handling a memcached "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="operation on %s. This may be due to an authentication failure."), operator=+), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lostConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['OperationException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=setupForAuth, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Reconnecting due to exception on %s"), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=lostConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) call[node.fixupOps, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[handleIO] operator[SEP] Keyword[final] identifier[SelectionKey] identifier[sk] operator[SEP] { identifier[MemcachedNode] identifier[node] operator[=] operator[SEP] identifier[MemcachedNode] operator[SEP] identifier[sk] operator[SEP] identifier[attachment] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[sk] , identifier[sk] operator[SEP] identifier[isReadable] operator[SEP] operator[SEP] , identifier[sk] operator[SEP] identifier[isWritable] operator[SEP] operator[SEP] , identifier[sk] operator[SEP] identifier[isConnectable] operator[SEP] operator[SEP] , identifier[sk] operator[SEP] identifier[attachment] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sk] operator[SEP] identifier[isConnectable] operator[SEP] operator[SEP] operator[&&] identifier[belongsToCluster] operator[SEP] identifier[node] operator[SEP] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[sk] operator[SEP] operator[SEP] Keyword[final] identifier[SocketChannel] identifier[channel] operator[=] identifier[node] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[channel] operator[SEP] identifier[finishConnect] operator[SEP] operator[SEP] operator[SEP] { identifier[finishConnect] operator[SEP] identifier[sk] , identifier[node] operator[SEP] operator[SEP] } Keyword[else] { Keyword[assert] operator[!] identifier[channel] operator[SEP] identifier[isConnected] operator[SEP] operator[SEP] operator[:] literal[String] operator[SEP] } } Keyword[else] { identifier[handleReadsAndWrites] operator[SEP] identifier[sk] , identifier[node] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[ClosedChannelException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[shutDown] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] literal[String] , identifier[node] , identifier[e] operator[SEP] operator[SEP] identifier[lostConnection] operator[SEP] identifier[node] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[ConnectException] identifier[e] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[node] , identifier[e] operator[SEP] operator[SEP] identifier[queueReconnect] operator[SEP] identifier[node] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[OperationException] identifier[e] operator[SEP] { identifier[node] operator[SEP] identifier[setupForAuth] operator[SEP] operator[SEP] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] literal[String] , identifier[node] , identifier[e] operator[SEP] operator[SEP] identifier[lostConnection] operator[SEP] identifier[node] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[node] operator[SEP] identifier[setupForAuth] operator[SEP] operator[SEP] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[node] , identifier[e] operator[SEP] operator[SEP] identifier[lostConnection] operator[SEP] identifier[node] operator[SEP] operator[SEP] } identifier[node] operator[SEP] identifier[fixupOps] operator[SEP] operator[SEP] operator[SEP] }
public Element parseError(final InputStream in) { try { final Document doc = parseContent(in); final Element root = doc.getDocumentElement(); expect(root, WebdavTags.error); final List<Element> els = getChildren(root); if (els.size() != 1) { return null; } return els.get(0); } catch (final Throwable ignored) { return null; } }
class class_name[name] begin[{] method[parseError, return_type[type[Element]], modifier[public], parameter[in]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseContent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=doc)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Document, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDocumentElement, postfix_operators=[], prefix_operators=[], qualifier=doc, selectors=[], type_arguments=None), name=root)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=WebdavTags, selectors=[])], member=expect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=els)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=els, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=els, 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=ignored, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Element] identifier[parseError] operator[SEP] Keyword[final] identifier[InputStream] identifier[in] operator[SEP] { Keyword[try] { Keyword[final] identifier[Document] identifier[doc] operator[=] identifier[parseContent] operator[SEP] identifier[in] operator[SEP] operator[SEP] Keyword[final] identifier[Element] identifier[root] operator[=] identifier[doc] operator[SEP] identifier[getDocumentElement] operator[SEP] operator[SEP] operator[SEP] identifier[expect] operator[SEP] identifier[root] , identifier[WebdavTags] operator[SEP] identifier[error] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Element] operator[>] identifier[els] operator[=] identifier[getChildren] operator[SEP] identifier[root] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[els] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] Other[1] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[els] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Throwable] identifier[ignored] operator[SEP] { Keyword[return] Other[null] operator[SEP] } }
@Nonnull public static <T, R> LObjIntFltFunctionBuilder<T, R> objIntFltFunction(Consumer<LObjIntFltFunction<T, R>> consumer) { return new LObjIntFltFunctionBuilder(consumer); }
class class_name[name] begin[{] method[objIntFltFunction, return_type[type[LObjIntFltFunctionBuilder]], modifier[public static], parameter[consumer]] begin[{] return[ClassCreator(arguments=[MemberReference(member=consumer, 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=LObjIntFltFunctionBuilder, sub_type=None))] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[R] operator[>] identifier[LObjIntFltFunctionBuilder] operator[<] identifier[T] , identifier[R] operator[>] identifier[objIntFltFunction] operator[SEP] identifier[Consumer] operator[<] identifier[LObjIntFltFunction] operator[<] identifier[T] , identifier[R] operator[>] operator[>] identifier[consumer] operator[SEP] { Keyword[return] Keyword[new] identifier[LObjIntFltFunctionBuilder] operator[SEP] identifier[consumer] operator[SEP] operator[SEP] }
public int newHandle( final int tag, final String owner, final String name, final String descriptor, final boolean isInterface) { return symbolTable.addConstantMethodHandle(tag, owner, name, descriptor, isInterface).index; }
class class_name[name] begin[{] method[newHandle, return_type[type[int]], modifier[public], parameter[tag, owner, name, descriptor, isInterface]] begin[{] return[call[symbolTable.addConstantMethodHandle, parameter[member[.tag], member[.owner], member[.name], member[.descriptor], member[.isInterface]]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[newHandle] operator[SEP] Keyword[final] Keyword[int] identifier[tag] , Keyword[final] identifier[String] identifier[owner] , Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[descriptor] , Keyword[final] Keyword[boolean] identifier[isInterface] operator[SEP] { Keyword[return] identifier[symbolTable] operator[SEP] identifier[addConstantMethodHandle] operator[SEP] identifier[tag] , identifier[owner] , identifier[name] , identifier[descriptor] , identifier[isInterface] operator[SEP] operator[SEP] identifier[index] operator[SEP] }
private void addPostParams(final Request request) { if (identity != null) { request.addPostParam("Identity", identity); } if (userAddress != null) { request.addPostParam("UserAddress", userAddress); } if (attributes != null) { request.addPostParam("Attributes", attributes); } if (twilioAddress != null) { request.addPostParam("TwilioAddress", twilioAddress); } if (dateCreated != null) { request.addPostParam("DateCreated", dateCreated.toString()); } if (dateUpdated != null) { request.addPostParam("DateUpdated", dateUpdated.toString()); } }
class class_name[name] begin[{] method[addPostParams, return_type[void], modifier[private], parameter[request]] begin[{] if[binary_operation[member[.identity], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["Identity"], member[.identity]]] else begin[{] None end[}] if[binary_operation[member[.userAddress], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["UserAddress"], member[.userAddress]]] else begin[{] None end[}] if[binary_operation[member[.attributes], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["Attributes"], member[.attributes]]] else begin[{] None end[}] if[binary_operation[member[.twilioAddress], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["TwilioAddress"], member[.twilioAddress]]] else begin[{] None end[}] if[binary_operation[member[.dateCreated], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["DateCreated"], call[dateCreated.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.dateUpdated], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["DateUpdated"], call[dateUpdated.toString, parameter[]]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[addPostParams] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] { Keyword[if] operator[SEP] identifier[identity] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[identity] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[userAddress] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[userAddress] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[attributes] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[attributes] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[twilioAddress] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[twilioAddress] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[dateCreated] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[dateCreated] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[dateUpdated] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[dateUpdated] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public InstagramSingleObjectResponse<InstagramTags> getTagsCountByName(String accessToken, String tagName) throws InstagramError { return instagramEndpoints.getTagsCountByName(accessToken, tagName); }
class class_name[name] begin[{] method[getTagsCountByName, return_type[type[InstagramSingleObjectResponse]], modifier[public], parameter[accessToken, tagName]] begin[{] return[call[instagramEndpoints.getTagsCountByName, parameter[member[.accessToken], member[.tagName]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[InstagramSingleObjectResponse] operator[<] identifier[InstagramTags] operator[>] identifier[getTagsCountByName] operator[SEP] identifier[String] identifier[accessToken] , identifier[String] identifier[tagName] operator[SEP] Keyword[throws] identifier[InstagramError] { Keyword[return] identifier[instagramEndpoints] operator[SEP] identifier[getTagsCountByName] operator[SEP] identifier[accessToken] , identifier[tagName] operator[SEP] operator[SEP] }
private File makeDestFile(URL src) { if (dest == null) { throw new IllegalArgumentException("Please provide a download destination"); } File destFile = dest; if (destFile.isDirectory()) { //guess name from URL String name = src.toString(); if (name.endsWith("/")) { name = name.substring(0, name.length() - 1); } name = name.substring(name.lastIndexOf('/') + 1); destFile = new File(dest, name); } else { //create destination directory File parent = destFile.getParentFile(); if (parent != null) { parent.mkdirs(); } } return destFile; }
class class_name[name] begin[{] method[makeDestFile, return_type[type[File]], modifier[private], parameter[src]] begin[{] if[binary_operation[member[.dest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Please provide a download destination")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[File], destFile] if[call[destFile.isDirectory, parameter[]]] begin[{] local_variable[type[String], name] if[call[name.endsWith, parameter[literal["/"]]]] begin[{] assign[member[.name], call[name.substring, parameter[literal[0], binary_operation[call[name.length, parameter[]], -, literal[1]]]]] else begin[{] None end[}] assign[member[.name], call[name.substring, parameter[binary_operation[call[name.lastIndexOf, parameter[literal['/']]], +, literal[1]]]]] assign[member[.destFile], ClassCreator(arguments=[MemberReference(member=dest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, 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))] else begin[{] local_variable[type[File], parent] if[binary_operation[member[.parent], !=, literal[null]]] begin[{] call[parent.mkdirs, parameter[]] else begin[{] None end[}] end[}] return[member[.destFile]] end[}] END[}]
Keyword[private] identifier[File] identifier[makeDestFile] operator[SEP] identifier[URL] identifier[src] operator[SEP] { Keyword[if] operator[SEP] identifier[dest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[File] identifier[destFile] operator[=] identifier[dest] operator[SEP] Keyword[if] operator[SEP] identifier[destFile] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[src] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[name] operator[=] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } identifier[name] operator[=] identifier[name] operator[SEP] identifier[substring] operator[SEP] identifier[name] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] identifier[destFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[dest] , identifier[name] operator[SEP] operator[SEP] } Keyword[else] { identifier[File] identifier[parent] operator[=] identifier[destFile] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] { identifier[parent] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[destFile] operator[SEP] }
public static <T> T notNull(final T object, final String message, final Object... values) { if (object == null) { throw new NullPointerException(StringUtils.simpleFormat(message, values)); } return object; }
class class_name[name] begin[{] method[notNull, return_type[type[T]], modifier[public static], parameter[object, message, values]] begin[{] if[binary_operation[member[.object], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=simpleFormat, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.object]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[notNull] operator[SEP] Keyword[final] identifier[T] identifier[object] , Keyword[final] identifier[String] identifier[message] , Keyword[final] identifier[Object] operator[...] identifier[values] operator[SEP] { Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] identifier[StringUtils] operator[SEP] identifier[simpleFormat] operator[SEP] identifier[message] , identifier[values] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[object] operator[SEP] }
String getAnnotatedQuery() { String query = getAnnotationValue("value", String.class); return StringUtils.hasText(query) ? query : null; }
class class_name[name] begin[{] method[getAnnotatedQuery, return_type[type[String]], modifier[default], parameter[]] begin[{] local_variable[type[String], query] return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasText, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
identifier[String] identifier[getAnnotatedQuery] operator[SEP] operator[SEP] { identifier[String] identifier[query] operator[=] identifier[getAnnotationValue] operator[SEP] literal[String] , identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[query] operator[SEP] operator[?] identifier[query] operator[:] Other[null] operator[SEP] }
public Object getCommand(String commandId, Class requiredType) throws CommandNotOfRequiredTypeException { return this.commandRegistry.getCommand(commandId, requiredType); }
class class_name[name] begin[{] method[getCommand, return_type[type[Object]], modifier[public], parameter[commandId, requiredType]] begin[{] return[THIS[member[None.commandRegistry]call[None.getCommand, parameter[member[.commandId], member[.requiredType]]]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[getCommand] operator[SEP] identifier[String] identifier[commandId] , identifier[Class] identifier[requiredType] operator[SEP] Keyword[throws] identifier[CommandNotOfRequiredTypeException] { Keyword[return] Keyword[this] operator[SEP] identifier[commandRegistry] operator[SEP] identifier[getCommand] operator[SEP] identifier[commandId] , identifier[requiredType] operator[SEP] operator[SEP] }
static synchronized void shutDownHub() { LOGGER.entering(); if (!isRunLocally()) { LOGGER.exiting(); return; } // shutdown in reverse order Collections.reverse(toBoot); for (LocalServerComponent eachItem : toBoot) { eachItem.shutdown(); } clearToBootList(); LOGGER.exiting(); }
class class_name[name] begin[{] method[shutDownHub, return_type[void], modifier[synchronized static], parameter[]] begin[{] call[LOGGER.entering, parameter[]] if[call[.isRunLocally, parameter[]]] begin[{] call[LOGGER.exiting, parameter[]] return[None] else begin[{] None end[}] call[Collections.reverse, parameter[member[.toBoot]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=shutdown, postfix_operators=[], prefix_operators=[], qualifier=eachItem, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=toBoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=eachItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LocalServerComponent, sub_type=None))), label=None) call[.clearToBootList, parameter[]] call[LOGGER.exiting, parameter[]] end[}] END[}]
Keyword[static] Keyword[synchronized] Keyword[void] identifier[shutDownHub] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[entering] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isRunLocally] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[exiting] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[Collections] operator[SEP] identifier[reverse] operator[SEP] identifier[toBoot] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[LocalServerComponent] identifier[eachItem] operator[:] identifier[toBoot] operator[SEP] { identifier[eachItem] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] } identifier[clearToBootList] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[exiting] operator[SEP] operator[SEP] operator[SEP] }
public ValueExpression getValueExpression(String name) { if (name == null) { throw new NullPointerException(); } return ((bindings == null) ? null : bindings.get(name)); }
class class_name[name] begin[{] method[getValueExpression, return_type[type[ValueExpression]], modifier[public], parameter[name]] begin[{] if[binary_operation[member[.name], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=bindings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=bindings, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[ValueExpression] identifier[getValueExpression] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] operator[SEP] identifier[bindings] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[bindings] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(GetDeviceInstanceRequest getDeviceInstanceRequest, ProtocolMarshaller protocolMarshaller) { if (getDeviceInstanceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getDeviceInstanceRequest.getArn(), ARN_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[getDeviceInstanceRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.getDeviceInstanceRequest], ==, 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=getArn, postfix_operators=[], prefix_operators=[], qualifier=getDeviceInstanceRequest, selectors=[], type_arguments=None), MemberReference(member=ARN_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[GetDeviceInstanceRequest] identifier[getDeviceInstanceRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[getDeviceInstanceRequest] 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[getDeviceInstanceRequest] operator[SEP] identifier[getArn] operator[SEP] operator[SEP] , identifier[ARN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private Object getData(final DocumentEntry de, final OutlookFieldInformation info) throws IOException { // if there is no field information available, we simply // return null. in that case, we're not interested in the // data anyway if (info == null) { return null; } // if the type is 001e (we know it is lower case // because analyzeDocumentEntry stores the type in // lower case), we create a String object from the data. // the encoding of the binary data is most probably // ISO-8859-1 (not pure ASCII). final int mapiType = info.getMapiType(); switch (mapiType) { case OutlookFieldInformation.UNKNOWN_MAPITYPE: // if there is no field information available, we simply return null // in that case, we're not interested in the data anyway return null; case 0x1e: // we put the complete data into a byte[] object... final byte[] textBytes1e = getBytesFromDocumentEntry(de); // ...and create a String object from it return new String(textBytes1e, "ISO-8859-1"); case 0x1f: // Unicode encoding with lowbyte followed by hibyte // Note: this is arcane guesswork, but it works final byte[] textBytes1f = getBytesFromDocumentEntry(de); // now that we have all bytes from the stream, // we can now convert the byte array into // a character array by switching hi- and lowbytes final char[] characters = new char[textBytes1f.length / 2]; int c = 0; for (int i = 0; i < textBytes1f.length - 1; i = i + 2) { final int ch = (int) textBytes1f[i + 1]; final int cl = (int) textBytes1f[i] & 0xff; //Using unsigned value (thanks to Reto Schuettel) characters[c++] = (char) ((ch << 8) + cl); } return new String(characters); case 0x102: try { // the data is read into a byte[] object // and returned as-is return getBytesFromDocumentEntry(de); } catch (final IOException e) { LOGGER.error("Could not get content of byte array of field 0x102", e); // To keep compatible with previous implementations, we return an empty array here return new byte[0]; } case 0x40: // The following part has been provided by Morten Sørensen (Thanks!) // This parsing has been lifted from the MsgViewer project // https://sourceforge.net/projects/msgviewer/ // the data is read into a byte[] object final byte[] bytes = getBytesFromDocumentEntry(de); // Read the byte array as little endian byteorder final ByteBuffer buff = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN); buff.put(bytes); // Convert the bytes to a long // Nanoseconds since 1601 Long timeLong = buff.getLong(0); // Convert to milliseconds timeLong /= 10000L; // Move the offset from since 1601 to 1970 timeLong -= 11644473600000L; // Convert to a Date object, and return return new Date(timeLong); default: // this should not happen LOGGER.trace("Unknown field type {}", mapiType); return null; } }
class class_name[name] begin[{] method[getData, return_type[type[Object]], modifier[private], parameter[de, info]] begin[{] if[binary_operation[member[.info], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], mapiType] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=UNKNOWN_MAPITYPE, postfix_operators=[], prefix_operators=[], qualifier=OutlookFieldInformation, selectors=[])], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x1e)], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=de, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytesFromDocumentEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=textBytes1e)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=textBytes1e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ISO-8859-1")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x1f)], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=de, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytesFromDocumentEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=textBytes1f)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=textBytes1f, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=/)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=char)), name=characters)], modifiers={'final'}, type=BasicType(dimensions=[None], name=char)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=textBytes1f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), type=BasicType(dimensions=[], name=int)), name=ch)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Cast(expression=MemberReference(member=textBytes1f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=int)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=cl)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=characters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=c, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operandr=MemberReference(member=cl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), type=BasicType(dimensions=[], name=char))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=textBytes1f, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+))]), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=characters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x102)], statements=[TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=de, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytesFromDocumentEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not get content of byte array of field 0x102"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x40)], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=de, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBytesFromDocumentEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=bytes)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8)], member=allocate, postfix_operators=[], prefix_operators=[], qualifier=ByteBuffer, selectors=[MethodInvocation(arguments=[MemberReference(member=LITTLE_ENDIAN, postfix_operators=[], prefix_operators=[], qualifier=ByteOrder, selectors=[])], member=order, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=buff)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ByteBuffer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=buff, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getLong, postfix_operators=[], prefix_operators=[], qualifier=buff, selectors=[], type_arguments=None), name=timeLong)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=timeLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=/=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10000L)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=timeLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=11644473600000L)), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=timeLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None)), label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown field type {}"), MemberReference(member=mapiType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])], expression=MemberReference(member=mapiType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[private] identifier[Object] identifier[getData] operator[SEP] Keyword[final] identifier[DocumentEntry] identifier[de] , Keyword[final] identifier[OutlookFieldInformation] identifier[info] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[info] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] Keyword[int] identifier[mapiType] operator[=] identifier[info] operator[SEP] identifier[getMapiType] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[mapiType] operator[SEP] { Keyword[case] identifier[OutlookFieldInformation] operator[SEP] identifier[UNKNOWN_MAPITYPE] operator[:] Keyword[return] Other[null] operator[SEP] Keyword[case] literal[Integer] operator[:] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[textBytes1e] operator[=] identifier[getBytesFromDocumentEntry] operator[SEP] identifier[de] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[textBytes1e] , literal[String] operator[SEP] operator[SEP] Keyword[case] literal[Integer] operator[:] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[textBytes1f] operator[=] identifier[getBytesFromDocumentEntry] operator[SEP] identifier[de] operator[SEP] operator[SEP] Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[characters] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[textBytes1f] operator[SEP] identifier[length] operator[/] Other[2] operator[SEP] operator[SEP] Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[textBytes1f] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] identifier[i] operator[=] identifier[i] operator[+] Other[2] operator[SEP] { Keyword[final] Keyword[int] identifier[ch] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[textBytes1f] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[cl] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[textBytes1f] operator[SEP] identifier[i] operator[SEP] operator[&] literal[Integer] operator[SEP] identifier[characters] operator[SEP] identifier[c] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] identifier[ch] operator[<<] Other[8] operator[SEP] operator[+] identifier[cl] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[characters] operator[SEP] operator[SEP] Keyword[case] literal[Integer] operator[:] Keyword[try] { Keyword[return] identifier[getBytesFromDocumentEntry] operator[SEP] identifier[de] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] Keyword[new] Keyword[byte] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[case] literal[Integer] operator[:] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[=] identifier[getBytesFromDocumentEntry] operator[SEP] identifier[de] operator[SEP] operator[SEP] Keyword[final] identifier[ByteBuffer] identifier[buff] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] Other[8] operator[SEP] operator[SEP] identifier[order] operator[SEP] identifier[ByteOrder] operator[SEP] identifier[LITTLE_ENDIAN] operator[SEP] operator[SEP] identifier[buff] operator[SEP] identifier[put] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] identifier[Long] identifier[timeLong] operator[=] identifier[buff] operator[SEP] identifier[getLong] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[timeLong] operator[/=] Other[10000L] operator[SEP] identifier[timeLong] operator[-=] Other[11644473600000L] operator[SEP] Keyword[return] Keyword[new] identifier[Date] operator[SEP] identifier[timeLong] operator[SEP] operator[SEP] Keyword[default] operator[:] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[mapiType] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public DERObject toASN1Object() { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(policyIdentifier); if (policyQualifiers != null) { v.add(policyQualifiers); } return new DERSequence(v); }
class class_name[name] begin[{] method[toASN1Object, return_type[type[DERObject]], modifier[public], parameter[]] begin[{] local_variable[type[ASN1EncodableVector], v] call[v.add, parameter[member[.policyIdentifier]]] if[binary_operation[member[.policyQualifiers], !=, literal[null]]] begin[{] call[v.add, parameter[member[.policyQualifiers]]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=v, 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=DERSequence, sub_type=None))] end[}] END[}]
Keyword[public] identifier[DERObject] identifier[toASN1Object] operator[SEP] operator[SEP] { identifier[ASN1EncodableVector] identifier[v] operator[=] Keyword[new] identifier[ASN1EncodableVector] operator[SEP] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[add] operator[SEP] identifier[policyIdentifier] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[policyQualifiers] operator[!=] Other[null] operator[SEP] { identifier[v] operator[SEP] identifier[add] operator[SEP] identifier[policyQualifiers] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[DERSequence] operator[SEP] identifier[v] operator[SEP] operator[SEP] }
private String encode() { byte[] pack = new byte[4 + m_bits.length]; pack[0] = (byte) ((FP_SIZE & 0xffffffff) >> 24); pack[1] = (byte) ((FP_SIZE & 0x00ffffff) >> 16); pack[2] = (byte) ((FP_SIZE & 0x0000ffff) >> 8); pack[3] = (byte) (FP_SIZE & 0x000000ff); for (int i = 0; i < m_bits.length; ++i) { pack[i + 4] = m_bits[i]; } return base64Encode(pack); }
class class_name[name] begin[{] method[encode, return_type[type[String]], modifier[private], parameter[]] begin[{] local_variable[type[byte], pack] assign[member[.pack], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=FP_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffffffff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.pack], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=FP_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x00ffffff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.pack], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=FP_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x0000ffff), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), type=BasicType(dimensions=[], name=byte))] assign[member[.pack], Cast(expression=BinaryOperation(operandl=MemberReference(member=FP_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x000000ff), operator=&), type=BasicType(dimensions=[], name=byte))] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=+))]), type==, value=MemberReference(member=m_bits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=m_bits, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) return[call[.base64Encode, parameter[member[.pack]]]] end[}] END[}]
Keyword[private] identifier[String] identifier[encode] operator[SEP] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[pack] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[4] operator[+] identifier[m_bits] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[pack] operator[SEP] Other[0] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[FP_SIZE] operator[&] literal[Integer] operator[SEP] operator[>] operator[>] Other[24] operator[SEP] operator[SEP] identifier[pack] operator[SEP] Other[1] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[FP_SIZE] operator[&] literal[Integer] operator[SEP] operator[>] operator[>] Other[16] operator[SEP] operator[SEP] identifier[pack] operator[SEP] Other[2] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[FP_SIZE] operator[&] literal[Integer] operator[SEP] operator[>] operator[>] Other[8] operator[SEP] operator[SEP] identifier[pack] operator[SEP] Other[3] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[FP_SIZE] operator[&] literal[Integer] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[m_bits] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[pack] operator[SEP] identifier[i] operator[+] Other[4] operator[SEP] operator[=] identifier[m_bits] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[base64Encode] operator[SEP] identifier[pack] operator[SEP] operator[SEP] }
public void advanceElementData(int length) throws IOException, AsnException { if( length==Tag.Indefinite_Length ) this.advanceIndefiniteLength(); else this.advance(length); }
class class_name[name] begin[{] method[advanceElementData, return_type[void], modifier[public], parameter[length]] begin[{] if[binary_operation[member[.length], ==, member[Tag.Indefinite_Length]]] begin[{] THIS[call[None.advanceIndefiniteLength, parameter[]]] else begin[{] THIS[call[None.advance, parameter[member[.length]]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[advanceElementData] operator[SEP] Keyword[int] identifier[length] operator[SEP] Keyword[throws] identifier[IOException] , identifier[AsnException] { Keyword[if] operator[SEP] identifier[length] operator[==] identifier[Tag] operator[SEP] identifier[Indefinite_Length] operator[SEP] Keyword[this] operator[SEP] identifier[advanceIndefiniteLength] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[this] operator[SEP] identifier[advance] operator[SEP] identifier[length] operator[SEP] operator[SEP] }
public void placeBracketOrder(KiteConnect kiteConnect) throws KiteException, IOException { /** Bracket order:- following is example param for bracket order* * trailing_stoploss and stoploss_value are points and not tick or price */ OrderParams orderParams = new OrderParams(); orderParams.quantity = 1; orderParams.orderType = Constants.ORDER_TYPE_LIMIT; orderParams.price = 30.5; orderParams.transactionType = Constants.TRANSACTION_TYPE_BUY; orderParams.tradingsymbol = "SOUTHBANK"; orderParams.trailingStoploss = 1.0; orderParams.stoploss = 2.0; orderParams.exchange = Constants.EXCHANGE_NSE; orderParams.validity = Constants.VALIDITY_DAY; orderParams.squareoff = 3.0; orderParams.product = Constants.PRODUCT_MIS; Order order10 = kiteConnect.placeOrder(orderParams, Constants.VARIETY_BO); System.out.println(order10.orderId); }
class class_name[name] begin[{] method[placeBracketOrder, return_type[void], modifier[public], parameter[kiteConnect]] begin[{] local_variable[type[OrderParams], orderParams] assign[member[orderParams.quantity], literal[1]] assign[member[orderParams.orderType], member[Constants.ORDER_TYPE_LIMIT]] assign[member[orderParams.price], literal[30.5]] assign[member[orderParams.transactionType], member[Constants.TRANSACTION_TYPE_BUY]] assign[member[orderParams.tradingsymbol], literal["SOUTHBANK"]] assign[member[orderParams.trailingStoploss], literal[1.0]] assign[member[orderParams.stoploss], literal[2.0]] assign[member[orderParams.exchange], member[Constants.EXCHANGE_NSE]] assign[member[orderParams.validity], member[Constants.VALIDITY_DAY]] assign[member[orderParams.squareoff], literal[3.0]] assign[member[orderParams.product], member[Constants.PRODUCT_MIS]] local_variable[type[Order], order10] call[System.out.println, parameter[member[order10.orderId]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[placeBracketOrder] operator[SEP] identifier[KiteConnect] identifier[kiteConnect] operator[SEP] Keyword[throws] identifier[KiteException] , identifier[IOException] { identifier[OrderParams] identifier[orderParams] operator[=] Keyword[new] identifier[OrderParams] operator[SEP] operator[SEP] operator[SEP] identifier[orderParams] operator[SEP] identifier[quantity] operator[=] Other[1] operator[SEP] identifier[orderParams] operator[SEP] identifier[orderType] operator[=] identifier[Constants] operator[SEP] identifier[ORDER_TYPE_LIMIT] operator[SEP] identifier[orderParams] operator[SEP] identifier[price] operator[=] literal[Float] operator[SEP] identifier[orderParams] operator[SEP] identifier[transactionType] operator[=] identifier[Constants] operator[SEP] identifier[TRANSACTION_TYPE_BUY] operator[SEP] identifier[orderParams] operator[SEP] identifier[tradingsymbol] operator[=] literal[String] operator[SEP] identifier[orderParams] operator[SEP] identifier[trailingStoploss] operator[=] literal[Float] operator[SEP] identifier[orderParams] operator[SEP] identifier[stoploss] operator[=] literal[Float] operator[SEP] identifier[orderParams] operator[SEP] identifier[exchange] operator[=] identifier[Constants] operator[SEP] identifier[EXCHANGE_NSE] operator[SEP] identifier[orderParams] operator[SEP] identifier[validity] operator[=] identifier[Constants] operator[SEP] identifier[VALIDITY_DAY] operator[SEP] identifier[orderParams] operator[SEP] identifier[squareoff] operator[=] literal[Float] operator[SEP] identifier[orderParams] operator[SEP] identifier[product] operator[=] identifier[Constants] operator[SEP] identifier[PRODUCT_MIS] operator[SEP] identifier[Order] identifier[order10] operator[=] identifier[kiteConnect] operator[SEP] identifier[placeOrder] operator[SEP] identifier[orderParams] , identifier[Constants] operator[SEP] identifier[VARIETY_BO] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[order10] operator[SEP] identifier[orderId] operator[SEP] operator[SEP] }
public static List<IntrospectedColumn> getModelBaseRecordClomns(IntrospectedTable introspectedTable) { List<IntrospectedColumn> introspectedColumns; if (includePrimaryKeyColumns(introspectedTable)) { if (includeBLOBColumns(introspectedTable)) { introspectedColumns = introspectedTable.getAllColumns(); } else { introspectedColumns = introspectedTable.getNonBLOBColumns(); } } else { if (includeBLOBColumns(introspectedTable)) { introspectedColumns = introspectedTable .getNonPrimaryKeyColumns(); } else { introspectedColumns = introspectedTable.getBaseColumns(); } } return introspectedColumns; }
class class_name[name] begin[{] method[getModelBaseRecordClomns, return_type[type[List]], modifier[public static], parameter[introspectedTable]] begin[{] local_variable[type[List], introspectedColumns] if[call[.includePrimaryKeyColumns, parameter[member[.introspectedTable]]]] begin[{] if[call[.includeBLOBColumns, parameter[member[.introspectedTable]]]] begin[{] assign[member[.introspectedColumns], call[introspectedTable.getAllColumns, parameter[]]] else begin[{] assign[member[.introspectedColumns], call[introspectedTable.getNonBLOBColumns, parameter[]]] end[}] else begin[{] if[call[.includeBLOBColumns, parameter[member[.introspectedTable]]]] begin[{] assign[member[.introspectedColumns], call[introspectedTable.getNonPrimaryKeyColumns, parameter[]]] else begin[{] assign[member[.introspectedColumns], call[introspectedTable.getBaseColumns, parameter[]]] end[}] end[}] return[member[.introspectedColumns]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[IntrospectedColumn] operator[>] identifier[getModelBaseRecordClomns] operator[SEP] identifier[IntrospectedTable] identifier[introspectedTable] operator[SEP] { identifier[List] operator[<] identifier[IntrospectedColumn] operator[>] identifier[introspectedColumns] operator[SEP] Keyword[if] operator[SEP] identifier[includePrimaryKeyColumns] operator[SEP] identifier[introspectedTable] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[includeBLOBColumns] operator[SEP] identifier[introspectedTable] operator[SEP] operator[SEP] { identifier[introspectedColumns] operator[=] identifier[introspectedTable] operator[SEP] identifier[getAllColumns] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[introspectedColumns] operator[=] identifier[introspectedTable] operator[SEP] identifier[getNonBLOBColumns] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[includeBLOBColumns] operator[SEP] identifier[introspectedTable] operator[SEP] operator[SEP] { identifier[introspectedColumns] operator[=] identifier[introspectedTable] operator[SEP] identifier[getNonPrimaryKeyColumns] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[introspectedColumns] operator[=] identifier[introspectedTable] operator[SEP] identifier[getBaseColumns] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[introspectedColumns] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.MPGRG__RG_LENGTH: return getRGLength(); case AfplibPackage.MPGRG__TRIPLETS: return getTriplets(); } 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=MPGRG__RG_LENGTH, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getRGLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=MPGRG__TRIPLETS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getTriplets, 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[MPGRG__RG_LENGTH] operator[:] Keyword[return] identifier[getRGLength] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[MPGRG__TRIPLETS] operator[:] Keyword[return] identifier[getTriplets] 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 BasicVector fromCollection(Collection<? extends Number> list) { //TODO goto lambdas double[] self = new double[list.size()]; int i = 0; for (Number x : list) { self[i] = x.doubleValue(); i++; } return fromArray(self); }
class class_name[name] begin[{] method[fromCollection, return_type[type[BasicVector]], modifier[public static], parameter[list]] begin[{] local_variable[type[double], self] local_variable[type[int], i] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=x)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))), label=None) return[call[.fromArray, parameter[member[.self]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BasicVector] identifier[fromCollection] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[Number] operator[>] identifier[list] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] identifier[self] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Number] identifier[x] operator[:] identifier[list] operator[SEP] { identifier[self] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[x] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] } Keyword[return] identifier[fromArray] operator[SEP] identifier[self] operator[SEP] operator[SEP] }
public Observable<Page<SubscriptionMediaServiceInner>> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<SubscriptionMediaServiceInner>>, Page<SubscriptionMediaServiceInner>>() { @Override public Page<SubscriptionMediaServiceInner> call(ServiceResponse<Page<SubscriptionMediaServiceInner>> response) { return response.body(); } }); }
class class_name[name] begin[{] method[listNextAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink]] begin[{] return[call[.listNextWithServiceResponseAsync, parameter[member[.nextPageLink]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[SubscriptionMediaServiceInner] operator[>] operator[>] identifier[listNextAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[listNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SubscriptionMediaServiceInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[SubscriptionMediaServiceInner] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[SubscriptionMediaServiceInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[SubscriptionMediaServiceInner] operator[>] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
@Handler(priority = 1000) public void onProtocolSwitchAccepted( ProtocolSwitchAccepted event, IOSubchannel channel) { event.requestEvent().associated(Selection.class) .ifPresent( selection -> channel.setAssociated(Selection.class, selection)); }
class class_name[name] begin[{] method[onProtocolSwitchAccepted, return_type[void], modifier[public], parameter[event, channel]] begin[{] call[event.requestEvent, parameter[]] end[}] END[}]
annotation[@] identifier[Handler] operator[SEP] identifier[priority] operator[=] Other[1000] operator[SEP] Keyword[public] Keyword[void] identifier[onProtocolSwitchAccepted] operator[SEP] identifier[ProtocolSwitchAccepted] identifier[event] , identifier[IOSubchannel] identifier[channel] operator[SEP] { identifier[event] operator[SEP] identifier[requestEvent] operator[SEP] operator[SEP] operator[SEP] identifier[associated] operator[SEP] identifier[Selection] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[ifPresent] operator[SEP] identifier[selection] operator[->] identifier[channel] operator[SEP] identifier[setAssociated] operator[SEP] identifier[Selection] operator[SEP] Keyword[class] , identifier[selection] operator[SEP] operator[SEP] operator[SEP] }
public com.google.api.ads.admanager.axis.v201902.Money getBudget() { return budget; }
class class_name[name] begin[{] method[getBudget, return_type[type[com]], modifier[public], parameter[]] begin[{] return[member[.budget]] end[}] END[}]
Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201902] operator[SEP] identifier[Money] identifier[getBudget] operator[SEP] operator[SEP] { Keyword[return] identifier[budget] operator[SEP] }
public static ScrollableArea create(@Nullable final Area top, @Nullable final Area bottom) { return new ScrollableArea(top, bottom); }
class class_name[name] begin[{] method[create, return_type[type[ScrollableArea]], modifier[public static], parameter[top, bottom]] begin[{] return[ClassCreator(arguments=[MemberReference(member=top, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bottom, 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=ScrollableArea, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ScrollableArea] identifier[create] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[Area] identifier[top] , annotation[@] identifier[Nullable] Keyword[final] identifier[Area] identifier[bottom] operator[SEP] { Keyword[return] Keyword[new] identifier[ScrollableArea] operator[SEP] identifier[top] , identifier[bottom] operator[SEP] operator[SEP] }
public static <I> DefaultOneSEVPA<I> minimize(OneSEVPA<?, I> sevpa, VPDAlphabet<I> alphabet) { return OneSEVPAMinimizer.minimize(sevpa, alphabet); }
class class_name[name] begin[{] method[minimize, return_type[type[DefaultOneSEVPA]], modifier[public static], parameter[sevpa, alphabet]] begin[{] return[call[OneSEVPAMinimizer.minimize, parameter[member[.sevpa], member[.alphabet]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[I] operator[>] identifier[DefaultOneSEVPA] operator[<] identifier[I] operator[>] identifier[minimize] operator[SEP] identifier[OneSEVPA] operator[<] operator[?] , identifier[I] operator[>] identifier[sevpa] , identifier[VPDAlphabet] operator[<] identifier[I] operator[>] identifier[alphabet] operator[SEP] { Keyword[return] identifier[OneSEVPAMinimizer] operator[SEP] identifier[minimize] operator[SEP] identifier[sevpa] , identifier[alphabet] operator[SEP] operator[SEP] }
public void beginImportImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().single().body(); }
class class_name[name] begin[{] method[beginImportImage, return_type[void], modifier[public], parameter[resourceGroupName, registryName, parameters]] begin[{] call[.beginImportImageWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.registryName], member[.parameters]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[beginImportImage] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[registryName] , identifier[ImportImageParameters] identifier[parameters] operator[SEP] { identifier[beginImportImageWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[registryName] , identifier[parameters] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
@Override public List<String> getAllInformations() { ArrayList<String> strings = new ArrayList<>(descriptors); strings.add(type); return strings; }
class class_name[name] begin[{] method[getAllInformations, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[ArrayList], strings] call[strings.add, parameter[member[.type]]] return[member[.strings]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getAllInformations] operator[SEP] operator[SEP] { identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[strings] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[descriptors] operator[SEP] operator[SEP] identifier[strings] operator[SEP] identifier[add] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[strings] operator[SEP] }
private void setValue(Object newValue) { try { if (this.type == null) value = newValue; else if (this.type.equals("java.lang.String")) value = newValue; else if (this.type.equals("java.lang.Boolean")) value = Boolean.valueOf((String) newValue); else if (this.type.equals("java.lang.Integer")) value = new Integer(((String) newValue)); else if (this.type.equals("java.lang.Double")) value = new Double(((String) newValue)); else if (this.type.equals("java.lang.Byte")) value = new Byte(((String) newValue)); else if (this.type.equals("java.lang.Short")) value = new Short(((String) newValue)); else if (this.type.equals("java.lang.Long")) value = new Long(((String) newValue)); else if (this.type.equals("java.lang.Float")) value = new Float(((String) newValue)); else if (this.type.equals("java.lang.Character")) value = Character.valueOf(((String) newValue).charAt(0)); else value = newValue; } catch (NumberFormatException nfe) { Tr.warning(tc, "INCOMPATIBLE_PROPERTY_TYPE_J2CA0207", new Object[] { name, type, newValue }); } }
class class_name[name] begin[{] method[setValue, return_type[void], modifier[private], parameter[newValue]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.lang.String")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.lang.Boolean")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.lang.Integer")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.lang.Double")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.lang.Byte")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.lang.Short")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.lang.Long")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.lang.Float")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="java.lang.Character")], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None))), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INCOMPATIBLE_PROPERTY_TYPE_J2CA0207"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, 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=warning, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nfe, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[setValue] operator[SEP] identifier[Object] identifier[newValue] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] identifier[value] operator[=] identifier[newValue] operator[SEP] Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[newValue] operator[SEP] Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[=] Keyword[new] identifier[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[=] Keyword[new] identifier[Double] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[=] Keyword[new] identifier[Byte] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[=] Keyword[new] identifier[Short] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[=] Keyword[new] identifier[Long] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[=] Keyword[new] identifier[Float] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[Character] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[else] identifier[value] operator[=] identifier[newValue] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[nfe] operator[SEP] { identifier[Tr] operator[SEP] identifier[warning] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[name] , identifier[type] , identifier[newValue] } operator[SEP] operator[SEP] } }
protected int scoreByMediaType(List<MediaType> mediaTypes, MediaType requiredMediaType) { int score = MAXIMUM_HEADER_SCORE; boolean match = false; boolean matchWildCard = false; for (MediaType mediaType : mediaTypes) { if (mediaType.matches(requiredMediaType)) { if (mediaType.isWildCardMediaType()) { matchWildCard = true; } match = true; break; } // Lower the score for each subsequent possible match score -= 2; } return match && !matchWildCard ? score : matchWildCard ? WILDCARD_MATCH_SCORE : DEFAULT_SCORE; }
class class_name[name] begin[{] method[scoreByMediaType, return_type[type[int]], modifier[protected], parameter[mediaTypes, requiredMediaType]] begin[{] local_variable[type[int], score] local_variable[type[boolean], match] local_variable[type[boolean], matchWildCard] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=requiredMediaType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=mediaType, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isWildCardMediaType, postfix_operators=[], prefix_operators=[], qualifier=mediaType, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=matchWildCard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=mediaTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=mediaType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MediaType, sub_type=None))), label=None) return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=matchWildCard, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operator=&&), if_false=TernaryExpression(condition=MemberReference(member=matchWildCard, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=DEFAULT_SCORE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=WILDCARD_MATCH_SCORE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), if_true=MemberReference(member=score, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] end[}] END[}]
Keyword[protected] Keyword[int] identifier[scoreByMediaType] operator[SEP] identifier[List] operator[<] identifier[MediaType] operator[>] identifier[mediaTypes] , identifier[MediaType] identifier[requiredMediaType] operator[SEP] { Keyword[int] identifier[score] operator[=] identifier[MAXIMUM_HEADER_SCORE] operator[SEP] Keyword[boolean] identifier[match] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[matchWildCard] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[MediaType] identifier[mediaType] operator[:] identifier[mediaTypes] operator[SEP] { Keyword[if] operator[SEP] identifier[mediaType] operator[SEP] identifier[matches] operator[SEP] identifier[requiredMediaType] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[mediaType] operator[SEP] identifier[isWildCardMediaType] operator[SEP] operator[SEP] operator[SEP] { identifier[matchWildCard] operator[=] literal[boolean] operator[SEP] } identifier[match] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } identifier[score] operator[-=] Other[2] operator[SEP] } Keyword[return] identifier[match] operator[&&] operator[!] identifier[matchWildCard] operator[?] identifier[score] operator[:] identifier[matchWildCard] operator[?] identifier[WILDCARD_MATCH_SCORE] operator[:] identifier[DEFAULT_SCORE] operator[SEP] }
public List<String> getMetadataWhereNameNotLike(String notLike, String sortColumn) { return getMetadataWhereNameLike(notLike, sortColumn, true); }
class class_name[name] begin[{] method[getMetadataWhereNameNotLike, return_type[type[List]], modifier[public], parameter[notLike, sortColumn]] begin[{] return[call[.getMetadataWhereNameLike, parameter[member[.notLike], member[.sortColumn], literal[true]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getMetadataWhereNameNotLike] operator[SEP] identifier[String] identifier[notLike] , identifier[String] identifier[sortColumn] operator[SEP] { Keyword[return] identifier[getMetadataWhereNameLike] operator[SEP] identifier[notLike] , identifier[sortColumn] , literal[boolean] operator[SEP] operator[SEP] }
protected Map<String, Object> extractContent(PropertySource<?> propertySource) { return new Binder(ConfigurationPropertySources.from(propertySource)) .bind("", STRING_OBJECT_MAP).orElseGet(LinkedHashMap::new); }
class class_name[name] begin[{] method[extractContent, return_type[type[Map]], modifier[protected], parameter[propertySource]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=propertySource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=from, postfix_operators=[], prefix_operators=[], qualifier=ConfigurationPropertySources, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), MemberReference(member=STRING_OBJECT_MAP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bind, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=LinkedHashMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=new, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), type_arguments=[])], member=orElseGet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Binder, sub_type=None))] end[}] END[}]
Keyword[protected] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[extractContent] operator[SEP] identifier[PropertySource] operator[<] operator[?] operator[>] identifier[propertySource] operator[SEP] { Keyword[return] Keyword[new] identifier[Binder] operator[SEP] identifier[ConfigurationPropertySources] operator[SEP] identifier[from] operator[SEP] identifier[propertySource] operator[SEP] operator[SEP] operator[SEP] identifier[bind] operator[SEP] literal[String] , identifier[STRING_OBJECT_MAP] operator[SEP] operator[SEP] identifier[orElseGet] operator[SEP] identifier[LinkedHashMap] operator[::] Keyword[new] operator[SEP] operator[SEP] }
public void remove(String identifier, ItemData item) { boolean inTransaction = cache.isTransactionActive(); try { if (!inTransaction) { cache.beginTransaction(); } cache.setLocal(true); cache.remove(new CacheId(getOwnerId(), identifier), item); } finally { cache.setLocal(false); if (!inTransaction) { dedicatedTxCommit(); } } }
class class_name[name] begin[{] method[remove, return_type[void], modifier[public], parameter[identifier, item]] begin[{] local_variable[type[boolean], inTransaction] TryStatement(block=[IfStatement(condition=MemberReference(member=inTransaction, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=beginTransaction, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setLocal, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getOwnerId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=identifier, 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=CacheId, sub_type=None)), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setLocal, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=inTransaction, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=dedicatedTxCommit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[remove] operator[SEP] identifier[String] identifier[identifier] , identifier[ItemData] identifier[item] operator[SEP] { Keyword[boolean] identifier[inTransaction] operator[=] identifier[cache] operator[SEP] identifier[isTransactionActive] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[inTransaction] operator[SEP] { identifier[cache] operator[SEP] identifier[beginTransaction] operator[SEP] operator[SEP] operator[SEP] } identifier[cache] operator[SEP] identifier[setLocal] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[remove] operator[SEP] Keyword[new] identifier[CacheId] operator[SEP] identifier[getOwnerId] operator[SEP] operator[SEP] , identifier[identifier] operator[SEP] , identifier[item] operator[SEP] operator[SEP] } Keyword[finally] { identifier[cache] operator[SEP] identifier[setLocal] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[inTransaction] operator[SEP] { identifier[dedicatedTxCommit] operator[SEP] operator[SEP] operator[SEP] } } }
public static int[] copyOf(int[] old, int length) { int[] newArray = new int[length]; int minLength = Math.min(old.length, length); System.arraycopy(old, 0, newArray, 0, minLength); return newArray; }
class class_name[name] begin[{] method[copyOf, return_type[type[int]], modifier[public static], parameter[old, length]] begin[{] local_variable[type[int], newArray] local_variable[type[int], minLength] call[System.arraycopy, parameter[member[.old], literal[0], member[.newArray], literal[0], member[.minLength]]] return[member[.newArray]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] operator[SEP] operator[SEP] identifier[copyOf] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[old] , Keyword[int] identifier[length] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[newArray] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] identifier[minLength] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[old] operator[SEP] identifier[length] , identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[old] , Other[0] , identifier[newArray] , Other[0] , identifier[minLength] operator[SEP] operator[SEP] Keyword[return] identifier[newArray] operator[SEP] }
private Entry setParent(Entry entry, Entry parent) { unlinkFromNeighbors(entry); entry.oParent = parent; parent.oFirstChild = mergeLists(entry, parent.oFirstChild); parent.degree++; entry.isMarked = false; return parent; }
class class_name[name] begin[{] method[setParent, return_type[type[Entry]], modifier[private], parameter[entry, parent]] begin[{] call[.unlinkFromNeighbors, parameter[member[.entry]]] assign[member[entry.oParent], member[.parent]] assign[member[parent.oFirstChild], call[.mergeLists, parameter[member[.entry], member[parent.oFirstChild]]]] member[parent.degree] assign[member[entry.isMarked], literal[false]] return[member[.parent]] end[}] END[}]
Keyword[private] identifier[Entry] identifier[setParent] operator[SEP] identifier[Entry] identifier[entry] , identifier[Entry] identifier[parent] operator[SEP] { identifier[unlinkFromNeighbors] operator[SEP] identifier[entry] operator[SEP] operator[SEP] identifier[entry] operator[SEP] identifier[oParent] operator[=] identifier[parent] operator[SEP] identifier[parent] operator[SEP] identifier[oFirstChild] operator[=] identifier[mergeLists] operator[SEP] identifier[entry] , identifier[parent] operator[SEP] identifier[oFirstChild] operator[SEP] operator[SEP] identifier[parent] operator[SEP] identifier[degree] operator[++] operator[SEP] identifier[entry] operator[SEP] identifier[isMarked] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[parent] operator[SEP] }
public void info(final Throwable exception, final String message) { if (minimumLevelCoversInfo) { provider.log(STACKTRACE_DEPTH, tag, Level.INFO, exception, message, (Object[]) null); } }
class class_name[name] begin[{] method[info, return_type[void], modifier[public], parameter[exception, message]] begin[{] if[member[.minimumLevelCoversInfo]] begin[{] call[provider.log, parameter[member[.STACKTRACE_DEPTH], member[.tag], member[Level.INFO], member[.exception], member[.message], Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[info] operator[SEP] Keyword[final] identifier[Throwable] identifier[exception] , Keyword[final] identifier[String] identifier[message] operator[SEP] { Keyword[if] operator[SEP] identifier[minimumLevelCoversInfo] operator[SEP] { identifier[provider] operator[SEP] identifier[log] operator[SEP] identifier[STACKTRACE_DEPTH] , identifier[tag] , identifier[Level] operator[SEP] identifier[INFO] , identifier[exception] , identifier[message] , operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] Other[null] operator[SEP] operator[SEP] } }
private static float hue2rgb(float m1, float m2, float h) { if (h < 0) h += 1; if (h > 1) h -= 1; if (h * 6f < 1) return m1 + (m2 - m1) * 6f * h; if (h * 2f < 1) return m2; if (h * 3f < 2) return m1 + (m2 - m1) * (2 / 3f - h) * 6f; return m1; }
class class_name[name] begin[{] method[hue2rgb, return_type[type[float]], modifier[private static], parameter[m1, m2, h]] begin[{] if[binary_operation[member[.h], <, literal[0]]] begin[{] assign[member[.h], literal[1]] else begin[{] None end[}] if[binary_operation[member[.h], >, literal[1]]] begin[{] assign[member[.h], literal[1]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.h], *, literal[6f]], <, literal[1]]] begin[{] return[binary_operation[member[.m1], +, binary_operation[binary_operation[binary_operation[member[.m2], -, member[.m1]], *, literal[6f]], *, member[.h]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.h], *, literal[2f]], <, literal[1]]] begin[{] return[member[.m2]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.h], *, literal[3f]], <, literal[2]]] begin[{] return[binary_operation[member[.m1], +, binary_operation[binary_operation[binary_operation[member[.m2], -, member[.m1]], *, binary_operation[binary_operation[literal[2], /, literal[3f]], -, member[.h]]], *, literal[6f]]]] else begin[{] None end[}] return[member[.m1]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[float] identifier[hue2rgb] operator[SEP] Keyword[float] identifier[m1] , Keyword[float] identifier[m2] , Keyword[float] identifier[h] operator[SEP] { Keyword[if] operator[SEP] identifier[h] operator[<] Other[0] operator[SEP] identifier[h] operator[+=] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[h] operator[>] Other[1] operator[SEP] identifier[h] operator[-=] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[h] operator[*] literal[Float] operator[<] Other[1] operator[SEP] Keyword[return] identifier[m1] operator[+] operator[SEP] identifier[m2] operator[-] identifier[m1] operator[SEP] operator[*] literal[Float] operator[*] identifier[h] operator[SEP] Keyword[if] operator[SEP] identifier[h] operator[*] literal[Float] operator[<] Other[1] operator[SEP] Keyword[return] identifier[m2] operator[SEP] Keyword[if] operator[SEP] identifier[h] operator[*] literal[Float] operator[<] Other[2] operator[SEP] Keyword[return] identifier[m1] operator[+] operator[SEP] identifier[m2] operator[-] identifier[m1] operator[SEP] operator[*] operator[SEP] Other[2] operator[/] literal[Float] operator[-] identifier[h] operator[SEP] operator[*] literal[Float] operator[SEP] Keyword[return] identifier[m1] operator[SEP] }
public Object invoke(MethodInvocation mi) throws Exception { Method method = mi.getMethod(); return simulatorAdapter.service(method.getDeclaringClass().getCanonicalName(), method.getName(), mi.getArguments(), rootPath, useRootRelativePath); }
class class_name[name] begin[{] method[invoke, return_type[type[Object]], modifier[public], parameter[mi]] begin[{] local_variable[type[Method], method] return[call[simulatorAdapter.service, parameter[call[method.getDeclaringClass, parameter[]], call[method.getName, parameter[]], call[mi.getArguments, parameter[]], member[.rootPath], member[.useRootRelativePath]]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[invoke] operator[SEP] identifier[MethodInvocation] identifier[mi] operator[SEP] Keyword[throws] identifier[Exception] { identifier[Method] identifier[method] operator[=] identifier[mi] operator[SEP] identifier[getMethod] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[simulatorAdapter] operator[SEP] identifier[service] operator[SEP] identifier[method] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] , identifier[method] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[mi] operator[SEP] identifier[getArguments] operator[SEP] operator[SEP] , identifier[rootPath] , identifier[useRootRelativePath] operator[SEP] operator[SEP] }
public long getHeaderSize() { long headerSize = get(MSDOSHeaderKey.HEADER_PARAGRAPHS) * PARAGRAPH_SIZE; if (headerSize > peSigOffset) { return peSigOffset; } assert headerSize >= 0; return headerSize; }
class class_name[name] begin[{] method[getHeaderSize, return_type[type[long]], modifier[public], parameter[]] begin[{] local_variable[type[long], headerSize] if[binary_operation[member[.headerSize], >, member[.peSigOffset]]] begin[{] return[member[.peSigOffset]] else begin[{] None end[}] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=headerSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), label=None, value=None) return[member[.headerSize]] end[}] END[}]
Keyword[public] Keyword[long] identifier[getHeaderSize] operator[SEP] operator[SEP] { Keyword[long] identifier[headerSize] operator[=] identifier[get] operator[SEP] identifier[MSDOSHeaderKey] operator[SEP] identifier[HEADER_PARAGRAPHS] operator[SEP] operator[*] identifier[PARAGRAPH_SIZE] operator[SEP] Keyword[if] operator[SEP] identifier[headerSize] operator[>] identifier[peSigOffset] operator[SEP] { Keyword[return] identifier[peSigOffset] operator[SEP] } Keyword[assert] identifier[headerSize] operator[>=] Other[0] operator[SEP] Keyword[return] identifier[headerSize] operator[SEP] }
public static RuntimeException launderCacheListenerException(CacheListenerException e) { Throwable cause = e.getCause(); if (cause instanceof CacheEntryListenerException) return (CacheEntryListenerException) cause; if (cause instanceof Exception) return new CacheEntryListenerException(cause); if (cause instanceof Error) throw (Error) cause; return e; }
class class_name[name] begin[{] method[launderCacheListenerException, return_type[type[RuntimeException]], modifier[public static], parameter[e]] begin[{] local_variable[type[Throwable], cause] if[binary_operation[member[.cause], instanceof, type[CacheEntryListenerException]]] begin[{] return[Cast(expression=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CacheEntryListenerException, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.cause], instanceof, type[Exception]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=cause, 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=CacheEntryListenerException, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.cause], instanceof, type[Error]]] begin[{] ThrowStatement(expression=Cast(expression=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Error, sub_type=None)), label=None) else begin[{] None end[}] return[member[.e]] end[}] END[}]
Keyword[public] Keyword[static] identifier[RuntimeException] identifier[launderCacheListenerException] operator[SEP] identifier[CacheListenerException] identifier[e] operator[SEP] { identifier[Throwable] identifier[cause] operator[=] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cause] Keyword[instanceof] identifier[CacheEntryListenerException] operator[SEP] Keyword[return] operator[SEP] identifier[CacheEntryListenerException] operator[SEP] identifier[cause] operator[SEP] Keyword[if] operator[SEP] identifier[cause] Keyword[instanceof] identifier[Exception] operator[SEP] Keyword[return] Keyword[new] identifier[CacheEntryListenerException] operator[SEP] identifier[cause] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cause] Keyword[instanceof] identifier[Error] operator[SEP] Keyword[throw] operator[SEP] identifier[Error] operator[SEP] identifier[cause] operator[SEP] Keyword[return] identifier[e] operator[SEP] }
public Integer getInteger(String key, int aDefault) { return getInteger(key, Integer.valueOf(aDefault)); }
class class_name[name] begin[{] method[getInteger, return_type[type[Integer]], modifier[public], parameter[key, aDefault]] begin[{] return[call[.getInteger, parameter[member[.key], call[Integer.valueOf, parameter[member[.aDefault]]]]]] end[}] END[}]
Keyword[public] identifier[Integer] identifier[getInteger] operator[SEP] identifier[String] identifier[key] , Keyword[int] identifier[aDefault] operator[SEP] { Keyword[return] identifier[getInteger] operator[SEP] identifier[key] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[aDefault] operator[SEP] operator[SEP] operator[SEP] }
@Override public CommerceTierPriceEntry findByUuid_C_First(String uuid, long companyId, OrderByComparator<CommerceTierPriceEntry> orderByComparator) throws NoSuchTierPriceEntryException { CommerceTierPriceEntry commerceTierPriceEntry = fetchByUuid_C_First(uuid, companyId, orderByComparator); if (commerceTierPriceEntry != null) { return commerceTierPriceEntry; } StringBundler msg = new StringBundler(6); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append("uuid="); msg.append(uuid); msg.append(", companyId="); msg.append(companyId); msg.append("}"); throw new NoSuchTierPriceEntryException(msg.toString()); }
class class_name[name] begin[{] method[findByUuid_C_First, return_type[type[CommerceTierPriceEntry]], modifier[public], parameter[uuid, companyId, orderByComparator]] begin[{] local_variable[type[CommerceTierPriceEntry], commerceTierPriceEntry] if[binary_operation[member[.commerceTierPriceEntry], !=, literal[null]]] begin[{] return[member[.commerceTierPriceEntry]] else begin[{] None end[}] local_variable[type[StringBundler], msg] call[msg.append, parameter[member[._NO_SUCH_ENTITY_WITH_KEY]]] call[msg.append, parameter[literal["uuid="]]] call[msg.append, parameter[member[.uuid]]] call[msg.append, parameter[literal[", companyId="]]] call[msg.append, parameter[member[.companyId]]] call[msg.append, parameter[literal["}"]]] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchTierPriceEntryException, sub_type=None)), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceTierPriceEntry] identifier[findByUuid_C_First] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[companyId] , identifier[OrderByComparator] operator[<] identifier[CommerceTierPriceEntry] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[NoSuchTierPriceEntryException] { identifier[CommerceTierPriceEntry] identifier[commerceTierPriceEntry] operator[=] identifier[fetchByUuid_C_First] operator[SEP] identifier[uuid] , identifier[companyId] , identifier[orderByComparator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceTierPriceEntry] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[commerceTierPriceEntry] operator[SEP] } identifier[StringBundler] identifier[msg] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[6] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_KEY] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[companyId] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NoSuchTierPriceEntryException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public synchronized void getOrCreateVertx( final VertxPlatformConfiguration config, final VertxListener listener) { Vertx vertx = vertxPlatforms.get(config.getVertxPlatformIdentifier()); if (vertx != null) { listener.whenReady(vertx); return; } VertxOptions options = new VertxOptions(); options.setClustered(config.isClustered()); options.setClusterHost(config.getClusterHost()); options.setClusterPort(config.getClusterPort()); CountDownLatch latch = new CountDownLatch(1); Vertx.clusteredVertx(options, ar -> { try { if (ar.succeeded()) { log.log(Level.INFO, "Acquired Vert.x platform."); listener.whenReady(ar.result()); vertxPlatforms.put(config.getVertxPlatformIdentifier(), ar.result()); } else { throw new RuntimeException("Could not acquire Vert.x platform.", ar.cause()); } } finally { latch.countDown(); } }); try { if (!latch.await(config.getTimeout(), TimeUnit.MILLISECONDS)) { log.log(Level.SEVERE, "Could not acquire Vert.x platform in interval."); throw new RuntimeException( "Could not acquire Vert.x platform in interval"); } } catch (Exception ignore) { } }
class class_name[name] begin[{] method[getOrCreateVertx, return_type[void], modifier[synchronized public], parameter[config, listener]] begin[{] local_variable[type[Vertx], vertx] if[binary_operation[member[.vertx], !=, literal[null]]] begin[{] call[listener.whenReady, parameter[member[.vertx]]] return[None] else begin[{] None end[}] local_variable[type[VertxOptions], options] call[options.setClustered, parameter[call[config.isClustered, parameter[]]]] call[options.setClusterHost, parameter[call[config.getClusterHost, parameter[]]]] call[options.setClusterPort, parameter[call[config.getClusterPort, parameter[]]]] local_variable[type[CountDownLatch], latch] call[Vertx.clusteredVertx, parameter[member[.options], LambdaExpression(body=[TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=succeeded, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not acquire Vert.x platform."), MethodInvocation(arguments=[], member=cause, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INFO, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Acquired Vert.x platform.")], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=result, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[], type_arguments=None)], member=whenReady, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getVertxPlatformIdentifier, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=result, postfix_operators=[], prefix_operators=[], qualifier=ar, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=vertxPlatforms, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=countDown, postfix_operators=[], prefix_operators=[], qualifier=latch, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], parameters=[MemberReference(member=ar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTimeout, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None), MemberReference(member=MILLISECONDS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[])], member=await, postfix_operators=[], prefix_operators=['!'], qualifier=latch, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not acquire Vert.x platform in interval.")], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not acquire Vert.x platform in interval")], 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)]))], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[getOrCreateVertx] operator[SEP] Keyword[final] identifier[VertxPlatformConfiguration] identifier[config] , Keyword[final] identifier[VertxListener] identifier[listener] operator[SEP] { identifier[Vertx] identifier[vertx] operator[=] identifier[vertxPlatforms] operator[SEP] identifier[get] operator[SEP] identifier[config] operator[SEP] identifier[getVertxPlatformIdentifier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vertx] operator[!=] Other[null] operator[SEP] { identifier[listener] operator[SEP] identifier[whenReady] operator[SEP] identifier[vertx] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[VertxOptions] identifier[options] operator[=] Keyword[new] identifier[VertxOptions] operator[SEP] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[setClustered] operator[SEP] identifier[config] operator[SEP] identifier[isClustered] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[setClusterHost] operator[SEP] identifier[config] operator[SEP] identifier[getClusterHost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[options] operator[SEP] identifier[setClusterPort] operator[SEP] identifier[config] operator[SEP] identifier[getClusterPort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CountDownLatch] identifier[latch] operator[=] Keyword[new] identifier[CountDownLatch] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[Vertx] operator[SEP] identifier[clusteredVertx] operator[SEP] identifier[options] , identifier[ar] operator[->] { Keyword[try] { Keyword[if] operator[SEP] identifier[ar] operator[SEP] identifier[succeeded] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[INFO] , literal[String] operator[SEP] operator[SEP] identifier[listener] operator[SEP] identifier[whenReady] operator[SEP] identifier[ar] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[vertxPlatforms] operator[SEP] identifier[put] operator[SEP] identifier[config] operator[SEP] identifier[getVertxPlatformIdentifier] operator[SEP] operator[SEP] , identifier[ar] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[ar] operator[SEP] identifier[cause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[latch] operator[SEP] identifier[countDown] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[latch] operator[SEP] identifier[await] operator[SEP] identifier[config] operator[SEP] identifier[getTimeout] operator[SEP] operator[SEP] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[ignore] operator[SEP] { } }
static public double rosenbrock(double[] x) { double sum = 0.0; for (int i = 0; i < (x.length - 1); i++) { double temp1 = (x[i] * x[i]) - x[i + 1]; double temp2 = x[i] - 1.0; sum += (100.0 * temp1 * temp1) + (temp2 * temp2); } return (sum); }
class class_name[name] begin[{] method[rosenbrock, return_type[type[double]], modifier[public static], parameter[x]] begin[{] local_variable[type[double], sum] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operator=-), name=temp1)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0), operator=-), name=temp2)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100.0), operandr=MemberReference(member=temp1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=temp1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=temp2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=temp2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.sum]] end[}] END[}]
Keyword[static] Keyword[public] Keyword[double] identifier[rosenbrock] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[x] operator[SEP] { Keyword[double] identifier[sum] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] operator[SEP] identifier[x] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[double] identifier[temp1] operator[=] operator[SEP] identifier[x] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[x] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[-] identifier[x] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[double] identifier[temp2] operator[=] identifier[x] operator[SEP] identifier[i] operator[SEP] operator[-] literal[Float] operator[SEP] identifier[sum] operator[+=] operator[SEP] literal[Float] operator[*] identifier[temp1] operator[*] identifier[temp1] operator[SEP] operator[+] operator[SEP] identifier[temp2] operator[*] identifier[temp2] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[sum] operator[SEP] operator[SEP] }
public boolean isHealthy() { return health() .map(health -> !"red".equals(health.path("status").asText()) && indexSetRegistry.isUp()) .orElse(false); }
class class_name[name] begin[{] method[isHealthy, return_type[type[boolean]], modifier[public], parameter[]] begin[{] return[call[.health, parameter[]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isHealthy] operator[SEP] operator[SEP] { Keyword[return] identifier[health] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[health] operator[->] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[health] operator[SEP] identifier[path] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[asText] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[indexSetRegistry] operator[SEP] identifier[isUp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
private static String key(String name) { return WHITE_SPACE.matcher(name).replaceAll(".").toLowerCase(Locale.ENGLISH); }
class class_name[name] begin[{] method[key, return_type[type[String]], modifier[private static], parameter[name]] begin[{] return[call[WHITE_SPACE.matcher, parameter[member[.name]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[key] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[return] identifier[WHITE_SPACE] operator[SEP] identifier[matcher] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] operator[SEP] operator[SEP] }
private Integer highlanderMode(JobDef jd, DbConn cnx) { if (!jd.isHighlander()) { return null; } try { Integer existing = cnx.runSelectSingle("ji_select_existing_highlander", Integer.class, jd.getId()); return existing; } catch (NoResultException ex) { // Just continue, this means no existing waiting JI in queue. } // Now we need to actually synchronize through the database to avoid double posting // TODO: use a dedicated table, not the JobDef one. Will avoid locking the configuration. ResultSet rs = cnx.runSelect(true, "jd_select_by_id", jd.getId()); // Now we have a lock, just retry - some other client may have created a job instance recently. try { Integer existing = cnx.runSelectSingle("ji_select_existing_highlander", Integer.class, jd.getId()); rs.close(); cnx.commit(); // Do not keep the lock! return existing; } catch (NoResultException ex) { // Just continue, this means no existing waiting JI in queue. We keep the lock! } catch (SQLException e) { // Who cares. jqmlogger.warn("Issue when closing a ResultSet. Transaction or session leak is possible.", e); } jqmlogger.trace("Highlander mode analysis is done: nor existing JO, must create a new one. Lock is hold."); return null; }
class class_name[name] begin[{] method[highlanderMode, return_type[type[Integer]], modifier[private], parameter[jd, cnx]] begin[{] if[call[jd.isHighlander, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ji_select_existing_highlander"), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=jd, selectors=[], type_arguments=None)], member=runSelectSingle, postfix_operators=[], prefix_operators=[], qualifier=cnx, selectors=[], type_arguments=None), name=existing)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), ReturnStatement(expression=MemberReference(member=existing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NoResultException']))], finally_block=None, label=None, resources=None) local_variable[type[ResultSet], rs] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ji_select_existing_highlander"), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=jd, selectors=[], type_arguments=None)], member=runSelectSingle, postfix_operators=[], prefix_operators=[], qualifier=cnx, selectors=[], type_arguments=None), name=existing)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=commit, postfix_operators=[], prefix_operators=[], qualifier=cnx, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=existing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NoResultException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Issue when closing a ResultSet. Transaction or session leak is possible."), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=jqmlogger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None) call[jqmlogger.trace, parameter[literal["Highlander mode analysis is done: nor existing JO, must create a new one. Lock is hold."]]] return[literal[null]] end[}] END[}]
Keyword[private] identifier[Integer] identifier[highlanderMode] operator[SEP] identifier[JobDef] identifier[jd] , identifier[DbConn] identifier[cnx] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[jd] operator[SEP] identifier[isHighlander] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[try] { identifier[Integer] identifier[existing] operator[=] identifier[cnx] operator[SEP] identifier[runSelectSingle] operator[SEP] literal[String] , identifier[Integer] operator[SEP] Keyword[class] , identifier[jd] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[existing] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoResultException] identifier[ex] operator[SEP] { } identifier[ResultSet] identifier[rs] operator[=] identifier[cnx] operator[SEP] identifier[runSelect] operator[SEP] literal[boolean] , literal[String] , identifier[jd] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Integer] identifier[existing] operator[=] identifier[cnx] operator[SEP] identifier[runSelectSingle] operator[SEP] literal[String] , identifier[Integer] operator[SEP] Keyword[class] , identifier[jd] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[rs] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[cnx] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[existing] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoResultException] identifier[ex] operator[SEP] { } Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] { identifier[jqmlogger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[jqmlogger] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
@Override public void notifySynchronization() { try { synchronisationObservable.notifyObservers(System.currentTimeMillis()); } catch (CouldNotPerformException ex) { ExceptionPrinter.printHistory(new CouldNotPerformException("Could not notify observer about synchronization", ex), logger); } }
class class_name[name] begin[{] method[notifySynchronization, return_type[void], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)], member=notifyObservers, postfix_operators=[], prefix_operators=[], qualifier=synchronisationObservable, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not notify observer about synchronization"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CouldNotPerformException, sub_type=None)), MemberReference(member=logger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printHistory, postfix_operators=[], prefix_operators=[], qualifier=ExceptionPrinter, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['CouldNotPerformException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[notifySynchronization] operator[SEP] operator[SEP] { Keyword[try] { identifier[synchronisationObservable] operator[SEP] identifier[notifyObservers] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CouldNotPerformException] identifier[ex] operator[SEP] { identifier[ExceptionPrinter] operator[SEP] identifier[printHistory] operator[SEP] Keyword[new] identifier[CouldNotPerformException] operator[SEP] literal[String] , identifier[ex] operator[SEP] , identifier[logger] operator[SEP] operator[SEP] } }
private void readResults() throws IOException, ParseException { factory.setFile(file); results = factory.createObjects(evalueThreshold); }
class class_name[name] begin[{] method[readResults, return_type[void], modifier[private], parameter[]] begin[{] call[factory.setFile, parameter[member[.file]]] assign[member[.results], call[factory.createObjects, parameter[member[.evalueThreshold]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[readResults] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ParseException] { identifier[factory] operator[SEP] identifier[setFile] operator[SEP] identifier[file] operator[SEP] operator[SEP] identifier[results] operator[=] identifier[factory] operator[SEP] identifier[createObjects] operator[SEP] identifier[evalueThreshold] operator[SEP] operator[SEP] }
private synchronized void asyncResponse(String command, SocketChannel sc) { if (closed) { Utils.tryToClose(sc); } else { Thread thread = new Thread(new ResponseThread(command, sc), "kernel-" + command + "-command-response"); // We allow a maximum of one outstanding status start or stop command Thread oldThread = responseThread.getAndSet(thread); if (oldThread != null) { oldThread.interrupt(); } thread.start(); } }
class class_name[name] begin[{] method[asyncResponse, return_type[void], modifier[synchronized private], parameter[command, sc]] begin[{] if[member[.closed]] begin[{] call[Utils.tryToClose, parameter[member[.sc]]] else begin[{] local_variable[type[Thread], thread] local_variable[type[Thread], oldThread] if[binary_operation[member[.oldThread], !=, literal[null]]] begin[{] call[oldThread.interrupt, parameter[]] else begin[{] None end[}] call[thread.start, parameter[]] end[}] end[}] END[}]
Keyword[private] Keyword[synchronized] Keyword[void] identifier[asyncResponse] operator[SEP] identifier[String] identifier[command] , identifier[SocketChannel] identifier[sc] operator[SEP] { Keyword[if] operator[SEP] identifier[closed] operator[SEP] { identifier[Utils] operator[SEP] identifier[tryToClose] operator[SEP] identifier[sc] operator[SEP] operator[SEP] } Keyword[else] { identifier[Thread] identifier[thread] operator[=] Keyword[new] identifier[Thread] operator[SEP] Keyword[new] identifier[ResponseThread] operator[SEP] identifier[command] , identifier[sc] operator[SEP] , literal[String] operator[+] identifier[command] operator[+] literal[String] operator[SEP] operator[SEP] identifier[Thread] identifier[oldThread] operator[=] identifier[responseThread] operator[SEP] identifier[getAndSet] operator[SEP] identifier[thread] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldThread] operator[!=] Other[null] operator[SEP] { identifier[oldThread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] } identifier[thread] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] } }
public int getHitCount(IDbgpSession session) throws CoreException { final PerSessionInfo info; synchronized (sessions) { info = (PerSessionInfo) sessions.get(session); } return info != null ? info.hitCount : -1; }
class class_name[name] begin[{] method[getHitCount, return_type[type[int]], modifier[public], parameter[session]] begin[{] local_variable[type[PerSessionInfo], info] SYNCHRONIZED[member[.sessions]] BEGIN[{] assign[member[.info], Cast(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=sessions, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=PerSessionInfo, sub_type=None))] END[}] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=info, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), if_true=MemberReference(member=hitCount, postfix_operators=[], prefix_operators=[], qualifier=info, selectors=[]))] end[}] END[}]
Keyword[public] Keyword[int] identifier[getHitCount] operator[SEP] identifier[IDbgpSession] identifier[session] operator[SEP] Keyword[throws] identifier[CoreException] { Keyword[final] identifier[PerSessionInfo] identifier[info] operator[SEP] Keyword[synchronized] operator[SEP] identifier[sessions] operator[SEP] { identifier[info] operator[=] operator[SEP] identifier[PerSessionInfo] operator[SEP] identifier[sessions] operator[SEP] identifier[get] operator[SEP] identifier[session] operator[SEP] operator[SEP] } Keyword[return] identifier[info] operator[!=] Other[null] operator[?] identifier[info] operator[SEP] identifier[hitCount] operator[:] operator[-] Other[1] operator[SEP] }
public static boolean reduceFragments(List<FragmentPair> fragments, FragmentPair f, Matrix rmsmat){ boolean doNotAdd =false; int i = f.getPos1(); int j = f.getPos2(); for ( int p =0; p < fragments.size(); p++){ FragmentPair tmp = fragments.get(p); int di1 = Math.abs(f.getPos1() - tmp.getPos1()); int di2 = Math.abs(f.getPos2() - tmp.getPos2()); if (( Math.abs(di1-di2) == 2)) { double rms1 = rmsmat.get(tmp.getPos1(),tmp.getPos2()); double rms2 = rmsmat.get(i,j); doNotAdd = true; if ( rms2 < rms1){ fragments.remove(p); fragments.add(f); break; } p = fragments.size(); } } return doNotAdd; }
class class_name[name] begin[{] method[reduceFragments, return_type[type[boolean]], modifier[public static], parameter[fragments, f, rmsmat]] begin[{] local_variable[type[boolean], doNotAdd] local_variable[type[int], i] local_variable[type[int], j] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=fragments, selectors=[], type_arguments=None), name=tmp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FragmentPair, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPos1, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getPos1, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None), operator=-)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=di1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPos2, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getPos2, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None), operator=-)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=di2)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=di1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=di2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPos1, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getPos2, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=rmsmat, selectors=[], type_arguments=None), name=rms1)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=rmsmat, selectors=[], type_arguments=None), name=rms2)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=doNotAdd, 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=rms2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rms1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=fragments, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fragments, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=fragments, selectors=[], type_arguments=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=fragments, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=p)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=p, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.doNotAdd]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[reduceFragments] operator[SEP] identifier[List] operator[<] identifier[FragmentPair] operator[>] identifier[fragments] , identifier[FragmentPair] identifier[f] , identifier[Matrix] identifier[rmsmat] operator[SEP] { Keyword[boolean] identifier[doNotAdd] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[f] operator[SEP] identifier[getPos1] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[f] operator[SEP] identifier[getPos2] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[p] operator[=] Other[0] operator[SEP] identifier[p] operator[<] identifier[fragments] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[p] operator[++] operator[SEP] { identifier[FragmentPair] identifier[tmp] operator[=] identifier[fragments] operator[SEP] identifier[get] operator[SEP] identifier[p] operator[SEP] operator[SEP] Keyword[int] identifier[di1] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[f] operator[SEP] identifier[getPos1] operator[SEP] operator[SEP] operator[-] identifier[tmp] operator[SEP] identifier[getPos1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[di2] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[f] operator[SEP] identifier[getPos2] operator[SEP] operator[SEP] operator[-] identifier[tmp] operator[SEP] identifier[getPos2] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[di1] operator[-] identifier[di2] operator[SEP] operator[==] Other[2] operator[SEP] operator[SEP] { Keyword[double] identifier[rms1] operator[=] identifier[rmsmat] operator[SEP] identifier[get] operator[SEP] identifier[tmp] operator[SEP] identifier[getPos1] operator[SEP] operator[SEP] , identifier[tmp] operator[SEP] identifier[getPos2] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[rms2] operator[=] identifier[rmsmat] operator[SEP] identifier[get] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] identifier[doNotAdd] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[rms2] operator[<] identifier[rms1] operator[SEP] { identifier[fragments] operator[SEP] identifier[remove] operator[SEP] identifier[p] operator[SEP] operator[SEP] identifier[fragments] operator[SEP] identifier[add] operator[SEP] identifier[f] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[p] operator[=] identifier[fragments] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[doNotAdd] operator[SEP] }
public OqlBuilder<T> orderBy(final int index, final String orderBy) { if (null != orders) { if (isNotEmpty(statement)) { throw new RuntimeException("cannot add order by to a exists statement."); } this.orders.addAll(index, Order.parse(orderBy)); } return this; }
class class_name[name] begin[{] method[orderBy, return_type[type[OqlBuilder]], modifier[public], parameter[index, orderBy]] begin[{] if[binary_operation[literal[null], !=, member[.orders]]] begin[{] if[call[.isNotEmpty, parameter[member[.statement]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cannot add order by to a exists statement.")], 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) else begin[{] None end[}] THIS[member[None.orders]call[None.addAll, parameter[member[.index], call[Order.parse, parameter[member[.orderBy]]]]]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[OqlBuilder] operator[<] identifier[T] operator[>] identifier[orderBy] operator[SEP] Keyword[final] Keyword[int] identifier[index] , Keyword[final] identifier[String] identifier[orderBy] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[!=] identifier[orders] operator[SEP] { Keyword[if] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[statement] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[orders] operator[SEP] identifier[addAll] operator[SEP] identifier[index] , identifier[Order] operator[SEP] identifier[parse] operator[SEP] identifier[orderBy] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@SuppressWarnings("unchecked") private void invokePartitionChangeListener() { if (!triggerListeners.isEmpty()) { Map<PartitionEntry, Integer> current = (Map<PartitionEntry, Integer>) partitionCache.get(CURRENT); Map<PartitionEntry, Integer> previous = (Map<PartitionEntry, Integer>) partitionCache.get(PREVIOUS); Map<String, List<String>> partition = getNodePartition(current, currentNode); Map<String, Map<String, List<String>>> addedRemoved = getAddedRemovedPartition(previous, current, currentNode); if (log.isDebugEnabled()) { log.debug("Invoke a Change Listener"); log.debugf("Previous: %s", previous); log.debugf("Current: %s", current); log.debugf("Partition: %s", partition); log.debugf("Added: %s", addedRemoved.get("added")); log.debugf("Removed: %s", addedRemoved.get("removed")); } triggerListeners.stream().forEach(triggerListener -> { triggerListener.onPartitionChange(partition, addedRemoved.get("removed"), addedRemoved.get("added")); }); } }
class class_name[name] begin[{] method[invokePartitionChangeListener, return_type[void], modifier[private], parameter[]] begin[{] if[call[triggerListeners.isEmpty, parameter[]]] begin[{] local_variable[type[Map], current] local_variable[type[Map], previous] local_variable[type[Map], partition] local_variable[type[Map], addedRemoved] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[literal["Invoke a Change Listener"]]] call[log.debugf, parameter[literal["Previous: %s"], member[.previous]]] call[log.debugf, parameter[literal["Current: %s"], member[.current]]] call[log.debugf, parameter[literal["Partition: %s"], member[.partition]]] call[log.debugf, parameter[literal["Added: %s"], call[addedRemoved.get, parameter[literal["added"]]]]] call[log.debugf, parameter[literal["Removed: %s"], call[addedRemoved.get, parameter[literal["removed"]]]]] else begin[{] None end[}] call[triggerListeners.stream, parameter[]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[invokePartitionChangeListener] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[triggerListeners] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[PartitionEntry] , identifier[Integer] operator[>] identifier[current] operator[=] operator[SEP] identifier[Map] operator[<] identifier[PartitionEntry] , identifier[Integer] operator[>] operator[SEP] identifier[partitionCache] operator[SEP] identifier[get] operator[SEP] identifier[CURRENT] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[PartitionEntry] , identifier[Integer] operator[>] identifier[previous] operator[=] operator[SEP] identifier[Map] operator[<] identifier[PartitionEntry] , identifier[Integer] operator[>] operator[SEP] identifier[partitionCache] operator[SEP] identifier[get] operator[SEP] identifier[PREVIOUS] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[partition] operator[=] identifier[getNodePartition] operator[SEP] identifier[current] , identifier[currentNode] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] operator[>] identifier[addedRemoved] operator[=] identifier[getAddedRemovedPartition] operator[SEP] identifier[previous] , identifier[current] , identifier[currentNode] operator[SEP] 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] literal[String] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debugf] operator[SEP] literal[String] , identifier[previous] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debugf] operator[SEP] literal[String] , identifier[current] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debugf] operator[SEP] literal[String] , identifier[partition] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debugf] operator[SEP] literal[String] , identifier[addedRemoved] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debugf] operator[SEP] literal[String] , identifier[addedRemoved] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } identifier[triggerListeners] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[triggerListener] operator[->] { identifier[triggerListener] operator[SEP] identifier[onPartitionChange] operator[SEP] identifier[partition] , identifier[addedRemoved] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] , identifier[addedRemoved] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] } }
public static Rational sSubtract(Rational a, Rational b) { long cPtr = VideoJNI.Rational_sSubtract(Rational.getCPtr(a), a, Rational.getCPtr(b), b); return (cPtr == 0) ? null : new Rational(cPtr, false); }
class class_name[name] begin[{] method[sSubtract, return_type[type[Rational]], modifier[public static], parameter[a, b]] begin[{] local_variable[type[long], cPtr] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cPtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=ClassCreator(arguments=[MemberReference(member=cPtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rational, sub_type=None)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Rational] identifier[sSubtract] operator[SEP] identifier[Rational] identifier[a] , identifier[Rational] identifier[b] operator[SEP] { Keyword[long] identifier[cPtr] operator[=] identifier[VideoJNI] operator[SEP] identifier[Rational_sSubtract] operator[SEP] identifier[Rational] operator[SEP] identifier[getCPtr] operator[SEP] identifier[a] operator[SEP] , identifier[a] , identifier[Rational] operator[SEP] identifier[getCPtr] operator[SEP] identifier[b] operator[SEP] , identifier[b] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[cPtr] operator[==] Other[0] operator[SEP] operator[?] Other[null] operator[:] Keyword[new] identifier[Rational] operator[SEP] identifier[cPtr] , literal[boolean] operator[SEP] operator[SEP] }
public static CPRuleAssetCategoryRel fetchByAssetCategoryId_First( long assetCategoryId, OrderByComparator<CPRuleAssetCategoryRel> orderByComparator) { return getPersistence() .fetchByAssetCategoryId_First(assetCategoryId, orderByComparator); }
class class_name[name] begin[{] method[fetchByAssetCategoryId_First, return_type[type[CPRuleAssetCategoryRel]], modifier[public static], parameter[assetCategoryId, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CPRuleAssetCategoryRel] identifier[fetchByAssetCategoryId_First] operator[SEP] Keyword[long] identifier[assetCategoryId] , identifier[OrderByComparator] operator[<] identifier[CPRuleAssetCategoryRel] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByAssetCategoryId_First] operator[SEP] identifier[assetCategoryId] , identifier[orderByComparator] operator[SEP] operator[SEP] }
public void refreshLock(LockToken lockToken, int timeout) throws DAVException { // Set up the request in the context. IContext context = newContext(); context.setTimeout(timeout); context.setLockToken(lockToken.getToken()); // Send the request to the server. IResponse response = null; try { response = davClient.lock(locator, context, null); examineResponse(response); } catch (IOException e) { throw new SystemException(e); } finally { closeResponse(response); } }
class class_name[name] begin[{] method[refreshLock, return_type[void], modifier[public], parameter[lockToken, timeout]] begin[{] local_variable[type[IContext], context] call[context.setTimeout, parameter[member[.timeout]]] call[context.setLockToken, parameter[call[lockToken.getToken, parameter[]]]] local_variable[type[IResponse], response] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=locator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=lock, postfix_operators=[], prefix_operators=[], qualifier=davClient, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=examineResponse, 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=SystemException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[refreshLock] operator[SEP] identifier[LockToken] identifier[lockToken] , Keyword[int] identifier[timeout] operator[SEP] Keyword[throws] identifier[DAVException] { identifier[IContext] identifier[context] operator[=] identifier[newContext] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setTimeout] operator[SEP] identifier[timeout] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setLockToken] operator[SEP] identifier[lockToken] operator[SEP] identifier[getToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[IResponse] identifier[response] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[response] operator[=] identifier[davClient] operator[SEP] identifier[lock] operator[SEP] identifier[locator] , identifier[context] , Other[null] operator[SEP] operator[SEP] identifier[examineResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SystemException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP] } }
public static ContinueResponseSender createResponseSender(final HttpServerExchange exchange) throws IOException { if (!exchange.isResponseChannelAvailable()) { throw UndertowMessages.MESSAGES.cannotSendContinueResponse(); } if(exchange.getAttachment(ALREADY_SENT) != null) { return new ContinueResponseSender() { @Override public boolean send() throws IOException { return true; } @Override public void awaitWritable() throws IOException { } @Override public void awaitWritable(long time, TimeUnit timeUnit) throws IOException { } }; } HttpServerExchange newExchange = exchange.getConnection().sendOutOfBandResponse(exchange); exchange.putAttachment(ALREADY_SENT, true); newExchange.setStatusCode(StatusCodes.CONTINUE); newExchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, 0); final StreamSinkChannel responseChannel = newExchange.getResponseChannel(); return new ContinueResponseSender() { boolean shutdown = false; @Override public boolean send() throws IOException { if (!shutdown) { shutdown = true; responseChannel.shutdownWrites(); } return responseChannel.flush(); } @Override public void awaitWritable() throws IOException { responseChannel.awaitWritable(); } @Override public void awaitWritable(final long time, final TimeUnit timeUnit) throws IOException { responseChannel.awaitWritable(time, timeUnit); } }; }
class class_name[name] begin[{] method[createResponseSender, return_type[type[ContinueResponseSender]], modifier[public static], parameter[exchange]] begin[{] if[call[exchange.isResponseChannelAvailable, parameter[]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[], member=cannotSendContinueResponse, postfix_operators=[], prefix_operators=[], qualifier=UndertowMessages.MESSAGES, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] if[binary_operation[call[exchange.getAttachment, parameter[member[.ALREADY_SENT]]], !=, literal[null]]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], documentation=None, modifiers={'public'}, name=send, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=['IOException'], type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[], documentation=None, modifiers={'public'}, name=awaitWritable, parameters=[], return_type=None, throws=['IOException'], type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[], documentation=None, modifiers={'public'}, name=awaitWritable, parameters=[FormalParameter(annotations=[], modifiers=set(), name=time, type=BasicType(dimensions=[], name=long), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=timeUnit, type=ReferenceType(arguments=None, dimensions=[], name=TimeUnit, sub_type=None), varargs=False)], return_type=None, throws=['IOException'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ContinueResponseSender, sub_type=None))] else begin[{] None end[}] local_variable[type[HttpServerExchange], newExchange] call[exchange.putAttachment, parameter[member[.ALREADY_SENT], literal[true]]] call[newExchange.setStatusCode, parameter[member[StatusCodes.CONTINUE]]] call[newExchange.getResponseHeaders, parameter[]] local_variable[type[StreamSinkChannel], responseChannel] return[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=shutdown)], documentation=None, modifiers=set(), type=BasicType(dimensions=[], name=boolean)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=MemberReference(member=shutdown, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=shutdown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=shutdownWrites, postfix_operators=[], prefix_operators=[], qualifier=responseChannel, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[], member=flush, postfix_operators=[], prefix_operators=[], qualifier=responseChannel, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=send, parameters=[], return_type=BasicType(dimensions=[], name=boolean), throws=['IOException'], type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=awaitWritable, postfix_operators=[], prefix_operators=[], qualifier=responseChannel, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=awaitWritable, parameters=[], return_type=None, throws=['IOException'], type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=awaitWritable, postfix_operators=[], prefix_operators=[], qualifier=responseChannel, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=awaitWritable, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=time, type=BasicType(dimensions=[], name=long), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=timeUnit, type=ReferenceType(arguments=None, dimensions=[], name=TimeUnit, sub_type=None), varargs=False)], return_type=None, throws=['IOException'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ContinueResponseSender, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ContinueResponseSender] identifier[createResponseSender] operator[SEP] Keyword[final] identifier[HttpServerExchange] identifier[exchange] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[exchange] operator[SEP] identifier[isResponseChannelAvailable] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] identifier[UndertowMessages] operator[SEP] identifier[MESSAGES] operator[SEP] identifier[cannotSendContinueResponse] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[exchange] operator[SEP] identifier[getAttachment] operator[SEP] identifier[ALREADY_SENT] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[ContinueResponseSender] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[send] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] literal[boolean] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[awaitWritable] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[awaitWritable] operator[SEP] Keyword[long] identifier[time] , identifier[TimeUnit] identifier[timeUnit] operator[SEP] Keyword[throws] identifier[IOException] { } } operator[SEP] } identifier[HttpServerExchange] identifier[newExchange] operator[=] identifier[exchange] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[sendOutOfBandResponse] operator[SEP] identifier[exchange] operator[SEP] operator[SEP] identifier[exchange] operator[SEP] identifier[putAttachment] operator[SEP] identifier[ALREADY_SENT] , literal[boolean] operator[SEP] operator[SEP] identifier[newExchange] operator[SEP] identifier[setStatusCode] operator[SEP] identifier[StatusCodes] operator[SEP] identifier[CONTINUE] operator[SEP] operator[SEP] identifier[newExchange] operator[SEP] identifier[getResponseHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[Headers] operator[SEP] identifier[CONTENT_LENGTH] , Other[0] operator[SEP] operator[SEP] Keyword[final] identifier[StreamSinkChannel] identifier[responseChannel] operator[=] identifier[newExchange] operator[SEP] identifier[getResponseChannel] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ContinueResponseSender] operator[SEP] operator[SEP] { Keyword[boolean] identifier[shutdown] operator[=] literal[boolean] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[send] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] operator[!] identifier[shutdown] operator[SEP] { identifier[shutdown] operator[=] literal[boolean] operator[SEP] identifier[responseChannel] operator[SEP] identifier[shutdownWrites] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[responseChannel] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[awaitWritable] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[responseChannel] operator[SEP] identifier[awaitWritable] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[awaitWritable] operator[SEP] Keyword[final] Keyword[long] identifier[time] , Keyword[final] identifier[TimeUnit] identifier[timeUnit] operator[SEP] Keyword[throws] identifier[IOException] { identifier[responseChannel] operator[SEP] identifier[awaitWritable] operator[SEP] identifier[time] , identifier[timeUnit] operator[SEP] operator[SEP] } } operator[SEP] }
@Override public boolean isShutdown() { return SHUTDOWN.equals(this.state.get()) || SHUTDOWN_IMMEDIATE.equals(this.state.get()); }
class class_name[name] begin[{] method[isShutdown, return_type[type[boolean]], modifier[public], parameter[]] begin[{] return[binary_operation[call[SHUTDOWN.equals, parameter[THIS[member[None.state]call[None.get, parameter[]]]]], ||, call[SHUTDOWN_IMMEDIATE.equals, parameter[THIS[member[None.state]call[None.get, parameter[]]]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isShutdown] operator[SEP] operator[SEP] { Keyword[return] identifier[SHUTDOWN] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[||] identifier[SHUTDOWN_IMMEDIATE] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public final void openTableHead(THeadTag.State state, AbstractRenderAppender appender) { if(state == null) state = THEAD_STATE; if(_theadRenderer == null) _theadRenderer = TagRenderingBase.Factory.getRendering(TagRenderingBase.THEAD_TAG, _request); appender.append(LINE_BREAK); _theadRenderer.doStartTag(appender, state); }
class class_name[name] begin[{] method[openTableHead, return_type[void], modifier[final public], parameter[state, appender]] begin[{] if[binary_operation[member[.state], ==, literal[null]]] begin[{] assign[member[.state], member[.THEAD_STATE]] else begin[{] None end[}] if[binary_operation[member[._theadRenderer], ==, literal[null]]] begin[{] assign[member[._theadRenderer], call[TagRenderingBase.Factory.getRendering, parameter[member[TagRenderingBase.THEAD_TAG], member[._request]]]] else begin[{] None end[}] call[appender.append, parameter[member[.LINE_BREAK]]] call[_theadRenderer.doStartTag, parameter[member[.appender], member[.state]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[openTableHead] operator[SEP] identifier[THeadTag] operator[SEP] identifier[State] identifier[state] , identifier[AbstractRenderAppender] identifier[appender] operator[SEP] { Keyword[if] operator[SEP] identifier[state] operator[==] Other[null] operator[SEP] identifier[state] operator[=] identifier[THEAD_STATE] operator[SEP] Keyword[if] operator[SEP] identifier[_theadRenderer] operator[==] Other[null] operator[SEP] identifier[_theadRenderer] operator[=] identifier[TagRenderingBase] operator[SEP] identifier[Factory] operator[SEP] identifier[getRendering] operator[SEP] identifier[TagRenderingBase] operator[SEP] identifier[THEAD_TAG] , identifier[_request] operator[SEP] operator[SEP] identifier[appender] operator[SEP] identifier[append] operator[SEP] identifier[LINE_BREAK] operator[SEP] operator[SEP] identifier[_theadRenderer] operator[SEP] identifier[doStartTag] operator[SEP] identifier[appender] , identifier[state] operator[SEP] operator[SEP] }
public void marshall(PutAppReplicationConfigurationRequest putAppReplicationConfigurationRequest, ProtocolMarshaller protocolMarshaller) { if (putAppReplicationConfigurationRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(putAppReplicationConfigurationRequest.getAppId(), APPID_BINDING); protocolMarshaller.marshall(putAppReplicationConfigurationRequest.getServerGroupReplicationConfigurations(), SERVERGROUPREPLICATIONCONFIGURATIONS_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[putAppReplicationConfigurationRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.putAppReplicationConfigurationRequest], ==, 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=getAppId, postfix_operators=[], prefix_operators=[], qualifier=putAppReplicationConfigurationRequest, selectors=[], type_arguments=None), MemberReference(member=APPID_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=getServerGroupReplicationConfigurations, postfix_operators=[], prefix_operators=[], qualifier=putAppReplicationConfigurationRequest, selectors=[], type_arguments=None), MemberReference(member=SERVERGROUPREPLICATIONCONFIGURATIONS_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[PutAppReplicationConfigurationRequest] identifier[putAppReplicationConfigurationRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[putAppReplicationConfigurationRequest] 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[putAppReplicationConfigurationRequest] operator[SEP] identifier[getAppId] operator[SEP] operator[SEP] , identifier[APPID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[putAppReplicationConfigurationRequest] operator[SEP] identifier[getServerGroupReplicationConfigurations] operator[SEP] operator[SEP] , identifier[SERVERGROUPREPLICATIONCONFIGURATIONS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static EsriFeature FeatureFromJson(InputStream jsonInputStream) throws JsonParseException, IOException{ JsonParser parser = jsonFactory.createJsonParser(jsonInputStream); return FeatureFromJson(parser); }
class class_name[name] begin[{] method[FeatureFromJson, return_type[type[EsriFeature]], modifier[public static], parameter[jsonInputStream]] begin[{] local_variable[type[JsonParser], parser] return[call[.FeatureFromJson, parameter[member[.parser]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[EsriFeature] identifier[FeatureFromJson] operator[SEP] identifier[InputStream] identifier[jsonInputStream] operator[SEP] Keyword[throws] identifier[JsonParseException] , identifier[IOException] { identifier[JsonParser] identifier[parser] operator[=] identifier[jsonFactory] operator[SEP] identifier[createJsonParser] operator[SEP] identifier[jsonInputStream] operator[SEP] operator[SEP] Keyword[return] identifier[FeatureFromJson] operator[SEP] identifier[parser] operator[SEP] operator[SEP] }
@UserFunction( "apoc.temporal.formatDuration" ) @Description( "apoc.temporal.formatDuration(input, format) | Format a Duration" ) public String formatDuration( @Name("input") Object input, @Name("format") String format ) { try { LocalDateTime midnight = LocalDateTime.of(0, 1, 1, 0, 0, 0, 0); LocalDateTime newDuration = midnight.plus( (DurationValue) input ); DateTimeFormatter formatter = getOrCreate(format); return newDuration.format(formatter); } catch (Exception e){ throw new RuntimeException("Available formats are:\n" + String.join("\n", getTypes()) + "\nSee also: https://www.elastic.co/guide/en/elasticsearch/reference/5.5/mapping-date-format.html#built-in-date-formats " + "and https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html"); } }
class class_name[name] begin[{] method[formatDuration, return_type[type[String]], modifier[public], parameter[input, format]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=of, postfix_operators=[], prefix_operators=[], qualifier=LocalDateTime, selectors=[], type_arguments=None), name=midnight)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LocalDateTime, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DurationValue, sub_type=None))], member=plus, postfix_operators=[], prefix_operators=[], qualifier=midnight, selectors=[], type_arguments=None), name=newDuration)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LocalDateTime, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOrCreate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=formatter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DateTimeFormatter, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=formatter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=newDuration, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Available formats are:\n"), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), MethodInvocation(arguments=[], member=getTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=join, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nSee also: https://www.elastic.co/guide/en/elasticsearch/reference/5.5/mapping-date-format.html#built-in-date-formats "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="and https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html"), 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=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[UserFunction] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Description] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[String] identifier[formatDuration] operator[SEP] annotation[@] identifier[Name] operator[SEP] literal[String] operator[SEP] identifier[Object] identifier[input] , annotation[@] identifier[Name] operator[SEP] literal[String] operator[SEP] identifier[String] identifier[format] operator[SEP] { Keyword[try] { identifier[LocalDateTime] identifier[midnight] operator[=] identifier[LocalDateTime] operator[SEP] identifier[of] operator[SEP] Other[0] , Other[1] , Other[1] , Other[0] , Other[0] , Other[0] , Other[0] operator[SEP] operator[SEP] identifier[LocalDateTime] identifier[newDuration] operator[=] identifier[midnight] operator[SEP] identifier[plus] operator[SEP] operator[SEP] identifier[DurationValue] operator[SEP] identifier[input] operator[SEP] operator[SEP] identifier[DateTimeFormatter] identifier[formatter] operator[=] identifier[getOrCreate] operator[SEP] identifier[format] operator[SEP] operator[SEP] Keyword[return] identifier[newDuration] operator[SEP] identifier[format] operator[SEP] identifier[formatter] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[getTypes] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } }
public static void checkAssignability(Object o, Class<?> type) { COMPARISON_TYPE ctO = COMPARISON_TYPE.fromObject(o); COMPARISON_TYPE ctT = COMPARISON_TYPE.fromClass(type); try { COMPARISON_TYPE.fromOperands(ctO, ctT); } catch (Exception e) { throw DBLogger.newUser("Cannot assign " + o.getClass() + " to " + type, e); } }
class class_name[name] begin[{] method[checkAssignability, return_type[void], modifier[public static], parameter[o, type]] begin[{] local_variable[type[COMPARISON_TYPE], ctO] local_variable[type[COMPARISON_TYPE], ctT] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ctO, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ctT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromOperands, postfix_operators=[], prefix_operators=[], qualifier=COMPARISON_TYPE, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot assign "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to "), operator=+), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newUser, postfix_operators=[], prefix_operators=[], qualifier=DBLogger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[checkAssignability] operator[SEP] identifier[Object] identifier[o] , identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[SEP] { identifier[COMPARISON_TYPE] identifier[ctO] operator[=] identifier[COMPARISON_TYPE] operator[SEP] identifier[fromObject] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[COMPARISON_TYPE] identifier[ctT] operator[=] identifier[COMPARISON_TYPE] operator[SEP] identifier[fromClass] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[try] { identifier[COMPARISON_TYPE] operator[SEP] identifier[fromOperands] operator[SEP] identifier[ctO] , identifier[ctT] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] identifier[DBLogger] operator[SEP] identifier[newUser] operator[SEP] literal[String] operator[+] identifier[o] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[type] , identifier[e] operator[SEP] operator[SEP] } }
public void add(Object dependency, ValueSet valueSet) { if (dependency == null) { throw new IllegalArgumentException("dependency cannot be null"); } if (valueSet != null) { dependencyToEntryTable.put(dependency, valueSet); } }
class class_name[name] begin[{] method[add, return_type[void], modifier[public], parameter[dependency, valueSet]] begin[{] if[binary_operation[member[.dependency], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="dependency cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.valueSet], !=, literal[null]]] begin[{] call[dependencyToEntryTable.put, parameter[member[.dependency], member[.valueSet]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[Object] identifier[dependency] , identifier[ValueSet] identifier[valueSet] operator[SEP] { Keyword[if] operator[SEP] identifier[dependency] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[valueSet] operator[!=] Other[null] operator[SEP] { identifier[dependencyToEntryTable] operator[SEP] identifier[put] operator[SEP] identifier[dependency] , identifier[valueSet] operator[SEP] operator[SEP] } }
protected Connection<MailResourcesHolder> createMailConnection() { //create new connection Connection<MailResourcesHolder> mailConnection=this.connectionFactory.createConnection(); //log debug Logger logger=this.getLogger(); logger.logInfo(new Object[]{"Created mail connection."},null); return mailConnection; }
class class_name[name] begin[{] method[createMailConnection, return_type[type[Connection]], modifier[protected], parameter[]] begin[{] local_variable[type[Connection], mailConnection] local_variable[type[Logger], logger] call[logger.logInfo, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Created mail connection.")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), literal[null]]] return[member[.mailConnection]] end[}] END[}]
Keyword[protected] identifier[Connection] operator[<] identifier[MailResourcesHolder] operator[>] identifier[createMailConnection] operator[SEP] operator[SEP] { identifier[Connection] operator[<] identifier[MailResourcesHolder] operator[>] identifier[mailConnection] operator[=] Keyword[this] operator[SEP] identifier[connectionFactory] operator[SEP] identifier[createConnection] operator[SEP] operator[SEP] operator[SEP] identifier[Logger] identifier[logger] operator[=] Keyword[this] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[logInfo] operator[SEP] Keyword[new] identifier[Object] operator[SEP] operator[SEP] { literal[String] } , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[mailConnection] operator[SEP] }
@SuppressWarnings("deprecation") private static List<Listener> createListenerAdapters(Object provider) { final List<Listener> listeners = new ArrayList<Listener>(); if (provider instanceof AuthenticationSuccessListener) { listeners.add(new AuthenticationSuccessListenerAdapter( (AuthenticationSuccessListener) provider)); } if (provider instanceof AuthenticationFailureListener) { listeners.add(new AuthenticationFailureListenerAdapter( (AuthenticationFailureListener) provider)); } if (provider instanceof TunnelConnectListener) { listeners.add(new TunnelConnectListenerAdapter( (TunnelConnectListener) provider)); } if (provider instanceof TunnelCloseListener) { listeners.add(new TunnelCloseListenerAdapter( (TunnelCloseListener) provider)); } return listeners; }
class class_name[name] begin[{] method[createListenerAdapters, return_type[type[List]], modifier[private static], parameter[provider]] begin[{] local_variable[type[List], listeners] if[binary_operation[member[.provider], instanceof, type[AuthenticationSuccessListener]]] begin[{] call[listeners.add, parameter[ClassCreator(arguments=[Cast(expression=MemberReference(member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AuthenticationSuccessListener, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuthenticationSuccessListenerAdapter, sub_type=None))]] else begin[{] None end[}] if[binary_operation[member[.provider], instanceof, type[AuthenticationFailureListener]]] begin[{] call[listeners.add, parameter[ClassCreator(arguments=[Cast(expression=MemberReference(member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AuthenticationFailureListener, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuthenticationFailureListenerAdapter, sub_type=None))]] else begin[{] None end[}] if[binary_operation[member[.provider], instanceof, type[TunnelConnectListener]]] begin[{] call[listeners.add, parameter[ClassCreator(arguments=[Cast(expression=MemberReference(member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TunnelConnectListener, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TunnelConnectListenerAdapter, sub_type=None))]] else begin[{] None end[}] if[binary_operation[member[.provider], instanceof, type[TunnelCloseListener]]] begin[{] call[listeners.add, parameter[ClassCreator(arguments=[Cast(expression=MemberReference(member=provider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TunnelCloseListener, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TunnelCloseListenerAdapter, sub_type=None))]] else begin[{] None end[}] return[member[.listeners]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[static] identifier[List] operator[<] identifier[Listener] operator[>] identifier[createListenerAdapters] operator[SEP] identifier[Object] identifier[provider] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[Listener] operator[>] identifier[listeners] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Listener] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[provider] Keyword[instanceof] identifier[AuthenticationSuccessListener] operator[SEP] { identifier[listeners] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[AuthenticationSuccessListenerAdapter] operator[SEP] operator[SEP] identifier[AuthenticationSuccessListener] operator[SEP] identifier[provider] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[provider] Keyword[instanceof] identifier[AuthenticationFailureListener] operator[SEP] { identifier[listeners] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[AuthenticationFailureListenerAdapter] operator[SEP] operator[SEP] identifier[AuthenticationFailureListener] operator[SEP] identifier[provider] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[provider] Keyword[instanceof] identifier[TunnelConnectListener] operator[SEP] { identifier[listeners] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[TunnelConnectListenerAdapter] operator[SEP] operator[SEP] identifier[TunnelConnectListener] operator[SEP] identifier[provider] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[provider] Keyword[instanceof] identifier[TunnelCloseListener] operator[SEP] { identifier[listeners] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[TunnelCloseListenerAdapter] operator[SEP] operator[SEP] identifier[TunnelCloseListener] operator[SEP] identifier[provider] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[listeners] operator[SEP] }
public static void stop() { synchronized (lock) { if (registry == null) return; try { registry.serviceDiscovery.close(); } catch (IOException e) { LOG.error(e); } finally { registry = null; } } }
class class_name[name] begin[{] method[stop, return_type[void], modifier[public static], parameter[]] begin[{] SYNCHRONIZED[member[.lock]] BEGIN[{] if[binary_operation[member[.registry], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=registry.serviceDiscovery, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=registry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None) END[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[stop] operator[SEP] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { Keyword[if] operator[SEP] identifier[registry] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[try] { identifier[registry] operator[SEP] identifier[serviceDiscovery] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[registry] operator[=] Other[null] operator[SEP] } } }
public static <T> PriorityQueueJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) { return new PriorityQueueJsonDeserializer<T>( deserializer ); }
class class_name[name] begin[{] method[newInstance, return_type[type[PriorityQueueJsonDeserializer]], modifier[public static], parameter[deserializer]] begin[{] return[ClassCreator(arguments=[MemberReference(member=deserializer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=PriorityQueueJsonDeserializer, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[PriorityQueueJsonDeserializer] operator[<] identifier[T] operator[>] identifier[newInstance] operator[SEP] identifier[JsonDeserializer] operator[<] identifier[T] operator[>] identifier[deserializer] operator[SEP] { Keyword[return] Keyword[new] identifier[PriorityQueueJsonDeserializer] operator[<] identifier[T] operator[>] operator[SEP] identifier[deserializer] operator[SEP] operator[SEP] }
public JSONArray element( double value ) { Double d = new Double( value ); JSONUtils.testValidity( d ); return element( d ); }
class class_name[name] begin[{] method[element, return_type[type[JSONArray]], modifier[public], parameter[value]] begin[{] local_variable[type[Double], d] call[JSONUtils.testValidity, parameter[member[.d]]] return[call[.element, parameter[member[.d]]]] end[}] END[}]
Keyword[public] identifier[JSONArray] identifier[element] operator[SEP] Keyword[double] identifier[value] operator[SEP] { identifier[Double] identifier[d] operator[=] Keyword[new] identifier[Double] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[JSONUtils] operator[SEP] identifier[testValidity] operator[SEP] identifier[d] operator[SEP] operator[SEP] Keyword[return] identifier[element] operator[SEP] identifier[d] operator[SEP] operator[SEP] }
void toggleTable(Button toggleButton) { I_CmsToggleTable table = (I_CmsToggleTable)m_table; table.toggle(!CmsVaadinUtils.isButtonPressed(toggleButton)); CmsVaadinUtils.toggleButton(toggleButton); if (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_filterTable.getValue())) { filterTable(m_filterTable.getValue()); } updateInfoButton(); }
class class_name[name] begin[{] method[toggleTable, return_type[void], modifier[default], parameter[toggleButton]] begin[{] local_variable[type[I_CmsToggleTable], table] call[table.toggle, parameter[call[CmsVaadinUtils.isButtonPressed, parameter[member[.toggleButton]]]]] call[CmsVaadinUtils.toggleButton, parameter[member[.toggleButton]]] if[call[CmsStringUtil.isEmptyOrWhitespaceOnly, parameter[call[m_filterTable.getValue, parameter[]]]]] begin[{] call[.filterTable, parameter[call[m_filterTable.getValue, parameter[]]]] else begin[{] None end[}] call[.updateInfoButton, parameter[]] end[}] END[}]
Keyword[void] identifier[toggleTable] operator[SEP] identifier[Button] identifier[toggleButton] operator[SEP] { identifier[I_CmsToggleTable] identifier[table] operator[=] operator[SEP] identifier[I_CmsToggleTable] operator[SEP] identifier[m_table] operator[SEP] identifier[table] operator[SEP] identifier[toggle] operator[SEP] operator[!] identifier[CmsVaadinUtils] operator[SEP] identifier[isButtonPressed] operator[SEP] identifier[toggleButton] operator[SEP] operator[SEP] operator[SEP] identifier[CmsVaadinUtils] operator[SEP] identifier[toggleButton] operator[SEP] identifier[toggleButton] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[CmsStringUtil] operator[SEP] identifier[isEmptyOrWhitespaceOnly] operator[SEP] identifier[m_filterTable] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[filterTable] operator[SEP] identifier[m_filterTable] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[updateInfoButton] operator[SEP] operator[SEP] operator[SEP] }
public URL getResource(String resourceName) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("getResource( " + resourceName + " )"); } if (resourceName.startsWith(mountPoint)) { resourceName = resourceName.substring(mountPoint.length()); } return bundle.getResource(resourceName); }
class class_name[name] begin[{] method[getResource, return_type[type[URL]], modifier[public], parameter[resourceName]] begin[{] if[call[LOGGER.isDebugEnabled, parameter[]]] begin[{] call[LOGGER.debug, parameter[binary_operation[binary_operation[literal["getResource( "], +, member[.resourceName]], +, literal[" )"]]]] else begin[{] None end[}] if[call[resourceName.startsWith, parameter[member[.mountPoint]]]] begin[{] assign[member[.resourceName], call[resourceName.substring, parameter[call[mountPoint.length, parameter[]]]]] else begin[{] None end[}] return[call[bundle.getResource, parameter[member[.resourceName]]]] end[}] END[}]
Keyword[public] identifier[URL] identifier[getResource] operator[SEP] identifier[String] identifier[resourceName] operator[SEP] { Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[resourceName] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[resourceName] operator[SEP] identifier[startsWith] operator[SEP] identifier[mountPoint] operator[SEP] operator[SEP] { identifier[resourceName] operator[=] identifier[resourceName] operator[SEP] identifier[substring] operator[SEP] identifier[mountPoint] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[bundle] operator[SEP] identifier[getResource] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] }
public void marshall(CreateWebhookRequest createWebhookRequest, ProtocolMarshaller protocolMarshaller) { if (createWebhookRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createWebhookRequest.getProjectName(), PROJECTNAME_BINDING); protocolMarshaller.marshall(createWebhookRequest.getBranchFilter(), BRANCHFILTER_BINDING); protocolMarshaller.marshall(createWebhookRequest.getFilterGroups(), FILTERGROUPS_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[createWebhookRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.createWebhookRequest], ==, 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=getProjectName, postfix_operators=[], prefix_operators=[], qualifier=createWebhookRequest, selectors=[], type_arguments=None), MemberReference(member=PROJECTNAME_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=getBranchFilter, postfix_operators=[], prefix_operators=[], qualifier=createWebhookRequest, selectors=[], type_arguments=None), MemberReference(member=BRANCHFILTER_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=getFilterGroups, postfix_operators=[], prefix_operators=[], qualifier=createWebhookRequest, selectors=[], type_arguments=None), MemberReference(member=FILTERGROUPS_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[CreateWebhookRequest] identifier[createWebhookRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createWebhookRequest] 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[createWebhookRequest] operator[SEP] identifier[getProjectName] operator[SEP] operator[SEP] , identifier[PROJECTNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createWebhookRequest] operator[SEP] identifier[getBranchFilter] operator[SEP] operator[SEP] , identifier[BRANCHFILTER_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createWebhookRequest] operator[SEP] identifier[getFilterGroups] operator[SEP] operator[SEP] , identifier[FILTERGROUPS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Override protected void startUp() throws Exception { initialTimeout = Executors.newScheduledThreadPool(1).schedule( new Runnable() { @Override public void run() { if (modelCounter.size() <= 0) { LOG.info("Heartbeat detection failed"); serviceFailed.notifyFailure(null); } } }, Constants.INITIALIZATION_TIMEOUT, TimeUnit.SECONDS); monitorFuture = Executors.newScheduledThreadPool(1).scheduleWithFixedDelay( new Runnable() { @Override public void run() { if (!checkState()) { Set<String> missingHeartbeatRecord = Sets.newHashSet(modelCounter); missingHeartbeatRecord.removeAll(heartbeatCounter); serviceFailed.notifyFailure(missingHeartbeatRecord); } } }, 2 * Constants.HEARTBEAT_FREQUENCY , Constants.HEARTBEAT_FREQUENCY , TimeUnit.SECONDS); }
class class_name[name] begin[{] method[startUp, return_type[void], modifier[protected], parameter[]] begin[{] assign[member[.initialTimeout], call[Executors.newScheduledThreadPool, parameter[literal[1]]]] assign[member[.monitorFuture], call[Executors.newScheduledThreadPool, parameter[literal[1]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[startUp] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[initialTimeout] operator[=] identifier[Executors] operator[SEP] identifier[newScheduledThreadPool] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[schedule] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[modelCounter] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[serviceFailed] operator[SEP] identifier[notifyFailure] operator[SEP] Other[null] operator[SEP] operator[SEP] } } } , identifier[Constants] operator[SEP] identifier[INITIALIZATION_TIMEOUT] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] identifier[monitorFuture] operator[=] identifier[Executors] operator[SEP] identifier[newScheduledThreadPool] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[scheduleWithFixedDelay] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[checkState] operator[SEP] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[missingHeartbeatRecord] operator[=] identifier[Sets] operator[SEP] identifier[newHashSet] operator[SEP] identifier[modelCounter] operator[SEP] operator[SEP] identifier[missingHeartbeatRecord] operator[SEP] identifier[removeAll] operator[SEP] identifier[heartbeatCounter] operator[SEP] operator[SEP] identifier[serviceFailed] operator[SEP] identifier[notifyFailure] operator[SEP] identifier[missingHeartbeatRecord] operator[SEP] operator[SEP] } } } , Other[2] operator[*] identifier[Constants] operator[SEP] identifier[HEARTBEAT_FREQUENCY] , identifier[Constants] operator[SEP] identifier[HEARTBEAT_FREQUENCY] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] }
boolean service(ServletRequest servletRequest, ServletResponse servletResponse) throws IOException, ServletException { final HttpServletRequest request = (HttpServletRequest) servletRequest; final String path = ServletUtils.getContextRelativePath(request); final boolean serve = shouldServe(path); //invocations of the chain end at the first matched servlet if (serve) { doService(servletRequest, servletResponse); } //return false if no servlet matched (so we can proceed down to the web.xml servlets) return serve; }
class class_name[name] begin[{] method[service, return_type[type[boolean]], modifier[default], parameter[servletRequest, servletResponse]] begin[{] local_variable[type[HttpServletRequest], request] local_variable[type[String], path] local_variable[type[boolean], serve] if[member[.serve]] begin[{] call[.doService, parameter[member[.servletRequest], member[.servletResponse]]] else begin[{] None end[}] return[member[.serve]] end[}] END[}]
Keyword[boolean] identifier[service] operator[SEP] identifier[ServletRequest] identifier[servletRequest] , identifier[ServletResponse] identifier[servletResponse] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] { Keyword[final] identifier[HttpServletRequest] identifier[request] operator[=] operator[SEP] identifier[HttpServletRequest] operator[SEP] identifier[servletRequest] operator[SEP] Keyword[final] identifier[String] identifier[path] operator[=] identifier[ServletUtils] operator[SEP] identifier[getContextRelativePath] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[serve] operator[=] identifier[shouldServe] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[serve] operator[SEP] { identifier[doService] operator[SEP] identifier[servletRequest] , identifier[servletResponse] operator[SEP] operator[SEP] } Keyword[return] identifier[serve] operator[SEP] }
public DesignSpec addSpacing(float position, float size, From from) { final Spacing spacing = new Spacing(position * mDensity, size * mDensity, from); if (mSpacings.contains(spacing)) { return this; } mSpacings.add(spacing); return this; }
class class_name[name] begin[{] method[addSpacing, return_type[type[DesignSpec]], modifier[public], parameter[position, size, from]] begin[{] local_variable[type[Spacing], spacing] if[call[mSpacings.contains, parameter[member[.spacing]]]] begin[{] return[THIS[]] else begin[{] None end[}] call[mSpacings.add, parameter[member[.spacing]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[DesignSpec] identifier[addSpacing] operator[SEP] Keyword[float] identifier[position] , Keyword[float] identifier[size] , identifier[From] identifier[from] operator[SEP] { Keyword[final] identifier[Spacing] identifier[spacing] operator[=] Keyword[new] identifier[Spacing] operator[SEP] identifier[position] operator[*] identifier[mDensity] , identifier[size] operator[*] identifier[mDensity] , identifier[from] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mSpacings] operator[SEP] identifier[contains] operator[SEP] identifier[spacing] operator[SEP] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } identifier[mSpacings] operator[SEP] identifier[add] operator[SEP] identifier[spacing] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static String getEOReferenceStringFromAnnotation(OpenEngSBForeignKey key) { return String.format("%s%s:%s", REFERENCE_PREFIX, key.modelType(), key.modelVersion().toString()); }
class class_name[name] begin[{] method[getEOReferenceStringFromAnnotation, return_type[type[String]], modifier[public static], parameter[key]] begin[{] return[call[String.format, parameter[literal["%s%s:%s"], member[.REFERENCE_PREFIX], call[key.modelType, parameter[]], call[key.modelVersion, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getEOReferenceStringFromAnnotation] operator[SEP] identifier[OpenEngSBForeignKey] identifier[key] operator[SEP] { Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[REFERENCE_PREFIX] , identifier[key] operator[SEP] identifier[modelType] operator[SEP] operator[SEP] , identifier[key] operator[SEP] identifier[modelVersion] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public ConfigurationBuilder setUrls(@Nonnull final Collection<URL> urls) { this.urls = Sets.newHashSet(urls); return this; }
class class_name[name] begin[{] method[setUrls, return_type[type[ConfigurationBuilder]], modifier[public], parameter[urls]] begin[{] assign[THIS[member[None.urls]], call[Sets.newHashSet, parameter[member[.urls]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[ConfigurationBuilder] identifier[setUrls] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[Collection] operator[<] identifier[URL] operator[>] identifier[urls] operator[SEP] { Keyword[this] operator[SEP] identifier[urls] operator[=] identifier[Sets] operator[SEP] identifier[newHashSet] operator[SEP] identifier[urls] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public String toStringHierarchy(final TypeWriter typeWriter) { final StringBuilder res = new StringBuilder(types.size() * 50); writeHierarchy(root, "", "", res, typeWriter); return res.toString(); }
class class_name[name] begin[{] method[toStringHierarchy, return_type[type[String]], modifier[public], parameter[typeWriter]] begin[{] local_variable[type[StringBuilder], res] call[.writeHierarchy, parameter[member[.root], literal[""], literal[""], member[.res], member[.typeWriter]]] return[call[res.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[toStringHierarchy] operator[SEP] Keyword[final] identifier[TypeWriter] identifier[typeWriter] operator[SEP] { Keyword[final] identifier[StringBuilder] identifier[res] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[types] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[*] Other[50] operator[SEP] operator[SEP] identifier[writeHierarchy] operator[SEP] identifier[root] , literal[String] , literal[String] , identifier[res] , identifier[typeWriter] operator[SEP] operator[SEP] Keyword[return] identifier[res] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public Optional<ImmutableList<Symbol>> getOptionalFileAsSymbolList(String param) throws IOException { if (isPresent(param)) { return Optional .of(FileUtils.loadSymbolList(Files.asCharSource(getExistingFile(param), Charsets.UTF_8))); } else { return Optional.absent(); } }
class class_name[name] begin[{] method[getOptionalFileAsSymbolList, return_type[type[Optional]], modifier[public], parameter[param]] begin[{] if[call[.isPresent, parameter[member[.param]]]] begin[{] return[call[Optional.of, parameter[call[FileUtils.loadSymbolList, parameter[call[Files.asCharSource, parameter[call[.getExistingFile, parameter[member[.param]]], member[Charsets.UTF_8]]]]]]]] else begin[{] return[call[Optional.absent, parameter[]]] end[}] end[}] END[}]
Keyword[public] identifier[Optional] operator[<] identifier[ImmutableList] operator[<] identifier[Symbol] operator[>] operator[>] identifier[getOptionalFileAsSymbolList] operator[SEP] identifier[String] identifier[param] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[isPresent] operator[SEP] identifier[param] operator[SEP] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[FileUtils] operator[SEP] identifier[loadSymbolList] operator[SEP] identifier[Files] operator[SEP] identifier[asCharSource] operator[SEP] identifier[getExistingFile] operator[SEP] identifier[param] operator[SEP] , identifier[Charsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[Optional] operator[SEP] identifier[absent] operator[SEP] operator[SEP] operator[SEP] } }
public ElementActionBuilder checkInput(boolean checked) { CheckInputAction action = new CheckInputAction(); action.setChecked(checked); action(action); return new ElementActionBuilder(action); }
class class_name[name] begin[{] method[checkInput, return_type[type[ElementActionBuilder]], modifier[public], parameter[checked]] begin[{] local_variable[type[CheckInputAction], action] call[action.setChecked, parameter[member[.checked]]] call[.action, parameter[member[.action]]] return[ClassCreator(arguments=[MemberReference(member=action, 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=ElementActionBuilder, sub_type=None))] end[}] END[}]
Keyword[public] identifier[ElementActionBuilder] identifier[checkInput] operator[SEP] Keyword[boolean] identifier[checked] operator[SEP] { identifier[CheckInputAction] identifier[action] operator[=] Keyword[new] identifier[CheckInputAction] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[setChecked] operator[SEP] identifier[checked] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[action] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ElementActionBuilder] operator[SEP] identifier[action] operator[SEP] operator[SEP] }