code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public String getMostLeftAndMostRightPageAnno() { if (sspans == null || sspans.isEmpty()) { return null; } TreeMap<Integer, SSpan> rightTokIdxToSSpan = sspans.get(sspans.firstKey()); SSpan leftSpan = rightTokIdxToSSpan.get(rightTokIdxToSSpan.firstKey()); SSpan rightSpan = null; Integer rightIdx = null; for (TreeMap<Integer, SSpan> leftIdxValue : sspans.values()) { for (Map.Entry<Integer, SSpan> rightIdxEntry : leftIdxValue.entrySet()) { if (rightIdx == null || rightIdx <= rightIdxEntry.getKey()) { rightIdx = rightIdxEntry.getKey(); rightSpan = rightIdxEntry.getValue(); } } } if (rightIdx != null) { return getPageFromAnnotation(leftSpan) + PAGE_NUMBER_SEPERATOR + getPageFromAnnotation(rightSpan); } return getPageFromAnnotation(leftSpan); }
class class_name[name] begin[{] method[getMostLeftAndMostRightPageAnno, return_type[type[String]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[member[.sspans], ==, literal[null]], ||, call[sspans.isEmpty, parameter[]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[TreeMap], rightTokIdxToSSpan] local_variable[type[SSpan], leftSpan] local_variable[type[SSpan], rightSpan] local_variable[type[Integer], rightIdx] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rightIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=rightIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=rightIdxEntry, selectors=[], type_arguments=None), operator=<=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rightIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=rightIdxEntry, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rightSpan, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=rightIdxEntry, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=leftIdxValue, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rightIdxEntry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SSpan, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=sspans, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=leftIdxValue)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=SSpan, sub_type=None))], dimensions=[], name=TreeMap, sub_type=None))), label=None) if[binary_operation[member[.rightIdx], !=, literal[null]]] begin[{] return[binary_operation[binary_operation[call[.getPageFromAnnotation, parameter[member[.leftSpan]]], +, member[.PAGE_NUMBER_SEPERATOR]], +, call[.getPageFromAnnotation, parameter[member[.rightSpan]]]]] else begin[{] None end[}] return[call[.getPageFromAnnotation, parameter[member[.leftSpan]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getMostLeftAndMostRightPageAnno] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[sspans] operator[==] Other[null] operator[||] identifier[sspans] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[TreeMap] operator[<] identifier[Integer] , identifier[SSpan] operator[>] identifier[rightTokIdxToSSpan] operator[=] identifier[sspans] operator[SEP] identifier[get] operator[SEP] identifier[sspans] operator[SEP] identifier[firstKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SSpan] identifier[leftSpan] operator[=] identifier[rightTokIdxToSSpan] operator[SEP] identifier[get] operator[SEP] identifier[rightTokIdxToSSpan] operator[SEP] identifier[firstKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SSpan] identifier[rightSpan] operator[=] Other[null] operator[SEP] identifier[Integer] identifier[rightIdx] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[TreeMap] operator[<] identifier[Integer] , identifier[SSpan] operator[>] identifier[leftIdxValue] operator[:] identifier[sspans] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[SSpan] operator[>] identifier[rightIdxEntry] operator[:] identifier[leftIdxValue] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[rightIdx] operator[==] Other[null] operator[||] identifier[rightIdx] operator[<=] identifier[rightIdxEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] { identifier[rightIdx] operator[=] identifier[rightIdxEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[rightSpan] operator[=] identifier[rightIdxEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[rightIdx] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[getPageFromAnnotation] operator[SEP] identifier[leftSpan] operator[SEP] operator[+] identifier[PAGE_NUMBER_SEPERATOR] operator[+] identifier[getPageFromAnnotation] operator[SEP] identifier[rightSpan] operator[SEP] operator[SEP] } Keyword[return] identifier[getPageFromAnnotation] operator[SEP] identifier[leftSpan] operator[SEP] operator[SEP] }
public static Object getResultSetValue(ResultSet rs, int index) throws SQLException { Object obj = rs.getObject(index); String className = null; if (obj != null) { className = obj.getClass().getName(); } if (obj instanceof Blob) { obj = rs.getBytes(index); } else if (obj instanceof Clob) { obj = rs.getString(index); } else if (className != null && ("oracle.sql.TIMESTAMP".equals(className) || "oracle.sql.TIMESTAMPTZ".equals(className))) { obj = rs.getTimestamp(index); } else if (className != null && className.startsWith("oracle.sql.DATE")) { String metaDataClassName = rs.getMetaData().getColumnClassName(index); if ("java.sql.Timestamp".equals(metaDataClassName) || "oracle.sql.TIMESTAMP".equals(metaDataClassName)) { obj = rs.getTimestamp(index); } else { obj = rs.getDate(index); } } else if (obj != null && obj instanceof java.sql.Date) { if ("java.sql.Timestamp".equals(rs.getMetaData().getColumnClassName(index))) { obj = rs.getTimestamp(index); } } return obj; }
class class_name[name] begin[{] method[getResultSetValue, return_type[type[Object]], modifier[public static], parameter[rs, index]] begin[{] local_variable[type[Object], obj] local_variable[type[String], className] if[binary_operation[member[.obj], !=, literal[null]]] begin[{] assign[member[.className], call[obj.getClass, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.obj], instanceof, type[Blob]]] begin[{] assign[member[.obj], call[rs.getBytes, parameter[member[.index]]]] else begin[{] if[binary_operation[member[.obj], instanceof, type[Clob]]] begin[{] assign[member[.obj], call[rs.getString, parameter[member[.index]]]] else begin[{] if[binary_operation[binary_operation[member[.className], !=, literal[null]], &&, binary_operation[literal["oracle.sql.TIMESTAMP"], ||, literal["oracle.sql.TIMESTAMPTZ"]]]] begin[{] assign[member[.obj], call[rs.getTimestamp, parameter[member[.index]]]] else begin[{] if[binary_operation[binary_operation[member[.className], !=, literal[null]], &&, call[className.startsWith, parameter[literal["oracle.sql.DATE"]]]]] begin[{] local_variable[type[String], metaDataClassName] if[binary_operation[literal["java.sql.Timestamp"], ||, literal["oracle.sql.TIMESTAMP"]]] begin[{] assign[member[.obj], call[rs.getTimestamp, parameter[member[.index]]]] else begin[{] assign[member[.obj], call[rs.getDate, parameter[member[.index]]]] end[}] else begin[{] if[binary_operation[binary_operation[member[.obj], !=, literal[null]], &&, binary_operation[member[.obj], instanceof, type[java]]]] begin[{] if[literal["java.sql.Timestamp"]] begin[{] assign[member[.obj], call[rs.getTimestamp, parameter[member[.index]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] end[}] end[}] end[}] return[member[.obj]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[getResultSetValue] operator[SEP] identifier[ResultSet] identifier[rs] , Keyword[int] identifier[index] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[Object] identifier[obj] operator[=] identifier[rs] operator[SEP] identifier[getObject] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[String] identifier[className] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[obj] operator[!=] Other[null] operator[SEP] { identifier[className] operator[=] identifier[obj] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Blob] operator[SEP] { identifier[obj] operator[=] identifier[rs] operator[SEP] identifier[getBytes] operator[SEP] identifier[index] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[obj] Keyword[instanceof] identifier[Clob] operator[SEP] { identifier[obj] operator[=] identifier[rs] operator[SEP] identifier[getString] operator[SEP] identifier[index] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[className] operator[!=] Other[null] operator[&&] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[className] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[className] operator[SEP] operator[SEP] operator[SEP] { identifier[obj] operator[=] identifier[rs] operator[SEP] identifier[getTimestamp] operator[SEP] identifier[index] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[className] operator[!=] Other[null] operator[&&] identifier[className] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[metaDataClassName] operator[=] identifier[rs] operator[SEP] identifier[getMetaData] operator[SEP] operator[SEP] operator[SEP] identifier[getColumnClassName] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[metaDataClassName] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[metaDataClassName] operator[SEP] operator[SEP] { identifier[obj] operator[=] identifier[rs] operator[SEP] identifier[getTimestamp] operator[SEP] identifier[index] operator[SEP] operator[SEP] } Keyword[else] { identifier[obj] operator[=] identifier[rs] operator[SEP] identifier[getDate] operator[SEP] identifier[index] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[obj] operator[!=] Other[null] operator[&&] identifier[obj] Keyword[instanceof] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Date] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[rs] operator[SEP] identifier[getMetaData] operator[SEP] operator[SEP] operator[SEP] identifier[getColumnClassName] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] { identifier[obj] operator[=] identifier[rs] operator[SEP] identifier[getTimestamp] operator[SEP] identifier[index] operator[SEP] operator[SEP] } } Keyword[return] identifier[obj] operator[SEP] }
public boolean registerDeployment(Deployment deployment) { if (deployments.contains(deployment)) return false; return deployments.add(deployment); }
class class_name[name] begin[{] method[registerDeployment, return_type[type[boolean]], modifier[public], parameter[deployment]] begin[{] if[call[deployments.contains, parameter[member[.deployment]]]] begin[{] return[literal[false]] else begin[{] None end[}] return[call[deployments.add, parameter[member[.deployment]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[registerDeployment] operator[SEP] identifier[Deployment] identifier[deployment] operator[SEP] { Keyword[if] operator[SEP] identifier[deployments] operator[SEP] identifier[contains] operator[SEP] identifier[deployment] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] identifier[deployments] operator[SEP] identifier[add] operator[SEP] identifier[deployment] operator[SEP] operator[SEP] }
private void convertMapToMap(Map<?, ?> srcMap, Map<Object, Object> targetMap) { final ConverterRegistry convert = ConverterRegistry.getInstance(); Object key; Object value; for (Entry<?, ?> entry : srcMap.entrySet()) { key = TypeUtil.isUnknow(this.keyType) ? entry.getKey() : convert.convert(this.keyType, entry.getKey()); value = TypeUtil.isUnknow(this.valueType) ? entry.getValue() : convert.convert(this.valueType, entry.getValue()); targetMap.put(key, value); } }
class class_name[name] begin[{] method[convertMapToMap, return_type[void], modifier[private], parameter[srcMap, targetMap]] begin[{] local_variable[type[ConverterRegistry], convert] local_variable[type[Object], key] local_variable[type[Object], value] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=keyType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=isUnknow, postfix_operators=[], prefix_operators=[], qualifier=TypeUtil, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=keyType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=convert, postfix_operators=[], prefix_operators=[], qualifier=convert, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=valueType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=isUnknow, postfix_operators=[], prefix_operators=[], qualifier=TypeUtil, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=valueType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=convert, postfix_operators=[], prefix_operators=[], qualifier=convert, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=targetMap, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=srcMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Entry, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[convertMapToMap] operator[SEP] identifier[Map] operator[<] operator[?] , operator[?] operator[>] identifier[srcMap] , identifier[Map] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[targetMap] operator[SEP] { Keyword[final] identifier[ConverterRegistry] identifier[convert] operator[=] identifier[ConverterRegistry] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[key] operator[SEP] identifier[Object] identifier[value] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] operator[?] , operator[?] operator[>] identifier[entry] operator[:] identifier[srcMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[key] operator[=] identifier[TypeUtil] operator[SEP] identifier[isUnknow] operator[SEP] Keyword[this] operator[SEP] identifier[keyType] operator[SEP] operator[?] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[:] identifier[convert] operator[SEP] identifier[convert] operator[SEP] Keyword[this] operator[SEP] identifier[keyType] , identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[=] identifier[TypeUtil] operator[SEP] identifier[isUnknow] operator[SEP] Keyword[this] operator[SEP] identifier[valueType] operator[SEP] operator[?] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[:] identifier[convert] operator[SEP] identifier[convert] operator[SEP] Keyword[this] operator[SEP] identifier[valueType] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[targetMap] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] } }
public AmqpChannel qosBasic(int prefetchSize, int prefetchCount, boolean global) { Object[] args = {prefetchSize, prefetchCount, global}; WrappedByteBuffer bodyArg = null; HashMap<String, Object> headersArg = null; String methodName = "qosBasic"; String methodId = "60" + "10"; AmqpMethod amqpMethod = MethodLookup.LookupMethod(methodId); Object[] arguments = {this, amqpMethod, this.id, args, bodyArg, headersArg}; asyncClient.enqueueAction(methodName, "channelWrite", arguments, null, null); return this; }
class class_name[name] begin[{] method[qosBasic, return_type[type[AmqpChannel]], modifier[public], parameter[prefetchSize, prefetchCount, global]] begin[{] local_variable[type[Object], args] local_variable[type[WrappedByteBuffer], bodyArg] local_variable[type[HashMap], headersArg] local_variable[type[String], methodName] local_variable[type[String], methodId] local_variable[type[AmqpMethod], amqpMethod] local_variable[type[Object], arguments] call[asyncClient.enqueueAction, parameter[member[.methodName], literal["channelWrite"], member[.arguments], literal[null], literal[null]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[AmqpChannel] identifier[qosBasic] operator[SEP] Keyword[int] identifier[prefetchSize] , Keyword[int] identifier[prefetchCount] , Keyword[boolean] identifier[global] operator[SEP] { identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[=] { identifier[prefetchSize] , identifier[prefetchCount] , identifier[global] } operator[SEP] identifier[WrappedByteBuffer] identifier[bodyArg] operator[=] Other[null] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[headersArg] operator[=] Other[null] operator[SEP] identifier[String] identifier[methodName] operator[=] literal[String] operator[SEP] identifier[String] identifier[methodId] operator[=] literal[String] operator[+] literal[String] operator[SEP] identifier[AmqpMethod] identifier[amqpMethod] operator[=] identifier[MethodLookup] operator[SEP] identifier[LookupMethod] operator[SEP] identifier[methodId] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] identifier[arguments] operator[=] { Keyword[this] , identifier[amqpMethod] , Keyword[this] operator[SEP] identifier[id] , identifier[args] , identifier[bodyArg] , identifier[headersArg] } operator[SEP] identifier[asyncClient] operator[SEP] identifier[enqueueAction] operator[SEP] identifier[methodName] , literal[String] , identifier[arguments] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override protected boolean checkCandidate(String beanName, BeanDefinition beanDefinition) throws IllegalStateException { if (super.checkCandidate(beanName, beanDefinition)) { return true; } else { log.warn("Skipping SpringRestClientFactoryBean with name '" + beanName + "' and '" + beanDefinition.getBeanClassName() + "' interfaceClazz" + ". Bean already defined with the same name!"); return false; } }
class class_name[name] begin[{] method[checkCandidate, return_type[type[boolean]], modifier[protected], parameter[beanName, beanDefinition]] begin[{] if[SuperMethodInvocation(arguments=[MemberReference(member=beanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=beanDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkCandidate, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] begin[{] return[literal[true]] else begin[{] call[log.warn, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Skipping SpringRestClientFactoryBean with name '"], +, member[.beanName]], +, literal["' and '"]], +, call[beanDefinition.getBeanClassName, parameter[]]], +, literal["' interfaceClazz"]], +, literal[". Bean already defined with the same name!"]]]] return[literal[false]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[boolean] identifier[checkCandidate] operator[SEP] identifier[String] identifier[beanName] , identifier[BeanDefinition] identifier[beanDefinition] operator[SEP] Keyword[throws] identifier[IllegalStateException] { Keyword[if] operator[SEP] Keyword[super] operator[SEP] identifier[checkCandidate] operator[SEP] identifier[beanName] , identifier[beanDefinition] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[beanName] operator[+] literal[String] operator[+] identifier[beanDefinition] operator[SEP] identifier[getBeanClassName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } }
static public void scanRoot(File root, Set<String> suffixes, List<String> excludes, List<String> includes, Map<String,Source> foundFiles, Map<String,Module> foundModules, final Module currentModule, boolean permitSourcesWithoutPackage, boolean inGensrc, boolean inLinksrc) throws IOException, ProblemException { if (root == null) return; FileSystem fs = root.toPath().getFileSystem(); if (includes.isEmpty()) { includes = Collections.singletonList("**"); } List<PathMatcher> includeMatchers = createPathMatchers(fs, includes); List<PathMatcher> excludeMatchers = createPathMatchers(fs, excludes); Files.walkFileTree(root.toPath(), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { Path relToRoot = root.toPath().relativize(file); if (includeMatchers.stream().anyMatch(im -> im.matches(relToRoot)) && excludeMatchers.stream().noneMatch(em -> em.matches(relToRoot)) && suffixes.contains(Util.fileSuffix(file))) { // TODO: Test this. Source existing = foundFiles.get(file); if (existing != null) { throw new IOException("You have already added the file "+file+" from "+existing.file().getPath()); } existing = currentModule.lookupSource(file.toString()); if (existing != null) { // Oups, the source is already added, could be ok, could be not, lets check. if (inLinksrc) { // So we are collecting sources for linking only. if (existing.isLinkedOnly()) { // Ouch, this one is also for linking only. Bad. throw new IOException("You have already added the link only file " + file + " from " + existing.file().getPath()); } // Ok, the existing source is to be compiled. Thus this link only is redundant // since all compiled are also linked to. Continue to the next source. // But we need to add the source, so that it will be visible to linking, // if not the multi core compile will fail because a JavaCompiler cannot // find the necessary dependencies for its part of the source. foundFiles.put(file.toString(), existing); } else { // We are looking for sources to compile, if we find an existing to be compiled // source with the same name, it is an internal error, since we must // find the sources to be compiled before we find the sources to be linked to. throw new IOException("Internal error: Double add of file " + file + " from " + existing.file().getPath()); } } else { ////////////////////////////////////////////////////////////// // Add source Source s = new Source(currentModule, file.toString(), file.toFile()); if (inGensrc) { s.markAsGenerated(); } if (inLinksrc) { s.markAsLinkedOnly(); } String pkg = packageOfJavaFile(root.toPath(), file); pkg = currentModule.name() + ":" + pkg; foundFiles.put(file.toString(), s); currentModule.addSource(pkg, s); ////////////////////////////////////////////////////////////// } } return FileVisitResult.CONTINUE; } }); }
class class_name[name] begin[{] method[scanRoot, return_type[void], modifier[public static], parameter[root, suffixes, excludes, includes, foundFiles, foundModules, currentModule, permitSourcesWithoutPackage, inGensrc, inLinksrc]] begin[{] if[binary_operation[member[.root], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[FileSystem], fs] if[call[includes.isEmpty, parameter[]]] begin[{] assign[member[.includes], call[Collections.singletonList, parameter[literal["**"]]]] else begin[{] None end[}] local_variable[type[List], includeMatchers] local_variable[type[List], excludeMatchers] call[Files.walkFileTree, parameter[call[root.toPath, parameter[]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toPath, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=relativize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=relToRoot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=includeMatchers, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=relToRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=im, selectors=[], type_arguments=None), parameters=[MemberReference(member=im, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=anyMatch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=excludeMatchers, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=relToRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=em, selectors=[], type_arguments=None), parameters=[MemberReference(member=em, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=noneMatch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fileSuffix, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=suffixes, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=foundFiles, selectors=[], type_arguments=None), name=existing)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Source, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=existing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You have already added the file "), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" from "), operator=+), operandr=MethodInvocation(arguments=[], member=file, postfix_operators=[], prefix_operators=[], qualifier=existing, selectors=[MethodInvocation(arguments=[], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=existing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], member=lookupSource, postfix_operators=[], prefix_operators=[], qualifier=currentModule, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=existing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=currentModule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=toFile, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Source, sub_type=None)), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Source, sub_type=None)), IfStatement(condition=MemberReference(member=inGensrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=markAsGenerated, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MemberReference(member=inLinksrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=markAsLinkedOnly, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toPath, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=packageOfJavaFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=pkg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pkg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=currentModule, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+), operandr=MemberReference(member=pkg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=foundFiles, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pkg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addSource, postfix_operators=[], prefix_operators=[], qualifier=currentModule, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=inLinksrc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Internal error: Double add of file "), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" from "), operator=+), operandr=MethodInvocation(arguments=[], member=file, postfix_operators=[], prefix_operators=[], qualifier=existing, selectors=[MethodInvocation(arguments=[], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isLinkedOnly, postfix_operators=[], prefix_operators=[], qualifier=existing, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You have already added the link only file "), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" from "), operator=+), operandr=MethodInvocation(arguments=[], member=file, postfix_operators=[], prefix_operators=[], qualifier=existing, selectors=[MethodInvocation(arguments=[], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), MemberReference(member=existing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=foundFiles, selectors=[], type_arguments=None), label=None)]))]))])), ReturnStatement(expression=MemberReference(member=CONTINUE, postfix_operators=[], prefix_operators=[], qualifier=FileVisitResult, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=visitFile, parameters=[FormalParameter(annotations=[], modifiers=set(), name=file, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=attrs, type=ReferenceType(arguments=None, dimensions=[], name=BasicFileAttributes, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=FileVisitResult, sub_type=None), throws=['IOException'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))], dimensions=None, name=SimpleFileVisitor, sub_type=None))]] end[}] END[}]
Keyword[static] Keyword[public] Keyword[void] identifier[scanRoot] operator[SEP] identifier[File] identifier[root] , identifier[Set] operator[<] identifier[String] operator[>] identifier[suffixes] , identifier[List] operator[<] identifier[String] operator[>] identifier[excludes] , identifier[List] operator[<] identifier[String] operator[>] identifier[includes] , identifier[Map] operator[<] identifier[String] , identifier[Source] operator[>] identifier[foundFiles] , identifier[Map] operator[<] identifier[String] , identifier[Module] operator[>] identifier[foundModules] , Keyword[final] identifier[Module] identifier[currentModule] , Keyword[boolean] identifier[permitSourcesWithoutPackage] , Keyword[boolean] identifier[inGensrc] , Keyword[boolean] identifier[inLinksrc] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ProblemException] { Keyword[if] operator[SEP] identifier[root] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[FileSystem] identifier[fs] operator[=] identifier[root] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] identifier[getFileSystem] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[includes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[includes] operator[=] identifier[Collections] operator[SEP] identifier[singletonList] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[PathMatcher] operator[>] identifier[includeMatchers] operator[=] identifier[createPathMatchers] operator[SEP] identifier[fs] , identifier[includes] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[PathMatcher] operator[>] identifier[excludeMatchers] operator[=] identifier[createPathMatchers] operator[SEP] identifier[fs] , identifier[excludes] operator[SEP] operator[SEP] identifier[Files] operator[SEP] identifier[walkFileTree] operator[SEP] identifier[root] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] , Keyword[new] identifier[SimpleFileVisitor] operator[<] identifier[Path] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[FileVisitResult] identifier[visitFile] operator[SEP] identifier[Path] identifier[file] , identifier[BasicFileAttributes] identifier[attrs] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Path] identifier[relToRoot] operator[=] identifier[root] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] identifier[relativize] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[includeMatchers] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[anyMatch] operator[SEP] identifier[im] operator[->] identifier[im] operator[SEP] identifier[matches] operator[SEP] identifier[relToRoot] operator[SEP] operator[SEP] operator[&&] identifier[excludeMatchers] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[noneMatch] operator[SEP] identifier[em] operator[->] identifier[em] operator[SEP] identifier[matches] operator[SEP] identifier[relToRoot] operator[SEP] operator[SEP] operator[&&] identifier[suffixes] operator[SEP] identifier[contains] operator[SEP] identifier[Util] operator[SEP] identifier[fileSuffix] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] { identifier[Source] identifier[existing] operator[=] identifier[foundFiles] operator[SEP] identifier[get] operator[SEP] identifier[file] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existing] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[file] operator[+] literal[String] operator[+] identifier[existing] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[existing] operator[=] identifier[currentModule] operator[SEP] identifier[lookupSource] operator[SEP] identifier[file] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existing] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[inLinksrc] operator[SEP] { Keyword[if] operator[SEP] identifier[existing] operator[SEP] identifier[isLinkedOnly] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[file] operator[+] literal[String] operator[+] identifier[existing] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[foundFiles] operator[SEP] identifier[put] operator[SEP] identifier[file] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[existing] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[file] operator[+] literal[String] operator[+] identifier[existing] operator[SEP] identifier[file] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[Source] identifier[s] operator[=] Keyword[new] identifier[Source] operator[SEP] identifier[currentModule] , identifier[file] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[file] operator[SEP] identifier[toFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inGensrc] operator[SEP] { identifier[s] operator[SEP] identifier[markAsGenerated] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[inLinksrc] operator[SEP] { identifier[s] operator[SEP] identifier[markAsLinkedOnly] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[pkg] operator[=] identifier[packageOfJavaFile] operator[SEP] identifier[root] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] , identifier[file] operator[SEP] operator[SEP] identifier[pkg] operator[=] identifier[currentModule] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[pkg] operator[SEP] identifier[foundFiles] operator[SEP] identifier[put] operator[SEP] identifier[file] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[s] operator[SEP] operator[SEP] identifier[currentModule] operator[SEP] identifier[addSource] operator[SEP] identifier[pkg] , identifier[s] operator[SEP] operator[SEP] } } Keyword[return] identifier[FileVisitResult] operator[SEP] identifier[CONTINUE] operator[SEP] } } operator[SEP] operator[SEP] }
public boolean isClientSideWindowHandlerRequest(FacesContext facesContext) { if (!isJavaScriptEnabled()) { return false; } String userAgent = getUserAgent(facesContext); if (userAgent != null && ( userAgent.indexOf("bot") >= 0 || // Googlebot, etc userAgent.indexOf("Bot") >= 0 || // BingBot, etc userAgent.indexOf("Slurp") >= 0 || // Yahoo Slurp userAgent.indexOf("Crawler") >= 0 // various other Crawlers ) ) { return false; } return true; }
class class_name[name] begin[{] method[isClientSideWindowHandlerRequest, return_type[type[boolean]], modifier[public], parameter[facesContext]] begin[{] if[call[.isJavaScriptEnabled, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[String], userAgent] if[binary_operation[binary_operation[member[.userAgent], !=, literal[null]], &&, binary_operation[binary_operation[binary_operation[binary_operation[call[userAgent.indexOf, parameter[literal["bot"]]], >=, literal[0]], ||, binary_operation[call[userAgent.indexOf, parameter[literal["Bot"]]], >=, literal[0]]], ||, binary_operation[call[userAgent.indexOf, parameter[literal["Slurp"]]], >=, literal[0]]], ||, binary_operation[call[userAgent.indexOf, parameter[literal["Crawler"]]], >=, literal[0]]]]] begin[{] return[literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isClientSideWindowHandlerRequest] operator[SEP] identifier[FacesContext] identifier[facesContext] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isJavaScriptEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[String] identifier[userAgent] operator[=] identifier[getUserAgent] operator[SEP] identifier[facesContext] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[userAgent] operator[!=] Other[null] operator[&&] operator[SEP] identifier[userAgent] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[||] identifier[userAgent] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[||] identifier[userAgent] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[||] identifier[userAgent] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[>=] Other[0] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public boolean unUnified(E e) { Node<E> node = elmap.get(e); if(node == null) { // never been the argument of a call to union -> true return true; } // even if e was sent to union in the past, maybe it was // unified only with equal elements; the following tests // check this quickly if(node.parent != node) { // already have a parent, so cannot be unUnified -> false return false; } // node is a root! last chance is that it's only a root of itself! return node.nbElems == 1; }
class class_name[name] begin[{] method[unUnified, return_type[type[boolean]], modifier[public], parameter[e]] begin[{] local_variable[type[Node], node] if[binary_operation[member[.node], ==, literal[null]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[member[node.parent], !=, member[.node]]] begin[{] return[literal[false]] else begin[{] None end[}] return[binary_operation[member[node.nbElems], ==, literal[1]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[unUnified] operator[SEP] identifier[E] identifier[e] operator[SEP] { identifier[Node] operator[<] identifier[E] operator[>] identifier[node] operator[=] identifier[elmap] operator[SEP] identifier[get] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[node] operator[SEP] identifier[parent] operator[!=] identifier[node] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] identifier[node] operator[SEP] identifier[nbElems] operator[==] Other[1] operator[SEP] }
public void zremrangeByRank(final String key, final long start, final long end) { zremrangeByRank(SafeEncoder.encode(key), start, end); }
class class_name[name] begin[{] method[zremrangeByRank, return_type[void], modifier[public], parameter[key, start, end]] begin[{] call[.zremrangeByRank, parameter[call[SafeEncoder.encode, parameter[member[.key]]], member[.start], member[.end]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[zremrangeByRank] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] Keyword[long] identifier[start] , Keyword[final] Keyword[long] identifier[end] operator[SEP] { identifier[zremrangeByRank] operator[SEP] identifier[SafeEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[key] operator[SEP] , identifier[start] , identifier[end] operator[SEP] operator[SEP] }
private MBeanPluginContext createMBeanPluginContext() { return new MBeanPluginContext() { public ObjectName registerMBean(Object pMBean, String... pOptionalName) throws MalformedObjectNameException, NotCompliantMBeanException, InstanceAlreadyExistsException { return MBeanServerHandler.this.registerMBean(pMBean, pOptionalName); } public void each(ObjectName pObjectName, MBeanEachCallback pCallback) throws IOException, ReflectionException, MBeanException { mBeanServerManager.each(pObjectName,pCallback); } public <R> R call(ObjectName pObjectName, MBeanAction<R> pMBeanAction, Object... pExtraArgs) throws IOException, ReflectionException, MBeanException, AttributeNotFoundException, InstanceNotFoundException { return mBeanServerManager.call(pObjectName,pMBeanAction,pExtraArgs); } public Set<ObjectName> queryNames(ObjectName pObjectName) throws IOException { return mBeanServerManager.queryNames(pObjectName); } public boolean hasMBeansListChangedSince(long pTimestamp) { return mBeanServerManager.hasMBeansListChangedSince(pTimestamp); } }; }
class class_name[name] begin[{] method[createMBeanPluginContext, return_type[type[MBeanPluginContext]], modifier[private], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=MBeanServerHandler, selectors=[MethodInvocation(arguments=[MemberReference(member=pMBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pOptionalName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=registerMBean, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], documentation=None, modifiers={'public'}, name=registerMBean, parameters=[FormalParameter(annotations=[], modifiers=set(), name=pMBean, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=pOptionalName, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=True)], return_type=ReferenceType(arguments=None, dimensions=[], name=ObjectName, sub_type=None), throws=['MalformedObjectNameException', 'NotCompliantMBeanException', 'InstanceAlreadyExistsException'], type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pCallback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=each, postfix_operators=[], prefix_operators=[], qualifier=mBeanServerManager, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=each, parameters=[FormalParameter(annotations=[], modifiers=set(), name=pObjectName, type=ReferenceType(arguments=None, dimensions=[], name=ObjectName, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=pCallback, type=ReferenceType(arguments=None, dimensions=[], name=MBeanEachCallback, sub_type=None), varargs=False)], return_type=None, throws=['IOException', 'ReflectionException', 'MBeanException'], type_parameters=None), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=pObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pMBeanAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pExtraArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=call, postfix_operators=[], prefix_operators=[], qualifier=mBeanServerManager, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=pObjectName, type=ReferenceType(arguments=None, dimensions=[], name=ObjectName, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=pMBeanAction, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None))], dimensions=[], name=MBeanAction, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=pExtraArgs, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=True)], return_type=ReferenceType(arguments=None, dimensions=[], name=R, sub_type=None), throws=['IOException', 'ReflectionException', 'MBeanException', 'AttributeNotFoundException', 'InstanceNotFoundException'], type_parameters=[TypeParameter(extends=None, name=R)]), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=pObjectName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=queryNames, postfix_operators=[], prefix_operators=[], qualifier=mBeanServerManager, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=queryNames, parameters=[FormalParameter(annotations=[], modifiers=set(), name=pObjectName, type=ReferenceType(arguments=None, dimensions=[], name=ObjectName, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ObjectName, sub_type=None))], dimensions=[], name=Set, sub_type=None), throws=['IOException'], type_parameters=None), MethodDeclaration(annotations=[], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=pTimestamp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasMBeansListChangedSince, postfix_operators=[], prefix_operators=[], qualifier=mBeanServerManager, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=hasMBeansListChangedSince, parameters=[FormalParameter(annotations=[], modifiers=set(), name=pTimestamp, type=BasicType(dimensions=[], name=long), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MBeanPluginContext, sub_type=None))] end[}] END[}]
Keyword[private] identifier[MBeanPluginContext] identifier[createMBeanPluginContext] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[MBeanPluginContext] operator[SEP] operator[SEP] { Keyword[public] identifier[ObjectName] identifier[registerMBean] operator[SEP] identifier[Object] identifier[pMBean] , identifier[String] operator[...] identifier[pOptionalName] operator[SEP] Keyword[throws] identifier[MalformedObjectNameException] , identifier[NotCompliantMBeanException] , identifier[InstanceAlreadyExistsException] { Keyword[return] identifier[MBeanServerHandler] operator[SEP] Keyword[this] operator[SEP] identifier[registerMBean] operator[SEP] identifier[pMBean] , identifier[pOptionalName] operator[SEP] operator[SEP] } Keyword[public] Keyword[void] identifier[each] operator[SEP] identifier[ObjectName] identifier[pObjectName] , identifier[MBeanEachCallback] identifier[pCallback] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ReflectionException] , identifier[MBeanException] { identifier[mBeanServerManager] operator[SEP] identifier[each] operator[SEP] identifier[pObjectName] , identifier[pCallback] operator[SEP] operator[SEP] } Keyword[public] operator[<] identifier[R] operator[>] identifier[R] identifier[call] operator[SEP] identifier[ObjectName] identifier[pObjectName] , identifier[MBeanAction] operator[<] identifier[R] operator[>] identifier[pMBeanAction] , identifier[Object] operator[...] identifier[pExtraArgs] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ReflectionException] , identifier[MBeanException] , identifier[AttributeNotFoundException] , identifier[InstanceNotFoundException] { Keyword[return] identifier[mBeanServerManager] operator[SEP] identifier[call] operator[SEP] identifier[pObjectName] , identifier[pMBeanAction] , identifier[pExtraArgs] operator[SEP] operator[SEP] } Keyword[public] identifier[Set] operator[<] identifier[ObjectName] operator[>] identifier[queryNames] operator[SEP] identifier[ObjectName] identifier[pObjectName] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[mBeanServerManager] operator[SEP] identifier[queryNames] operator[SEP] identifier[pObjectName] operator[SEP] operator[SEP] } Keyword[public] Keyword[boolean] identifier[hasMBeansListChangedSince] operator[SEP] Keyword[long] identifier[pTimestamp] operator[SEP] { Keyword[return] identifier[mBeanServerManager] operator[SEP] identifier[hasMBeansListChangedSince] operator[SEP] identifier[pTimestamp] operator[SEP] operator[SEP] } } operator[SEP] }
public String updateByPath(String path,String entity) throws ElasticSearchException{ try { return this.client.executeHttp(path, entity, ClientUtil.HTTP_POST); } catch(ElasticSearchException e){ return ResultUtil.hand404HttpRuntimeException(e,String.class,ResultUtil.OPERTYPE_updateDocument); } }
class class_name[name] begin[{] method[updateByPath, return_type[type[String]], modifier[public], parameter[path, entity]] begin[{] TryStatement(block=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=client, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=HTTP_POST, postfix_operators=[], prefix_operators=[], qualifier=ClientUtil, selectors=[])], member=executeHttp, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), MemberReference(member=OPERTYPE_updateDocument, postfix_operators=[], prefix_operators=[], qualifier=ResultUtil, selectors=[])], member=hand404HttpRuntimeException, postfix_operators=[], prefix_operators=[], qualifier=ResultUtil, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ElasticSearchException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[String] identifier[updateByPath] operator[SEP] identifier[String] identifier[path] , identifier[String] identifier[entity] operator[SEP] Keyword[throws] identifier[ElasticSearchException] { Keyword[try] { Keyword[return] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[executeHttp] operator[SEP] identifier[path] , identifier[entity] , identifier[ClientUtil] operator[SEP] identifier[HTTP_POST] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ElasticSearchException] identifier[e] operator[SEP] { Keyword[return] identifier[ResultUtil] operator[SEP] identifier[hand404HttpRuntimeException] operator[SEP] identifier[e] , identifier[String] operator[SEP] Keyword[class] , identifier[ResultUtil] operator[SEP] identifier[OPERTYPE_updateDocument] operator[SEP] operator[SEP] } }
@Override public CorruptFileBlocks listCorruptFileBlocks(String path, String cookie) throws IOException { return listCorruptFileBlocksInternal(path, cookie); }
class class_name[name] begin[{] method[listCorruptFileBlocks, return_type[type[CorruptFileBlocks]], modifier[public], parameter[path, cookie]] begin[{] return[call[.listCorruptFileBlocksInternal, parameter[member[.path], member[.cookie]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CorruptFileBlocks] identifier[listCorruptFileBlocks] operator[SEP] identifier[String] identifier[path] , identifier[String] identifier[cookie] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[listCorruptFileBlocksInternal] operator[SEP] identifier[path] , identifier[cookie] operator[SEP] operator[SEP] }
@Deprecated public void compact(boolean exhaustive) { if (!isCompact) { int limitCompacted = 0; int iBlockStart = 0; char iUntouched = 0xFFFF; for (int i = 0; i < indices.length; ++i, iBlockStart += BLOCKCOUNT) { indices[i] = 0xFFFF; boolean touched = blockTouched(i); if (!touched && iUntouched != 0xFFFF) { // If no values in this block were set, we can just set its // index to be the same as some other block with no values // set, assuming we've seen one yet. indices[i] = iUntouched; } else { int jBlockStart = 0; int j = 0; for (j = 0; j < limitCompacted; ++j, jBlockStart += BLOCKCOUNT) { if (hashes[i] == hashes[j] && arrayRegionMatches(values, iBlockStart, values, jBlockStart, BLOCKCOUNT)) { indices[i] = (char)jBlockStart; break; } } if (indices[i] == 0xFFFF) { // we didn't match, so copy & update System.arraycopy(values, iBlockStart, values, jBlockStart, BLOCKCOUNT); indices[i] = (char)jBlockStart; hashes[j] = hashes[i]; ++limitCompacted; if (!touched) { // If this is the first untouched block we've seen, // remember its index. iUntouched = (char)jBlockStart; } } } } // we are done compacting, so now make the array shorter int newSize = limitCompacted*BLOCKCOUNT; byte[] result = new byte[newSize]; System.arraycopy(values, 0, result, 0, newSize); values = result; isCompact = true; hashes = null; } }
class class_name[name] begin[{] method[compact, return_type[void], modifier[public], parameter[exhaustive]] begin[{] if[member[.isCompact]] begin[{] local_variable[type[int], limitCompacted] local_variable[type[int], iBlockStart] local_variable[type[char], iUntouched] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFFFF)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=blockTouched, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=touched)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=touched, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=iUntouched, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFFFF), operator=!=), operator=&&), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=jBlockStart)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=hashes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=hashes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iBlockStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jBlockStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=BLOCKCOUNT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arrayRegionMatches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=jBlockStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=limitCompacted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), Assignment(expressionl=MemberReference(member=jBlockStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=BLOCKCOUNT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=indices, 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=0xFFFF), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iBlockStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jBlockStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=BLOCKCOUNT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=jBlockStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=hashes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=hashes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), StatementExpression(expression=MemberReference(member=limitCompacted, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), IfStatement(condition=MemberReference(member=touched, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=iUntouched, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=jBlockStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))), label=None)]))]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=iUntouched, 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=indices, 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=[]), Assignment(expressionl=MemberReference(member=iBlockStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=BLOCKCOUNT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None) local_variable[type[int], newSize] local_variable[type[byte], result] call[System.arraycopy, parameter[member[.values], literal[0], member[.result], literal[0], member[.newSize]]] assign[member[.values], member[.result]] assign[member[.isCompact], literal[true]] assign[member[.hashes], literal[null]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[void] identifier[compact] operator[SEP] Keyword[boolean] identifier[exhaustive] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isCompact] operator[SEP] { Keyword[int] identifier[limitCompacted] operator[=] Other[0] operator[SEP] Keyword[int] identifier[iBlockStart] operator[=] Other[0] operator[SEP] Keyword[char] identifier[iUntouched] operator[=] literal[Integer] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[indices] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] , identifier[iBlockStart] operator[+=] identifier[BLOCKCOUNT] operator[SEP] { identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[=] literal[Integer] operator[SEP] Keyword[boolean] identifier[touched] operator[=] identifier[blockTouched] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[touched] operator[&&] identifier[iUntouched] operator[!=] literal[Integer] operator[SEP] { identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[iUntouched] operator[SEP] } Keyword[else] { Keyword[int] identifier[jBlockStart] operator[=] Other[0] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[limitCompacted] operator[SEP] operator[++] identifier[j] , identifier[jBlockStart] operator[+=] identifier[BLOCKCOUNT] operator[SEP] { Keyword[if] operator[SEP] identifier[hashes] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[hashes] operator[SEP] identifier[j] operator[SEP] operator[&&] identifier[arrayRegionMatches] operator[SEP] identifier[values] , identifier[iBlockStart] , identifier[values] , identifier[jBlockStart] , identifier[BLOCKCOUNT] operator[SEP] operator[SEP] { identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[jBlockStart] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[==] literal[Integer] operator[SEP] { identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[values] , identifier[iBlockStart] , identifier[values] , identifier[jBlockStart] , identifier[BLOCKCOUNT] operator[SEP] operator[SEP] identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[jBlockStart] operator[SEP] identifier[hashes] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[hashes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[++] identifier[limitCompacted] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[touched] operator[SEP] { identifier[iUntouched] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[jBlockStart] operator[SEP] } } } } Keyword[int] identifier[newSize] operator[=] identifier[limitCompacted] operator[*] identifier[BLOCKCOUNT] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[newSize] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[values] , Other[0] , identifier[result] , Other[0] , identifier[newSize] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[result] operator[SEP] identifier[isCompact] operator[=] literal[boolean] operator[SEP] identifier[hashes] operator[=] Other[null] operator[SEP] } }
public static <T> T callUninterruptibly(Try.Callable<T, InterruptedException> cmd) { N.checkArgNotNull(cmd); boolean interrupted = false; try { while (true) { try { return cmd.call(); } catch (InterruptedException e) { interrupted = true; } } } finally { if (interrupted) { Thread.currentThread().interrupt(); } } }
class class_name[name] begin[{] method[callUninterruptibly, return_type[type[T]], modifier[public static], parameter[cmd]] begin[{] call[N.checkArgNotNull, parameter[member[.cmd]]] local_variable[type[boolean], interrupted] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=call, postfix_operators=[], prefix_operators=[], qualifier=cmd, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=interrupted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=interrupted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[callUninterruptibly] operator[SEP] identifier[Try] operator[SEP] identifier[Callable] operator[<] identifier[T] , identifier[InterruptedException] operator[>] identifier[cmd] operator[SEP] { identifier[N] operator[SEP] identifier[checkArgNotNull] operator[SEP] identifier[cmd] operator[SEP] operator[SEP] Keyword[boolean] identifier[interrupted] operator[=] literal[boolean] operator[SEP] Keyword[try] { Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[try] { Keyword[return] identifier[cmd] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[interrupted] operator[=] literal[boolean] operator[SEP] } } } Keyword[finally] { Keyword[if] operator[SEP] identifier[interrupted] operator[SEP] { identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] } } }
int run(@Nonnull String[] args, @Nonnull final ProcessStream system) { OptionHandlerRegistry.getRegistry().registerHandler(CliCommand.class, CliCommandOptionHandler.class); OptionHandlerRegistry.getRegistry().registerHandler(ProcessRuntime.class, new OptionHandlerRegistry.OptionHandlerFactory() { public OptionHandler<?> getHandler(CmdLineParser parser, OptionDef o, Setter setter) { return new ProcessRuntimeOptionHandler(parser, o, setter, system); } }); CmdLineParser parser = new CmdLineParser(this); try { parser.parseArgument(args); return handler.run(system); } catch (CmdLineException ex) { system.err().println(ex.getMessage()); HelpCommand.printUsage(handler, system.err(), ex); } catch (CommandFailedException ex) { system.err().println(ex.getMessage()); } catch (RuntimeException ex) { ex.printStackTrace(system.err()); } return -1; }
class class_name[name] begin[{] method[run, return_type[type[int]], modifier[default], parameter[args, system]] begin[{] call[OptionHandlerRegistry.getRegistry, parameter[]] call[OptionHandlerRegistry.getRegistry, parameter[]] local_variable[type[CmdLineParser], parser] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseArgument, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=system, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=run, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=err, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)], member=println, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=err, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printUsage, postfix_operators=[], prefix_operators=[], qualifier=HelpCommand, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['CmdLineException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=err, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)], member=println, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['CommandFailedException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=err, postfix_operators=[], prefix_operators=[], qualifier=system, selectors=[], type_arguments=None)], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['RuntimeException']))], finally_block=None, label=None, resources=None) return[literal[1]] end[}] END[}]
Keyword[int] identifier[run] operator[SEP] annotation[@] identifier[Nonnull] identifier[String] operator[SEP] operator[SEP] identifier[args] , annotation[@] identifier[Nonnull] Keyword[final] identifier[ProcessStream] identifier[system] operator[SEP] { identifier[OptionHandlerRegistry] operator[SEP] identifier[getRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[registerHandler] operator[SEP] identifier[CliCommand] operator[SEP] Keyword[class] , identifier[CliCommandOptionHandler] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[OptionHandlerRegistry] operator[SEP] identifier[getRegistry] operator[SEP] operator[SEP] operator[SEP] identifier[registerHandler] operator[SEP] identifier[ProcessRuntime] operator[SEP] Keyword[class] , Keyword[new] identifier[OptionHandlerRegistry] operator[SEP] identifier[OptionHandlerFactory] operator[SEP] operator[SEP] { Keyword[public] identifier[OptionHandler] operator[<] operator[?] operator[>] identifier[getHandler] operator[SEP] identifier[CmdLineParser] identifier[parser] , identifier[OptionDef] identifier[o] , identifier[Setter] identifier[setter] operator[SEP] { Keyword[return] Keyword[new] identifier[ProcessRuntimeOptionHandler] operator[SEP] identifier[parser] , identifier[o] , identifier[setter] , identifier[system] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[CmdLineParser] identifier[parser] operator[=] Keyword[new] identifier[CmdLineParser] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[try] { identifier[parser] operator[SEP] identifier[parseArgument] operator[SEP] identifier[args] operator[SEP] operator[SEP] Keyword[return] identifier[handler] operator[SEP] identifier[run] operator[SEP] identifier[system] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CmdLineException] identifier[ex] operator[SEP] { identifier[system] operator[SEP] identifier[err] operator[SEP] operator[SEP] operator[SEP] identifier[println] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[HelpCommand] operator[SEP] identifier[printUsage] operator[SEP] identifier[handler] , identifier[system] operator[SEP] identifier[err] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CommandFailedException] identifier[ex] operator[SEP] { identifier[system] operator[SEP] identifier[err] operator[SEP] operator[SEP] operator[SEP] identifier[println] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[ex] operator[SEP] { identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] identifier[system] operator[SEP] identifier[err] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[-] Other[1] operator[SEP] }
public void marshall(Input input, ProtocolMarshaller protocolMarshaller) { if (input == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(input.getArn(), ARN_BINDING); protocolMarshaller.marshall(input.getAttachedChannels(), ATTACHEDCHANNELS_BINDING); protocolMarshaller.marshall(input.getDestinations(), DESTINATIONS_BINDING); protocolMarshaller.marshall(input.getId(), ID_BINDING); protocolMarshaller.marshall(input.getInputClass(), INPUTCLASS_BINDING); protocolMarshaller.marshall(input.getMediaConnectFlows(), MEDIACONNECTFLOWS_BINDING); protocolMarshaller.marshall(input.getName(), NAME_BINDING); protocolMarshaller.marshall(input.getRoleArn(), ROLEARN_BINDING); protocolMarshaller.marshall(input.getSecurityGroups(), SECURITYGROUPS_BINDING); protocolMarshaller.marshall(input.getSources(), SOURCES_BINDING); protocolMarshaller.marshall(input.getState(), STATE_BINDING); protocolMarshaller.marshall(input.getTags(), TAGS_BINDING); protocolMarshaller.marshall(input.getType(), TYPE_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[input, protocolMarshaller]] begin[{] if[binary_operation[member[.input], ==, 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=input, 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), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getAttachedChannels, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=ATTACHEDCHANNELS_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=getDestinations, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=DESTINATIONS_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=getId, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=ID_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=getInputClass, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=INPUTCLASS_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=getMediaConnectFlows, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=MEDIACONNECTFLOWS_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=getName, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=NAME_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRoleArn, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=ROLEARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSecurityGroups, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=SECURITYGROUPS_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=getSources, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=SOURCES_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=getState, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=STATE_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=getTags, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=TAGS_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=getType, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=TYPE_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[Input] identifier[input] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[input] 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[input] operator[SEP] identifier[getArn] operator[SEP] operator[SEP] , identifier[ARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getAttachedChannels] operator[SEP] operator[SEP] , identifier[ATTACHEDCHANNELS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getDestinations] operator[SEP] operator[SEP] , identifier[DESTINATIONS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[ID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getInputClass] operator[SEP] operator[SEP] , identifier[INPUTCLASS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getMediaConnectFlows] operator[SEP] operator[SEP] , identifier[MEDIACONNECTFLOWS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getRoleArn] operator[SEP] operator[SEP] , identifier[ROLEARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getSecurityGroups] operator[SEP] operator[SEP] , identifier[SECURITYGROUPS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getSources] operator[SEP] operator[SEP] , identifier[SOURCES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getState] operator[SEP] operator[SEP] , identifier[STATE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] , identifier[TAGS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[input] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[TYPE_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 final ValueWithPos<String> formatCommonNational(final ValueWithPos<String> pphoneNumber) { return valueWithPosDefaults( this.formatCommonNationalWithPos(this.parsePhoneNumber(pphoneNumber)), pphoneNumber); }
class class_name[name] begin[{] method[formatCommonNational, return_type[type[ValueWithPos]], modifier[final public], parameter[pphoneNumber]] begin[{] return[call[.valueWithPosDefaults, parameter[THIS[call[None.formatCommonNationalWithPos, parameter[THIS[call[None.parsePhoneNumber, parameter[member[.pphoneNumber]]]]]]], member[.pphoneNumber]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[ValueWithPos] operator[<] identifier[String] operator[>] identifier[formatCommonNational] operator[SEP] Keyword[final] identifier[ValueWithPos] operator[<] identifier[String] operator[>] identifier[pphoneNumber] operator[SEP] { Keyword[return] identifier[valueWithPosDefaults] operator[SEP] Keyword[this] operator[SEP] identifier[formatCommonNationalWithPos] operator[SEP] Keyword[this] operator[SEP] identifier[parsePhoneNumber] operator[SEP] identifier[pphoneNumber] operator[SEP] operator[SEP] , identifier[pphoneNumber] operator[SEP] operator[SEP] }
private long calculatePartSize(long fileSize) { long partSize = MINIMUM_PART_SIZE; int approxNumParts = 1; while (partSize * approxNumParts < fileSize && partSize*2 <= MAXIMUM_UPLOAD_PART_SIZE) { partSize *= 2; approxNumParts *= 2; } return partSize; }
class class_name[name] begin[{] method[calculatePartSize, return_type[type[long]], modifier[private], parameter[fileSize]] begin[{] local_variable[type[long], partSize] local_variable[type[int], approxNumParts] while[binary_operation[binary_operation[binary_operation[member[.partSize], *, member[.approxNumParts]], <, member[.fileSize]], &&, binary_operation[binary_operation[member[.partSize], *, literal[2]], <=, member[.MAXIMUM_UPLOAD_PART_SIZE]]]] begin[{] assign[member[.partSize], literal[2]] assign[member[.approxNumParts], literal[2]] end[}] return[member[.partSize]] end[}] END[}]
Keyword[private] Keyword[long] identifier[calculatePartSize] operator[SEP] Keyword[long] identifier[fileSize] operator[SEP] { Keyword[long] identifier[partSize] operator[=] identifier[MINIMUM_PART_SIZE] operator[SEP] Keyword[int] identifier[approxNumParts] operator[=] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[partSize] operator[*] identifier[approxNumParts] operator[<] identifier[fileSize] operator[&&] identifier[partSize] operator[*] Other[2] operator[<=] identifier[MAXIMUM_UPLOAD_PART_SIZE] operator[SEP] { identifier[partSize] operator[*=] Other[2] operator[SEP] identifier[approxNumParts] operator[*=] Other[2] operator[SEP] } Keyword[return] identifier[partSize] operator[SEP] }
public void setVersion(int version) throws ParserException { if (this.versionSeen) throw new ParserException("Current BioEntry already has a version"); else { try { this.version = version; this.versionSeen = true; } catch (NumberFormatException e) { throw new ParserException("Could not parse version as an integer"); } } }
class class_name[name] begin[{] method[setVersion, return_type[void], modifier[public], parameter[version]] begin[{] if[THIS[member[None.versionSeen]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Current BioEntry already has a version")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParserException, sub_type=None)), label=None) else begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=version, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=versionSeen, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not parse version as an integer")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParserException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setVersion] operator[SEP] Keyword[int] identifier[version] operator[SEP] Keyword[throws] identifier[ParserException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[versionSeen] operator[SEP] Keyword[throw] Keyword[new] identifier[ParserException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[else] { Keyword[try] { Keyword[this] operator[SEP] identifier[version] operator[=] identifier[version] operator[SEP] Keyword[this] operator[SEP] identifier[versionSeen] operator[=] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ParserException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } }
void setActive(boolean active) { m_deactivationPanel.setVisible(!active); m_datesPanel.setVisible(active); if (m_seriesCheckBox.getFormValue().booleanValue()) { setSerialOptionsVisible(active); } m_controller.sizeChanged(); }
class class_name[name] begin[{] method[setActive, return_type[void], modifier[default], parameter[active]] begin[{] call[m_deactivationPanel.setVisible, parameter[member[.active]]] call[m_datesPanel.setVisible, parameter[member[.active]]] if[call[m_seriesCheckBox.getFormValue, parameter[]]] begin[{] call[.setSerialOptionsVisible, parameter[member[.active]]] else begin[{] None end[}] call[m_controller.sizeChanged, parameter[]] end[}] END[}]
Keyword[void] identifier[setActive] operator[SEP] Keyword[boolean] identifier[active] operator[SEP] { identifier[m_deactivationPanel] operator[SEP] identifier[setVisible] operator[SEP] operator[!] identifier[active] operator[SEP] operator[SEP] identifier[m_datesPanel] operator[SEP] identifier[setVisible] operator[SEP] identifier[active] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_seriesCheckBox] operator[SEP] identifier[getFormValue] operator[SEP] operator[SEP] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] operator[SEP] { identifier[setSerialOptionsVisible] operator[SEP] identifier[active] operator[SEP] operator[SEP] } identifier[m_controller] operator[SEP] identifier[sizeChanged] operator[SEP] operator[SEP] operator[SEP] }
public static String getFilePath(int docId, String extention) { int[] split = getSplit(docId); return split[0] + "/" + split[1] + "/" + split[2] + "." + extention; }
class class_name[name] begin[{] method[getFilePath, return_type[type[String]], modifier[public static], parameter[docId, extention]] begin[{] local_variable[type[int], split] return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.split], +, literal["/"]], +, member[.split]], +, literal["/"]], +, member[.split]], +, literal["."]], +, member[.extention]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getFilePath] operator[SEP] Keyword[int] identifier[docId] , identifier[String] identifier[extention] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[split] operator[=] identifier[getSplit] operator[SEP] identifier[docId] operator[SEP] operator[SEP] Keyword[return] identifier[split] operator[SEP] Other[0] operator[SEP] operator[+] literal[String] operator[+] identifier[split] operator[SEP] Other[1] operator[SEP] operator[+] literal[String] operator[+] identifier[split] operator[SEP] Other[2] operator[SEP] operator[+] literal[String] operator[+] identifier[extention] operator[SEP] }
private void showColumn(TableColumn column) { // Ignore changes to the TableColumnModel made by the TableColumnManager columnModel.removeColumnModelListener(this); // Add the column to the end of the table columnModel.addColumn(column); // Move the column to its position before it was hidden. // (Multiple columns may be hidden so we need to find the first // visible column before this column so the column can be moved // to the appropriate position) int position = allColumns.indexOf(column); int from = columnModel.getColumnCount() - 1; int to = 0; for (int i = position - 1; i > -1; i--) { try { TableColumn visibleColumn = allColumns.get(i); to = columnModel.getColumnIndex(visibleColumn.getHeaderValue()) + 1; break; } catch (IllegalArgumentException e) { } } columnModel.moveColumn(from, to); columnModel.addColumnModelListener(this); }
class class_name[name] begin[{] method[showColumn, return_type[void], modifier[private], parameter[column]] begin[{] call[columnModel.removeColumnModelListener, parameter[THIS[]]] call[columnModel.addColumn, parameter[member[.column]]] local_variable[type[int], position] local_variable[type[int], from] local_variable[type[int], to] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=allColumns, selectors=[], type_arguments=None), name=visibleColumn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TableColumn, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHeaderValue, postfix_operators=[], prefix_operators=[], qualifier=visibleColumn, selectors=[], type_arguments=None)], member=getColumnIndex, postfix_operators=[], prefix_operators=[], qualifier=columnModel, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None), BreakStatement(goto=None, label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[columnModel.moveColumn, parameter[member[.from], member[.to]]] call[columnModel.addColumnModelListener, parameter[THIS[]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[showColumn] operator[SEP] identifier[TableColumn] identifier[column] operator[SEP] { identifier[columnModel] operator[SEP] identifier[removeColumnModelListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[columnModel] operator[SEP] identifier[addColumn] operator[SEP] identifier[column] operator[SEP] operator[SEP] Keyword[int] identifier[position] operator[=] identifier[allColumns] operator[SEP] identifier[indexOf] operator[SEP] identifier[column] operator[SEP] operator[SEP] Keyword[int] identifier[from] operator[=] identifier[columnModel] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[int] identifier[to] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[position] operator[-] Other[1] operator[SEP] identifier[i] operator[>] operator[-] Other[1] operator[SEP] identifier[i] operator[--] operator[SEP] { Keyword[try] { identifier[TableColumn] identifier[visibleColumn] operator[=] identifier[allColumns] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[to] operator[=] identifier[columnModel] operator[SEP] identifier[getColumnIndex] operator[SEP] identifier[visibleColumn] operator[SEP] identifier[getHeaderValue] operator[SEP] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[break] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[e] operator[SEP] { } } identifier[columnModel] operator[SEP] identifier[moveColumn] operator[SEP] identifier[from] , identifier[to] operator[SEP] operator[SEP] identifier[columnModel] operator[SEP] identifier[addColumnModelListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP] }
public void removesScanResult(String uri, String method) { SpiderScanResult toRemove = new SpiderScanResult(uri, method); int index = scanResults.indexOf(toRemove); if (index >= 0) { scanResults.remove(index); fireTableRowsDeleted(index, index); } }
class class_name[name] begin[{] method[removesScanResult, return_type[void], modifier[public], parameter[uri, method]] begin[{] local_variable[type[SpiderScanResult], toRemove] local_variable[type[int], index] if[binary_operation[member[.index], >=, literal[0]]] begin[{] call[scanResults.remove, parameter[member[.index]]] call[.fireTableRowsDeleted, parameter[member[.index], member[.index]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[removesScanResult] operator[SEP] identifier[String] identifier[uri] , identifier[String] identifier[method] operator[SEP] { identifier[SpiderScanResult] identifier[toRemove] operator[=] Keyword[new] identifier[SpiderScanResult] operator[SEP] identifier[uri] , identifier[method] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[scanResults] operator[SEP] identifier[indexOf] operator[SEP] identifier[toRemove] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[>=] Other[0] operator[SEP] { identifier[scanResults] operator[SEP] identifier[remove] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[fireTableRowsDeleted] operator[SEP] identifier[index] , identifier[index] operator[SEP] operator[SEP] } }
@Override public void send( ByteBuffer bytes ) { if( bytes == null ) throw new IllegalArgumentException( "Cannot send 'null' data to a WebSocketImpl." ); send( draft.createFrames( bytes, role == Role.CLIENT ) ); }
class class_name[name] begin[{] method[send, return_type[void], modifier[public], parameter[bytes]] begin[{] if[binary_operation[member[.bytes], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot send 'null' data to a WebSocketImpl.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[.send, parameter[call[draft.createFrames, parameter[member[.bytes], binary_operation[member[.role], ==, member[Role.CLIENT]]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[send] operator[SEP] identifier[ByteBuffer] identifier[bytes] operator[SEP] { Keyword[if] operator[SEP] identifier[bytes] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[send] operator[SEP] identifier[draft] operator[SEP] identifier[createFrames] operator[SEP] identifier[bytes] , identifier[role] operator[==] identifier[Role] operator[SEP] identifier[CLIENT] operator[SEP] operator[SEP] operator[SEP] }
public static Collector<Link, ?, Links> collector() { return Collectors.collectingAndThen(Collectors.toList(), Links::of); }
class class_name[name] begin[{] method[collector, return_type[type[Collector]], modifier[public static], parameter[]] begin[{] return[call[Collectors.collectingAndThen, parameter[call[Collectors.toList, parameter[]], MethodReference(expression=MemberReference(member=Links, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=of, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Collector] operator[<] identifier[Link] , operator[?] , identifier[Links] operator[>] identifier[collector] operator[SEP] operator[SEP] { Keyword[return] identifier[Collectors] operator[SEP] identifier[collectingAndThen] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] , identifier[Links] operator[::] identifier[of] operator[SEP] operator[SEP] }
private void registerQuickStartSecurityAdministratorRole() { if (bc == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "BundleContext is null, we must be deactivated."); } return; } if (managementRoleReg != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "QuickStartSecurityAdministratorRole is already registered."); } return; } if (urConfigReg == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "QuickStartSecurityRegistry configuration is not registered, will not register QuickStartSecurityAdministratorRole."); } return; } if (isStringValueUndefined(config.userName())) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "User is not set, can not register the QuickStartSecurityAdministratorRole"); } return; } if (!managementRoles.isEmpty()) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Other managment roles are present, will not register the QuickStartSecurityAdministratorRole"); } return; } Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put(ManagementRole.MANAGEMENT_ROLE_NAME, QUICK_START_ADMINISTRATOR_ROLE_NAME); props.put("service.vendor", "IBM"); managementRole = new QuickStartSecurityAdministratorRole(config.userName()); managementRoleReg = bc.registerService(ManagementRole.class, managementRole, props); }
class class_name[name] begin[{] method[registerQuickStartSecurityAdministratorRole, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[member[.bc], ==, literal[null]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["BundleContext is null, we must be deactivated."]]] else begin[{] None end[}] return[None] else begin[{] None end[}] if[binary_operation[member[.managementRoleReg], !=, literal[null]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["QuickStartSecurityAdministratorRole is already registered."]]] else begin[{] None end[}] return[None] else begin[{] None end[}] if[binary_operation[member[.urConfigReg], ==, literal[null]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["QuickStartSecurityRegistry configuration is not registered, will not register QuickStartSecurityAdministratorRole."]]] else begin[{] None end[}] return[None] else begin[{] None end[}] if[call[.isStringValueUndefined, parameter[call[config.userName, parameter[]]]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["User is not set, can not register the QuickStartSecurityAdministratorRole"]]] else begin[{] None end[}] return[None] else begin[{] None end[}] if[call[managementRoles.isEmpty, parameter[]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], literal["Other managment roles are present, will not register the QuickStartSecurityAdministratorRole"]]] else begin[{] None end[}] return[None] else begin[{] None end[}] local_variable[type[Dictionary], props] call[props.put, parameter[member[ManagementRole.MANAGEMENT_ROLE_NAME], member[.QUICK_START_ADMINISTRATOR_ROLE_NAME]]] call[props.put, parameter[literal["service.vendor"], literal["IBM"]]] assign[member[.managementRole], ClassCreator(arguments=[MethodInvocation(arguments=[], member=userName, postfix_operators=[], prefix_operators=[], qualifier=config, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QuickStartSecurityAdministratorRole, sub_type=None))] assign[member[.managementRoleReg], call[bc.registerService, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ManagementRole, sub_type=None)), member[.managementRole], member[.props]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[registerQuickStartSecurityAdministratorRole] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[bc] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[managementRoleReg] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[urConfigReg] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[isStringValueUndefined] operator[SEP] identifier[config] operator[SEP] identifier[userName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[managementRoles] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } identifier[Dictionary] operator[<] identifier[String] , identifier[Object] operator[>] identifier[props] operator[=] Keyword[new] identifier[Hashtable] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[put] operator[SEP] identifier[ManagementRole] operator[SEP] identifier[MANAGEMENT_ROLE_NAME] , identifier[QUICK_START_ADMINISTRATOR_ROLE_NAME] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[managementRole] operator[=] Keyword[new] identifier[QuickStartSecurityAdministratorRole] operator[SEP] identifier[config] operator[SEP] identifier[userName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[managementRoleReg] operator[=] identifier[bc] operator[SEP] identifier[registerService] operator[SEP] identifier[ManagementRole] operator[SEP] Keyword[class] , identifier[managementRole] , identifier[props] operator[SEP] operator[SEP] }
protected boolean equalElements(KTypeArrayDeque<?> other) { int max = size(); if (other.size() != max) { return false; } Iterator<KTypeCursor<KType>> i1 = this.iterator(); Iterator<? extends KTypeCursor<?>> i2 = other.iterator(); while (i1.hasNext() && i2.hasNext()) { if (!Intrinsics.equals(this, i1.next().value, i2.next().value)) { return false; } } return !i1.hasNext() && !i2.hasNext(); }
class class_name[name] begin[{] method[equalElements, return_type[type[boolean]], modifier[protected], parameter[other]] begin[{] local_variable[type[int], max] if[binary_operation[call[other.size, parameter[]], !=, member[.max]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[Iterator], i1] local_variable[type[Iterator], i2] while[binary_operation[call[i1.hasNext, parameter[]], &&, call[i2.hasNext, parameter[]]]] begin[{] if[call[Intrinsics.equals, parameter[THIS[], call[i1.next, parameter[]], call[i2.next, parameter[]]]]] begin[{] return[literal[false]] else begin[{] None end[}] end[}] return[binary_operation[call[i1.hasNext, parameter[]], &&, call[i2.hasNext, parameter[]]]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[equalElements] operator[SEP] identifier[KTypeArrayDeque] operator[<] operator[?] operator[>] identifier[other] operator[SEP] { Keyword[int] identifier[max] operator[=] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[other] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[max] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[Iterator] operator[<] identifier[KTypeCursor] operator[<] identifier[KType] operator[>] operator[>] identifier[i1] operator[=] Keyword[this] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] operator[?] Keyword[extends] identifier[KTypeCursor] operator[<] operator[?] operator[>] operator[>] identifier[i2] operator[=] identifier[other] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[i1] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] identifier[i2] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[Intrinsics] operator[SEP] identifier[equals] operator[SEP] Keyword[this] , identifier[i1] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[value] , identifier[i2] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] operator[!] identifier[i1] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[i2] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] }
public org.tensorflow.framework.StepStats getStepStats() { return stepStats_ == null ? org.tensorflow.framework.StepStats.getDefaultInstance() : stepStats_; }
class class_name[name] begin[{] method[getStepStats, return_type[type[org]], modifier[public], parameter[]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=stepStats_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=stepStats_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=getDefaultInstance, postfix_operators=[], prefix_operators=[], qualifier=org.tensorflow.framework.StepStats, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] identifier[org] operator[SEP] identifier[tensorflow] operator[SEP] identifier[framework] operator[SEP] identifier[StepStats] identifier[getStepStats] operator[SEP] operator[SEP] { Keyword[return] identifier[stepStats_] operator[==] Other[null] operator[?] identifier[org] operator[SEP] identifier[tensorflow] operator[SEP] identifier[framework] operator[SEP] identifier[StepStats] operator[SEP] identifier[getDefaultInstance] operator[SEP] operator[SEP] operator[:] identifier[stepStats_] operator[SEP] }
public void reportContextTree(MetricRegistry registry) { reportRegistry(registry); if (registry instanceof MetricContext) { for (MetricContext context : ((MetricContext) registry).getChildContextsAsMap().values()) { reportContextTree(context); } } }
class class_name[name] begin[{] method[reportContextTree, return_type[void], modifier[public], parameter[registry]] begin[{] call[.reportRegistry, parameter[member[.registry]]] if[binary_operation[member[.registry], instanceof, type[MetricContext]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportContextTree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=registry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MetricContext, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=context)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MetricContext, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[reportContextTree] operator[SEP] identifier[MetricRegistry] identifier[registry] operator[SEP] { identifier[reportRegistry] operator[SEP] identifier[registry] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[registry] Keyword[instanceof] identifier[MetricContext] operator[SEP] { Keyword[for] operator[SEP] identifier[MetricContext] identifier[context] operator[:] operator[SEP] operator[SEP] identifier[MetricContext] operator[SEP] identifier[registry] operator[SEP] operator[SEP] identifier[getChildContextsAsMap] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[reportContextTree] operator[SEP] identifier[context] operator[SEP] operator[SEP] } } }
public static <N, V> ValueGraph<N, V> transpose(ValueGraph<N, V> graph) { if (!graph.isDirected()) { return graph; // the transpose of an undirected graph is an identical graph } if (graph instanceof TransposedValueGraph) { return ((TransposedValueGraph<N, V>) graph).graph; } return new TransposedValueGraph<N, V>(graph); }
class class_name[name] begin[{] method[transpose, return_type[type[ValueGraph]], modifier[public static], parameter[graph]] begin[{] if[call[graph.isDirected, parameter[]]] begin[{] return[member[.graph]] else begin[{] None end[}] if[binary_operation[member[.graph], instanceof, type[TransposedValueGraph]]] begin[{] return[Cast(expression=MemberReference(member=graph, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=N, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=TransposedValueGraph, sub_type=None))] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=graph, 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=N, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=TransposedValueGraph, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[N] , identifier[V] operator[>] identifier[ValueGraph] operator[<] identifier[N] , identifier[V] operator[>] identifier[transpose] operator[SEP] identifier[ValueGraph] operator[<] identifier[N] , identifier[V] operator[>] identifier[graph] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[graph] operator[SEP] identifier[isDirected] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[graph] operator[SEP] } Keyword[if] operator[SEP] identifier[graph] Keyword[instanceof] identifier[TransposedValueGraph] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[TransposedValueGraph] operator[<] identifier[N] , identifier[V] operator[>] operator[SEP] identifier[graph] operator[SEP] operator[SEP] identifier[graph] operator[SEP] } Keyword[return] Keyword[new] identifier[TransposedValueGraph] operator[<] identifier[N] , identifier[V] operator[>] operator[SEP] identifier[graph] operator[SEP] operator[SEP] }
public Complex minus(Complex b) { Complex a = this; double real = a.re - b.re; double imag = a.im - b.im; return new Complex(real, imag); }
class class_name[name] begin[{] method[minus, return_type[type[Complex]], modifier[public], parameter[b]] begin[{] local_variable[type[Complex], a] local_variable[type[double], real] local_variable[type[double], imag] return[ClassCreator(arguments=[MemberReference(member=real, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=imag, 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=Complex, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Complex] identifier[minus] operator[SEP] identifier[Complex] identifier[b] operator[SEP] { identifier[Complex] identifier[a] operator[=] Keyword[this] operator[SEP] Keyword[double] identifier[real] operator[=] identifier[a] operator[SEP] identifier[re] operator[-] identifier[b] operator[SEP] identifier[re] operator[SEP] Keyword[double] identifier[imag] operator[=] identifier[a] operator[SEP] identifier[im] operator[-] identifier[b] operator[SEP] identifier[im] operator[SEP] Keyword[return] Keyword[new] identifier[Complex] operator[SEP] identifier[real] , identifier[imag] operator[SEP] operator[SEP] }
public BatcherBuilder listenerService(ExecutorService listenerService) { checkState(this.listenerService == null, "A listener service has already been set"); requireNonNull(listenerService); this.listenerService = listenerService; return this; }
class class_name[name] begin[{] method[listenerService, return_type[type[BatcherBuilder]], modifier[public], parameter[listenerService]] begin[{] call[.checkState, parameter[binary_operation[THIS[member[None.listenerService]], ==, literal[null]], literal["A listener service has already been set"]]] call[.requireNonNull, parameter[member[.listenerService]]] assign[THIS[member[None.listenerService]], member[.listenerService]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[BatcherBuilder] identifier[listenerService] operator[SEP] identifier[ExecutorService] identifier[listenerService] operator[SEP] { identifier[checkState] operator[SEP] Keyword[this] operator[SEP] identifier[listenerService] operator[==] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[listenerService] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[listenerService] operator[=] identifier[listenerService] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static MetricValue merge(MetricKind kind, MetricValue prior, MetricValue latest) { if (prior.getValueCase() != latest.getValueCase()) { log.atWarning().log("Could not merge different types of metric: %s, %s", prior, latest); throw new IllegalArgumentException(MSG_CANNOT_MERGE_DIFFERENT_TYPES); } if (kind == MetricKind.DELTA) { Builder builder = latest.toBuilder(); mergeTimestamps(builder, prior, latest); mergeValues(builder, prior, latest); return builder.build(); } else if (Timestamps.COMPARATOR.compare(prior.getEndTime(), latest.getEndTime()) < 0) { return latest; } else { return prior; } }
class class_name[name] begin[{] method[merge, return_type[type[MetricValue]], modifier[public static], parameter[kind, prior, latest]] begin[{] if[binary_operation[call[prior.getValueCase, parameter[]], !=, call[latest.getValueCase, parameter[]]]] begin[{] call[log.atWarning, parameter[]] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=MSG_CANNOT_MERGE_DIFFERENT_TYPES, 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=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.kind], ==, member[MetricKind.DELTA]]] begin[{] local_variable[type[Builder], builder] call[.mergeTimestamps, parameter[member[.builder], member[.prior], member[.latest]]] call[.mergeValues, parameter[member[.builder], member[.prior], member[.latest]]] return[call[builder.build, parameter[]]] else begin[{] if[binary_operation[call[Timestamps.COMPARATOR.compare, parameter[call[prior.getEndTime, parameter[]], call[latest.getEndTime, parameter[]]]], <, literal[0]]] begin[{] return[member[.latest]] else begin[{] return[member[.prior]] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[MetricValue] identifier[merge] operator[SEP] identifier[MetricKind] identifier[kind] , identifier[MetricValue] identifier[prior] , identifier[MetricValue] identifier[latest] operator[SEP] { Keyword[if] operator[SEP] identifier[prior] operator[SEP] identifier[getValueCase] operator[SEP] operator[SEP] operator[!=] identifier[latest] operator[SEP] identifier[getValueCase] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[atWarning] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] literal[String] , identifier[prior] , identifier[latest] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[MSG_CANNOT_MERGE_DIFFERENT_TYPES] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[kind] operator[==] identifier[MetricKind] operator[SEP] identifier[DELTA] operator[SEP] { identifier[Builder] identifier[builder] operator[=] identifier[latest] operator[SEP] identifier[toBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[mergeTimestamps] operator[SEP] identifier[builder] , identifier[prior] , identifier[latest] operator[SEP] operator[SEP] identifier[mergeValues] operator[SEP] identifier[builder] , identifier[prior] , identifier[latest] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[Timestamps] operator[SEP] identifier[COMPARATOR] operator[SEP] identifier[compare] operator[SEP] identifier[prior] operator[SEP] identifier[getEndTime] operator[SEP] operator[SEP] , identifier[latest] operator[SEP] identifier[getEndTime] operator[SEP] operator[SEP] operator[SEP] operator[<] Other[0] operator[SEP] { Keyword[return] identifier[latest] operator[SEP] } Keyword[else] { Keyword[return] identifier[prior] operator[SEP] } }
public synchronized byte[] getBytes( int parameterIndex) throws SQLException { Object x = getColumnInType(parameterIndex, Type.SQL_VARBINARY); if (x == null) { return null; } return ((BinaryData) x).getBytes(); }
class class_name[name] begin[{] method[getBytes, return_type[type[byte]], modifier[synchronized public], parameter[parameterIndex]] begin[{] local_variable[type[Object], x] if[binary_operation[member[.x], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[Cast(expression=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BinaryData, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[byte] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] Keyword[int] identifier[parameterIndex] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[Object] identifier[x] operator[=] identifier[getColumnInType] operator[SEP] identifier[parameterIndex] , identifier[Type] operator[SEP] identifier[SQL_VARBINARY] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[x] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] operator[SEP] operator[SEP] identifier[BinaryData] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] }
@Override public void writeChar(int v) throws IOException { work[0] = (byte) (0xff & v); work[1] = (byte) (0xff & (v >> 8)); write(work, 0, 2); }
class class_name[name] begin[{] method[writeChar, return_type[void], modifier[public], parameter[v]] begin[{] assign[member[.work], Cast(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operandr=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), type=BasicType(dimensions=[], name=byte))] assign[member[.work], Cast(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operandr=BinaryOperation(operandl=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operator=&), type=BasicType(dimensions=[], name=byte))] call[.write, parameter[member[.work], literal[0], literal[2]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[writeChar] operator[SEP] Keyword[int] identifier[v] operator[SEP] Keyword[throws] identifier[IOException] { identifier[work] operator[SEP] Other[0] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] literal[Integer] operator[&] identifier[v] operator[SEP] operator[SEP] identifier[work] operator[SEP] Other[1] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] literal[Integer] operator[&] operator[SEP] identifier[v] operator[>] operator[>] Other[8] operator[SEP] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[work] , Other[0] , Other[2] operator[SEP] operator[SEP] }
public static Observable<String> from(final String host, final int port, long quietTimeoutMs, long reconnectDelayMs, Charset charset, Scheduler scheduler) { // delay connect by delayMs so that if server closes // stream on every connect we won't be in a mad loop of // failing connections return from(socketCreator(host, port, (int) quietTimeoutMs), quietTimeoutMs, reconnectDelayMs, charset, scheduler); // }
class class_name[name] begin[{] method[from, return_type[type[Observable]], modifier[public static], parameter[host, port, quietTimeoutMs, reconnectDelayMs, charset, scheduler]] begin[{] return[call[.from, parameter[call[.socketCreator, parameter[member[.host], member[.port], Cast(expression=MemberReference(member=quietTimeoutMs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=int))]], member[.quietTimeoutMs], member[.reconnectDelayMs], member[.charset], member[.scheduler]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Observable] operator[<] identifier[String] operator[>] identifier[from] operator[SEP] Keyword[final] identifier[String] identifier[host] , Keyword[final] Keyword[int] identifier[port] , Keyword[long] identifier[quietTimeoutMs] , Keyword[long] identifier[reconnectDelayMs] , identifier[Charset] identifier[charset] , identifier[Scheduler] identifier[scheduler] operator[SEP] { Keyword[return] identifier[from] operator[SEP] identifier[socketCreator] operator[SEP] identifier[host] , identifier[port] , operator[SEP] Keyword[int] operator[SEP] identifier[quietTimeoutMs] operator[SEP] , identifier[quietTimeoutMs] , identifier[reconnectDelayMs] , identifier[charset] , identifier[scheduler] operator[SEP] operator[SEP] }
public HttpClient options(String url) throws HelloSignException { request = new HttpOptionsRequest(url); request.execute(); return this; }
class class_name[name] begin[{] method[options, return_type[type[HttpClient]], modifier[public], parameter[url]] begin[{] assign[member[.request], ClassCreator(arguments=[MemberReference(member=url, 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=HttpOptionsRequest, sub_type=None))] call[request.execute, parameter[]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[HttpClient] identifier[options] operator[SEP] identifier[String] identifier[url] operator[SEP] Keyword[throws] identifier[HelloSignException] { identifier[request] operator[=] Keyword[new] identifier[HttpOptionsRequest] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void marshall(DeleteUserByPrincipalIdRequest deleteUserByPrincipalIdRequest, ProtocolMarshaller protocolMarshaller) { if (deleteUserByPrincipalIdRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteUserByPrincipalIdRequest.getPrincipalId(), PRINCIPALID_BINDING); protocolMarshaller.marshall(deleteUserByPrincipalIdRequest.getAwsAccountId(), AWSACCOUNTID_BINDING); protocolMarshaller.marshall(deleteUserByPrincipalIdRequest.getNamespace(), NAMESPACE_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[deleteUserByPrincipalIdRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.deleteUserByPrincipalIdRequest], ==, 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=getPrincipalId, postfix_operators=[], prefix_operators=[], qualifier=deleteUserByPrincipalIdRequest, selectors=[], type_arguments=None), MemberReference(member=PRINCIPALID_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=getAwsAccountId, postfix_operators=[], prefix_operators=[], qualifier=deleteUserByPrincipalIdRequest, selectors=[], type_arguments=None), MemberReference(member=AWSACCOUNTID_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=getNamespace, postfix_operators=[], prefix_operators=[], qualifier=deleteUserByPrincipalIdRequest, selectors=[], type_arguments=None), MemberReference(member=NAMESPACE_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[DeleteUserByPrincipalIdRequest] identifier[deleteUserByPrincipalIdRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[deleteUserByPrincipalIdRequest] 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[deleteUserByPrincipalIdRequest] operator[SEP] identifier[getPrincipalId] operator[SEP] operator[SEP] , identifier[PRINCIPALID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteUserByPrincipalIdRequest] operator[SEP] identifier[getAwsAccountId] operator[SEP] operator[SEP] , identifier[AWSACCOUNTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[deleteUserByPrincipalIdRequest] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] , identifier[NAMESPACE_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 BuildableType.Builder mapType(UnaryOperator<Type> mapper) { Objects.requireNonNull(mapper); return type(mapper.apply(type())); }
class class_name[name] begin[{] method[mapType, return_type[type[BuildableType]], modifier[public], parameter[mapper]] begin[{] call[Objects.requireNonNull, parameter[member[.mapper]]] return[call[.type, parameter[call[mapper.apply, parameter[call[.type, parameter[]]]]]]] end[}] END[}]
Keyword[public] identifier[BuildableType] operator[SEP] identifier[Builder] identifier[mapType] operator[SEP] identifier[UnaryOperator] operator[<] identifier[Type] operator[>] identifier[mapper] operator[SEP] { identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[mapper] operator[SEP] operator[SEP] Keyword[return] identifier[type] operator[SEP] identifier[mapper] operator[SEP] identifier[apply] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public String getMethodSig() { if (!visitingMethod) { throw new IllegalStateException("getMethodSig called while not visiting method"); } if (methodSig == null) { methodSig = getStringFromIndex(method.getSignatureIndex()); } return methodSig; }
class class_name[name] begin[{] method[getMethodSig, return_type[type[String]], modifier[public], parameter[]] begin[{] if[member[.visitingMethod]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getMethodSig called while not visiting method")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.methodSig], ==, literal[null]]] begin[{] assign[member[.methodSig], call[.getStringFromIndex, parameter[call[method.getSignatureIndex, parameter[]]]]] else begin[{] None end[}] return[member[.methodSig]] end[}] END[}]
Keyword[public] identifier[String] identifier[getMethodSig] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[visitingMethod] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[methodSig] operator[==] Other[null] operator[SEP] { identifier[methodSig] operator[=] identifier[getStringFromIndex] operator[SEP] identifier[method] operator[SEP] identifier[getSignatureIndex] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[methodSig] operator[SEP] }
protected void setInnerName(String innerName) { m_innerName = innerName; if (m_innerName != null) { m_typeName = createTypeName(innerName); } }
class class_name[name] begin[{] method[setInnerName, return_type[void], modifier[protected], parameter[innerName]] begin[{] assign[member[.m_innerName], member[.innerName]] if[binary_operation[member[.m_innerName], !=, literal[null]]] begin[{] assign[member[.m_typeName], call[.createTypeName, parameter[member[.innerName]]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[setInnerName] operator[SEP] identifier[String] identifier[innerName] operator[SEP] { identifier[m_innerName] operator[=] identifier[innerName] operator[SEP] Keyword[if] operator[SEP] identifier[m_innerName] operator[!=] Other[null] operator[SEP] { identifier[m_typeName] operator[=] identifier[createTypeName] operator[SEP] identifier[innerName] operator[SEP] operator[SEP] } }
private void populateInitialAuthorizationTable() { clearAuthorizationTable(); Map<String, Set<String>> userToRoleName = new HashMap<String, Set<String>>(); Map<String, Set<String>> groupToRoleName = new HashMap<String, Set<String>>(); Iterator<ManagementRole> itr = managementRoles.getServices(); while (itr.hasNext()) { ManagementRole role = itr.next(); String roleName = role.getRoleName(); for (String user : role.getUsers()) { Set<String> assignedRoles = userToRoleName.get(user); if (assignedRoles == null) { assignedRoles = new HashSet<String>(); userToRoleName.put(user, assignedRoles); } assignedRoles.add(roleName); } for (String group : role.getGroups()) { Set<String> assignedRoles = groupToRoleName.get(group); if (assignedRoles == null) { assignedRoles = new HashSet<String>(); groupToRoleName.put(group, assignedRoles); } assignedRoles.add(roleName); } } for (Map.Entry<String, Set<String>> entry : userToRoleName.entrySet()) { userToRoles.put(entry.getKey(), new RoleSet(entry.getValue())); } for (Map.Entry<String, Set<String>> entry : groupToRoleName.entrySet()) { groupToRoles.put(entry.getKey(), new RoleSet(entry.getValue())); } }
class class_name[name] begin[{] method[populateInitialAuthorizationTable, return_type[void], modifier[private], parameter[]] begin[{] call[.clearAuthorizationTable, parameter[]] local_variable[type[Map], userToRoleName] local_variable[type[Map], groupToRoleName] local_variable[type[Iterator], itr] while[call[itr.hasNext, parameter[]]] begin[{] local_variable[type[ManagementRole], role] local_variable[type[String], roleName] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=userToRoleName, selectors=[], type_arguments=None), name=assignedRoles)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=assignedRoles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=assignedRoles, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=user, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=assignedRoles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=userToRoleName, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=roleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=assignedRoles, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getUsers, postfix_operators=[], prefix_operators=[], qualifier=role, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=user)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=groupToRoleName, selectors=[], type_arguments=None), name=assignedRoles)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=assignedRoles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=assignedRoles, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=assignedRoles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=groupToRoleName, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=roleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=assignedRoles, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getGroups, postfix_operators=[], prefix_operators=[], qualifier=role, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=group)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RoleSet, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=userToRoles, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=userToRoleName, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RoleSet, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=groupToRoles, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=groupToRoleName, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[populateInitialAuthorizationTable] operator[SEP] operator[SEP] { identifier[clearAuthorizationTable] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[userToRoleName] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[groupToRoleName] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[ManagementRole] operator[>] identifier[itr] operator[=] identifier[managementRoles] operator[SEP] identifier[getServices] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itr] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[ManagementRole] identifier[role] operator[=] identifier[itr] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[roleName] operator[=] identifier[role] operator[SEP] identifier[getRoleName] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[user] operator[:] identifier[role] operator[SEP] identifier[getUsers] operator[SEP] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[assignedRoles] operator[=] identifier[userToRoleName] operator[SEP] identifier[get] operator[SEP] identifier[user] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[assignedRoles] operator[==] Other[null] operator[SEP] { identifier[assignedRoles] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[userToRoleName] operator[SEP] identifier[put] operator[SEP] identifier[user] , identifier[assignedRoles] operator[SEP] operator[SEP] } identifier[assignedRoles] operator[SEP] identifier[add] operator[SEP] identifier[roleName] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[group] operator[:] identifier[role] operator[SEP] identifier[getGroups] operator[SEP] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[assignedRoles] operator[=] identifier[groupToRoleName] operator[SEP] identifier[get] operator[SEP] identifier[group] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[assignedRoles] operator[==] Other[null] operator[SEP] { identifier[assignedRoles] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[groupToRoleName] operator[SEP] identifier[put] operator[SEP] identifier[group] , identifier[assignedRoles] operator[SEP] operator[SEP] } identifier[assignedRoles] operator[SEP] identifier[add] operator[SEP] identifier[roleName] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[userToRoleName] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[userToRoles] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , Keyword[new] identifier[RoleSet] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[entry] operator[:] identifier[groupToRoleName] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[groupToRoles] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , Keyword[new] identifier[RoleSet] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
protected String getRowKeyValueAsString(final Object key) { final String result = key.toString(); return "r_" + StringUtils.deleteWhitespace(result); }
class class_name[name] begin[{] method[getRowKeyValueAsString, return_type[type[String]], modifier[protected], parameter[key]] begin[{] local_variable[type[String], result] return[binary_operation[literal["r_"], +, call[StringUtils.deleteWhitespace, parameter[member[.result]]]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getRowKeyValueAsString] operator[SEP] Keyword[final] identifier[Object] identifier[key] operator[SEP] { Keyword[final] identifier[String] identifier[result] operator[=] identifier[key] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[+] identifier[StringUtils] operator[SEP] identifier[deleteWhitespace] operator[SEP] identifier[result] operator[SEP] operator[SEP] }
@Override @FFDCIgnore({ ClassNotFoundException.class }) public void validateEjbInjection(EJB ejb, CDIArchive injectionArchive, Class<?> injectionType) throws ClassCastException, CDIException { Collection<CDIArchive> moduleArchives = injectionArchive.getApplication().getModuleArchives(); String applicationName = injectionArchive.getApplication().getName(); String moduleName = injectionArchive.getName(); for (CDIArchive archive : moduleArchives) { try { EJBEndpoint endpoint = findEJBEndpoint(archive, ejb, injectionType, applicationName, moduleName); if (endpoint != null) { // Found it! return; } } catch (ClassNotFoundException e) { // Could not find the class, even though it should be in this module // Give up looking but don't fail validation return; } catch (ClassCastException e) { // Found the EJB and it's the wrong type // Throw on this exception to be handled by the caller throw e; } //TODO what happens if the endpoint is not found in any of the archives?? } }
class class_name[name] begin[{] method[validateEjbInjection, return_type[void], modifier[public], parameter[ejb, injectionArchive, injectionType]] begin[{] local_variable[type[Collection], moduleArchives] local_variable[type[String], applicationName] local_variable[type[String], moduleName] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=archive, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ejb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=injectionType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=applicationName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=moduleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findEJBEndpoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=endpoint)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EJBEndpoint, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=endpoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)]))], catches=[CatchClause(block=[ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException'])), CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassCastException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=moduleArchives, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=archive)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CDIArchive, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[FFDCIgnore] operator[SEP] { identifier[ClassNotFoundException] operator[SEP] Keyword[class] } operator[SEP] Keyword[public] Keyword[void] identifier[validateEjbInjection] operator[SEP] identifier[EJB] identifier[ejb] , identifier[CDIArchive] identifier[injectionArchive] , identifier[Class] operator[<] operator[?] operator[>] identifier[injectionType] operator[SEP] Keyword[throws] identifier[ClassCastException] , identifier[CDIException] { identifier[Collection] operator[<] identifier[CDIArchive] operator[>] identifier[moduleArchives] operator[=] identifier[injectionArchive] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] identifier[getModuleArchives] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[applicationName] operator[=] identifier[injectionArchive] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[moduleName] operator[=] identifier[injectionArchive] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CDIArchive] identifier[archive] operator[:] identifier[moduleArchives] operator[SEP] { Keyword[try] { identifier[EJBEndpoint] identifier[endpoint] operator[=] identifier[findEJBEndpoint] operator[SEP] identifier[archive] , identifier[ejb] , identifier[injectionType] , identifier[applicationName] , identifier[moduleName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[endpoint] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { Keyword[return] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] { Keyword[throw] identifier[e] operator[SEP] } } }
@Override public String nextName() { int p = peeked; if (p == PEEKED_NONE) { p = doPeek(); } String result; if (p == PEEKED_UNQUOTED_NAME) { result = nextUnquotedValue(); } else if (p == PEEKED_SINGLE_QUOTED_NAME) { result = nextQuotedValue('\''); } else if (p == PEEKED_DOUBLE_QUOTED_NAME) { result = nextQuotedValue('"'); } else { throw new IllegalStateException("Expected a name but was " + peek() + " at line " + getLineNumber() + " column " + getColumnNumber()); } peeked = PEEKED_NONE; return result; }
class class_name[name] begin[{] method[nextName, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[int], p] if[binary_operation[member[.p], ==, member[.PEEKED_NONE]]] begin[{] assign[member[.p], call[.doPeek, parameter[]]] else begin[{] None end[}] local_variable[type[String], result] if[binary_operation[member[.p], ==, member[.PEEKED_UNQUOTED_NAME]]] begin[{] assign[member[.result], call[.nextUnquotedValue, parameter[]]] else begin[{] if[binary_operation[member[.p], ==, member[.PEEKED_SINGLE_QUOTED_NAME]]] begin[{] assign[member[.result], call[.nextQuotedValue, parameter[literal['\'']]]] else begin[{] if[binary_operation[member[.p], ==, member[.PEEKED_DOUBLE_QUOTED_NAME]]] begin[{] assign[member[.result], call[.nextQuotedValue, parameter[literal['"']]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected a name but was "), operandr=MethodInvocation(arguments=[], member=peek, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" at line "), operator=+), operandr=MethodInvocation(arguments=[], member=getLineNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" column "), operator=+), operandr=MethodInvocation(arguments=[], member=getColumnNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] end[}] end[}] assign[member[.peeked], member[.PEEKED_NONE]] return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[nextName] operator[SEP] operator[SEP] { Keyword[int] identifier[p] operator[=] identifier[peeked] operator[SEP] Keyword[if] operator[SEP] identifier[p] operator[==] identifier[PEEKED_NONE] operator[SEP] { identifier[p] operator[=] identifier[doPeek] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[p] operator[==] identifier[PEEKED_UNQUOTED_NAME] operator[SEP] { identifier[result] operator[=] identifier[nextUnquotedValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[p] operator[==] identifier[PEEKED_SINGLE_QUOTED_NAME] operator[SEP] { identifier[result] operator[=] identifier[nextQuotedValue] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[p] operator[==] identifier[PEEKED_DOUBLE_QUOTED_NAME] operator[SEP] { identifier[result] operator[=] identifier[nextQuotedValue] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[peek] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getLineNumber] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getColumnNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[peeked] operator[=] identifier[PEEKED_NONE] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static <K, V> Map<K, V> toMap(final Iterable<Map.Entry<K, V>> iterable) { final Map<K, V> result = newLinkedHashMap(); for (Map.Entry<K, V> entry : iterable) { result.put(entry.getKey(), entry.getValue()); } return result; }
class class_name[name] begin[{] method[toMap, return_type[type[Map]], modifier[public static], parameter[iterable]] begin[{] local_variable[type[Map], result] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=iterable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[toMap] operator[SEP] Keyword[final] identifier[Iterable] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[iterable] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[result] operator[=] identifier[newLinkedHashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[entry] operator[:] identifier[iterable] operator[SEP] { identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
@Nullable private static <T> T valueOrProperty(@Nullable final T value, @Nonnull final Property property, @Nullable final T defaultValue) { if (!valueNullOrEmpty(value)) { LOGGER.trace("using provided argument value {} for property {}", value, property); return value; } else if (hasProperty(property)) { final T propertyValue = getProperty(property); LOGGER.trace("using value {} from config file for property {}", propertyValue, property); return propertyValue; } else { LOGGER.trace("no value provided as argument or in config file for property {}, using default value {}", property, defaultValue); return defaultValue; } }
class class_name[name] begin[{] method[valueOrProperty, return_type[type[T]], modifier[private static], parameter[value, property, defaultValue]] begin[{] if[call[.valueNullOrEmpty, parameter[member[.value]]]] begin[{] call[LOGGER.trace, parameter[literal["using provided argument value {} for property {}"], member[.value], member[.property]]] return[member[.value]] else begin[{] if[call[.hasProperty, parameter[member[.property]]]] begin[{] local_variable[type[T], propertyValue] call[LOGGER.trace, parameter[literal["using value {} from config file for property {}"], member[.propertyValue], member[.property]]] return[member[.propertyValue]] else begin[{] call[LOGGER.trace, parameter[literal["no value provided as argument or in config file for property {}, using default value {}"], member[.property], member[.defaultValue]]] return[member[.defaultValue]] end[}] end[}] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[private] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[valueOrProperty] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[T] identifier[value] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Property] identifier[property] , annotation[@] identifier[Nullable] Keyword[final] identifier[T] identifier[defaultValue] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[valueNullOrEmpty] operator[SEP] identifier[value] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[value] , identifier[property] operator[SEP] operator[SEP] Keyword[return] identifier[value] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[hasProperty] operator[SEP] identifier[property] operator[SEP] operator[SEP] { Keyword[final] identifier[T] identifier[propertyValue] operator[=] identifier[getProperty] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[propertyValue] , identifier[property] operator[SEP] operator[SEP] Keyword[return] identifier[propertyValue] operator[SEP] } Keyword[else] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[property] , identifier[defaultValue] operator[SEP] operator[SEP] Keyword[return] identifier[defaultValue] operator[SEP] } }
public static List<CommerceWarehouse> toModels( CommerceWarehouseSoap[] soapModels) { if (soapModels == null) { return null; } List<CommerceWarehouse> models = new ArrayList<CommerceWarehouse>(soapModels.length); for (CommerceWarehouseSoap soapModel : soapModels) { models.add(toModel(soapModel)); } return models; }
class class_name[name] begin[{] method[toModels, return_type[type[List]], modifier[public static], parameter[soapModels]] begin[{] if[binary_operation[member[.soapModels], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[List], models] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=soapModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=models, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=soapModels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=soapModel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommerceWarehouseSoap, sub_type=None))), label=None) return[member[.models]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[CommerceWarehouse] operator[>] identifier[toModels] operator[SEP] identifier[CommerceWarehouseSoap] operator[SEP] operator[SEP] identifier[soapModels] operator[SEP] { Keyword[if] operator[SEP] identifier[soapModels] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[List] operator[<] identifier[CommerceWarehouse] operator[>] identifier[models] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CommerceWarehouse] operator[>] operator[SEP] identifier[soapModels] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CommerceWarehouseSoap] identifier[soapModel] operator[:] identifier[soapModels] operator[SEP] { identifier[models] operator[SEP] identifier[add] operator[SEP] identifier[toModel] operator[SEP] identifier[soapModel] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[models] operator[SEP] }
public void onContentChange() { Scheduler.get().scheduleDeferred(new ScheduledCommand() { public void execute() { Widget parent = getParent(); while (parent != null) { if (parent instanceof CmsGalleryDialog) { ((CmsGalleryDialog)parent).updateSizes(); parent = null; } else { parent = parent.getParent(); } } } }); }
class class_name[name] begin[{] method[onContentChange, return_type[void], modifier[public], parameter[]] begin[{] call[Scheduler.get, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[onContentChange] operator[SEP] operator[SEP] { identifier[Scheduler] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[scheduleDeferred] operator[SEP] Keyword[new] identifier[ScheduledCommand] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] { identifier[Widget] identifier[parent] operator[=] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[parent] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[parent] Keyword[instanceof] identifier[CmsGalleryDialog] operator[SEP] { operator[SEP] operator[SEP] identifier[CmsGalleryDialog] operator[SEP] identifier[parent] operator[SEP] operator[SEP] identifier[updateSizes] operator[SEP] operator[SEP] operator[SEP] identifier[parent] operator[=] Other[null] operator[SEP] } Keyword[else] { identifier[parent] operator[=] identifier[parent] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] } } } } operator[SEP] operator[SEP] }
public Object get(int idx) { int index = idx & 0xff; if (isEmpty()) { // System.err.println("index "+index+" is invalid as stack is empty"); return null; } else if (index < 0 || index >= size) { // System.err.println("index "+index+" is outside of range [0,"+(size-1)+"]"); return null; } return objects[index]; }
class class_name[name] begin[{] method[get, return_type[type[Object]], modifier[public], parameter[idx]] begin[{] local_variable[type[int], index] if[call[.isEmpty, parameter[]]] begin[{] return[literal[null]] else begin[{] if[binary_operation[binary_operation[member[.index], <, literal[0]], ||, binary_operation[member[.index], >=, member[.size]]]] begin[{] return[literal[null]] else begin[{] None end[}] end[}] return[member[.objects]] end[}] END[}]
Keyword[public] identifier[Object] identifier[get] operator[SEP] Keyword[int] identifier[idx] operator[SEP] { Keyword[int] identifier[index] operator[=] identifier[idx] operator[&] literal[Integer] operator[SEP] Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[index] operator[<] Other[0] operator[||] identifier[index] operator[>=] identifier[size] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[objects] operator[SEP] identifier[index] operator[SEP] operator[SEP] }
static String suppressionPath(final Class<?> klass, final String name) { return decapitalize(klass.getSimpleName()) + "/" + name; }
class class_name[name] begin[{] method[suppressionPath, return_type[type[String]], modifier[static], parameter[klass, name]] begin[{] return[binary_operation[binary_operation[call[.decapitalize, parameter[call[klass.getSimpleName, parameter[]]]], +, literal["/"]], +, member[.name]]] end[}] END[}]
Keyword[static] identifier[String] identifier[suppressionPath] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[klass] , Keyword[final] identifier[String] identifier[name] operator[SEP] { Keyword[return] identifier[decapitalize] operator[SEP] identifier[klass] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[name] operator[SEP] }
public void prunePoints(int neighbors , double distance ) { // Use a nearest neighbor search to find near by points Point3D_F64 worldX = new Point3D_F64(); List<Point3D_F64> cloud = new ArrayList<>(); for (int i = 0; i < structure.points.length; i++) { SceneStructureMetric.Point structureP = structure.points[i]; structureP.get(worldX); cloud.add(worldX.copy()); } NearestNeighbor<Point3D_F64> nn = FactoryNearestNeighbor.kdtree(new KdTreePoint3D_F64()); NearestNeighbor.Search<Point3D_F64> search = nn.createSearch(); nn.setPoints(cloud,false); FastQueue<NnData<Point3D_F64>> resultsNN = new FastQueue(NnData.class,true); // Create a look up table containing from old to new indexes for each point int oldToNew[] = new int[ structure.points.length ]; Arrays.fill(oldToNew,-1); // crash is bug // List of point ID's which are to be removed. GrowQueue_I32 prunePointID = new GrowQueue_I32(); // identify points which need to be pruned for (int pointId = 0; pointId < structure.points.length; pointId++) { SceneStructureMetric.Point structureP = structure.points[pointId]; structureP.get(worldX); // distance is squared search.findNearest(cloud.get(pointId),distance*distance,neighbors+1,resultsNN); // Don't prune if it has enough neighbors. Remember that it will always find itself. if( resultsNN.size() > neighbors ) { oldToNew[pointId] = pointId-prunePointID.size; continue; } prunePointID.add(pointId); // Remove observations of this point for (int viewIdx = 0; viewIdx < structureP.views.size; viewIdx++) { SceneObservations.View v = observations.getView(structureP.views.data[viewIdx]); int pointIdx = v.point.indexOf(pointId); if( pointIdx < 0 ) throw new RuntimeException("Bad structure. Point not found in view's observation " + "which was in its structure"); v.remove(pointIdx); } } pruneUpdatePointID(oldToNew, prunePointID); }
class class_name[name] begin[{] method[prunePoints, return_type[void], modifier[public], parameter[neighbors, distance]] begin[{] local_variable[type[Point3D_F64], worldX] local_variable[type[List], cloud] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=points, postfix_operators=[], prefix_operators=[], qualifier=structure, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=structureP)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SceneStructureMetric, sub_type=ReferenceType(arguments=None, dimensions=None, name=Point, sub_type=None))), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=worldX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=structureP, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=copy, postfix_operators=[], prefix_operators=[], qualifier=worldX, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=cloud, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=structure.points, 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[NearestNeighbor], nn] local_variable[type[NearestNeighbor], search] call[nn.setPoints, parameter[member[.cloud], literal[false]]] local_variable[type[FastQueue], resultsNN] local_variable[type[int], oldToNew] call[Arrays.fill, parameter[member[.oldToNew], literal[1]]] local_variable[type[GrowQueue_I32], prunePointID] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=points, postfix_operators=[], prefix_operators=[], qualifier=structure, selectors=[ArraySelector(index=MemberReference(member=pointId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=structureP)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SceneStructureMetric, sub_type=ReferenceType(arguments=None, dimensions=None, name=Point, sub_type=None))), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=worldX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=structureP, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=pointId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cloud, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=distance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=distance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), BinaryOperation(operandl=MemberReference(member=neighbors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=resultsNN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findNearest, postfix_operators=[], prefix_operators=[], qualifier=search, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=resultsNN, selectors=[], type_arguments=None), operandr=MemberReference(member=neighbors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=oldToNew, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=pointId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=pointId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=prunePointID, selectors=[]), operator=-)), label=None), ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pointId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=prunePointID, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=structureP.views, selectors=[ArraySelector(index=MemberReference(member=viewIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getView, postfix_operators=[], prefix_operators=[], qualifier=observations, selectors=[], type_arguments=None), name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SceneObservations, sub_type=ReferenceType(arguments=None, dimensions=None, name=View, sub_type=None))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=pointId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=v.point, selectors=[], type_arguments=None), name=pointIdx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pointIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Bad structure. Point not found in view's observation "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="which was in its structure"), 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)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pointIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=viewIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=structureP.views, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=viewIdx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=viewIdx, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=pointId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=structure.points, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=pointId)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=pointId, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[.pruneUpdatePointID, parameter[member[.oldToNew], member[.prunePointID]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[prunePoints] operator[SEP] Keyword[int] identifier[neighbors] , Keyword[double] identifier[distance] operator[SEP] { identifier[Point3D_F64] identifier[worldX] operator[=] Keyword[new] identifier[Point3D_F64] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Point3D_F64] operator[>] identifier[cloud] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[structure] operator[SEP] identifier[points] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[SceneStructureMetric] operator[SEP] identifier[Point] identifier[structureP] operator[=] identifier[structure] operator[SEP] identifier[points] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[structureP] operator[SEP] identifier[get] operator[SEP] identifier[worldX] operator[SEP] operator[SEP] identifier[cloud] operator[SEP] identifier[add] operator[SEP] identifier[worldX] operator[SEP] identifier[copy] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[NearestNeighbor] operator[<] identifier[Point3D_F64] operator[>] identifier[nn] operator[=] identifier[FactoryNearestNeighbor] operator[SEP] identifier[kdtree] operator[SEP] Keyword[new] identifier[KdTreePoint3D_F64] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[NearestNeighbor] operator[SEP] identifier[Search] operator[<] identifier[Point3D_F64] operator[>] identifier[search] operator[=] identifier[nn] operator[SEP] identifier[createSearch] operator[SEP] operator[SEP] operator[SEP] identifier[nn] operator[SEP] identifier[setPoints] operator[SEP] identifier[cloud] , literal[boolean] operator[SEP] operator[SEP] identifier[FastQueue] operator[<] identifier[NnData] operator[<] identifier[Point3D_F64] operator[>] operator[>] identifier[resultsNN] operator[=] Keyword[new] identifier[FastQueue] operator[SEP] identifier[NnData] operator[SEP] Keyword[class] , literal[boolean] operator[SEP] operator[SEP] Keyword[int] identifier[oldToNew] operator[SEP] operator[SEP] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[structure] operator[SEP] identifier[points] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[oldToNew] , operator[-] Other[1] operator[SEP] operator[SEP] identifier[GrowQueue_I32] identifier[prunePointID] operator[=] Keyword[new] identifier[GrowQueue_I32] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[pointId] operator[=] Other[0] operator[SEP] identifier[pointId] operator[<] identifier[structure] operator[SEP] identifier[points] operator[SEP] identifier[length] operator[SEP] identifier[pointId] operator[++] operator[SEP] { identifier[SceneStructureMetric] operator[SEP] identifier[Point] identifier[structureP] operator[=] identifier[structure] operator[SEP] identifier[points] operator[SEP] identifier[pointId] operator[SEP] operator[SEP] identifier[structureP] operator[SEP] identifier[get] operator[SEP] identifier[worldX] operator[SEP] operator[SEP] identifier[search] operator[SEP] identifier[findNearest] operator[SEP] identifier[cloud] operator[SEP] identifier[get] operator[SEP] identifier[pointId] operator[SEP] , identifier[distance] operator[*] identifier[distance] , identifier[neighbors] operator[+] Other[1] , identifier[resultsNN] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resultsNN] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] identifier[neighbors] operator[SEP] { identifier[oldToNew] operator[SEP] identifier[pointId] operator[SEP] operator[=] identifier[pointId] operator[-] identifier[prunePointID] operator[SEP] identifier[size] operator[SEP] Keyword[continue] operator[SEP] } identifier[prunePointID] operator[SEP] identifier[add] operator[SEP] identifier[pointId] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[viewIdx] operator[=] Other[0] operator[SEP] identifier[viewIdx] operator[<] identifier[structureP] operator[SEP] identifier[views] operator[SEP] identifier[size] operator[SEP] identifier[viewIdx] operator[++] operator[SEP] { identifier[SceneObservations] operator[SEP] identifier[View] identifier[v] operator[=] identifier[observations] operator[SEP] identifier[getView] operator[SEP] identifier[structureP] operator[SEP] identifier[views] operator[SEP] identifier[data] operator[SEP] identifier[viewIdx] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[pointIdx] operator[=] identifier[v] operator[SEP] identifier[point] operator[SEP] identifier[indexOf] operator[SEP] identifier[pointId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pointIdx] operator[<] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] identifier[v] operator[SEP] identifier[remove] operator[SEP] identifier[pointIdx] operator[SEP] operator[SEP] } } identifier[pruneUpdatePointID] operator[SEP] identifier[oldToNew] , identifier[prunePointID] operator[SEP] operator[SEP] }
static String safeName(String unsafeElementName) { String elementName = HtmlLexer.canonicalName(unsafeElementName); // Substitute a reliably non-raw-text element for raw-text and // plain-text elements. switch (elementName.length()) { case 3: if ("xmp".equals(elementName)) { return "pre"; } break; case 7: if ("listing".equals(elementName)) { return "pre"; } break; case 9: if ("plaintext".equals(elementName)) { return "pre"; } break; } return elementName; }
class class_name[name] begin[{] method[safeName, return_type[type[String]], modifier[static], parameter[unsafeElementName]] begin[{] local_variable[type[String], elementName] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=elementName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="xmp"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pre"), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=7)], statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=elementName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="listing"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pre"), label=None)])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=9)], statements=[IfStatement(condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=elementName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="plaintext"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="pre"), label=None)])), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=elementName, selectors=[], type_arguments=None), label=None) return[member[.elementName]] end[}] END[}]
Keyword[static] identifier[String] identifier[safeName] operator[SEP] identifier[String] identifier[unsafeElementName] operator[SEP] { identifier[String] identifier[elementName] operator[=] identifier[HtmlLexer] operator[SEP] identifier[canonicalName] operator[SEP] identifier[unsafeElementName] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[elementName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] Other[3] operator[:] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[elementName] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] Other[7] operator[:] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[elementName] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] Other[9] operator[:] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[elementName] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[break] operator[SEP] } Keyword[return] identifier[elementName] operator[SEP] }
protected void storeSnapshotProps(String spaceId, String serializedProps) { InputStream propsStream; try { propsStream = IOUtil.writeStringToStream(serializedProps); } catch (IOException e) { throw new TaskException("Unable to build stream from serialized " + "snapshot properties due to: " + e.getMessage()); } ChecksumUtil checksumUtil = new ChecksumUtil(ChecksumUtil.Algorithm.MD5); String propsChecksum = checksumUtil.generateChecksum(serializedProps); snapshotProvider.addContent(spaceId, Constants.SNAPSHOT_PROPS_FILENAME, "text/x-java-properties", null, // Ensures that length is based on UTF-8 encoded bytes serializedProps.getBytes(StandardCharsets.UTF_8).length, propsChecksum, propsStream); }
class class_name[name] begin[{] method[storeSnapshotProps, return_type[void], modifier[protected], parameter[spaceId, serializedProps]] begin[{] local_variable[type[InputStream], propsStream] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=propsStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=serializedProps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeStringToStream, postfix_operators=[], prefix_operators=[], qualifier=IOUtil, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to build stream from serialized "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="snapshot properties due to: "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TaskException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) local_variable[type[ChecksumUtil], checksumUtil] local_variable[type[String], propsChecksum] call[snapshotProvider.addContent, parameter[member[.spaceId], member[Constants.SNAPSHOT_PROPS_FILENAME], literal["text/x-java-properties"], literal[null], call[serializedProps.getBytes, parameter[member[StandardCharsets.UTF_8]]], member[.propsChecksum], member[.propsStream]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[storeSnapshotProps] operator[SEP] identifier[String] identifier[spaceId] , identifier[String] identifier[serializedProps] operator[SEP] { identifier[InputStream] identifier[propsStream] operator[SEP] Keyword[try] { identifier[propsStream] operator[=] identifier[IOUtil] operator[SEP] identifier[writeStringToStream] operator[SEP] identifier[serializedProps] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[TaskException] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ChecksumUtil] identifier[checksumUtil] operator[=] Keyword[new] identifier[ChecksumUtil] operator[SEP] identifier[ChecksumUtil] operator[SEP] identifier[Algorithm] operator[SEP] identifier[MD5] operator[SEP] operator[SEP] identifier[String] identifier[propsChecksum] operator[=] identifier[checksumUtil] operator[SEP] identifier[generateChecksum] operator[SEP] identifier[serializedProps] operator[SEP] operator[SEP] identifier[snapshotProvider] operator[SEP] identifier[addContent] operator[SEP] identifier[spaceId] , identifier[Constants] operator[SEP] identifier[SNAPSHOT_PROPS_FILENAME] , literal[String] , Other[null] , identifier[serializedProps] operator[SEP] identifier[getBytes] operator[SEP] identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] identifier[length] , identifier[propsChecksum] , identifier[propsStream] operator[SEP] operator[SEP] }
@Override public CommerceAvailabilityEstimate[] findByGroupId_PrevAndNext( long commerceAvailabilityEstimateId, long groupId, OrderByComparator<CommerceAvailabilityEstimate> orderByComparator) throws NoSuchAvailabilityEstimateException { CommerceAvailabilityEstimate commerceAvailabilityEstimate = findByPrimaryKey(commerceAvailabilityEstimateId); Session session = null; try { session = openSession(); CommerceAvailabilityEstimate[] array = new CommerceAvailabilityEstimateImpl[3]; array[0] = getByGroupId_PrevAndNext(session, commerceAvailabilityEstimate, groupId, orderByComparator, true); array[1] = commerceAvailabilityEstimate; array[2] = getByGroupId_PrevAndNext(session, commerceAvailabilityEstimate, groupId, orderByComparator, false); return array; } catch (Exception e) { throw processException(e); } finally { closeSession(session); } }
class class_name[name] begin[{] method[findByGroupId_PrevAndNext, return_type[type[CommerceAvailabilityEstimate]], modifier[public], parameter[commerceAvailabilityEstimateId, groupId, orderByComparator]] begin[{] local_variable[type[CommerceAvailabilityEstimate], commerceAvailabilityEstimate] local_variable[type[Session], session] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommerceAvailabilityEstimateImpl, sub_type=None)), name=array)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=CommerceAvailabilityEstimate, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=commerceAvailabilityEstimate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orderByComparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getByGroupId_PrevAndNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=MemberReference(member=commerceAvailabilityEstimate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), type==, value=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=commerceAvailabilityEstimate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=groupId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orderByComparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getByGroupId_PrevAndNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, 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=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CommerceAvailabilityEstimate] operator[SEP] operator[SEP] identifier[findByGroupId_PrevAndNext] operator[SEP] Keyword[long] identifier[commerceAvailabilityEstimateId] , Keyword[long] identifier[groupId] , identifier[OrderByComparator] operator[<] identifier[CommerceAvailabilityEstimate] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[NoSuchAvailabilityEstimateException] { identifier[CommerceAvailabilityEstimate] identifier[commerceAvailabilityEstimate] operator[=] identifier[findByPrimaryKey] operator[SEP] identifier[commerceAvailabilityEstimateId] operator[SEP] operator[SEP] identifier[Session] identifier[session] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[session] operator[=] identifier[openSession] operator[SEP] operator[SEP] operator[SEP] identifier[CommerceAvailabilityEstimate] operator[SEP] operator[SEP] identifier[array] operator[=] Keyword[new] identifier[CommerceAvailabilityEstimateImpl] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[array] operator[SEP] Other[0] operator[SEP] operator[=] identifier[getByGroupId_PrevAndNext] operator[SEP] identifier[session] , identifier[commerceAvailabilityEstimate] , identifier[groupId] , identifier[orderByComparator] , literal[boolean] operator[SEP] operator[SEP] identifier[array] operator[SEP] Other[1] operator[SEP] operator[=] identifier[commerceAvailabilityEstimate] operator[SEP] identifier[array] operator[SEP] Other[2] operator[SEP] operator[=] identifier[getByGroupId_PrevAndNext] operator[SEP] identifier[session] , identifier[commerceAvailabilityEstimate] , identifier[groupId] , identifier[orderByComparator] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[array] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] identifier[processException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeSession] operator[SEP] identifier[session] operator[SEP] operator[SEP] } }
public static void setNestedSerializersSnapshots( CompositeTypeSerializerSnapshot<?, ?> compositeSnapshot, TypeSerializerSnapshot<?>... nestedSnapshots) { NestedSerializersSnapshotDelegate delegate = new NestedSerializersSnapshotDelegate(nestedSnapshots); compositeSnapshot.setNestedSerializersSnapshotDelegate(delegate); }
class class_name[name] begin[{] method[setNestedSerializersSnapshots, return_type[void], modifier[public static], parameter[compositeSnapshot, nestedSnapshots]] begin[{] local_variable[type[NestedSerializersSnapshotDelegate], delegate] call[compositeSnapshot.setNestedSerializersSnapshotDelegate, parameter[member[.delegate]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setNestedSerializersSnapshots] operator[SEP] identifier[CompositeTypeSerializerSnapshot] operator[<] operator[?] , operator[?] operator[>] identifier[compositeSnapshot] , identifier[TypeSerializerSnapshot] operator[<] operator[?] operator[>] operator[...] identifier[nestedSnapshots] operator[SEP] { identifier[NestedSerializersSnapshotDelegate] identifier[delegate] operator[=] Keyword[new] identifier[NestedSerializersSnapshotDelegate] operator[SEP] identifier[nestedSnapshots] operator[SEP] operator[SEP] identifier[compositeSnapshot] operator[SEP] identifier[setNestedSerializersSnapshotDelegate] operator[SEP] identifier[delegate] operator[SEP] operator[SEP] }
public boolean canAddChildNode(String childNodeName) { try { InternalQName cname = locationFactory.parseJCRName(childNodeName).getInternalName(); NodeDefinitionData childNodeDef = nodeTypeDataManager.getChildNodeDefinition(cname, nodeTypeData.getName()); return !(childNodeDef == null || childNodeDef.isProtected() || childNodeDef.getDefaultPrimaryType() == null); } catch (RepositoryException e) { LOG.error("canAddChildNode " + e, e); return false; } }
class class_name[name] begin[{] method[canAddChildNode, return_type[type[boolean]], modifier[public], parameter[childNodeName]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=childNodeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseJCRName, postfix_operators=[], prefix_operators=[], qualifier=locationFactory, selectors=[MethodInvocation(arguments=[], member=getInternalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=cname)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InternalQName, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=cname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=nodeTypeData, selectors=[], type_arguments=None)], member=getChildNodeDefinition, postfix_operators=[], prefix_operators=[], qualifier=nodeTypeDataManager, selectors=[], type_arguments=None), name=childNodeDef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeDefinitionData, sub_type=None)), ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=childNodeDef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=isProtected, postfix_operators=[], prefix_operators=[], qualifier=childNodeDef, selectors=[], type_arguments=None), operator=||), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDefaultPrimaryType, postfix_operators=[], prefix_operators=[], qualifier=childNodeDef, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=||), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="canAddChildNode "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RepositoryException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[boolean] identifier[canAddChildNode] operator[SEP] identifier[String] identifier[childNodeName] operator[SEP] { Keyword[try] { identifier[InternalQName] identifier[cname] operator[=] identifier[locationFactory] operator[SEP] identifier[parseJCRName] operator[SEP] identifier[childNodeName] operator[SEP] operator[SEP] identifier[getInternalName] operator[SEP] operator[SEP] operator[SEP] identifier[NodeDefinitionData] identifier[childNodeDef] operator[=] identifier[nodeTypeDataManager] operator[SEP] identifier[getChildNodeDefinition] operator[SEP] identifier[cname] , identifier[nodeTypeData] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[!] operator[SEP] identifier[childNodeDef] operator[==] Other[null] operator[||] identifier[childNodeDef] operator[SEP] identifier[isProtected] operator[SEP] operator[SEP] operator[||] identifier[childNodeDef] operator[SEP] identifier[getDefaultPrimaryType] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RepositoryException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[e] , identifier[e] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } }
@SuppressWarnings("unchecked") private <T> T getPropertyAs(String propertyName, Class<T> propertyType) { final String sValue = properties == null ? null : properties.getProperty(propertyName); final T value; if (sValue == null) { value = null; } else if (propertyType.equals(String.class)) { value = propertyType.cast(sValue); } else if (propertyType.equals(Integer.class)) { value = propertyType.cast(Integer.valueOf(sValue)); } else if (propertyType.equals(int.class)) { value = (T) Integer.valueOf(sValue); } else if (propertyType.equals(Long.class)) { value = propertyType.cast(Long.valueOf(sValue)); } else if (propertyType.equals(long.class)) { value = (T) Long.valueOf(sValue); } else if (propertyType.equals(Boolean.class)) { value = propertyType.cast(Boolean.valueOf(sValue)); } else if (propertyType.equals(boolean.class)) { value = (T) Boolean.valueOf(sValue); } else { value = null; } return value; }
class class_name[name] begin[{] method[getPropertyAs, return_type[type[T]], modifier[private], parameter[propertyName, propertyType]] begin[{] local_variable[type[String], sValue] local_variable[type[T], value] if[binary_operation[member[.sValue], ==, literal[null]]] begin[{] assign[member[.value], literal[null]] else begin[{] if[call[propertyType.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]] begin[{] assign[member[.value], call[propertyType.cast, parameter[member[.sValue]]]] else begin[{] if[call[propertyType.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]] begin[{] assign[member[.value], call[propertyType.cast, parameter[call[Integer.valueOf, parameter[member[.sValue]]]]]] else begin[{] if[call[propertyType.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int))]]] begin[{] assign[member[.value], Cast(expression=MethodInvocation(arguments=[MemberReference(member=sValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] else begin[{] if[call[propertyType.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]] begin[{] assign[member[.value], call[propertyType.cast, parameter[call[Long.valueOf, parameter[member[.sValue]]]]]] else begin[{] if[call[propertyType.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=long))]]] begin[{] assign[member[.value], Cast(expression=MethodInvocation(arguments=[MemberReference(member=sValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] else begin[{] if[call[propertyType.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))]]] begin[{] assign[member[.value], call[propertyType.cast, parameter[call[Boolean.valueOf, parameter[member[.sValue]]]]]] else begin[{] if[call[propertyType.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=boolean))]]] begin[{] assign[member[.value], Cast(expression=MethodInvocation(arguments=[MemberReference(member=sValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] else begin[{] assign[member[.value], literal[null]] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] return[member[.value]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] operator[<] identifier[T] operator[>] identifier[T] identifier[getPropertyAs] operator[SEP] identifier[String] identifier[propertyName] , identifier[Class] operator[<] identifier[T] operator[>] identifier[propertyType] operator[SEP] { Keyword[final] identifier[String] identifier[sValue] operator[=] identifier[properties] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] Keyword[final] identifier[T] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[sValue] operator[==] Other[null] operator[SEP] { identifier[value] operator[=] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[propertyType] operator[SEP] identifier[equals] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[propertyType] operator[SEP] identifier[cast] operator[SEP] identifier[sValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[propertyType] operator[SEP] identifier[equals] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[propertyType] operator[SEP] identifier[cast] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[sValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[propertyType] operator[SEP] identifier[equals] operator[SEP] Keyword[int] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[value] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[sValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[propertyType] operator[SEP] identifier[equals] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[propertyType] operator[SEP] identifier[cast] operator[SEP] identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[sValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[propertyType] operator[SEP] identifier[equals] operator[SEP] Keyword[long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[value] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[sValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[propertyType] operator[SEP] identifier[equals] operator[SEP] identifier[Boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[value] operator[=] identifier[propertyType] operator[SEP] identifier[cast] operator[SEP] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[sValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[propertyType] operator[SEP] identifier[equals] operator[SEP] Keyword[boolean] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[value] operator[=] operator[SEP] identifier[T] operator[SEP] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[sValue] operator[SEP] operator[SEP] } Keyword[else] { identifier[value] operator[=] Other[null] operator[SEP] } Keyword[return] identifier[value] operator[SEP] }
public static String[] intersect( Comparator<? super String> comparator, String[] first, String[] second) { List<String> result = new ArrayList<>(); for (String a : first) { for (String b : second) { if (comparator.compare(a, b) == 0) { result.add(a); break; } } } return result.toArray(new String[0]); }
class class_name[name] begin[{] method[intersect, return_type[type[String]], modifier[public static], parameter[comparator, first, second]] begin[{] local_variable[type[List], result] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compare, postfix_operators=[], prefix_operators=[], qualifier=comparator, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=second, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=b)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=a)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[result.toArray, parameter[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[intersect] operator[SEP] identifier[Comparator] operator[<] operator[?] Keyword[super] identifier[String] operator[>] identifier[comparator] , identifier[String] operator[SEP] operator[SEP] identifier[first] , identifier[String] operator[SEP] operator[SEP] identifier[second] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[a] operator[:] identifier[first] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[b] operator[:] identifier[second] operator[SEP] { Keyword[if] operator[SEP] identifier[comparator] operator[SEP] identifier[compare] operator[SEP] identifier[a] , identifier[b] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[a] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } } Keyword[return] identifier[result] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] }
public TypeUsage.Builder mapEnd(IntUnaryOperator mapper) { Objects.requireNonNull(mapper); return end(mapper.applyAsInt(end())); }
class class_name[name] begin[{] method[mapEnd, return_type[type[TypeUsage]], modifier[public], parameter[mapper]] begin[{] call[Objects.requireNonNull, parameter[member[.mapper]]] return[call[.end, parameter[call[mapper.applyAsInt, parameter[call[.end, parameter[]]]]]]] end[}] END[}]
Keyword[public] identifier[TypeUsage] operator[SEP] identifier[Builder] identifier[mapEnd] operator[SEP] identifier[IntUnaryOperator] identifier[mapper] operator[SEP] { identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[mapper] operator[SEP] operator[SEP] Keyword[return] identifier[end] operator[SEP] identifier[mapper] operator[SEP] identifier[applyAsInt] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public EList<IfcRelFillsElement> getHasFillings() { return (EList<IfcRelFillsElement>) eGet(Ifc2x3tc1Package.Literals.IFC_OPENING_ELEMENT__HAS_FILLINGS, true); }
class class_name[name] begin[{] method[getHasFillings, return_type[type[EList]], modifier[public], parameter[]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=IFC_OPENING_ELEMENT__HAS_FILLINGS, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IfcRelFillsElement, sub_type=None))], dimensions=[], name=EList, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[EList] operator[<] identifier[IfcRelFillsElement] operator[>] identifier[getHasFillings] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[IfcRelFillsElement] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[Literals] operator[SEP] identifier[IFC_OPENING_ELEMENT__HAS_FILLINGS] , literal[boolean] operator[SEP] operator[SEP] }
private int[] changeColor() { int[] changedPixels = new int[pixels.length]; double frequenz = 2 * Math.PI / 1020; for (int i = 0; i < pixels.length; i++) { int argb = pixels[i]; int a = (argb >> 24) & 0xff; int r = (argb >> 16) & 0xff; int g = (argb >> 8) & 0xff; int b = argb & 0xff; r = (int) (255 * Math.sin(frequenz * r)); b = (int) (-255 * Math.cos(frequenz * b) + 255); changedPixels[i] = (a << 24) | (r << 16) | (g << 8) | b; } return changedPixels; }
class class_name[name] begin[{] method[changeColor, return_type[type[int]], modifier[private], parameter[]] begin[{] local_variable[type[int], changedPixels] local_variable[type[double], frequenz] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=pixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=argb)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=argb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=a)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=argb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=r)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=argb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=g)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=argb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff), operator=&), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=frequenz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=sin, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operator=*), type=BasicType(dimensions=[], name=int))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=255), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=frequenz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=cos, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255), operator=+), type=BasicType(dimensions=[], name=int))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=changedPixels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=<<), operandr=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=<<), operator=|), operandr=BinaryOperation(operandl=MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operator=|), operandr=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=pixels, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.changedPixels]] end[}] END[}]
Keyword[private] Keyword[int] operator[SEP] operator[SEP] identifier[changeColor] operator[SEP] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[changedPixels] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[pixels] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[double] identifier[frequenz] operator[=] Other[2] operator[*] identifier[Math] operator[SEP] identifier[PI] operator[/] Other[1020] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[pixels] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[argb] operator[=] identifier[pixels] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[a] operator[=] operator[SEP] identifier[argb] operator[>] operator[>] Other[24] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[int] identifier[r] operator[=] operator[SEP] identifier[argb] operator[>] operator[>] Other[16] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[int] identifier[g] operator[=] operator[SEP] identifier[argb] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[int] identifier[b] operator[=] identifier[argb] operator[&] literal[Integer] operator[SEP] identifier[r] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] Other[255] operator[*] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[frequenz] operator[*] identifier[r] operator[SEP] operator[SEP] operator[SEP] identifier[b] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[-] Other[255] operator[*] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[frequenz] operator[*] identifier[b] operator[SEP] operator[+] Other[255] operator[SEP] operator[SEP] identifier[changedPixels] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[a] operator[<<] Other[24] operator[SEP] operator[|] operator[SEP] identifier[r] operator[<<] Other[16] operator[SEP] operator[|] operator[SEP] identifier[g] operator[<<] Other[8] operator[SEP] operator[|] identifier[b] operator[SEP] } Keyword[return] identifier[changedPixels] operator[SEP] }
public String[] partOfSpeechTag(List<String> wordList) { if (posTagger == null) { throw new IllegalStateException("未提供词性标注模型"); } return tag(wordList); }
class class_name[name] begin[{] method[partOfSpeechTag, return_type[type[String]], modifier[public], parameter[wordList]] begin[{] if[binary_operation[member[.posTagger], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="未提供词性标注模型")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] return[call[.tag, parameter[member[.wordList]]]] end[}] END[}]
Keyword[public] identifier[String] operator[SEP] operator[SEP] identifier[partOfSpeechTag] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[wordList] operator[SEP] { Keyword[if] operator[SEP] identifier[posTagger] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[tag] operator[SEP] identifier[wordList] operator[SEP] operator[SEP] }
List<JcError> store(Map<Long, Integer> elementVersionsMap) { List<JcError> ret = null; ITransaction txToClose = null; try { if (isModified()) { txToClose = this.resultHandler.createLockingTxIfNeeded(); ret = this.resultHandler.store(elementVersionsMap); } else ret = Collections.emptyList(); } finally { if (txToClose != null) { // we have created the transaction if (ret == null) ret = new ArrayList<JcError>(); ret.addAll(txToClose.close()); } } return ret; }
class class_name[name] begin[{] method[store, return_type[type[List]], modifier[default], parameter[elementVersionsMap]] begin[{] local_variable[type[List], ret] local_variable[type[ITransaction], txToClose] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isModified, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=emptyList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=txToClose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=resultHandler, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=createLockingTxIfNeeded, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=resultHandler, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=elementVersionsMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=store, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]))], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=txToClose, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JcError, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=txToClose, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) return[member[.ret]] end[}] END[}]
identifier[List] operator[<] identifier[JcError] operator[>] identifier[store] operator[SEP] identifier[Map] operator[<] identifier[Long] , identifier[Integer] operator[>] identifier[elementVersionsMap] operator[SEP] { identifier[List] operator[<] identifier[JcError] operator[>] identifier[ret] operator[=] Other[null] operator[SEP] identifier[ITransaction] identifier[txToClose] operator[=] Other[null] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[isModified] operator[SEP] operator[SEP] operator[SEP] { identifier[txToClose] operator[=] Keyword[this] operator[SEP] identifier[resultHandler] operator[SEP] identifier[createLockingTxIfNeeded] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[=] Keyword[this] operator[SEP] identifier[resultHandler] operator[SEP] identifier[store] operator[SEP] identifier[elementVersionsMap] operator[SEP] operator[SEP] } Keyword[else] identifier[ret] operator[=] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[txToClose] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[ret] operator[==] Other[null] operator[SEP] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[JcError] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[SEP] identifier[addAll] operator[SEP] identifier[txToClose] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[ret] operator[SEP] }
public static INDArray ceiling(INDArray ndArray, boolean copyOnOps) { return exec(copyOnOps ? new Ceil(ndArray, ndArray.dup()) : new Ceil(ndArray, ndArray)); }
class class_name[name] begin[{] method[ceiling, return_type[type[INDArray]], modifier[public static], parameter[ndArray, copyOnOps]] begin[{] return[call[.exec, parameter[TernaryExpression(condition=MemberReference(member=copyOnOps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=ClassCreator(arguments=[MemberReference(member=ndArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ndArray, 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=Ceil, sub_type=None)), if_true=ClassCreator(arguments=[MemberReference(member=ndArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=dup, postfix_operators=[], prefix_operators=[], qualifier=ndArray, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Ceil, sub_type=None)))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[INDArray] identifier[ceiling] operator[SEP] identifier[INDArray] identifier[ndArray] , Keyword[boolean] identifier[copyOnOps] operator[SEP] { Keyword[return] identifier[exec] operator[SEP] identifier[copyOnOps] operator[?] Keyword[new] identifier[Ceil] operator[SEP] identifier[ndArray] , identifier[ndArray] operator[SEP] identifier[dup] operator[SEP] operator[SEP] operator[SEP] operator[:] Keyword[new] identifier[Ceil] operator[SEP] identifier[ndArray] , identifier[ndArray] operator[SEP] operator[SEP] operator[SEP] }
public T headersSanitizer(Function<? super HttpHeaders, ? extends HttpHeaders> headersSanitizer) { requireNonNull(headersSanitizer, "headersSanitizer"); requestHeadersSanitizer(headersSanitizer); requestTrailersSanitizer(headersSanitizer); responseHeadersSanitizer(headersSanitizer); responseTrailersSanitizer(headersSanitizer); return self(); }
class class_name[name] begin[{] method[headersSanitizer, return_type[type[T]], modifier[public], parameter[headersSanitizer]] begin[{] call[.requireNonNull, parameter[member[.headersSanitizer], literal["headersSanitizer"]]] call[.requestHeadersSanitizer, parameter[member[.headersSanitizer]]] call[.requestTrailersSanitizer, parameter[member[.headersSanitizer]]] call[.responseHeadersSanitizer, parameter[member[.headersSanitizer]]] call[.responseTrailersSanitizer, parameter[member[.headersSanitizer]]] return[call[.self, parameter[]]] end[}] END[}]
Keyword[public] identifier[T] identifier[headersSanitizer] operator[SEP] identifier[Function] operator[<] operator[?] Keyword[super] identifier[HttpHeaders] , operator[?] Keyword[extends] identifier[HttpHeaders] operator[>] identifier[headersSanitizer] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[headersSanitizer] , literal[String] operator[SEP] operator[SEP] identifier[requestHeadersSanitizer] operator[SEP] identifier[headersSanitizer] operator[SEP] operator[SEP] identifier[requestTrailersSanitizer] operator[SEP] identifier[headersSanitizer] operator[SEP] operator[SEP] identifier[responseHeadersSanitizer] operator[SEP] identifier[headersSanitizer] operator[SEP] operator[SEP] identifier[responseTrailersSanitizer] operator[SEP] identifier[headersSanitizer] operator[SEP] operator[SEP] Keyword[return] identifier[self] operator[SEP] operator[SEP] operator[SEP] }
public static PredicateExpression all(Object... rhs) { PredicateExpression ex = new PredicateExpression( "$all", rhs); if (rhs.length == 1) { ex.single = true; } return ex; }
class class_name[name] begin[{] method[all, return_type[type[PredicateExpression]], modifier[public static], parameter[rhs]] begin[{] local_variable[type[PredicateExpression], ex] if[binary_operation[member[rhs.length], ==, literal[1]]] begin[{] assign[member[ex.single], literal[true]] else begin[{] None end[}] return[member[.ex]] end[}] END[}]
Keyword[public] Keyword[static] identifier[PredicateExpression] identifier[all] operator[SEP] identifier[Object] operator[...] identifier[rhs] operator[SEP] { identifier[PredicateExpression] identifier[ex] operator[=] Keyword[new] identifier[PredicateExpression] operator[SEP] literal[String] , identifier[rhs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rhs] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] { identifier[ex] operator[SEP] identifier[single] operator[=] literal[boolean] operator[SEP] } Keyword[return] identifier[ex] operator[SEP] }
synchronized void startBlinkTimer() { if(blinkTimer != null) { // Already on! return; } blinkTimer = new Timer("LanternaTerminalBlinkTimer", true); blinkTimer.schedule(new TimerTask() { @Override public void run() { blinkOn = !blinkOn; if(hasBlinkingText) { repaint(); } } }, deviceConfiguration.getBlinkLengthInMilliSeconds(), deviceConfiguration.getBlinkLengthInMilliSeconds()); }
class class_name[name] begin[{] method[startBlinkTimer, return_type[void], modifier[synchronized], parameter[]] begin[{] if[binary_operation[member[.blinkTimer], !=, literal[null]]] begin[{] return[None] else begin[{] None end[}] assign[member[.blinkTimer], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="LanternaTerminalBlinkTimer"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Timer, sub_type=None))] call[blinkTimer.schedule, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=blinkOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=blinkOn, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[])), label=None), IfStatement(condition=MemberReference(member=hasBlinkingText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=repaint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TimerTask, sub_type=None)), call[deviceConfiguration.getBlinkLengthInMilliSeconds, parameter[]], call[deviceConfiguration.getBlinkLengthInMilliSeconds, parameter[]]]] end[}] END[}]
Keyword[synchronized] Keyword[void] identifier[startBlinkTimer] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[blinkTimer] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[blinkTimer] operator[=] Keyword[new] identifier[Timer] operator[SEP] literal[String] , literal[boolean] operator[SEP] operator[SEP] identifier[blinkTimer] operator[SEP] identifier[schedule] operator[SEP] Keyword[new] identifier[TimerTask] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[blinkOn] operator[=] operator[!] identifier[blinkOn] operator[SEP] Keyword[if] operator[SEP] identifier[hasBlinkingText] operator[SEP] { identifier[repaint] operator[SEP] operator[SEP] operator[SEP] } } } , identifier[deviceConfiguration] operator[SEP] identifier[getBlinkLengthInMilliSeconds] operator[SEP] operator[SEP] , identifier[deviceConfiguration] operator[SEP] identifier[getBlinkLengthInMilliSeconds] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static ZooFieldDef create(ZooClassDef declaringType, String fieldName, ZooClassDef fieldType, int arrayDim) { String typeName = fieldType.getClassName(); JdoType jdoType; if (arrayDim > 0) { jdoType = JdoType.ARRAY; } else { jdoType = JdoType.REFERENCE; } long fieldOid = declaringType.jdoZooGetNode().getOidBuffer().allocateOid(); ZooFieldDef f = new ZooFieldDef(declaringType, fieldName, typeName, arrayDim, jdoType, fieldOid); return f; }
class class_name[name] begin[{] method[create, return_type[type[ZooFieldDef]], modifier[public static], parameter[declaringType, fieldName, fieldType, arrayDim]] begin[{] local_variable[type[String], typeName] local_variable[type[JdoType], jdoType] if[binary_operation[member[.arrayDim], >, literal[0]]] begin[{] assign[member[.jdoType], member[JdoType.ARRAY]] else begin[{] assign[member[.jdoType], member[JdoType.REFERENCE]] end[}] local_variable[type[long], fieldOid] local_variable[type[ZooFieldDef], f] return[member[.f]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ZooFieldDef] identifier[create] operator[SEP] identifier[ZooClassDef] identifier[declaringType] , identifier[String] identifier[fieldName] , identifier[ZooClassDef] identifier[fieldType] , Keyword[int] identifier[arrayDim] operator[SEP] { identifier[String] identifier[typeName] operator[=] identifier[fieldType] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] identifier[JdoType] identifier[jdoType] operator[SEP] Keyword[if] operator[SEP] identifier[arrayDim] operator[>] Other[0] operator[SEP] { identifier[jdoType] operator[=] identifier[JdoType] operator[SEP] identifier[ARRAY] operator[SEP] } Keyword[else] { identifier[jdoType] operator[=] identifier[JdoType] operator[SEP] identifier[REFERENCE] operator[SEP] } Keyword[long] identifier[fieldOid] operator[=] identifier[declaringType] operator[SEP] identifier[jdoZooGetNode] operator[SEP] operator[SEP] operator[SEP] identifier[getOidBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[allocateOid] operator[SEP] operator[SEP] operator[SEP] identifier[ZooFieldDef] identifier[f] operator[=] Keyword[new] identifier[ZooFieldDef] operator[SEP] identifier[declaringType] , identifier[fieldName] , identifier[typeName] , identifier[arrayDim] , identifier[jdoType] , identifier[fieldOid] operator[SEP] operator[SEP] Keyword[return] identifier[f] operator[SEP] }
public void mapConstraint(Class<? extends Constraint> c, Class<? extends ChocoConstraint> cc) { constraints.put(c, cc); }
class class_name[name] begin[{] method[mapConstraint, return_type[void], modifier[public], parameter[c, cc]] begin[{] call[constraints.put, parameter[member[.c], member[.cc]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[mapConstraint] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Constraint] operator[>] identifier[c] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ChocoConstraint] operator[>] identifier[cc] operator[SEP] { identifier[constraints] operator[SEP] identifier[put] operator[SEP] identifier[c] , identifier[cc] operator[SEP] operator[SEP] }
public static Properties readProperties(InputStream _stream) { Properties props = new Properties(); if (_stream == null) { return null; } try { props.load(_stream); return props; } catch (IOException | NumberFormatException _ex) { LOGGER.warn("Could not properties: ", _ex); } return null; }
class class_name[name] begin[{] method[readProperties, return_type[type[Properties]], modifier[public static], parameter[_stream]] begin[{] local_variable[type[Properties], props] if[binary_operation[member[._stream], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=_stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=load, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=props, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not properties: "), MemberReference(member=_ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=_ex, types=['IOException', 'NumberFormatException']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Properties] identifier[readProperties] operator[SEP] identifier[InputStream] identifier[_stream] operator[SEP] { identifier[Properties] identifier[props] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_stream] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[try] { identifier[props] operator[SEP] identifier[load] operator[SEP] identifier[_stream] operator[SEP] operator[SEP] Keyword[return] identifier[props] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] operator[|] identifier[NumberFormatException] identifier[_ex] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[_ex] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public static JFrame run(final JComponent component) { final JFrame frame = new JFrame(); try { frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); component.setOpaque(true); // si opaque false, il y a des pbs de paint frame.setContentPane(component); frame.setTitle(component.getClass().getName()); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } catch (final Exception exception) { exception.printStackTrace(getSystemErrorStream()); // NOPMD } return frame; }
class class_name[name] begin[{] method[run, return_type[type[JFrame]], modifier[public static], parameter[component]] begin[{] local_variable[type[JFrame], frame] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=EXIT_ON_CLOSE, postfix_operators=[], prefix_operators=[], qualifier=WindowConstants, selectors=[])], member=setDefaultCloseOperation, postfix_operators=[], prefix_operators=[], qualifier=frame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setOpaque, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setContentPane, postfix_operators=[], prefix_operators=[], qualifier=frame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=component, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setTitle, postfix_operators=[], prefix_operators=[], qualifier=frame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=pack, postfix_operators=[], prefix_operators=[], qualifier=frame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setLocationRelativeTo, postfix_operators=[], prefix_operators=[], qualifier=frame, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setVisible, postfix_operators=[], prefix_operators=[], qualifier=frame, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSystemErrorStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=exception, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['Exception']))], finally_block=None, label=None, resources=None) return[member[.frame]] end[}] END[}]
Keyword[public] Keyword[static] identifier[JFrame] identifier[run] operator[SEP] Keyword[final] identifier[JComponent] identifier[component] operator[SEP] { Keyword[final] identifier[JFrame] identifier[frame] operator[=] Keyword[new] identifier[JFrame] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[frame] operator[SEP] identifier[setDefaultCloseOperation] operator[SEP] identifier[WindowConstants] operator[SEP] identifier[EXIT_ON_CLOSE] operator[SEP] operator[SEP] identifier[component] operator[SEP] identifier[setOpaque] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[frame] operator[SEP] identifier[setContentPane] operator[SEP] identifier[component] operator[SEP] operator[SEP] identifier[frame] operator[SEP] identifier[setTitle] operator[SEP] identifier[component] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[frame] operator[SEP] identifier[pack] operator[SEP] operator[SEP] operator[SEP] identifier[frame] operator[SEP] identifier[setLocationRelativeTo] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[frame] operator[SEP] identifier[setVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[exception] operator[SEP] { identifier[exception] operator[SEP] identifier[printStackTrace] operator[SEP] identifier[getSystemErrorStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[frame] operator[SEP] }
boolean flush() { if (!dirty) return true; acquireExclusiveLock(); try { final long timer = OProfiler.getInstance().startChrono(); // FORCE THE WRITE OF THE BUFFER for (int i = 0; i < FORCE_RETRY; ++i) { try { buffer.force(); dirty = false; break; } catch (Exception e) { OLogManager.instance().debug(this, "Cannot write memory buffer to disk. Retrying (" + (i + 1) + "/" + FORCE_RETRY + ")..."); OMemoryWatchDog.freeMemory(FORCE_DELAY); } } if (dirty) OLogManager.instance().debug(this, "Cannot commit memory buffer to disk after %d retries", FORCE_RETRY); else OProfiler.getInstance().updateCounter("system.file.mmap.pagesCommitted", 1); OProfiler.getInstance().stopChrono("system.file.mmap.commitPages", timer); return !dirty; } finally { releaseExclusiveLock(); } }
class class_name[name] begin[{] method[flush, return_type[type[boolean]], modifier[default], parameter[]] begin[{] if[member[.dirty]] begin[{] return[literal[true]] else begin[{] None end[}] call[.acquireExclusiveLock, parameter[]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=OProfiler, selectors=[MethodInvocation(arguments=[], member=startChrono, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=timer)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=force, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=dirty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=instance, postfix_operators=[], prefix_operators=[], qualifier=OLogManager, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot write memory buffer to disk. Retrying ("), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=FORCE_RETRY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")..."), operator=+)], member=debug, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FORCE_DELAY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=freeMemory, postfix_operators=[], prefix_operators=[], qualifier=OMemoryWatchDog, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=FORCE_RETRY, 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), IfStatement(condition=MemberReference(member=dirty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=OProfiler, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="system.file.mmap.pagesCommitted"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=updateCounter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[], member=instance, postfix_operators=[], prefix_operators=[], qualifier=OLogManager, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot commit memory buffer to disk after %d retries"), MemberReference(member=FORCE_RETRY, 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)), StatementExpression(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=OProfiler, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="system.file.mmap.commitPages"), MemberReference(member=timer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stopChrono, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=dirty, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=releaseExclusiveLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[boolean] identifier[flush] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[dirty] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[acquireExclusiveLock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] Keyword[long] identifier[timer] operator[=] identifier[OProfiler] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[startChrono] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[FORCE_RETRY] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[try] { identifier[buffer] operator[SEP] identifier[force] operator[SEP] operator[SEP] operator[SEP] identifier[dirty] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[OLogManager] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , literal[String] operator[+] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[+] literal[String] operator[+] identifier[FORCE_RETRY] operator[+] literal[String] operator[SEP] operator[SEP] identifier[OMemoryWatchDog] operator[SEP] identifier[freeMemory] operator[SEP] identifier[FORCE_DELAY] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[dirty] operator[SEP] identifier[OLogManager] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , literal[String] , identifier[FORCE_RETRY] operator[SEP] operator[SEP] Keyword[else] identifier[OProfiler] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[updateCounter] operator[SEP] literal[String] , Other[1] operator[SEP] operator[SEP] identifier[OProfiler] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[stopChrono] operator[SEP] literal[String] , identifier[timer] operator[SEP] operator[SEP] Keyword[return] operator[!] identifier[dirty] operator[SEP] } Keyword[finally] { identifier[releaseExclusiveLock] operator[SEP] operator[SEP] operator[SEP] } }
private void runInitializationStage(Event event) { // Immediate synchronous dispatching of Initialize event try { setOwnerState(OwnerState.INITIALIZING); try { this.eventDispatcher.immediateDispatch(event); } finally { setOwnerState(OwnerState.ALIVE); } this.agentAsEventListener.fireEnqueuedEvents(this); if (this.agentAsEventListener.isKilled.get()) { this.agentAsEventListener.killOwner(InternalEventBusSkill.this); } } catch (Exception e) { // Log the exception final Logging loggingCapacity = getLoggingSkill(); if (loggingCapacity != null) { loggingCapacity.error(Messages.InternalEventBusSkill_3, e); } else { final LogRecord record = new LogRecord(Level.SEVERE, Messages.InternalEventBusSkill_3); this.logger.getKernelLogger().log( this.logger.prepareLogRecord(record, this.logger.getKernelLogger().getName(), Throwables.getRootCause(e))); } // If we have an exception within the agent's initialization, we kill the agent. setOwnerState(OwnerState.ALIVE); // Asynchronous kill of the event. this.agentAsEventListener.killOrMarkAsKilled(); } }
class class_name[name] begin[{] method[runInitializationStage, return_type[void], modifier[private], parameter[event]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INITIALIZING, postfix_operators=[], prefix_operators=[], qualifier=OwnerState, selectors=[])], member=setOwnerState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=eventDispatcher, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=immediateDispatch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ALIVE, postfix_operators=[], prefix_operators=[], qualifier=OwnerState, selectors=[])], member=setOwnerState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=agentAsEventListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=fireEnqueuedEvents, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=agentAsEventListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=isKilled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=agentAsEventListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=InternalEventBusSkill, selectors=[])], member=killOwner, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]))], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLoggingSkill, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=loggingCapacity)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Logging, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=loggingCapacity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MemberReference(member=InternalEventBusSkill_3, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LogRecord, sub_type=None)), name=record)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=LogRecord, sub_type=None)), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getKernelLogger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=record, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getKernelLogger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRootCause, postfix_operators=[], prefix_operators=[], qualifier=Throwables, selectors=[], type_arguments=None)], member=prepareLogRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=log, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=InternalEventBusSkill_3, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=loggingCapacity, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ALIVE, postfix_operators=[], prefix_operators=[], qualifier=OwnerState, selectors=[])], member=setOwnerState, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=agentAsEventListener, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=killOrMarkAsKilled, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, 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[private] Keyword[void] identifier[runInitializationStage] operator[SEP] identifier[Event] identifier[event] operator[SEP] { Keyword[try] { identifier[setOwnerState] operator[SEP] identifier[OwnerState] operator[SEP] identifier[INITIALIZING] operator[SEP] operator[SEP] Keyword[try] { Keyword[this] operator[SEP] identifier[eventDispatcher] operator[SEP] identifier[immediateDispatch] operator[SEP] identifier[event] operator[SEP] operator[SEP] } Keyword[finally] { identifier[setOwnerState] operator[SEP] identifier[OwnerState] operator[SEP] identifier[ALIVE] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[agentAsEventListener] operator[SEP] identifier[fireEnqueuedEvents] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[agentAsEventListener] operator[SEP] identifier[isKilled] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[agentAsEventListener] operator[SEP] identifier[killOwner] operator[SEP] identifier[InternalEventBusSkill] operator[SEP] Keyword[this] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[final] identifier[Logging] identifier[loggingCapacity] operator[=] identifier[getLoggingSkill] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[loggingCapacity] operator[!=] Other[null] operator[SEP] { identifier[loggingCapacity] operator[SEP] identifier[error] operator[SEP] identifier[Messages] operator[SEP] identifier[InternalEventBusSkill_3] , identifier[e] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] identifier[LogRecord] identifier[record] operator[=] Keyword[new] identifier[LogRecord] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , identifier[Messages] operator[SEP] identifier[InternalEventBusSkill_3] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[getKernelLogger] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[prepareLogRecord] operator[SEP] identifier[record] , Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[getKernelLogger] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[Throwables] operator[SEP] identifier[getRootCause] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[setOwnerState] operator[SEP] identifier[OwnerState] operator[SEP] identifier[ALIVE] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[agentAsEventListener] operator[SEP] identifier[killOrMarkAsKilled] operator[SEP] operator[SEP] operator[SEP] } }
protected ResourcesModel toResourcesModel(Resource[] resourceAnnotations, KnowledgeNamespace knowledgeNamespace) { if (resourceAnnotations == null || resourceAnnotations.length == 0) { return null; } ResourcesModel resourcesModel = new V1ResourcesModel(knowledgeNamespace.uri()); for (Resource resourceAnnotation : resourceAnnotations) { ResourceModel resourceModel = new V1ResourceModel(knowledgeNamespace.uri()); String location = resourceAnnotation.location(); if (!UNDEFINED.equals(location)) { resourceModel.setLocation(location); } String type = resourceAnnotation.type(); if (!UNDEFINED.equals(type)) { resourceModel.setType(ResourceType.valueOf(type)); } ResourceDetailModel resourceDetailModel = toResourceDetailModel(resourceAnnotation.detail(), knowledgeNamespace); if (resourceDetailModel != null) { resourceModel.setDetail(resourceDetailModel); } resourcesModel.addResource(resourceModel); } return resourcesModel; }
class class_name[name] begin[{] method[toResourcesModel, return_type[type[ResourcesModel]], modifier[protected], parameter[resourceAnnotations, knowledgeNamespace]] begin[{] if[binary_operation[binary_operation[member[.resourceAnnotations], ==, literal[null]], ||, binary_operation[member[resourceAnnotations.length], ==, literal[0]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[ResourcesModel], resourcesModel] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=uri, postfix_operators=[], prefix_operators=[], qualifier=knowledgeNamespace, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=V1ResourceModel, sub_type=None)), name=resourceModel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceModel, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=location, postfix_operators=[], prefix_operators=[], qualifier=resourceAnnotation, selectors=[], type_arguments=None), name=location)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=UNDEFINED, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setLocation, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=resourceAnnotation, selectors=[], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=UNDEFINED, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=ResourceType, selectors=[], type_arguments=None)], member=setType, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=detail, postfix_operators=[], prefix_operators=[], qualifier=resourceAnnotation, selectors=[], type_arguments=None), MemberReference(member=knowledgeNamespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toResourceDetailModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=resourceDetailModel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceDetailModel, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=resourceDetailModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourceDetailModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDetail, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=resourceModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addResource, postfix_operators=[], prefix_operators=[], qualifier=resourcesModel, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=resourceAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=resourceAnnotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Resource, sub_type=None))), label=None) return[member[.resourcesModel]] end[}] END[}]
Keyword[protected] identifier[ResourcesModel] identifier[toResourcesModel] operator[SEP] identifier[Resource] operator[SEP] operator[SEP] identifier[resourceAnnotations] , identifier[KnowledgeNamespace] identifier[knowledgeNamespace] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceAnnotations] operator[==] Other[null] operator[||] identifier[resourceAnnotations] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[ResourcesModel] identifier[resourcesModel] operator[=] Keyword[new] identifier[V1ResourcesModel] operator[SEP] identifier[knowledgeNamespace] operator[SEP] identifier[uri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Resource] identifier[resourceAnnotation] operator[:] identifier[resourceAnnotations] operator[SEP] { identifier[ResourceModel] identifier[resourceModel] operator[=] Keyword[new] identifier[V1ResourceModel] operator[SEP] identifier[knowledgeNamespace] operator[SEP] identifier[uri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[location] operator[=] identifier[resourceAnnotation] operator[SEP] identifier[location] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[UNDEFINED] operator[SEP] identifier[equals] operator[SEP] identifier[location] operator[SEP] operator[SEP] { identifier[resourceModel] operator[SEP] identifier[setLocation] operator[SEP] identifier[location] operator[SEP] operator[SEP] } identifier[String] identifier[type] operator[=] identifier[resourceAnnotation] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[UNDEFINED] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[resourceModel] operator[SEP] identifier[setType] operator[SEP] identifier[ResourceType] operator[SEP] identifier[valueOf] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] } identifier[ResourceDetailModel] identifier[resourceDetailModel] operator[=] identifier[toResourceDetailModel] operator[SEP] identifier[resourceAnnotation] operator[SEP] identifier[detail] operator[SEP] operator[SEP] , identifier[knowledgeNamespace] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resourceDetailModel] operator[!=] Other[null] operator[SEP] { identifier[resourceModel] operator[SEP] identifier[setDetail] operator[SEP] identifier[resourceDetailModel] operator[SEP] operator[SEP] } identifier[resourcesModel] operator[SEP] identifier[addResource] operator[SEP] identifier[resourceModel] operator[SEP] operator[SEP] } Keyword[return] identifier[resourcesModel] operator[SEP] }
@Nullable @Override public DFA<?, I> findCounterExample(DFA<?, I> automaton, Collection<? extends I> inputs, String property) throws ModelCheckingException { final File fsm = findCounterExampleFSM(automaton, inputs, property); try { final CompactDFA<I> result; if (fsm != null) { result = FSM2DFAParser.getParser(inputs, getString2Input(), LABEL_NAME, LABEL_VALUE).readModel(fsm); // check if we must keep the FSM if (!isKeepFiles() && !fsm.delete()) { throw new ModelCheckingException("Could not delete file: " + fsm.getAbsolutePath()); } for (Integer state : result.getStates()) { final boolean deadlocks = result.getInputAlphabet().stream().noneMatch( i -> result.getSuccessor(state, i) != null); result.setAccepting(state, deadlocks); } } else { result = null; } return result; } catch (IOException | FSMParseException e) { throw new ModelCheckingException(e); } }
class class_name[name] begin[{] method[findCounterExample, return_type[type[DFA]], modifier[public], parameter[automaton, inputs, property]] begin[{] local_variable[type[File], fsm] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=result)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=I, sub_type=None))], dimensions=[], name=CompactDFA, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fsm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=inputs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getString2Input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=LABEL_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=LABEL_VALUE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getParser, postfix_operators=[], prefix_operators=[], qualifier=FSM2DFAParser, selectors=[MethodInvocation(arguments=[MemberReference(member=fsm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readModel, 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=isKeepFiles, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=['!'], qualifier=fsm, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not delete file: "), operandr=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=fsm, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModelCheckingException, sub_type=None)), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInputAlphabet, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[], member=stream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[LambdaExpression(body=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSuccessor, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), parameters=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=noneMatch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=deadlocks)], modifiers={'final'}, type=BasicType(dimensions=[], name=boolean)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=deadlocks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAccepting, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getStates, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=state)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))), label=None)])), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModelCheckingException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException', 'FSMParseException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Nullable] annotation[@] identifier[Override] Keyword[public] identifier[DFA] operator[<] operator[?] , identifier[I] operator[>] identifier[findCounterExample] operator[SEP] identifier[DFA] operator[<] operator[?] , identifier[I] operator[>] identifier[automaton] , identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[I] operator[>] identifier[inputs] , identifier[String] identifier[property] operator[SEP] Keyword[throws] identifier[ModelCheckingException] { Keyword[final] identifier[File] identifier[fsm] operator[=] identifier[findCounterExampleFSM] operator[SEP] identifier[automaton] , identifier[inputs] , identifier[property] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[CompactDFA] operator[<] identifier[I] operator[>] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[fsm] operator[!=] Other[null] operator[SEP] { identifier[result] operator[=] identifier[FSM2DFAParser] operator[SEP] identifier[getParser] operator[SEP] identifier[inputs] , identifier[getString2Input] operator[SEP] operator[SEP] , identifier[LABEL_NAME] , identifier[LABEL_VALUE] operator[SEP] operator[SEP] identifier[readModel] operator[SEP] identifier[fsm] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isKeepFiles] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[fsm] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ModelCheckingException] operator[SEP] literal[String] operator[+] identifier[fsm] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Integer] identifier[state] operator[:] identifier[result] operator[SEP] identifier[getStates] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[boolean] identifier[deadlocks] operator[=] identifier[result] operator[SEP] identifier[getInputAlphabet] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[noneMatch] operator[SEP] identifier[i] operator[->] identifier[result] operator[SEP] identifier[getSuccessor] operator[SEP] identifier[state] , identifier[i] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setAccepting] operator[SEP] identifier[state] , identifier[deadlocks] operator[SEP] operator[SEP] } } Keyword[else] { identifier[result] operator[=] Other[null] operator[SEP] } Keyword[return] identifier[result] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] operator[|] identifier[FSMParseException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ModelCheckingException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public int getIfdCount() { int c = 0; if (metadata != null && metadata.contains("IFD")) c = getMetadataList("IFD").size(); return c; }
class class_name[name] begin[{] method[getIfdCount, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[int], c] if[binary_operation[binary_operation[member[.metadata], !=, literal[null]], &&, call[metadata.contains, parameter[literal["IFD"]]]]] begin[{] assign[member[.c], call[.getMetadataList, parameter[literal["IFD"]]]] else begin[{] None end[}] return[member[.c]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getIfdCount] operator[SEP] operator[SEP] { Keyword[int] identifier[c] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[metadata] operator[!=] Other[null] operator[&&] identifier[metadata] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[getMetadataList] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[c] operator[SEP] }
public static GISModel trainModel(EventStream eventStream, int iterations, int cutoff, boolean smoothing,boolean printMessagesWhileTraining) { GISTrainer trainer = new GISTrainer(printMessagesWhileTraining); trainer.setSmoothing(smoothing); trainer.setSmoothingObservation(SMOOTHING_OBSERVATION); return trainer.trainModel(eventStream, iterations, cutoff); }
class class_name[name] begin[{] method[trainModel, return_type[type[GISModel]], modifier[public static], parameter[eventStream, iterations, cutoff, smoothing, printMessagesWhileTraining]] begin[{] local_variable[type[GISTrainer], trainer] call[trainer.setSmoothing, parameter[member[.smoothing]]] call[trainer.setSmoothingObservation, parameter[member[.SMOOTHING_OBSERVATION]]] return[call[trainer.trainModel, parameter[member[.eventStream], member[.iterations], member[.cutoff]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[GISModel] identifier[trainModel] operator[SEP] identifier[EventStream] identifier[eventStream] , Keyword[int] identifier[iterations] , Keyword[int] identifier[cutoff] , Keyword[boolean] identifier[smoothing] , Keyword[boolean] identifier[printMessagesWhileTraining] operator[SEP] { identifier[GISTrainer] identifier[trainer] operator[=] Keyword[new] identifier[GISTrainer] operator[SEP] identifier[printMessagesWhileTraining] operator[SEP] operator[SEP] identifier[trainer] operator[SEP] identifier[setSmoothing] operator[SEP] identifier[smoothing] operator[SEP] operator[SEP] identifier[trainer] operator[SEP] identifier[setSmoothingObservation] operator[SEP] identifier[SMOOTHING_OBSERVATION] operator[SEP] operator[SEP] Keyword[return] identifier[trainer] operator[SEP] identifier[trainModel] operator[SEP] identifier[eventStream] , identifier[iterations] , identifier[cutoff] operator[SEP] operator[SEP] }
public <T> T getValue(String nameSpace, String cellName, Class<T> cellClass) { Cell cell = getCellByName(nameSpace, cellName); return cell == null ? null : cell.getValue(cellClass); }
class class_name[name] begin[{] method[getValue, return_type[type[T]], modifier[public], parameter[nameSpace, cellName, cellClass]] begin[{] local_variable[type[Cell], cell] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cell, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=cellClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=cell, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[getValue] operator[SEP] identifier[String] identifier[nameSpace] , identifier[String] identifier[cellName] , identifier[Class] operator[<] identifier[T] operator[>] identifier[cellClass] operator[SEP] { identifier[Cell] identifier[cell] operator[=] identifier[getCellByName] operator[SEP] identifier[nameSpace] , identifier[cellName] operator[SEP] operator[SEP] Keyword[return] identifier[cell] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[cell] operator[SEP] identifier[getValue] operator[SEP] identifier[cellClass] operator[SEP] operator[SEP] }
private void remove(PollController conn) { if (conn == null) { return; } JniSocketImpl socket = (JniSocketImpl) conn.getSocket(); int nativeFd = socket.getNativeFd(); if (_lifecycle.isDestroyed()) { return; } _activeCount.incrementAndGet(); if (nativeFd > 0) { try { removeNative(_fd, nativeFd); } catch (Throwable e) { log.log(Level.WARNING, e.toString(), e); _lifecycle.toError(); } } conn.toKeepaliveClose(); if (_activeCount.decrementAndGet() == 0 && _lifecycle.isDestroyed()) { destroy(); } }
class class_name[name] begin[{] method[remove, return_type[void], modifier[private], parameter[conn]] begin[{] if[binary_operation[member[.conn], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[JniSocketImpl], socket] local_variable[type[int], nativeFd] if[call[_lifecycle.isDestroyed, parameter[]]] begin[{] return[None] else begin[{] None end[}] call[_activeCount.incrementAndGet, parameter[]] if[binary_operation[member[.nativeFd], >, literal[0]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=_fd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nativeFd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeNative, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=toError, postfix_operators=[], prefix_operators=[], qualifier=_lifecycle, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] call[conn.toKeepaliveClose, parameter[]] if[binary_operation[binary_operation[call[_activeCount.decrementAndGet, parameter[]], ==, literal[0]], &&, call[_lifecycle.isDestroyed, parameter[]]]] begin[{] call[.destroy, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[remove] operator[SEP] identifier[PollController] identifier[conn] operator[SEP] { Keyword[if] operator[SEP] identifier[conn] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[JniSocketImpl] identifier[socket] operator[=] operator[SEP] identifier[JniSocketImpl] operator[SEP] identifier[conn] operator[SEP] identifier[getSocket] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[nativeFd] operator[=] identifier[socket] operator[SEP] identifier[getNativeFd] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_lifecycle] operator[SEP] identifier[isDestroyed] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[_activeCount] operator[SEP] identifier[incrementAndGet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nativeFd] operator[>] Other[0] operator[SEP] { Keyword[try] { identifier[removeNative] operator[SEP] identifier[_fd] , identifier[nativeFd] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[_lifecycle] operator[SEP] identifier[toError] operator[SEP] operator[SEP] operator[SEP] } } identifier[conn] operator[SEP] identifier[toKeepaliveClose] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_activeCount] operator[SEP] identifier[decrementAndGet] operator[SEP] operator[SEP] operator[==] Other[0] operator[&&] identifier[_lifecycle] operator[SEP] identifier[isDestroyed] operator[SEP] operator[SEP] operator[SEP] { identifier[destroy] operator[SEP] operator[SEP] operator[SEP] } }
private <T> void checkFormat(Collection<T> c) { Class<?> type = null; List<Class<?>> typeList = new ArrayList<Class<?>>(); Iterator<T> it = c.iterator(); while (it.hasNext()) { Object o = it.next(); // check the input types for 1-dimension if (type != null && !type.equals(o.getClass())) { throw new RuntimeException("elements of input list should have the same type"); } else { type = o.getClass(); } // check the input types for 2-dimension array if (typeList.size() == 0 && o.getClass().isArray()) { for (Object s : (Object[]) o) { typeList.add(s.getClass()); } } else if (o.getClass().isArray()) { int index = 0; if (((Object[]) o).length != typeList.size()) { throw new RuntimeException("elements of input list should have the same size"); } for (Object s : (Object[]) o) { if (!s.getClass().equals(typeList.get(index++))) { throw new RuntimeException("elements of input list should have the same type"); } } } // check the input types for 2-dimension collection if (typeList.size() == 0 && o instanceof Collection) { @SuppressWarnings("unchecked") Iterator<Object> tmpIt = ((Collection<Object>) o).iterator(); while (tmpIt.hasNext()) { Object s = tmpIt.next(); typeList.add(s.getClass()); } } else if (o instanceof Collection) { int index = 0; @SuppressWarnings("unchecked") Iterator<Object> tmpIt = ((Collection<Object>) o).iterator(); while (tmpIt.hasNext()) { Object s = tmpIt.next(); if (!s.getClass().equals(typeList.get(index++))) { throw new RuntimeException("elements of input list should have the same type"); } } if (index != typeList.size()) { throw new RuntimeException("elements of input list should have the same size"); } } } }
class class_name[name] begin[{] method[checkFormat, return_type[void], modifier[private], parameter[c]] begin[{] local_variable[type[Class], type] local_variable[type[List], typeList] local_variable[type[Iterator], it] while[call[it.hasNext, parameter[]]] begin[{] local_variable[type[Object], o] if[binary_operation[binary_operation[member[.type], !=, literal[null]], &&, call[type.equals, parameter[call[o.getClass, parameter[]]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="elements of input list should have the same type")], 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[{] assign[member[.type], call[o.getClass, parameter[]]] end[}] if[binary_operation[binary_operation[call[typeList.size, parameter[]], ==, literal[0]], &&, call[o.getClass, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=typeList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) else begin[{] if[call[o.getClass, parameter[]]] begin[{] local_variable[type[int], index] if[binary_operation[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), !=, call[typeList.size, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="elements of input list should have the same size")], 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[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=['!'], qualifier=s, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=typeList, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="elements of input list should have the same type")], 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)]))]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=Object, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) else begin[{] None end[}] end[}] if[binary_operation[binary_operation[call[typeList.size, parameter[]], ==, literal[0]], &&, binary_operation[member[.o], instanceof, type[Collection]]]] begin[{] local_variable[type[Iterator], tmpIt] while[call[tmpIt.hasNext, parameter[]]] begin[{] local_variable[type[Object], s] call[typeList.add, parameter[call[s.getClass, parameter[]]]] end[}] else begin[{] if[binary_operation[member[.o], instanceof, type[Collection]]] begin[{] local_variable[type[int], index] local_variable[type[Iterator], tmpIt] while[call[tmpIt.hasNext, parameter[]]] begin[{] local_variable[type[Object], s] if[call[s.getClass, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="elements of input list should have the same type")], 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[}] end[}] if[binary_operation[member[.index], !=, call[typeList.size, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="elements of input list should have the same size")], 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[}] else begin[{] None end[}] end[}] end[}] end[}] END[}]
Keyword[private] operator[<] identifier[T] operator[>] Keyword[void] identifier[checkFormat] operator[SEP] identifier[Collection] operator[<] identifier[T] operator[>] identifier[c] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[typeList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[T] operator[>] identifier[it] operator[=] identifier[c] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[o] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[!=] Other[null] operator[&&] operator[!] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[o] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[type] operator[=] identifier[o] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[typeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[&&] identifier[o] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Object] identifier[s] operator[:] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[o] operator[SEP] { identifier[typeList] operator[SEP] identifier[add] operator[SEP] identifier[s] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[o] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[length] operator[!=] identifier[typeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Object] identifier[s] operator[:] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[o] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[s] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeList] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[typeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[&&] identifier[o] Keyword[instanceof] identifier[Collection] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Iterator] operator[<] identifier[Object] operator[>] identifier[tmpIt] operator[=] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[Object] operator[>] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[tmpIt] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[s] operator[=] identifier[tmpIt] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[typeList] operator[SEP] identifier[add] operator[SEP] identifier[s] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Collection] operator[SEP] { Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Iterator] operator[<] identifier[Object] operator[>] identifier[tmpIt] operator[=] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[Object] operator[>] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[tmpIt] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[s] operator[=] identifier[tmpIt] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[s] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeList] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[++] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[index] operator[!=] identifier[typeList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } } }
public void setAttribute(String name, String value, String facet) throws JspException { if (name != null) { if (name.equals(ACTION) || name.equals(METHOD)) { String s = Bundle.getString("Tags_AttributeMayNotBeSet", new Object[]{name}); registerTagError(s, null); } } super.setAttribute(name, value, facet); }
class class_name[name] begin[{] method[setAttribute, return_type[void], modifier[public], parameter[name, value, facet]] begin[{] if[binary_operation[member[.name], !=, literal[null]]] begin[{] if[binary_operation[call[name.equals, parameter[member[.ACTION]]], ||, call[name.equals, parameter[member[.METHOD]]]]] begin[{] local_variable[type[String], s] call[.registerTagError, parameter[member[.s], literal[null]]] else begin[{] None end[}] else begin[{] None end[}] SuperMethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=facet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setAttribute] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[value] , identifier[String] identifier[facet] operator[SEP] Keyword[throws] identifier[JspException] { Keyword[if] operator[SEP] identifier[name] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[ACTION] operator[SEP] operator[||] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[METHOD] operator[SEP] operator[SEP] { identifier[String] identifier[s] operator[=] identifier[Bundle] operator[SEP] identifier[getString] operator[SEP] literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[name] } operator[SEP] operator[SEP] identifier[registerTagError] operator[SEP] identifier[s] , Other[null] operator[SEP] operator[SEP] } } Keyword[super] operator[SEP] identifier[setAttribute] operator[SEP] identifier[name] , identifier[value] , identifier[facet] operator[SEP] operator[SEP] }
@Override public void evaluate(RDFHandler resultHandler) throws QueryEvaluationException, RDFHandlerException { GraphQueryResult queryResult = evaluate(); if(queryResult.hasNext()) { QueryResults.report(queryResult, resultHandler); } }
class class_name[name] begin[{] method[evaluate, return_type[void], modifier[public], parameter[resultHandler]] begin[{] local_variable[type[GraphQueryResult], queryResult] if[call[queryResult.hasNext, parameter[]]] begin[{] call[QueryResults.report, parameter[member[.queryResult], member[.resultHandler]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[evaluate] operator[SEP] identifier[RDFHandler] identifier[resultHandler] operator[SEP] Keyword[throws] identifier[QueryEvaluationException] , identifier[RDFHandlerException] { identifier[GraphQueryResult] identifier[queryResult] operator[=] identifier[evaluate] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[queryResult] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[QueryResults] operator[SEP] identifier[report] operator[SEP] identifier[queryResult] , identifier[resultHandler] operator[SEP] operator[SEP] } }
public static String computeAttrString( final String attrString, final Map<String, ? extends Object> attributes ) { return computeAttrString( attrString, attributes, true, null ); }
class class_name[name] begin[{] method[computeAttrString, return_type[type[String]], modifier[public static], parameter[attrString, attributes]] begin[{] return[call[.computeAttrString, parameter[member[.attrString], member[.attributes], literal[true], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[computeAttrString] operator[SEP] Keyword[final] identifier[String] identifier[attrString] , Keyword[final] identifier[Map] operator[<] identifier[String] , operator[?] Keyword[extends] identifier[Object] operator[>] identifier[attributes] operator[SEP] { Keyword[return] identifier[computeAttrString] operator[SEP] identifier[attrString] , identifier[attributes] , literal[boolean] , Other[null] operator[SEP] operator[SEP] }
public static ExpectationMaximizationGmm_F64 gaussianMixtureModelEM_F64( int maxIterations, int maxConverge , double convergeTol) { StandardKMeans_F64 kmeans = kMeans_F64(null,maxIterations,maxConverge,convergeTol); SeedFromKMeans_F64 seeds = new SeedFromKMeans_F64(kmeans); return new ExpectationMaximizationGmm_F64(maxIterations,convergeTol,seeds); }
class class_name[name] begin[{] method[gaussianMixtureModelEM_F64, return_type[type[ExpectationMaximizationGmm_F64]], modifier[public static], parameter[maxIterations, maxConverge, convergeTol]] begin[{] local_variable[type[StandardKMeans_F64], kmeans] local_variable[type[SeedFromKMeans_F64], seeds] return[ClassCreator(arguments=[MemberReference(member=maxIterations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=convergeTol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=seeds, 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=ExpectationMaximizationGmm_F64, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ExpectationMaximizationGmm_F64] identifier[gaussianMixtureModelEM_F64] operator[SEP] Keyword[int] identifier[maxIterations] , Keyword[int] identifier[maxConverge] , Keyword[double] identifier[convergeTol] operator[SEP] { identifier[StandardKMeans_F64] identifier[kmeans] operator[=] identifier[kMeans_F64] operator[SEP] Other[null] , identifier[maxIterations] , identifier[maxConverge] , identifier[convergeTol] operator[SEP] operator[SEP] identifier[SeedFromKMeans_F64] identifier[seeds] operator[=] Keyword[new] identifier[SeedFromKMeans_F64] operator[SEP] identifier[kmeans] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ExpectationMaximizationGmm_F64] operator[SEP] identifier[maxIterations] , identifier[convergeTol] , identifier[seeds] operator[SEP] operator[SEP] }
public ModeledUser retrieveSkeletonUser(AuthenticationProvider authenticationProvider, AuthenticatedUser authenticatedUser) throws GuacamoleException { // Set up an empty user model ModeledUser user = getObjectInstance(null, new UserModel(authenticatedUser.getIdentifier())); // Create user object, and configure cyclic reference user.setCurrentUser(new ModeledAuthenticatedUser(authenticatedUser, authenticationProvider, user)); // Return the new user. return user; }
class class_name[name] begin[{] method[retrieveSkeletonUser, return_type[type[ModeledUser]], modifier[public], parameter[authenticationProvider, authenticatedUser]] begin[{] local_variable[type[ModeledUser], user] call[user.setCurrentUser, parameter[ClassCreator(arguments=[MemberReference(member=authenticatedUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=authenticationProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=user, 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=ModeledAuthenticatedUser, sub_type=None))]] return[member[.user]] end[}] END[}]
Keyword[public] identifier[ModeledUser] identifier[retrieveSkeletonUser] operator[SEP] identifier[AuthenticationProvider] identifier[authenticationProvider] , identifier[AuthenticatedUser] identifier[authenticatedUser] operator[SEP] Keyword[throws] identifier[GuacamoleException] { identifier[ModeledUser] identifier[user] operator[=] identifier[getObjectInstance] operator[SEP] Other[null] , Keyword[new] identifier[UserModel] operator[SEP] identifier[authenticatedUser] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setCurrentUser] operator[SEP] Keyword[new] identifier[ModeledAuthenticatedUser] operator[SEP] identifier[authenticatedUser] , identifier[authenticationProvider] , identifier[user] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[user] operator[SEP] }
protected void addAllClassesLink(Content ul) { Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME, contents.allClassesLabel, "", "packageFrame"); Content li = HtmlTree.LI(linkContent); ul.addContent(li); }
class class_name[name] begin[{] method[addAllClassesLink, return_type[void], modifier[protected], parameter[ul]] begin[{] local_variable[type[Content], linkContent] local_variable[type[Content], li] call[ul.addContent, parameter[member[.li]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[addAllClassesLink] operator[SEP] identifier[Content] identifier[ul] operator[SEP] { identifier[Content] identifier[linkContent] operator[=] identifier[getHyperLink] operator[SEP] identifier[DocPaths] operator[SEP] identifier[ALLCLASSES_FRAME] , identifier[contents] operator[SEP] identifier[allClassesLabel] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[Content] identifier[li] operator[=] identifier[HtmlTree] operator[SEP] identifier[LI] operator[SEP] identifier[linkContent] operator[SEP] operator[SEP] identifier[ul] operator[SEP] identifier[addContent] operator[SEP] identifier[li] operator[SEP] operator[SEP] }
private List<Word> getRecognizedWords(int pageIteratorLevel) { List<Word> words = new ArrayList<Word>(); try { TessResultIterator ri = api.TessBaseAPIGetIterator(handle); TessPageIterator pi = api.TessResultIteratorGetPageIterator(ri); api.TessPageIteratorBegin(pi); do { Pointer ptr = api.TessResultIteratorGetUTF8Text(ri, pageIteratorLevel); String text = ptr.getString(0); api.TessDeleteText(ptr); float confidence = api.TessResultIteratorConfidence(ri, pageIteratorLevel); IntBuffer leftB = IntBuffer.allocate(1); IntBuffer topB = IntBuffer.allocate(1); IntBuffer rightB = IntBuffer.allocate(1); IntBuffer bottomB = IntBuffer.allocate(1); api.TessPageIteratorBoundingBox(pi, pageIteratorLevel, leftB, topB, rightB, bottomB); int left = leftB.get(); int top = topB.get(); int right = rightB.get(); int bottom = bottomB.get(); Word word = new Word(text, confidence, new Rectangle(left, top, right - left, bottom - top)); words.add(word); } while (api.TessPageIteratorNext(pi, pageIteratorLevel) == TRUE); } catch (Exception e) { logger.warn(e.getMessage(), e); } return words; }
class class_name[name] begin[{] method[getRecognizedWords, return_type[type[List]], modifier[private], parameter[pageIteratorLevel]] begin[{] local_variable[type[List], words] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=handle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=TessBaseAPIGetIterator, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[], type_arguments=None), name=ri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TessResultIterator, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=TessResultIteratorGetPageIterator, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[], type_arguments=None), name=pi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TessPageIterator, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=TessPageIteratorBegin, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[], type_arguments=None), label=None), DoStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pageIteratorLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=TessResultIteratorGetUTF8Text, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[], type_arguments=None), name=ptr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Pointer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getString, postfix_operators=[], prefix_operators=[], qualifier=ptr, selectors=[], type_arguments=None), name=text)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ptr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=TessDeleteText, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=ri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pageIteratorLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=TessResultIteratorConfidence, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[], type_arguments=None), name=confidence)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=allocate, postfix_operators=[], prefix_operators=[], qualifier=IntBuffer, selectors=[], type_arguments=None), name=leftB)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntBuffer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=allocate, postfix_operators=[], prefix_operators=[], qualifier=IntBuffer, selectors=[], type_arguments=None), name=topB)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntBuffer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=allocate, postfix_operators=[], prefix_operators=[], qualifier=IntBuffer, selectors=[], type_arguments=None), name=rightB)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntBuffer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=allocate, postfix_operators=[], prefix_operators=[], qualifier=IntBuffer, selectors=[], type_arguments=None), name=bottomB)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntBuffer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pageIteratorLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=leftB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rightB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bottomB, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=TessPageIteratorBoundingBox, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=leftB, selectors=[], type_arguments=None), name=left)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=topB, selectors=[], type_arguments=None), name=top)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=rightB, selectors=[], type_arguments=None), name=right)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=bottomB, selectors=[], type_arguments=None), name=bottom)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=confidence, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=top, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), BinaryOperation(operandl=MemberReference(member=bottom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=top, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Word, sub_type=None)), name=word)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Word, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=words, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pageIteratorLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=TessPageIteratorNext, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[], type_arguments=None), operandr=MemberReference(member=TRUE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[member[.words]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[Word] operator[>] identifier[getRecognizedWords] operator[SEP] Keyword[int] identifier[pageIteratorLevel] operator[SEP] { identifier[List] operator[<] identifier[Word] operator[>] identifier[words] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Word] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[TessResultIterator] identifier[ri] operator[=] identifier[api] operator[SEP] identifier[TessBaseAPIGetIterator] operator[SEP] identifier[handle] operator[SEP] operator[SEP] identifier[TessPageIterator] identifier[pi] operator[=] identifier[api] operator[SEP] identifier[TessResultIteratorGetPageIterator] operator[SEP] identifier[ri] operator[SEP] operator[SEP] identifier[api] operator[SEP] identifier[TessPageIteratorBegin] operator[SEP] identifier[pi] operator[SEP] operator[SEP] Keyword[do] { identifier[Pointer] identifier[ptr] operator[=] identifier[api] operator[SEP] identifier[TessResultIteratorGetUTF8Text] operator[SEP] identifier[ri] , identifier[pageIteratorLevel] operator[SEP] operator[SEP] identifier[String] identifier[text] operator[=] identifier[ptr] operator[SEP] identifier[getString] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[api] operator[SEP] identifier[TessDeleteText] operator[SEP] identifier[ptr] operator[SEP] operator[SEP] Keyword[float] identifier[confidence] operator[=] identifier[api] operator[SEP] identifier[TessResultIteratorConfidence] operator[SEP] identifier[ri] , identifier[pageIteratorLevel] operator[SEP] operator[SEP] identifier[IntBuffer] identifier[leftB] operator[=] identifier[IntBuffer] operator[SEP] identifier[allocate] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[IntBuffer] identifier[topB] operator[=] identifier[IntBuffer] operator[SEP] identifier[allocate] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[IntBuffer] identifier[rightB] operator[=] identifier[IntBuffer] operator[SEP] identifier[allocate] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[IntBuffer] identifier[bottomB] operator[=] identifier[IntBuffer] operator[SEP] identifier[allocate] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[api] operator[SEP] identifier[TessPageIteratorBoundingBox] operator[SEP] identifier[pi] , identifier[pageIteratorLevel] , identifier[leftB] , identifier[topB] , identifier[rightB] , identifier[bottomB] operator[SEP] operator[SEP] Keyword[int] identifier[left] operator[=] identifier[leftB] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[top] operator[=] identifier[topB] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[right] operator[=] identifier[rightB] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[bottom] operator[=] identifier[bottomB] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[Word] identifier[word] operator[=] Keyword[new] identifier[Word] operator[SEP] identifier[text] , identifier[confidence] , Keyword[new] identifier[Rectangle] operator[SEP] identifier[left] , identifier[top] , identifier[right] operator[-] identifier[left] , identifier[bottom] operator[-] identifier[top] operator[SEP] operator[SEP] operator[SEP] identifier[words] operator[SEP] identifier[add] operator[SEP] identifier[word] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] identifier[api] operator[SEP] identifier[TessPageIteratorNext] operator[SEP] identifier[pi] , identifier[pageIteratorLevel] operator[SEP] operator[==] identifier[TRUE] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[words] operator[SEP] }
public static String[] split( String str, char separator) { // String.split returns a single empty result for splitting the empty // string. if (str.isEmpty()) { return new String[]{""}; } ArrayList<String> strList = new ArrayList<String>(); int startIndex = 0; int nextIndex = 0; while ((nextIndex = str.indexOf(separator, startIndex)) != -1) { strList.add(str.substring(startIndex, nextIndex)); startIndex = nextIndex + 1; } strList.add(str.substring(startIndex)); // remove trailing empty split(s) int last = strList.size(); // last split while (--last>=0 && "".equals(strList.get(last))) { strList.remove(last); } return strList.toArray(new String[strList.size()]); }
class class_name[name] begin[{] method[split, return_type[type[String]], modifier[public static], parameter[str, separator]] begin[{] if[call[str.isEmpty, parameter[]]] begin[{] return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] else begin[{] None end[}] local_variable[type[ArrayList], strList] local_variable[type[int], startIndex] local_variable[type[int], nextIndex] while[binary_operation[assign[member[.nextIndex], call[str.indexOf, parameter[member[.separator], member[.startIndex]]]], !=, literal[1]]] begin[{] call[strList.add, parameter[call[str.substring, parameter[member[.startIndex], member[.nextIndex]]]]] assign[member[.startIndex], binary_operation[member[.nextIndex], +, literal[1]]] end[}] call[strList.add, parameter[call[str.substring, parameter[member[.startIndex]]]]] local_variable[type[int], last] while[binary_operation[binary_operation[member[.last], >=, literal[0]], &&, literal[""]]] begin[{] call[strList.remove, parameter[member[.last]]] end[}] return[call[strList.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=strList, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[String] identifier[str] , Keyword[char] identifier[separator] operator[SEP] { Keyword[if] operator[SEP] identifier[str] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[String] operator[SEP] operator[SEP] { literal[String] } operator[SEP] } identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[strList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[startIndex] operator[=] Other[0] operator[SEP] Keyword[int] identifier[nextIndex] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[nextIndex] operator[=] identifier[str] operator[SEP] identifier[indexOf] operator[SEP] identifier[separator] , identifier[startIndex] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[strList] operator[SEP] identifier[add] operator[SEP] identifier[str] operator[SEP] identifier[substring] operator[SEP] identifier[startIndex] , identifier[nextIndex] operator[SEP] operator[SEP] operator[SEP] identifier[startIndex] operator[=] identifier[nextIndex] operator[+] Other[1] operator[SEP] } identifier[strList] operator[SEP] identifier[add] operator[SEP] identifier[str] operator[SEP] identifier[substring] operator[SEP] identifier[startIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[last] operator[=] identifier[strList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[--] identifier[last] operator[>=] Other[0] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[strList] operator[SEP] identifier[get] operator[SEP] identifier[last] operator[SEP] operator[SEP] operator[SEP] { identifier[strList] operator[SEP] identifier[remove] operator[SEP] identifier[last] operator[SEP] operator[SEP] } Keyword[return] identifier[strList] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[strList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public String registerApplication(AppDescriptor descriptor, SPFPersona persona) { String token = mTokenGenerator.generateAccessToken(); ContentValues cv = new ContentValues(); cv.put(Contract.COLUMN_APP_NAME, descriptor.getAppName()); cv.put(Contract.COLUMN_ACCESS_TOKEN, token); cv.put(Contract.COLUMN_APP_IDENTIFIER, descriptor.getAppIdentifier()); cv.put(Contract.COLUMN_PERMISSION_CODE, descriptor.getPermissionCode()); cv.put(Contract.COLUMN_PERSONA, persona.getIdentifier()); SQLiteDatabase db = mRegistryTable.getWritableDatabase(); if (db.insert(Contract.TABLE_NAME, null, cv) == -1) { return null; // TODO handle insertion error } return token; }
class class_name[name] begin[{] method[registerApplication, return_type[type[String]], modifier[public], parameter[descriptor, persona]] begin[{] local_variable[type[String], token] local_variable[type[ContentValues], cv] call[cv.put, parameter[member[Contract.COLUMN_APP_NAME], call[descriptor.getAppName, parameter[]]]] call[cv.put, parameter[member[Contract.COLUMN_ACCESS_TOKEN], member[.token]]] call[cv.put, parameter[member[Contract.COLUMN_APP_IDENTIFIER], call[descriptor.getAppIdentifier, parameter[]]]] call[cv.put, parameter[member[Contract.COLUMN_PERMISSION_CODE], call[descriptor.getPermissionCode, parameter[]]]] call[cv.put, parameter[member[Contract.COLUMN_PERSONA], call[persona.getIdentifier, parameter[]]]] local_variable[type[SQLiteDatabase], db] if[binary_operation[call[db.insert, parameter[member[Contract.TABLE_NAME], literal[null], member[.cv]]], ==, literal[1]]] begin[{] return[literal[null]] else begin[{] None end[}] return[member[.token]] end[}] END[}]
Keyword[public] identifier[String] identifier[registerApplication] operator[SEP] identifier[AppDescriptor] identifier[descriptor] , identifier[SPFPersona] identifier[persona] operator[SEP] { identifier[String] identifier[token] operator[=] identifier[mTokenGenerator] operator[SEP] identifier[generateAccessToken] operator[SEP] operator[SEP] operator[SEP] identifier[ContentValues] identifier[cv] operator[=] Keyword[new] identifier[ContentValues] operator[SEP] operator[SEP] operator[SEP] identifier[cv] operator[SEP] identifier[put] operator[SEP] identifier[Contract] operator[SEP] identifier[COLUMN_APP_NAME] , identifier[descriptor] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cv] operator[SEP] identifier[put] operator[SEP] identifier[Contract] operator[SEP] identifier[COLUMN_ACCESS_TOKEN] , identifier[token] operator[SEP] operator[SEP] identifier[cv] operator[SEP] identifier[put] operator[SEP] identifier[Contract] operator[SEP] identifier[COLUMN_APP_IDENTIFIER] , identifier[descriptor] operator[SEP] identifier[getAppIdentifier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cv] operator[SEP] identifier[put] operator[SEP] identifier[Contract] operator[SEP] identifier[COLUMN_PERMISSION_CODE] , identifier[descriptor] operator[SEP] identifier[getPermissionCode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cv] operator[SEP] identifier[put] operator[SEP] identifier[Contract] operator[SEP] identifier[COLUMN_PERSONA] , identifier[persona] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SQLiteDatabase] identifier[db] operator[=] identifier[mRegistryTable] operator[SEP] identifier[getWritableDatabase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[db] operator[SEP] identifier[insert] operator[SEP] identifier[Contract] operator[SEP] identifier[TABLE_NAME] , Other[null] , identifier[cv] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[token] operator[SEP] }
public static String requireProperty (Properties props, String key) { return requireProperty(props, key, "Missing required property '" + key + "'."); }
class class_name[name] begin[{] method[requireProperty, return_type[type[String]], modifier[public static], parameter[props, key]] begin[{] return[call[.requireProperty, parameter[member[.props], member[.key], binary_operation[binary_operation[literal["Missing required property '"], +, member[.key]], +, literal["'."]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[requireProperty] operator[SEP] identifier[Properties] identifier[props] , identifier[String] identifier[key] operator[SEP] { Keyword[return] identifier[requireProperty] operator[SEP] identifier[props] , identifier[key] , literal[String] operator[+] identifier[key] operator[+] literal[String] operator[SEP] operator[SEP] }
public static Map<String, Object> identityMap(CouchbaseEvent source) { Map<String, Object> root = new HashMap<String, Object>(); Map<String, String> event = new HashMap<String, String>(); event.put("name", source.getClass().getSimpleName().replaceAll("Event$", "")); event.put("type", source.type().toString()); root.put("event", event); return root; }
class class_name[name] begin[{] method[identityMap, return_type[type[Map]], modifier[public static], parameter[source]] begin[{] local_variable[type[Map], root] local_variable[type[Map], event] call[event.put, parameter[literal["name"], call[source.getClass, parameter[]]]] call[event.put, parameter[literal["type"], call[source.type, parameter[]]]] call[root.put, parameter[literal["event"], member[.event]]] return[member[.root]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[identityMap] operator[SEP] identifier[CouchbaseEvent] identifier[source] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[root] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[event] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[event] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[source] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[event] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[source] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[root] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[event] operator[SEP] operator[SEP] Keyword[return] identifier[root] operator[SEP] }
protected static String getInstancesFolder(FileSystem fS, Configuration conf) throws IOException { return conf.get(HDFS_TMP_FOLDER_CONF, fS.equals(FileSystem.getLocal(conf)) ? DEFAULT_LOCAL_TMP_FOLDER_CONF_VALUE : DEFAULT_HDFS_TMP_FOLDER_CONF_VALUE); }
class class_name[name] begin[{] method[getInstancesFolder, return_type[type[String]], modifier[static protected], parameter[fS, conf]] begin[{] return[call[conf.get, parameter[member[.HDFS_TMP_FOLDER_CONF], TernaryExpression(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=conf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getLocal, postfix_operators=[], prefix_operators=[], qualifier=FileSystem, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=fS, selectors=[], type_arguments=None), if_false=MemberReference(member=DEFAULT_HDFS_TMP_FOLDER_CONF_VALUE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=DEFAULT_LOCAL_TMP_FOLDER_CONF_VALUE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]]] end[}] END[}]
Keyword[protected] Keyword[static] identifier[String] identifier[getInstancesFolder] operator[SEP] identifier[FileSystem] identifier[fS] , identifier[Configuration] identifier[conf] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[conf] operator[SEP] identifier[get] operator[SEP] identifier[HDFS_TMP_FOLDER_CONF] , identifier[fS] operator[SEP] identifier[equals] operator[SEP] identifier[FileSystem] operator[SEP] identifier[getLocal] operator[SEP] identifier[conf] operator[SEP] operator[SEP] operator[?] identifier[DEFAULT_LOCAL_TMP_FOLDER_CONF_VALUE] operator[:] identifier[DEFAULT_HDFS_TMP_FOLDER_CONF_VALUE] operator[SEP] operator[SEP] }
public RiakObject setVTag(String vtag) { if (vtag != null && vtag.isEmpty()) { throw new IllegalArgumentException("vtag can not be zero length"); } this.vtag = vtag; return this; }
class class_name[name] begin[{] method[setVTag, return_type[type[RiakObject]], modifier[public], parameter[vtag]] begin[{] if[binary_operation[binary_operation[member[.vtag], !=, literal[null]], &&, call[vtag.isEmpty, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="vtag can not be zero length")], 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[}] assign[THIS[member[None.vtag]], member[.vtag]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[RiakObject] identifier[setVTag] operator[SEP] identifier[String] identifier[vtag] operator[SEP] { Keyword[if] operator[SEP] identifier[vtag] operator[!=] Other[null] operator[&&] identifier[vtag] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[vtag] operator[=] identifier[vtag] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private List<String> readFile(File file) throws Exception { List<String> content = new ArrayList<>(100); try (BufferedReader is = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"))) { String line; while ((line = is.readLine()) != null) { content.add(line); } return content; } }
class class_name[name] begin[{] method[readFile, return_type[type[List]], modifier[private], parameter[file]] begin[{] local_variable[type[List], content] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=content, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), ReturnStatement(expression=MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=is, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)))]) end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[String] operator[>] identifier[readFile] operator[SEP] identifier[File] identifier[file] operator[SEP] Keyword[throws] identifier[Exception] { identifier[List] operator[<] identifier[String] operator[>] identifier[content] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[100] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[BufferedReader] identifier[is] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[file] operator[SEP] , literal[String] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[line] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[is] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[content] operator[SEP] identifier[add] operator[SEP] identifier[line] operator[SEP] operator[SEP] } Keyword[return] identifier[content] operator[SEP] } }
public static CommerceCountry fetchByUUID_G(String uuid, long groupId, boolean retrieveFromCache) { return getPersistence().fetchByUUID_G(uuid, groupId, retrieveFromCache); }
class class_name[name] begin[{] method[fetchByUUID_G, return_type[type[CommerceCountry]], modifier[public static], parameter[uuid, groupId, retrieveFromCache]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommerceCountry] identifier[fetchByUUID_G] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[groupId] , Keyword[boolean] identifier[retrieveFromCache] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByUUID_G] operator[SEP] identifier[uuid] , identifier[groupId] , identifier[retrieveFromCache] operator[SEP] operator[SEP] }
private ValueContainer[] addValues(ValueContainer[] target, ValueContainer[] source) { ValueContainer[] newArray; if(source != null && source.length > 0) { if(target != null) { newArray = new ValueContainer[target.length + source.length]; System.arraycopy(target, 0, newArray, 0, target.length); System.arraycopy(source, 0, newArray, target.length, source.length); } else { newArray = source; } } else { newArray = target; } return newArray; }
class class_name[name] begin[{] method[addValues, return_type[type[ValueContainer]], modifier[private], parameter[target, source]] begin[{] local_variable[type[ValueContainer], newArray] if[binary_operation[binary_operation[member[.source], !=, literal[null]], &&, binary_operation[member[source.length], >, literal[0]]]] begin[{] if[binary_operation[member[.target], !=, literal[null]]] begin[{] assign[member[.newArray], ArrayCreator(dimensions=[BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=source, selectors=[]), operator=+)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValueContainer, sub_type=None))] call[System.arraycopy, parameter[member[.target], literal[0], member[.newArray], literal[0], member[target.length]]] call[System.arraycopy, parameter[member[.source], literal[0], member[.newArray], member[target.length], member[source.length]]] else begin[{] assign[member[.newArray], member[.source]] end[}] else begin[{] assign[member[.newArray], member[.target]] end[}] return[member[.newArray]] end[}] END[}]
Keyword[private] identifier[ValueContainer] operator[SEP] operator[SEP] identifier[addValues] operator[SEP] identifier[ValueContainer] operator[SEP] operator[SEP] identifier[target] , identifier[ValueContainer] operator[SEP] operator[SEP] identifier[source] operator[SEP] { identifier[ValueContainer] operator[SEP] operator[SEP] identifier[newArray] operator[SEP] Keyword[if] operator[SEP] identifier[source] operator[!=] Other[null] operator[&&] identifier[source] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[target] operator[!=] Other[null] operator[SEP] { identifier[newArray] operator[=] Keyword[new] identifier[ValueContainer] operator[SEP] identifier[target] operator[SEP] identifier[length] operator[+] identifier[source] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[target] , Other[0] , identifier[newArray] , Other[0] , identifier[target] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[source] , Other[0] , identifier[newArray] , identifier[target] operator[SEP] identifier[length] , identifier[source] operator[SEP] identifier[length] operator[SEP] operator[SEP] } Keyword[else] { identifier[newArray] operator[=] identifier[source] operator[SEP] } } Keyword[else] { identifier[newArray] operator[=] identifier[target] operator[SEP] } Keyword[return] identifier[newArray] operator[SEP] }
public void setCompiler(final CompilerType compiler) { // check that the jar for the specified compiler are present if ( compiler == CompilerType.ECLIPSE ) { try { Class.forName( "org.eclipse.jdt.internal.compiler.Compiler", true, this.conf.getClassLoader() ); } catch ( ClassNotFoundException e ) { throw new RuntimeException( "The Eclipse JDT Core jar is not in the classpath" ); } } else if ( compiler == CompilerType.JANINO ){ try { Class.forName( "org.codehaus.janino.Parser", true, this.conf.getClassLoader() ); } catch ( ClassNotFoundException e ) { throw new RuntimeException( "The Janino jar is not in the classpath" ); } } switch ( compiler ) { case ECLIPSE : this.compiler = CompilerType.ECLIPSE; break; case JANINO : this.compiler = CompilerType.JANINO; break; case NATIVE : this.compiler = CompilerType.NATIVE; break; default : throw new RuntimeException( "value '" + compiler + "' is not a valid compiler" ); } }
class class_name[name] begin[{] method[setCompiler, return_type[void], modifier[public], parameter[compiler]] begin[{] if[binary_operation[member[.compiler], ==, member[CompilerType.ECLIPSE]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.eclipse.jdt.internal.compiler.Compiler"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=conf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The Eclipse JDT Core jar is not in the classpath")], 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=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) else begin[{] if[binary_operation[member[.compiler], ==, member[CompilerType.JANINO]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.codehaus.janino.Parser"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=conf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The Janino jar is not in the classpath")], 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=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] SwitchStatement(cases=[SwitchStatementCase(case=['ECLIPSE'], statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=compiler, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=ECLIPSE, postfix_operators=[], prefix_operators=[], qualifier=CompilerType, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['JANINO'], statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=compiler, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=JANINO, postfix_operators=[], prefix_operators=[], qualifier=CompilerType, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['NATIVE'], statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=compiler, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=NATIVE, postfix_operators=[], prefix_operators=[], qualifier=CompilerType, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value '"), operandr=MemberReference(member=compiler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid compiler"), 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)])], expression=MemberReference(member=compiler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setCompiler] operator[SEP] Keyword[final] identifier[CompilerType] identifier[compiler] operator[SEP] { Keyword[if] operator[SEP] identifier[compiler] operator[==] identifier[CompilerType] operator[SEP] identifier[ECLIPSE] operator[SEP] { Keyword[try] { identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] , literal[boolean] , Keyword[this] operator[SEP] identifier[conf] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[compiler] operator[==] identifier[CompilerType] operator[SEP] identifier[JANINO] operator[SEP] { Keyword[try] { identifier[Class] operator[SEP] identifier[forName] operator[SEP] literal[String] , literal[boolean] , Keyword[this] operator[SEP] identifier[conf] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[switch] operator[SEP] identifier[compiler] operator[SEP] { Keyword[case] identifier[ECLIPSE] operator[:] Keyword[this] operator[SEP] identifier[compiler] operator[=] identifier[CompilerType] operator[SEP] identifier[ECLIPSE] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[JANINO] operator[:] Keyword[this] operator[SEP] identifier[compiler] operator[=] identifier[CompilerType] operator[SEP] identifier[JANINO] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[NATIVE] operator[:] Keyword[this] operator[SEP] identifier[compiler] operator[=] identifier[CompilerType] operator[SEP] identifier[NATIVE] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[compiler] operator[+] literal[String] operator[SEP] operator[SEP] } }
protected double[][] extractFeaturesInternal(BufferedImage image) { double[][] descriptions = harder(image); if (!perBandNormalization) { // if perBandNormalization is off then do a final L2 normalization for (int i = 0; i < descriptions.length; i++) { Normalization.normalizeL2(descriptions[i]); // SurfDescribeOps.normalizeFeatures(descriptions[i]); } } return descriptions; }
class class_name[name] begin[{] method[extractFeaturesInternal, return_type[type[double]], modifier[protected], parameter[image]] begin[{] local_variable[type[double], descriptions] if[member[.perBandNormalization]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=descriptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=normalizeL2, postfix_operators=[], prefix_operators=[], qualifier=Normalization, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=descriptions, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] return[member[.descriptions]] end[}] END[}]
Keyword[protected] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[extractFeaturesInternal] operator[SEP] identifier[BufferedImage] identifier[image] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[descriptions] operator[=] identifier[harder] operator[SEP] identifier[image] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[perBandNormalization] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[descriptions] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Normalization] operator[SEP] identifier[normalizeL2] operator[SEP] identifier[descriptions] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[descriptions] operator[SEP] }