code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public void setWidths(float[] widths) throws BadElementException { if (widths.length != columns) { throw new BadElementException("Wrong number of columns."); } // The sum of all values is 100% float hundredPercent = 0; for (int i = 0; i < columns; i++) { hundredPercent += widths[i]; } // The different percentages are calculated float width; this.widths[columns - 1] = 100; for (int i = 0; i < columns - 1; i++) { width = (100.0f * widths[i]) / hundredPercent; this.widths[i] = width; this.widths[columns - 1] -= width; } }
class class_name[name] begin[{] method[setWidths, return_type[void], modifier[public], parameter[widths]] begin[{] if[binary_operation[member[widths.length], !=, member[.columns]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Wrong number of columns.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BadElementException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[float], hundredPercent] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hundredPercent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=widths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[float], width] assign[THIS[member[None.widths]ArraySelector(index=BinaryOperation(operandl=MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))], literal[100]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100.0f), operandr=MemberReference(member=widths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*), operandr=MemberReference(member=hundredPercent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=widths, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=widths, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), type=-=, value=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setWidths] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[widths] operator[SEP] Keyword[throws] identifier[BadElementException] { Keyword[if] operator[SEP] identifier[widths] operator[SEP] identifier[length] operator[!=] identifier[columns] operator[SEP] { Keyword[throw] Keyword[new] identifier[BadElementException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[float] identifier[hundredPercent] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[columns] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[hundredPercent] operator[+=] identifier[widths] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[float] identifier[width] operator[SEP] Keyword[this] operator[SEP] identifier[widths] operator[SEP] identifier[columns] operator[-] Other[1] operator[SEP] operator[=] Other[100] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[columns] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[width] operator[=] operator[SEP] literal[Float] operator[*] identifier[widths] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[/] identifier[hundredPercent] operator[SEP] Keyword[this] operator[SEP] identifier[widths] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[width] operator[SEP] Keyword[this] operator[SEP] identifier[widths] operator[SEP] identifier[columns] operator[-] Other[1] operator[SEP] operator[-=] identifier[width] operator[SEP] } }
public AVFile getAVFile() { if (actualFile != null) { return actualFile; } else if (null != file && file.containsKey(FILE_URL)) { Map<String, Object> avfileMeta = null; if (file.containsKey(FILE_META)) { avfileMeta = (Map) file.get(FILE_META); } AVFile avfile = new AVFile(null, (String) file.get(FILE_URL), avfileMeta); if (file.containsKey(OBJECT_ID)) { avfile.setObjectId((String) file.get(OBJECT_ID)); } return avfile; } return null; }
class class_name[name] begin[{] method[getAVFile, return_type[type[AVFile]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.actualFile], !=, literal[null]]] begin[{] return[member[.actualFile]] else begin[{] if[binary_operation[binary_operation[literal[null], !=, member[.file]], &&, call[file.containsKey, parameter[member[.FILE_URL]]]]] begin[{] local_variable[type[Map], avfileMeta] if[call[file.containsKey, parameter[member[.FILE_META]]]] begin[{] assign[member[.avfileMeta], Cast(expression=MethodInvocation(arguments=[MemberReference(member=FILE_META, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=None))] else begin[{] None end[}] local_variable[type[AVFile], avfile] if[call[file.containsKey, parameter[member[.OBJECT_ID]]]] begin[{] call[avfile.setObjectId, parameter[Cast(expression=MethodInvocation(arguments=[MemberReference(member=OBJECT_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]] else begin[{] None end[}] return[member[.avfile]] else begin[{] None end[}] end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[AVFile] identifier[getAVFile] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[actualFile] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[actualFile] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[file] operator[&&] identifier[file] operator[SEP] identifier[containsKey] operator[SEP] identifier[FILE_URL] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[avfileMeta] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[containsKey] operator[SEP] identifier[FILE_META] operator[SEP] operator[SEP] { identifier[avfileMeta] operator[=] operator[SEP] identifier[Map] operator[SEP] identifier[file] operator[SEP] identifier[get] operator[SEP] identifier[FILE_META] operator[SEP] operator[SEP] } identifier[AVFile] identifier[avfile] operator[=] Keyword[new] identifier[AVFile] operator[SEP] Other[null] , operator[SEP] identifier[String] operator[SEP] identifier[file] operator[SEP] identifier[get] operator[SEP] identifier[FILE_URL] operator[SEP] , identifier[avfileMeta] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[SEP] identifier[containsKey] operator[SEP] identifier[OBJECT_ID] operator[SEP] operator[SEP] { identifier[avfile] operator[SEP] identifier[setObjectId] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[file] operator[SEP] identifier[get] operator[SEP] identifier[OBJECT_ID] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[avfile] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@Override public int remove(PartitionRecord criteria) throws Exception { StringBuilder delete = new StringBuilder(111) .append("DELETE FROM Partition p WHERE"); if (criteria != null) { if (criteria.hasExecutor()) delete.append(" p.EXECUTOR=:x AND"); if (criteria.hasHostName()) delete.append(" p.HOSTNAME=:h AND"); if (criteria.hasId()) delete.append(" p.ID=:i AND"); if (criteria.hasLibertyServer()) delete.append(" p.LSERVER=:l AND"); if (criteria.hasUserDir()) delete.append(" p.USERDIR=:u AND"); } int length = delete.length(); delete.delete(length - (delete.charAt(length - 1) == 'E' ? 6 : 4), length); final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(this, tc, "remove", criteria, delete); EntityManager em = getPersistenceServiceUnit().createEntityManager(); try { Query query = em.createQuery(delete.toString()); if (criteria != null) { if (criteria.hasExecutor()) query.setParameter("x", criteria.getExecutor()); if (criteria.hasHostName()) query.setParameter("h", criteria.getHostName()); if (criteria.hasId()) query.setParameter("i", criteria.getId()); if (criteria.hasLibertyServer()) query.setParameter("l", criteria.getLibertyServer()); if (criteria.hasUserDir()) query.setParameter("u", criteria.getUserDir()); } int count = query.executeUpdate(); if (trace && tc.isEntryEnabled()) Tr.exit(this, tc, "remove", count); return count; } finally { em.close(); } }
class class_name[name] begin[{] method[remove, return_type[type[int]], modifier[public], parameter[criteria]] begin[{] local_variable[type[StringBuilder], delete] if[binary_operation[member[.criteria], !=, literal[null]]] begin[{] if[call[criteria.hasExecutor, parameter[]]] begin[{] call[delete.append, parameter[literal[" p.EXECUTOR=:x AND"]]] else begin[{] None end[}] if[call[criteria.hasHostName, parameter[]]] begin[{] call[delete.append, parameter[literal[" p.HOSTNAME=:h AND"]]] else begin[{] None end[}] if[call[criteria.hasId, parameter[]]] begin[{] call[delete.append, parameter[literal[" p.ID=:i AND"]]] else begin[{] None end[}] if[call[criteria.hasLibertyServer, parameter[]]] begin[{] call[delete.append, parameter[literal[" p.LSERVER=:l AND"]]] else begin[{] None end[}] if[call[criteria.hasUserDir, parameter[]]] begin[{] call[delete.append, parameter[literal[" p.USERDIR=:u AND"]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[int], length] call[delete.delete, parameter[binary_operation[member[.length], -, TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=delete, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='E'), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6))], member[.length]]] local_variable[type[boolean], trace] if[binary_operation[member[.trace], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[THIS[], member[.tc], literal["remove"], member[.criteria], member[.delete]]] else begin[{] None end[}] local_variable[type[EntityManager], em] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=delete, selectors=[], type_arguments=None)], member=createQuery, postfix_operators=[], prefix_operators=[], qualifier=em, selectors=[], type_arguments=None), name=query)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Query, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=criteria, 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=MethodInvocation(arguments=[], member=hasExecutor, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="x"), MethodInvocation(arguments=[], member=getExecutor, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=setParameter, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=hasHostName, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="h"), MethodInvocation(arguments=[], member=getHostName, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=setParameter, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=hasId, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="i"), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=setParameter, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=hasLibertyServer, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="l"), MethodInvocation(arguments=[], member=getLibertyServer, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=setParameter, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), label=None)), IfStatement(condition=MethodInvocation(arguments=[], member=hasUserDir, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="u"), MethodInvocation(arguments=[], member=getUserDir, postfix_operators=[], prefix_operators=[], qualifier=criteria, selectors=[], type_arguments=None)], member=setParameter, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), label=None))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=executeUpdate, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), name=count)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=trace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="remove"), MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=em, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[remove] operator[SEP] identifier[PartitionRecord] identifier[criteria] operator[SEP] Keyword[throws] identifier[Exception] { identifier[StringBuilder] identifier[delete] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[111] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[hasExecutor] operator[SEP] operator[SEP] operator[SEP] identifier[delete] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[hasHostName] operator[SEP] operator[SEP] operator[SEP] identifier[delete] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[hasId] operator[SEP] operator[SEP] operator[SEP] identifier[delete] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[hasLibertyServer] operator[SEP] operator[SEP] operator[SEP] identifier[delete] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[hasUserDir] operator[SEP] operator[SEP] operator[SEP] identifier[delete] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[int] identifier[length] operator[=] identifier[delete] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[delete] operator[SEP] identifier[delete] operator[SEP] identifier[length] operator[-] operator[SEP] identifier[delete] operator[SEP] identifier[charAt] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[==] literal[String] operator[?] Other[6] operator[:] Other[4] operator[SEP] , identifier[length] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[trace] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[criteria] , identifier[delete] operator[SEP] operator[SEP] identifier[EntityManager] identifier[em] operator[=] identifier[getPersistenceServiceUnit] operator[SEP] operator[SEP] operator[SEP] identifier[createEntityManager] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Query] identifier[query] operator[=] identifier[em] operator[SEP] identifier[createQuery] operator[SEP] identifier[delete] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[hasExecutor] operator[SEP] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setParameter] operator[SEP] literal[String] , identifier[criteria] operator[SEP] identifier[getExecutor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[hasHostName] operator[SEP] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setParameter] operator[SEP] literal[String] , identifier[criteria] operator[SEP] identifier[getHostName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[hasId] operator[SEP] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setParameter] operator[SEP] literal[String] , identifier[criteria] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[hasLibertyServer] operator[SEP] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setParameter] operator[SEP] literal[String] , identifier[criteria] operator[SEP] identifier[getLibertyServer] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[criteria] operator[SEP] identifier[hasUserDir] operator[SEP] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setParameter] operator[SEP] literal[String] , identifier[criteria] operator[SEP] identifier[getUserDir] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[count] operator[=] identifier[query] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[count] operator[SEP] operator[SEP] Keyword[return] identifier[count] operator[SEP] } Keyword[finally] { identifier[em] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } }
@Nonnull public BugInstance addCalledMethod(ConstantPoolGen cpg, InvokeInstruction inv) { String className = inv.getClassName(cpg); String methodName = inv.getMethodName(cpg); String methodSig = inv.getSignature(cpg); addMethod(className, methodName, methodSig, inv.getOpcode() == Const.INVOKESTATIC); describe(MethodAnnotation.METHOD_CALLED); return this; }
class class_name[name] begin[{] method[addCalledMethod, return_type[type[BugInstance]], modifier[public], parameter[cpg, inv]] begin[{] local_variable[type[String], className] local_variable[type[String], methodName] local_variable[type[String], methodSig] call[.addMethod, parameter[member[.className], member[.methodName], member[.methodSig], binary_operation[call[inv.getOpcode, parameter[]], ==, member[Const.INVOKESTATIC]]]] call[.describe, parameter[member[MethodAnnotation.METHOD_CALLED]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] identifier[BugInstance] identifier[addCalledMethod] operator[SEP] identifier[ConstantPoolGen] identifier[cpg] , identifier[InvokeInstruction] identifier[inv] operator[SEP] { identifier[String] identifier[className] operator[=] identifier[inv] operator[SEP] identifier[getClassName] operator[SEP] identifier[cpg] operator[SEP] operator[SEP] identifier[String] identifier[methodName] operator[=] identifier[inv] operator[SEP] identifier[getMethodName] operator[SEP] identifier[cpg] operator[SEP] operator[SEP] identifier[String] identifier[methodSig] operator[=] identifier[inv] operator[SEP] identifier[getSignature] operator[SEP] identifier[cpg] operator[SEP] operator[SEP] identifier[addMethod] operator[SEP] identifier[className] , identifier[methodName] , identifier[methodSig] , identifier[inv] operator[SEP] identifier[getOpcode] operator[SEP] operator[SEP] operator[==] identifier[Const] operator[SEP] identifier[INVOKESTATIC] operator[SEP] operator[SEP] identifier[describe] operator[SEP] identifier[MethodAnnotation] operator[SEP] identifier[METHOD_CALLED] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static FileSystem get(URI uri) throws IOException { FileSystem fs = null; synchronized (SYNCHRONIZATION_OBJECT) { if (uri.getScheme() == null) { try { uri = new URI("file", null, uri.getPath(), null); } catch (URISyntaxException e) { // we tried to repair it, but could not. report the scheme error throw new IOException("FileSystem: Scheme is null. file:// or hdfs:// are example schemes."); } } final FSKey key = new FSKey(uri.getScheme(), uri.getAuthority()); // See if there is a file system object in the cache if (CACHE.containsKey(key)) { return CACHE.get(key); } // Try to create a new file system if (!FSDIRECTORY.containsKey(uri.getScheme())) { throw new IOException("No file system found with scheme " + uri.getScheme()); } Class<? extends FileSystem> fsClass = null; try { fsClass = ClassUtils.getFileSystemByName(FSDIRECTORY.get(uri.getScheme())); } catch (ClassNotFoundException e1) { throw new IOException(StringUtils.stringifyException(e1)); } try { fs = fsClass.newInstance(); } catch (InstantiationException e) { throw new IOException("Could not instantiate file system class: " + e.getMessage(), e); } catch (IllegalAccessException e) { throw new IOException("Could not instantiate file system class: " + e.getMessage(), e); } // Initialize new file system object fs.initialize(uri); // Add new file system object to cache CACHE.put(key, fs); } return fs; }
class class_name[name] begin[{] method[get, return_type[type[FileSystem]], modifier[public static], parameter[uri]] begin[{] local_variable[type[FileSystem], fs] SYNCHRONIZED[member[.SYNCHRONIZATION_OBJECT]] BEGIN[{] if[binary_operation[call[uri.getScheme, parameter[]], ==, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="file"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URI, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="FileSystem: Scheme is null. file:// or hdfs:// are example schemes.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] local_variable[type[FSKey], key] if[call[CACHE.containsKey, parameter[member[.key]]]] begin[{] return[call[CACHE.get, parameter[member[.key]]]] else begin[{] None end[}] if[call[FSDIRECTORY.containsKey, parameter[call[uri.getScheme, parameter[]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No file system found with scheme "), operandr=MethodInvocation(arguments=[], member=getScheme, postfix_operators=[], prefix_operators=[], qualifier=uri, 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=IOException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[Class], fsClass] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fsClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getScheme, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=FSDIRECTORY, selectors=[], type_arguments=None)], member=getFileSystemByName, postfix_operators=[], prefix_operators=[], qualifier=ClassUtils, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=e1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stringifyException, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None) TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=fsClass, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not instantiate file system class: "), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InstantiationException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not instantiate file system class: "), 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=IOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException']))], finally_block=None, label=None, resources=None) call[fs.initialize, parameter[member[.uri]]] call[CACHE.put, parameter[member[.key], member[.fs]]] END[}] return[member[.fs]] end[}] END[}]
Keyword[public] Keyword[static] identifier[FileSystem] identifier[get] operator[SEP] identifier[URI] identifier[uri] operator[SEP] Keyword[throws] identifier[IOException] { identifier[FileSystem] identifier[fs] operator[=] Other[null] operator[SEP] Keyword[synchronized] operator[SEP] identifier[SYNCHRONIZATION_OBJECT] operator[SEP] { Keyword[if] operator[SEP] identifier[uri] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[try] { identifier[uri] operator[=] Keyword[new] identifier[URI] operator[SEP] literal[String] , Other[null] , identifier[uri] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[final] identifier[FSKey] identifier[key] operator[=] Keyword[new] identifier[FSKey] operator[SEP] identifier[uri] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] , identifier[uri] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CACHE] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[return] identifier[CACHE] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[FSDIRECTORY] operator[SEP] identifier[containsKey] operator[SEP] identifier[uri] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[uri] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Class] operator[<] operator[?] Keyword[extends] identifier[FileSystem] operator[>] identifier[fsClass] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[fsClass] operator[=] identifier[ClassUtils] operator[SEP] identifier[getFileSystemByName] operator[SEP] identifier[FSDIRECTORY] operator[SEP] identifier[get] operator[SEP] identifier[uri] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e1] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] identifier[StringUtils] operator[SEP] identifier[stringifyException] operator[SEP] identifier[e1] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[fs] operator[=] identifier[fsClass] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } identifier[fs] operator[SEP] identifier[initialize] operator[SEP] identifier[uri] operator[SEP] operator[SEP] identifier[CACHE] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[fs] operator[SEP] operator[SEP] } Keyword[return] identifier[fs] operator[SEP] }
public void createIndexes(Connection connection, TableCreationMode mode) { ArrayList<Type<?>> sorted = sortTypes(); for (Type<?> type : sorted) { createIndexes(connection, mode, type); } }
class class_name[name] begin[{] method[createIndexes, return_type[void], modifier[public], parameter[connection, mode]] begin[{] local_variable[type[ArrayList], sorted] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createIndexes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sorted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Type, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[createIndexes] operator[SEP] identifier[Connection] identifier[connection] , identifier[TableCreationMode] identifier[mode] operator[SEP] { identifier[ArrayList] operator[<] identifier[Type] operator[<] operator[?] operator[>] operator[>] identifier[sorted] operator[=] identifier[sortTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Type] operator[<] operator[?] operator[>] identifier[type] operator[:] identifier[sorted] operator[SEP] { identifier[createIndexes] operator[SEP] identifier[connection] , identifier[mode] , identifier[type] operator[SEP] operator[SEP] } }
public void marshall(DescribeEntityAggregatesRequest describeEntityAggregatesRequest, ProtocolMarshaller protocolMarshaller) { if (describeEntityAggregatesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeEntityAggregatesRequest.getEventArns(), EVENTARNS_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[describeEntityAggregatesRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.describeEntityAggregatesRequest], ==, 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=getEventArns, postfix_operators=[], prefix_operators=[], qualifier=describeEntityAggregatesRequest, selectors=[], type_arguments=None), MemberReference(member=EVENTARNS_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[DescribeEntityAggregatesRequest] identifier[describeEntityAggregatesRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[describeEntityAggregatesRequest] 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[describeEntityAggregatesRequest] operator[SEP] identifier[getEventArns] operator[SEP] operator[SEP] , identifier[EVENTARNS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private String parse(final Arguments arguments, String input) { final Configuration configuration = arguments.getConfiguration(); final IStandardExpressionParser parser = StandardExpressions.getExpressionParser(configuration); final IStandardExpression expression = parser.parseExpression(configuration, arguments, input); return (String) expression.execute(configuration, arguments); }
class class_name[name] begin[{] method[parse, return_type[type[String]], modifier[private], parameter[arguments, input]] begin[{] local_variable[type[Configuration], configuration] local_variable[type[IStandardExpressionParser], parser] local_variable[type[IStandardExpression], expression] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=configuration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=arguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=expression, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))] end[}] END[}]
Keyword[private] identifier[String] identifier[parse] operator[SEP] Keyword[final] identifier[Arguments] identifier[arguments] , identifier[String] identifier[input] operator[SEP] { Keyword[final] identifier[Configuration] identifier[configuration] operator[=] identifier[arguments] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[IStandardExpressionParser] identifier[parser] operator[=] identifier[StandardExpressions] operator[SEP] identifier[getExpressionParser] operator[SEP] identifier[configuration] operator[SEP] operator[SEP] Keyword[final] identifier[IStandardExpression] identifier[expression] operator[=] identifier[parser] operator[SEP] identifier[parseExpression] operator[SEP] identifier[configuration] , identifier[arguments] , identifier[input] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[String] operator[SEP] identifier[expression] operator[SEP] identifier[execute] operator[SEP] identifier[configuration] , identifier[arguments] operator[SEP] operator[SEP] }
public static vpnvserver_intranetip_binding[] get(nitro_service service, String name) throws Exception{ vpnvserver_intranetip_binding obj = new vpnvserver_intranetip_binding(); obj.set_name(name); vpnvserver_intranetip_binding response[] = (vpnvserver_intranetip_binding[]) obj.get_resources(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[vpnvserver_intranetip_binding]], modifier[public static], parameter[service, name]] begin[{] local_variable[type[vpnvserver_intranetip_binding], obj] call[obj.set_name, parameter[member[.name]]] local_variable[type[vpnvserver_intranetip_binding], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[vpnvserver_intranetip_binding] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[Exception] { identifier[vpnvserver_intranetip_binding] identifier[obj] operator[=] Keyword[new] identifier[vpnvserver_intranetip_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_name] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[vpnvserver_intranetip_binding] identifier[response] operator[SEP] operator[SEP] operator[=] operator[SEP] identifier[vpnvserver_intranetip_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
@Api public void setMapType(MapType type) { this.type = type; if (googleMap != null) { setMapType(googleMap, type.toString()); } }
class class_name[name] begin[{] method[setMapType, return_type[void], modifier[public], parameter[type]] begin[{] assign[THIS[member[None.type]], member[.type]] if[binary_operation[member[.googleMap], !=, literal[null]]] begin[{] call[.setMapType, parameter[member[.googleMap], call[type.toString, parameter[]]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Api] Keyword[public] Keyword[void] identifier[setMapType] operator[SEP] identifier[MapType] identifier[type] operator[SEP] { Keyword[this] operator[SEP] identifier[type] operator[=] identifier[type] operator[SEP] Keyword[if] operator[SEP] identifier[googleMap] operator[!=] Other[null] operator[SEP] { identifier[setMapType] operator[SEP] identifier[googleMap] , identifier[type] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public final void setDate(LocalDate optionalDate) { // Set the text field to the supplied date, using the standard format for null, AD, or BC. String standardDateString = zGetStandardTextFieldDateString(optionalDate); String textFieldString = dateTextField.getText(); // We will only change the date, when the text or the last valid date does not match the // supplied date. This will prevent any registered date change listeners from receiving // any events unless the date actually changes. if ((!standardDateString.equals(textFieldString))) { zInternalSetDateTextField(standardDateString); } }
class class_name[name] begin[{] method[setDate, return_type[void], modifier[final public], parameter[optionalDate]] begin[{] local_variable[type[String], standardDateString] local_variable[type[String], textFieldString] if[call[standardDateString.equals, parameter[member[.textFieldString]]]] begin[{] call[.zInternalSetDateTextField, parameter[member[.standardDateString]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[setDate] operator[SEP] identifier[LocalDate] identifier[optionalDate] operator[SEP] { identifier[String] identifier[standardDateString] operator[=] identifier[zGetStandardTextFieldDateString] operator[SEP] identifier[optionalDate] operator[SEP] operator[SEP] identifier[String] identifier[textFieldString] operator[=] identifier[dateTextField] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[!] identifier[standardDateString] operator[SEP] identifier[equals] operator[SEP] identifier[textFieldString] operator[SEP] operator[SEP] operator[SEP] { identifier[zInternalSetDateTextField] operator[SEP] identifier[standardDateString] operator[SEP] operator[SEP] } }
public static responderaction[] get_filtered(nitro_service service, String filter) throws Exception{ responderaction obj = new responderaction(); options option = new options(); option.set_filter(filter); responderaction[] response = (responderaction[]) obj.getfiltered(service, option); return response; }
class class_name[name] begin[{] method[get_filtered, return_type[type[responderaction]], modifier[public static], parameter[service, filter]] begin[{] local_variable[type[responderaction], obj] local_variable[type[options], option] call[option.set_filter, parameter[member[.filter]]] local_variable[type[responderaction], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[responderaction] operator[SEP] operator[SEP] identifier[get_filtered] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[filter] operator[SEP] Keyword[throws] identifier[Exception] { identifier[responderaction] identifier[obj] operator[=] Keyword[new] identifier[responderaction] operator[SEP] operator[SEP] operator[SEP] identifier[options] identifier[option] operator[=] Keyword[new] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[option] operator[SEP] identifier[set_filter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[responderaction] operator[SEP] operator[SEP] identifier[response] operator[=] operator[SEP] identifier[responderaction] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[getfiltered] operator[SEP] identifier[service] , identifier[option] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
public void marshall(ResolverEndpoint resolverEndpoint, ProtocolMarshaller protocolMarshaller) { if (resolverEndpoint == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(resolverEndpoint.getId(), ID_BINDING); protocolMarshaller.marshall(resolverEndpoint.getCreatorRequestId(), CREATORREQUESTID_BINDING); protocolMarshaller.marshall(resolverEndpoint.getArn(), ARN_BINDING); protocolMarshaller.marshall(resolverEndpoint.getName(), NAME_BINDING); protocolMarshaller.marshall(resolverEndpoint.getSecurityGroupIds(), SECURITYGROUPIDS_BINDING); protocolMarshaller.marshall(resolverEndpoint.getDirection(), DIRECTION_BINDING); protocolMarshaller.marshall(resolverEndpoint.getIpAddressCount(), IPADDRESSCOUNT_BINDING); protocolMarshaller.marshall(resolverEndpoint.getHostVPCId(), HOSTVPCID_BINDING); protocolMarshaller.marshall(resolverEndpoint.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(resolverEndpoint.getStatusMessage(), STATUSMESSAGE_BINDING); protocolMarshaller.marshall(resolverEndpoint.getCreationTime(), CREATIONTIME_BINDING); protocolMarshaller.marshall(resolverEndpoint.getModificationTime(), MODIFICATIONTIME_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[resolverEndpoint, protocolMarshaller]] begin[{] if[binary_operation[member[.resolverEndpoint], ==, 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=getId, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, 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=getCreatorRequestId, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, selectors=[], type_arguments=None), MemberReference(member=CREATORREQUESTID_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=getArn, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, 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=getName, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, 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=getSecurityGroupIds, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, selectors=[], type_arguments=None), MemberReference(member=SECURITYGROUPIDS_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=getDirection, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, selectors=[], type_arguments=None), MemberReference(member=DIRECTION_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=getIpAddressCount, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, selectors=[], type_arguments=None), MemberReference(member=IPADDRESSCOUNT_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=getHostVPCId, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, selectors=[], type_arguments=None), MemberReference(member=HOSTVPCID_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=getStatus, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, selectors=[], type_arguments=None), MemberReference(member=STATUS_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=getStatusMessage, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, selectors=[], type_arguments=None), MemberReference(member=STATUSMESSAGE_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=getCreationTime, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, selectors=[], type_arguments=None), MemberReference(member=CREATIONTIME_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=getModificationTime, postfix_operators=[], prefix_operators=[], qualifier=resolverEndpoint, selectors=[], type_arguments=None), MemberReference(member=MODIFICATIONTIME_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[ResolverEndpoint] identifier[resolverEndpoint] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[resolverEndpoint] 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[resolverEndpoint] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[ID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getCreatorRequestId] operator[SEP] operator[SEP] , identifier[CREATORREQUESTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getArn] operator[SEP] operator[SEP] , identifier[ARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[NAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getSecurityGroupIds] operator[SEP] operator[SEP] , identifier[SECURITYGROUPIDS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getDirection] operator[SEP] operator[SEP] , identifier[DIRECTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getIpAddressCount] operator[SEP] operator[SEP] , identifier[IPADDRESSCOUNT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getHostVPCId] operator[SEP] operator[SEP] , identifier[HOSTVPCID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getStatusMessage] operator[SEP] operator[SEP] , identifier[STATUSMESSAGE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getCreationTime] operator[SEP] operator[SEP] , identifier[CREATIONTIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[resolverEndpoint] operator[SEP] identifier[getModificationTime] operator[SEP] operator[SEP] , identifier[MODIFICATIONTIME_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private boolean processRuleset(final Branch parent_branch, int depth) { // when we've passed the final rule, just return to stop the recursion if (rule_idx > max_rule_level) { return true; } // setup the branch for this iteration and set the "current_branch" // reference. It's not final as we'll be copying references back and forth final Branch previous_branch = current_branch; current_branch = new Branch(tree.getTreeId()); // fetch the current rule level or try to find the next one TreeMap<Integer, TreeRule> rule_level = fetchRuleLevel(); if (rule_level == null) { return true; } // loop through each rule in the level, processing as we go for (Map.Entry<Integer, TreeRule> entry : rule_level.entrySet()) { // set the local rule rule = entry.getValue(); testMessage("Processing rule: " + rule); // route to the proper handler based on the rule type if (rule.getType() == TreeRuleType.METRIC) { parseMetricRule(); // local_branch = current_branch; //do we need this??? } else if (rule.getType() == TreeRuleType.TAGK) { parseTagkRule(); } else if (rule.getType() == TreeRuleType.METRIC_CUSTOM) { parseMetricCustomRule(); } else if (rule.getType() == TreeRuleType.TAGK_CUSTOM) { parseTagkCustomRule(); } else if (rule.getType() == TreeRuleType.TAGV_CUSTOM) { parseTagvRule(); } else { throw new IllegalArgumentException("Unkown rule type: " + rule.getType()); } // rules on a given level are ORd so the first one that matches, we bail if (current_branch.getDisplayName() != null && !current_branch.getDisplayName().isEmpty()) { break; } } // if no match was found on the level, then we need to set no match if (current_branch.getDisplayName() == null || current_branch.getDisplayName().isEmpty()) { if (not_matched == null) { not_matched = new String(rule.toString()); } else { not_matched += " " + rule; } } // determine if we need to continue processing splits, are done with splits // or need to increment to the next rule level if (splits != null && split_idx >= splits.length) { // finished split processing splits = null; split_idx = 0; rule_idx++; } else if (splits != null) { // we're still processing splits, so continue } else { // didn't have any splits so continue on to the next level rule_idx++; } // call ourselves recursively until we hit a leaf or run out of rules final boolean complete = processRuleset(current_branch, ++depth); // if the recursion loop is complete, we either have a leaf or need to roll // back if (complete) { // if the current branch is null or empty, we didn't match, so roll back // to the previous branch and tell it to be the leaf if (current_branch == null || current_branch.getDisplayName() == null || current_branch.getDisplayName().isEmpty()) { LOG.trace("Got to a null branch"); current_branch = previous_branch; return true; } // if the parent has an empty ID, we need to roll back till we find one if (parent_branch.getDisplayName() == null || parent_branch.getDisplayName().isEmpty()) { testMessage("Depth [" + depth + "] Parent branch was empty, rolling back"); return true; } // add the leaf to the parent and roll back final Leaf leaf = new Leaf(current_branch.getDisplayName(), meta.getTSUID()); parent_branch.addLeaf(leaf, tree); testMessage("Depth [" + depth + "] Adding leaf [" + leaf + "] to parent branch [" + parent_branch + "]"); current_branch = previous_branch; return false; } // if a rule level failed to match, we just skip the result swap if ((previous_branch == null || previous_branch.getDisplayName().isEmpty()) && !current_branch.getDisplayName().isEmpty()) { if (depth > 2) { testMessage("Depth [" + depth + "] Skipping a non-matched branch, returning: " + current_branch); } return false; } // if the current branch is empty, skip it if (current_branch.getDisplayName() == null || current_branch.getDisplayName().isEmpty()) { testMessage("Depth [" + depth + "] Branch was empty"); current_branch = previous_branch; return false; } // if the previous and current branch are the same, we just discard the // previous, since the current may have a leaf if (current_branch.getDisplayName().equals(previous_branch.getDisplayName())){ testMessage("Depth [" + depth + "] Current was the same as previous"); return false; } // we've found a new branch, so add it parent_branch.addChild(current_branch); testMessage("Depth [" + depth + "] Adding branch: " + current_branch + " to parent: " + parent_branch); current_branch = previous_branch; return false; }
class class_name[name] begin[{] method[processRuleset, return_type[type[boolean]], modifier[private], parameter[parent_branch, depth]] begin[{] if[binary_operation[member[.rule_idx], >, member[.max_rule_level]]] begin[{] return[literal[true]] else begin[{] None end[}] local_variable[type[Branch], previous_branch] assign[member[.current_branch], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getTreeId, postfix_operators=[], prefix_operators=[], qualifier=tree, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Branch, sub_type=None))] local_variable[type[TreeMap], rule_level] if[binary_operation[member[.rule_level], ==, literal[null]]] begin[{] return[literal[true]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Processing rule: "), operandr=MemberReference(member=rule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=testMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), operandr=MemberReference(member=METRIC, postfix_operators=[], prefix_operators=[], qualifier=TreeRuleType, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), operandr=MemberReference(member=TAGK, postfix_operators=[], prefix_operators=[], qualifier=TreeRuleType, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), operandr=MemberReference(member=METRIC_CUSTOM, postfix_operators=[], prefix_operators=[], qualifier=TreeRuleType, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), operandr=MemberReference(member=TAGK_CUSTOM, postfix_operators=[], prefix_operators=[], qualifier=TreeRuleType, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None), operandr=MemberReference(member=TAGV_CUSTOM, postfix_operators=[], prefix_operators=[], qualifier=TreeRuleType, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unkown rule type: "), operandr=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=rule, 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=IllegalArgumentException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=parseTagvRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=parseTagkCustomRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=parseMetricCustomRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=parseTagkRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=parseMetricRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDisplayName, postfix_operators=[], prefix_operators=[], qualifier=current_branch, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=getDisplayName, postfix_operators=[], prefix_operators=['!'], qualifier=current_branch, selectors=[MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=rule_level, 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=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TreeRule, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) if[binary_operation[binary_operation[call[current_branch.getDisplayName, parameter[]], ==, literal[null]], ||, call[current_branch.getDisplayName, parameter[]]]] begin[{] if[binary_operation[member[.not_matched], ==, literal[null]]] begin[{] assign[member[.not_matched], ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=rule, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] else begin[{] assign[member[.not_matched], binary_operation[literal[" "], +, member[.rule]]] end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[.splits], !=, literal[null]], &&, binary_operation[member[.split_idx], >=, member[splits.length]]]] begin[{] assign[member[.splits], literal[null]] assign[member[.split_idx], literal[0]] member[.rule_idx] else begin[{] if[binary_operation[member[.splits], !=, literal[null]]] begin[{] else begin[{] member[.rule_idx] end[}] end[}] local_variable[type[boolean], complete] if[member[.complete]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.current_branch], ==, literal[null]], ||, binary_operation[call[current_branch.getDisplayName, parameter[]], ==, literal[null]]], ||, call[current_branch.getDisplayName, parameter[]]]] begin[{] call[LOG.trace, parameter[literal["Got to a null branch"]]] assign[member[.current_branch], member[.previous_branch]] return[literal[true]] else begin[{] None end[}] if[binary_operation[binary_operation[call[parent_branch.getDisplayName, parameter[]], ==, literal[null]], ||, call[parent_branch.getDisplayName, parameter[]]]] begin[{] call[.testMessage, parameter[binary_operation[binary_operation[literal["Depth ["], +, member[.depth]], +, literal["] Parent branch was empty, rolling back"]]]] return[literal[true]] else begin[{] None end[}] local_variable[type[Leaf], leaf] call[parent_branch.addLeaf, parameter[member[.leaf], member[.tree]]] call[.testMessage, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Depth ["], +, member[.depth]], +, literal["] Adding leaf ["]], +, member[.leaf]], +, literal["] to parent branch ["]], +, member[.parent_branch]], +, literal["]"]]]] assign[member[.current_branch], member[.previous_branch]] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[member[.previous_branch], ==, literal[null]], ||, call[previous_branch.getDisplayName, parameter[]]], &&, call[current_branch.getDisplayName, parameter[]]]] begin[{] if[binary_operation[member[.depth], >, literal[2]]] begin[{] call[.testMessage, parameter[binary_operation[binary_operation[binary_operation[literal["Depth ["], +, member[.depth]], +, literal["] Skipping a non-matched branch, returning: "]], +, member[.current_branch]]]] else begin[{] None end[}] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[call[current_branch.getDisplayName, parameter[]], ==, literal[null]], ||, call[current_branch.getDisplayName, parameter[]]]] begin[{] call[.testMessage, parameter[binary_operation[binary_operation[literal["Depth ["], +, member[.depth]], +, literal["] Branch was empty"]]]] assign[member[.current_branch], member[.previous_branch]] return[literal[false]] else begin[{] None end[}] if[call[current_branch.getDisplayName, parameter[]]] begin[{] call[.testMessage, parameter[binary_operation[binary_operation[literal["Depth ["], +, member[.depth]], +, literal["] Current was the same as previous"]]]] return[literal[false]] else begin[{] None end[}] call[parent_branch.addChild, parameter[member[.current_branch]]] call[.testMessage, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Depth ["], +, member[.depth]], +, literal["] Adding branch: "]], +, member[.current_branch]], +, literal[" to parent: "]], +, member[.parent_branch]]]] assign[member[.current_branch], member[.previous_branch]] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[processRuleset] operator[SEP] Keyword[final] identifier[Branch] identifier[parent_branch] , Keyword[int] identifier[depth] operator[SEP] { Keyword[if] operator[SEP] identifier[rule_idx] operator[>] identifier[max_rule_level] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[final] identifier[Branch] identifier[previous_branch] operator[=] identifier[current_branch] operator[SEP] identifier[current_branch] operator[=] Keyword[new] identifier[Branch] operator[SEP] identifier[tree] operator[SEP] identifier[getTreeId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[TreeMap] operator[<] identifier[Integer] , identifier[TreeRule] operator[>] identifier[rule_level] operator[=] identifier[fetchRuleLevel] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rule_level] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Integer] , identifier[TreeRule] operator[>] identifier[entry] operator[:] identifier[rule_level] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[rule] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[testMessage] operator[SEP] literal[String] operator[+] identifier[rule] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rule] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[TreeRuleType] operator[SEP] identifier[METRIC] operator[SEP] { identifier[parseMetricRule] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[rule] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[TreeRuleType] operator[SEP] identifier[TAGK] operator[SEP] { identifier[parseTagkRule] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[rule] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[TreeRuleType] operator[SEP] identifier[METRIC_CUSTOM] operator[SEP] { identifier[parseMetricCustomRule] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[rule] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[TreeRuleType] operator[SEP] identifier[TAGK_CUSTOM] operator[SEP] { identifier[parseTagkCustomRule] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[rule] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[TreeRuleType] operator[SEP] identifier[TAGV_CUSTOM] operator[SEP] { identifier[parseTagvRule] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[rule] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[not_matched] operator[==] Other[null] operator[SEP] { identifier[not_matched] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[rule] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[not_matched] operator[+=] literal[String] operator[+] identifier[rule] operator[SEP] } } Keyword[if] operator[SEP] identifier[splits] operator[!=] Other[null] operator[&&] identifier[split_idx] operator[>=] identifier[splits] operator[SEP] identifier[length] operator[SEP] { identifier[splits] operator[=] Other[null] operator[SEP] identifier[split_idx] operator[=] Other[0] operator[SEP] identifier[rule_idx] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[splits] operator[!=] Other[null] operator[SEP] { } Keyword[else] { identifier[rule_idx] operator[++] operator[SEP] } Keyword[final] Keyword[boolean] identifier[complete] operator[=] identifier[processRuleset] operator[SEP] identifier[current_branch] , operator[++] identifier[depth] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[complete] operator[SEP] { Keyword[if] operator[SEP] identifier[current_branch] operator[==] Other[null] operator[||] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[current_branch] operator[=] identifier[previous_branch] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[parent_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[parent_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[testMessage] operator[SEP] literal[String] operator[+] identifier[depth] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[final] identifier[Leaf] identifier[leaf] operator[=] Keyword[new] identifier[Leaf] operator[SEP] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] , identifier[meta] operator[SEP] identifier[getTSUID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[parent_branch] operator[SEP] identifier[addLeaf] operator[SEP] identifier[leaf] , identifier[tree] operator[SEP] operator[SEP] identifier[testMessage] operator[SEP] literal[String] operator[+] identifier[depth] operator[+] literal[String] operator[+] identifier[leaf] operator[+] literal[String] operator[+] identifier[parent_branch] operator[+] literal[String] operator[SEP] operator[SEP] identifier[current_branch] operator[=] identifier[previous_branch] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[SEP] identifier[previous_branch] operator[==] Other[null] operator[||] identifier[previous_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[depth] operator[>] Other[2] operator[SEP] { identifier[testMessage] operator[SEP] literal[String] operator[+] identifier[depth] operator[+] literal[String] operator[+] identifier[current_branch] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[testMessage] operator[SEP] literal[String] operator[+] identifier[depth] operator[+] literal[String] operator[SEP] operator[SEP] identifier[current_branch] operator[=] identifier[previous_branch] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[current_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[previous_branch] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[testMessage] operator[SEP] literal[String] operator[+] identifier[depth] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[parent_branch] operator[SEP] identifier[addChild] operator[SEP] identifier[current_branch] operator[SEP] operator[SEP] identifier[testMessage] operator[SEP] literal[String] operator[+] identifier[depth] operator[+] literal[String] operator[+] identifier[current_branch] operator[+] literal[String] operator[+] identifier[parent_branch] operator[SEP] operator[SEP] identifier[current_branch] operator[=] identifier[previous_branch] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public String getStringValue(DataBinder binder) { // binder can't get a non existent param if (this.name == null || this.name.equals("")) { return null; } String value = (String) binder.getLocal(this.name); if (value == null && this.required) { throw new IllegalArgumentException("Parameter " + name + " is required"); } return value; }
class class_name[name] begin[{] method[getStringValue, return_type[type[String]], modifier[public], parameter[binder]] begin[{] if[binary_operation[binary_operation[THIS[member[None.name]], ==, literal[null]], ||, THIS[member[None.name]call[None.equals, parameter[literal[""]]]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], value] if[binary_operation[binary_operation[member[.value], ==, literal[null]], &&, THIS[member[None.required]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is required"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.value]] end[}] END[}]
Keyword[public] identifier[String] identifier[getStringValue] operator[SEP] identifier[DataBinder] identifier[binder] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[name] operator[==] Other[null] operator[||] Keyword[this] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[String] identifier[value] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[binder] operator[SEP] identifier[getLocal] operator[SEP] Keyword[this] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[required] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[value] operator[SEP] }
private static boolean portsMatch(ServicePort servicePort, IntOrString intOrString) { if (intOrString != null) { Integer port = servicePort.getPort(); Integer intVal = intOrString.getIntVal(); String strVal = intOrString.getStrVal(); if (intVal != null) { if (port != null) { return port.intValue() == intVal.intValue(); } else { /// should we find the port by name now? } } else if (strVal != null ){ return Objects.equal(strVal, servicePort.getName()); } } return false; }
class class_name[name] begin[{] method[portsMatch, return_type[type[boolean]], modifier[private static], parameter[servicePort, intOrString]] begin[{] if[binary_operation[member[.intOrString], !=, literal[null]]] begin[{] local_variable[type[Integer], port] local_variable[type[Integer], intVal] local_variable[type[String], strVal] if[binary_operation[member[.intVal], !=, literal[null]]] begin[{] if[binary_operation[member[.port], !=, literal[null]]] begin[{] return[binary_operation[call[port.intValue, parameter[]], ==, call[intVal.intValue, parameter[]]]] else begin[{] end[}] else begin[{] if[binary_operation[member[.strVal], !=, literal[null]]] begin[{] return[call[Objects.equal, parameter[member[.strVal], call[servicePort.getName, parameter[]]]]] else begin[{] None end[}] end[}] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[portsMatch] operator[SEP] identifier[ServicePort] identifier[servicePort] , identifier[IntOrString] identifier[intOrString] operator[SEP] { Keyword[if] operator[SEP] identifier[intOrString] operator[!=] Other[null] operator[SEP] { identifier[Integer] identifier[port] operator[=] identifier[servicePort] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] identifier[Integer] identifier[intVal] operator[=] identifier[intOrString] operator[SEP] identifier[getIntVal] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[strVal] operator[=] identifier[intOrString] operator[SEP] identifier[getStrVal] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[intVal] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[port] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[port] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[==] identifier[intVal] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { } } Keyword[else] Keyword[if] operator[SEP] identifier[strVal] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[Objects] operator[SEP] identifier[equal] operator[SEP] identifier[strVal] , identifier[servicePort] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public static void d(String tag, String msg) { if (logEnabled) { Log.d(tag, msg); } }
class class_name[name] begin[{] method[d, return_type[void], modifier[public static], parameter[tag, msg]] begin[{] if[member[.logEnabled]] begin[{] call[Log.d, parameter[member[.tag], member[.msg]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[d] operator[SEP] identifier[String] identifier[tag] , identifier[String] identifier[msg] operator[SEP] { Keyword[if] operator[SEP] identifier[logEnabled] operator[SEP] { identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[tag] , identifier[msg] operator[SEP] operator[SEP] } }
public static Geometry convert(org.postgis.Geometry geometry) { switch (geometry.getType()) { case org.postgis.Geometry.POINT: return convert((org.postgis.Point) geometry); case org.postgis.Geometry.LINESTRING: return convert((org.postgis.LineString) geometry); case org.postgis.Geometry.LINEARRING: return convert((org.postgis.LinearRing) geometry); case org.postgis.Geometry.POLYGON: return convert((org.postgis.Polygon) geometry); case org.postgis.Geometry.MULTILINESTRING: return convert((org.postgis.MultiLineString) geometry); case org.postgis.Geometry.MULTIPOINT: return convert((org.postgis.MultiPoint) geometry); case org.postgis.Geometry.MULTIPOLYGON: return convert((org.postgis.MultiPolygon) geometry); case org.postgis.Geometry.GEOMETRYCOLLECTION: return convert((org.postgis.GeometryCollection) geometry); } throw new IllegalArgumentException(geometry.toString()); }
class class_name[name] begin[{] method[convert, return_type[type[Geometry]], modifier[public static], parameter[geometry]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=POINT, postfix_operators=[], prefix_operators=[], qualifier=org.postgis.Geometry, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=postgis, sub_type=ReferenceType(arguments=None, dimensions=None, name=Point, sub_type=None))))], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=LINESTRING, postfix_operators=[], prefix_operators=[], qualifier=org.postgis.Geometry, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=postgis, sub_type=ReferenceType(arguments=None, dimensions=None, name=LineString, sub_type=None))))], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=LINEARRING, postfix_operators=[], prefix_operators=[], qualifier=org.postgis.Geometry, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=postgis, sub_type=ReferenceType(arguments=None, dimensions=None, name=LinearRing, sub_type=None))))], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=POLYGON, postfix_operators=[], prefix_operators=[], qualifier=org.postgis.Geometry, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=postgis, sub_type=ReferenceType(arguments=None, dimensions=None, name=Polygon, sub_type=None))))], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=MULTILINESTRING, postfix_operators=[], prefix_operators=[], qualifier=org.postgis.Geometry, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=postgis, sub_type=ReferenceType(arguments=None, dimensions=None, name=MultiLineString, sub_type=None))))], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=MULTIPOINT, postfix_operators=[], prefix_operators=[], qualifier=org.postgis.Geometry, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=postgis, sub_type=ReferenceType(arguments=None, dimensions=None, name=MultiPoint, sub_type=None))))], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=MULTIPOLYGON, postfix_operators=[], prefix_operators=[], qualifier=org.postgis.Geometry, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=postgis, sub_type=ReferenceType(arguments=None, dimensions=None, name=MultiPolygon, sub_type=None))))], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=GEOMETRYCOLLECTION, postfix_operators=[], prefix_operators=[], qualifier=org.postgis.Geometry, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=postgis, sub_type=ReferenceType(arguments=None, dimensions=None, name=GeometryCollection, sub_type=None))))], member=convert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=geometry, selectors=[], type_arguments=None), label=None) ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=geometry, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Geometry] identifier[convert] operator[SEP] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Geometry] identifier[geometry] operator[SEP] { Keyword[switch] operator[SEP] identifier[geometry] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Geometry] operator[SEP] identifier[POINT] operator[:] Keyword[return] identifier[convert] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Point] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] Keyword[case] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Geometry] operator[SEP] identifier[LINESTRING] operator[:] Keyword[return] identifier[convert] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[LineString] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] Keyword[case] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Geometry] operator[SEP] identifier[LINEARRING] operator[:] Keyword[return] identifier[convert] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[LinearRing] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] Keyword[case] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Geometry] operator[SEP] identifier[POLYGON] operator[:] Keyword[return] identifier[convert] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Polygon] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] Keyword[case] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Geometry] operator[SEP] identifier[MULTILINESTRING] operator[:] Keyword[return] identifier[convert] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[MultiLineString] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] Keyword[case] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Geometry] operator[SEP] identifier[MULTIPOINT] operator[:] Keyword[return] identifier[convert] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[MultiPoint] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] Keyword[case] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Geometry] operator[SEP] identifier[MULTIPOLYGON] operator[:] Keyword[return] identifier[convert] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[MultiPolygon] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] Keyword[case] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[Geometry] operator[SEP] identifier[GEOMETRYCOLLECTION] operator[:] Keyword[return] identifier[convert] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[postgis] operator[SEP] identifier[GeometryCollection] operator[SEP] identifier[geometry] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[geometry] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public int doEndTag() throws JspException { if(hasErrors()) reportErrors(); else { AbstractCallMethod cm = (AbstractCallMethod)getParent(); cm.addParameter(_type, _isNull ? null : _value); } localRelease(); return EVAL_PAGE; }
class class_name[name] begin[{] method[doEndTag, return_type[type[int]], modifier[public], parameter[]] begin[{] if[call[.hasErrors, parameter[]]] begin[{] call[.reportErrors, parameter[]] else begin[{] local_variable[type[AbstractCallMethod], cm] call[cm.addParameter, parameter[member[._type], TernaryExpression(condition=MemberReference(member=_isNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=_value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]] end[}] call[.localRelease, parameter[]] return[member[.EVAL_PAGE]] end[}] END[}]
Keyword[public] Keyword[int] identifier[doEndTag] operator[SEP] operator[SEP] Keyword[throws] identifier[JspException] { Keyword[if] operator[SEP] identifier[hasErrors] operator[SEP] operator[SEP] operator[SEP] identifier[reportErrors] operator[SEP] operator[SEP] operator[SEP] Keyword[else] { identifier[AbstractCallMethod] identifier[cm] operator[=] operator[SEP] identifier[AbstractCallMethod] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] identifier[cm] operator[SEP] identifier[addParameter] operator[SEP] identifier[_type] , identifier[_isNull] operator[?] Other[null] operator[:] identifier[_value] operator[SEP] operator[SEP] } identifier[localRelease] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[EVAL_PAGE] operator[SEP] }
public void modifyServiceProvider(final Map<String, Object> changedValues) { AddressTemplate template = SERVICE_PROVIDER_TEMPLATE.replaceWildcards(federation, serviceProvider); modify(template, serviceProvider, changedValues); }
class class_name[name] begin[{] method[modifyServiceProvider, return_type[void], modifier[public], parameter[changedValues]] begin[{] local_variable[type[AddressTemplate], template] call[.modify, parameter[member[.template], member[.serviceProvider], member[.changedValues]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[modifyServiceProvider] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[changedValues] operator[SEP] { identifier[AddressTemplate] identifier[template] operator[=] identifier[SERVICE_PROVIDER_TEMPLATE] operator[SEP] identifier[replaceWildcards] operator[SEP] identifier[federation] , identifier[serviceProvider] operator[SEP] operator[SEP] identifier[modify] operator[SEP] identifier[template] , identifier[serviceProvider] , identifier[changedValues] operator[SEP] operator[SEP] }
protected void receiveServerRequest(HttpMessage request) { BuilderSupport<HttpActionBuilder> action = builder -> { HttpServerActionBuilder.HttpServerReceiveActionBuilder receiveBuilder = builder.server(httpServer).receive(); HttpServerRequestActionBuilder requestBuilder; if (request.getRequestMethod() == null || request.getRequestMethod().equals(HttpMethod.POST)) { requestBuilder = receiveBuilder.post().message(request); } else if (request.getRequestMethod().equals(HttpMethod.GET)) { requestBuilder = receiveBuilder.get().message(request); } else if (request.getRequestMethod().equals(HttpMethod.PUT)) { requestBuilder = receiveBuilder.put().message(request); } else if (request.getRequestMethod().equals(HttpMethod.DELETE)) { requestBuilder = receiveBuilder.delete().message(request); } else if (request.getRequestMethod().equals(HttpMethod.HEAD)) { requestBuilder = receiveBuilder.head().message(request); } else if (request.getRequestMethod().equals(HttpMethod.TRACE)) { requestBuilder = receiveBuilder.trace().message(request); } else if (request.getRequestMethod().equals(HttpMethod.PATCH)) { requestBuilder = receiveBuilder.patch().message(request); } else if (request.getRequestMethod().equals(HttpMethod.OPTIONS)) { requestBuilder = receiveBuilder.options().message(request); } else { requestBuilder = receiveBuilder.post().message(request); } for (Map.Entry<String, String> headerEntry : pathValidations.entrySet()) { requestBuilder.validate(headerEntry.getKey(), headerEntry.getValue()); } pathValidations.clear(); }; runner.http(action); }
class class_name[name] begin[{] method[receiveServerRequest, return_type[void], modifier[protected], parameter[request]] begin[{] local_variable[type[BuilderSupport], action] call[runner.http, parameter[member[.action]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[receiveServerRequest] operator[SEP] identifier[HttpMessage] identifier[request] operator[SEP] { identifier[BuilderSupport] operator[<] identifier[HttpActionBuilder] operator[>] identifier[action] operator[=] identifier[builder] operator[->] { identifier[HttpServerActionBuilder] operator[SEP] identifier[HttpServerReceiveActionBuilder] identifier[receiveBuilder] operator[=] identifier[builder] operator[SEP] identifier[server] operator[SEP] identifier[httpServer] operator[SEP] operator[SEP] identifier[receive] operator[SEP] operator[SEP] operator[SEP] identifier[HttpServerRequestActionBuilder] identifier[requestBuilder] operator[SEP] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[==] Other[null] operator[||] identifier[request] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[POST] operator[SEP] operator[SEP] { identifier[requestBuilder] operator[=] identifier[receiveBuilder] operator[SEP] identifier[post] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[GET] operator[SEP] operator[SEP] { identifier[requestBuilder] operator[=] identifier[receiveBuilder] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[PUT] operator[SEP] operator[SEP] { identifier[requestBuilder] operator[=] identifier[receiveBuilder] operator[SEP] identifier[put] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[DELETE] operator[SEP] operator[SEP] { identifier[requestBuilder] operator[=] identifier[receiveBuilder] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[HEAD] operator[SEP] operator[SEP] { identifier[requestBuilder] operator[=] identifier[receiveBuilder] operator[SEP] identifier[head] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[TRACE] operator[SEP] operator[SEP] { identifier[requestBuilder] operator[=] identifier[receiveBuilder] operator[SEP] identifier[trace] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[PATCH] operator[SEP] operator[SEP] { identifier[requestBuilder] operator[=] identifier[receiveBuilder] operator[SEP] identifier[patch] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getRequestMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[HttpMethod] operator[SEP] identifier[OPTIONS] operator[SEP] operator[SEP] { identifier[requestBuilder] operator[=] identifier[receiveBuilder] operator[SEP] identifier[options] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[else] { identifier[requestBuilder] operator[=] identifier[receiveBuilder] operator[SEP] identifier[post] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[request] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[headerEntry] operator[:] identifier[pathValidations] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[requestBuilder] operator[SEP] identifier[validate] operator[SEP] identifier[headerEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[headerEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pathValidations] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } operator[SEP] identifier[runner] operator[SEP] identifier[http] operator[SEP] identifier[action] operator[SEP] operator[SEP] }
public static Writer quote(String str, Writer writer) throws IOException { return quote(str, writer, true); }
class class_name[name] begin[{] method[quote, return_type[type[Writer]], modifier[public static], parameter[str, writer]] begin[{] return[call[.quote, parameter[member[.str], member[.writer], literal[true]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Writer] identifier[quote] operator[SEP] identifier[String] identifier[str] , identifier[Writer] identifier[writer] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[quote] operator[SEP] identifier[str] , identifier[writer] , literal[boolean] operator[SEP] operator[SEP] }
@Override public void markStale() { final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled(); if (isTracingEnabled && tc.isEntryEnabled()) { Tr.entry(this, tc, "markStale"); } // This update must be thread safe. I'm assuming here that a boolean assignment // is atomic. If that's incorrect, then we'll need to add a synchronize(stale) // gaurd here and on the isStale method. stale = true; if (isTracingEnabled && tc.isEntryEnabled()) { Tr.exit(this, tc, "markStale"); } }
class class_name[name] begin[{] method[markStale, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[boolean], isTracingEnabled] if[binary_operation[member[.isTracingEnabled], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[THIS[], member[.tc], literal["markStale"]]] else begin[{] None end[}] assign[member[.stale], literal[true]] if[binary_operation[member[.isTracingEnabled], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[THIS[], member[.tc], literal["markStale"]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[markStale] operator[SEP] operator[SEP] { Keyword[final] Keyword[boolean] identifier[isTracingEnabled] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTracingEnabled] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] } identifier[stale] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[isTracingEnabled] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] } }
public boolean addOptionalParams(JSType ...types) { if (hasVarArgs()) { return false; } for (JSType type : types) { newParameter(registry.createOptionalType(type)).setOptionalArg(true); } return true; }
class class_name[name] begin[{] method[addOptionalParams, return_type[type[boolean]], modifier[public], parameter[types]] begin[{] if[call[.hasVarArgs, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createOptionalType, postfix_operators=[], prefix_operators=[], qualifier=registry, selectors=[], type_arguments=None)], member=newParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setOptionalArg, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=types, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSType, sub_type=None))), label=None) return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[addOptionalParams] operator[SEP] identifier[JSType] operator[...] identifier[types] operator[SEP] { Keyword[if] operator[SEP] identifier[hasVarArgs] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] identifier[JSType] identifier[type] operator[:] identifier[types] operator[SEP] { identifier[newParameter] operator[SEP] identifier[registry] operator[SEP] identifier[createOptionalType] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[setOptionalArg] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private static List<String> removeNonAccessible(CmsObject cms, List<String> sitePaths) { List<String> result = new ArrayList<String>(sitePaths.size()); for (String sitePath : sitePaths) { if (cms.existsResource(sitePath, CmsResourceFilter.IGNORE_EXPIRATION)) { result.add(sitePath); } } return result; }
class class_name[name] begin[{] method[removeNonAccessible, return_type[type[List]], modifier[private static], parameter[cms, sitePaths]] begin[{] local_variable[type[List], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sitePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=IGNORE_EXPIRATION, postfix_operators=[], prefix_operators=[], qualifier=CmsResourceFilter, selectors=[])], member=existsResource, postfix_operators=[], prefix_operators=[], qualifier=cms, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sitePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=sitePaths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sitePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[removeNonAccessible] operator[SEP] identifier[CmsObject] identifier[cms] , identifier[List] operator[<] identifier[String] operator[>] identifier[sitePaths] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[sitePaths] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[sitePath] operator[:] identifier[sitePaths] operator[SEP] { Keyword[if] operator[SEP] identifier[cms] operator[SEP] identifier[existsResource] operator[SEP] identifier[sitePath] , identifier[CmsResourceFilter] operator[SEP] identifier[IGNORE_EXPIRATION] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[sitePath] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
private static IllegalStateException unrecognizedSchemaType(ClassTemplateSpec enclosingClass, String memberName, DataSchema schema) { return new IllegalStateException("Unrecognized schema: " + schema + enclosingClassAndMemberNameToString(enclosingClass, memberName)); }
class class_name[name] begin[{] method[unrecognizedSchemaType, return_type[type[IllegalStateException]], modifier[private static], parameter[enclosingClass, memberName, schema]] begin[{] return[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unrecognized schema: "), operandr=MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=enclosingClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=memberName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=enclosingClassAndMemberNameToString, 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))] end[}] END[}]
Keyword[private] Keyword[static] identifier[IllegalStateException] identifier[unrecognizedSchemaType] operator[SEP] identifier[ClassTemplateSpec] identifier[enclosingClass] , identifier[String] identifier[memberName] , identifier[DataSchema] identifier[schema] operator[SEP] { Keyword[return] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[schema] operator[+] identifier[enclosingClassAndMemberNameToString] operator[SEP] identifier[enclosingClass] , identifier[memberName] operator[SEP] operator[SEP] operator[SEP] }
public ObjectResult updateObject(SpiderTransaction parentTran, DBObject dbObj, Map<String, String> currScalarMap) { ObjectResult result = new ObjectResult(); try { result.setObjectID(dbObj.getObjectID()); boolean bUpdated = updateExistingObject(dbObj, currScalarMap); result.setUpdated(bUpdated); if (bUpdated) { m_logger.trace("updateObject(): object updated for ID={}", dbObj.getObjectID()); parentTran.mergeSubTransaction(m_dbTran); } else { result.setComment("No updates made"); m_logger.trace("updateObject(): no updates made for ID={}", dbObj.getObjectID()); } } catch (Throwable ex) { buildErrorStatus(result, dbObj.getObjectID(), ex); } return result; }
class class_name[name] begin[{] method[updateObject, return_type[type[ObjectResult]], modifier[public], parameter[parentTran, dbObj, currScalarMap]] begin[{] local_variable[type[ObjectResult], result] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getObjectID, postfix_operators=[], prefix_operators=[], qualifier=dbObj, selectors=[], type_arguments=None)], member=setObjectID, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dbObj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=currScalarMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateExistingObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=bUpdated)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bUpdated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setUpdated, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=bUpdated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No updates made")], member=setComment, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="updateObject(): no updates made for ID={}"), MethodInvocation(arguments=[], member=getObjectID, postfix_operators=[], prefix_operators=[], qualifier=dbObj, selectors=[], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=m_logger, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="updateObject(): object updated for ID={}"), MethodInvocation(arguments=[], member=getObjectID, postfix_operators=[], prefix_operators=[], qualifier=dbObj, selectors=[], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=m_logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_dbTran, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mergeSubTransaction, postfix_operators=[], prefix_operators=[], qualifier=parentTran, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getObjectID, postfix_operators=[], prefix_operators=[], qualifier=dbObj, selectors=[], type_arguments=None), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildErrorStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Throwable']))], finally_block=None, label=None, resources=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[ObjectResult] identifier[updateObject] operator[SEP] identifier[SpiderTransaction] identifier[parentTran] , identifier[DBObject] identifier[dbObj] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[currScalarMap] operator[SEP] { identifier[ObjectResult] identifier[result] operator[=] Keyword[new] identifier[ObjectResult] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[result] operator[SEP] identifier[setObjectID] operator[SEP] identifier[dbObj] operator[SEP] identifier[getObjectID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[bUpdated] operator[=] identifier[updateExistingObject] operator[SEP] identifier[dbObj] , identifier[currScalarMap] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[setUpdated] operator[SEP] identifier[bUpdated] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bUpdated] operator[SEP] { identifier[m_logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[dbObj] operator[SEP] identifier[getObjectID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[parentTran] operator[SEP] identifier[mergeSubTransaction] operator[SEP] identifier[m_dbTran] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[setComment] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[m_logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[dbObj] operator[SEP] identifier[getObjectID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] { identifier[buildErrorStatus] operator[SEP] identifier[result] , identifier[dbObj] operator[SEP] identifier[getObjectID] operator[SEP] operator[SEP] , identifier[ex] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
private void includeXmlContent(final XIncludeAttributes xIncludeAttributes) throws XIncludeFatalException, XIncludeResourceException { try { settingLanguage(); final SAXSource source = buildingXIncludeSource(xIncludeAttributes); final TreeInfo docInfo = this.context.getConfiguration().getProcessor().getUnderlyingConfiguration() .buildDocumentTree(source); final XdmNode node = new XdmNode(docInfo.getRootNode()); startingInjectXInclude(); injectingXInclude(xIncludeAttributes, source, node); } catch (final XPointerResourceException e) { throw new XIncludeResourceException(e.getMessage()); } catch (final XPointerException e) { throw new XIncludeFatalException(e.getMessage()); } catch (final XPathException e) { if (e.getCause() instanceof XIncludeFatalException) { throw (XIncludeFatalException) e.getCause(); } else { throw new XIncludeFatalException(e.getMessage()); } } finally { if (isInjectingXInclude()) { endingInjectXInclude(); } } }
class class_name[name] begin[{] method[includeXmlContent, return_type[void], modifier[private], parameter[xIncludeAttributes]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=settingLanguage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=xIncludeAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildingXIncludeSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=source)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=SAXSource, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=context, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getConfiguration, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getProcessor, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getUnderlyingConfiguration, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildDocumentTree, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=docInfo)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=TreeInfo, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getRootNode, postfix_operators=[], prefix_operators=[], qualifier=docInfo, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XdmNode, sub_type=None)), name=node)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=XdmNode, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=startingInjectXInclude, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=xIncludeAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=injectingXInclude, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XIncludeResourceException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['XPointerResourceException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XIncludeFatalException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['XPointerException'])), CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operandr=ReferenceType(arguments=None, dimensions=[], name=XIncludeFatalException, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XIncludeFatalException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=Cast(expression=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=XIncludeFatalException, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['XPathException']))], finally_block=[IfStatement(condition=MethodInvocation(arguments=[], member=isInjectingXInclude, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=endingInjectXInclude, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[includeXmlContent] operator[SEP] Keyword[final] identifier[XIncludeAttributes] identifier[xIncludeAttributes] operator[SEP] Keyword[throws] identifier[XIncludeFatalException] , identifier[XIncludeResourceException] { Keyword[try] { identifier[settingLanguage] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[SAXSource] identifier[source] operator[=] identifier[buildingXIncludeSource] operator[SEP] identifier[xIncludeAttributes] operator[SEP] operator[SEP] Keyword[final] identifier[TreeInfo] identifier[docInfo] operator[=] Keyword[this] operator[SEP] identifier[context] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[getProcessor] operator[SEP] operator[SEP] operator[SEP] identifier[getUnderlyingConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[buildDocumentTree] operator[SEP] identifier[source] operator[SEP] operator[SEP] Keyword[final] identifier[XdmNode] identifier[node] operator[=] Keyword[new] identifier[XdmNode] operator[SEP] identifier[docInfo] operator[SEP] identifier[getRootNode] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[startingInjectXInclude] operator[SEP] operator[SEP] operator[SEP] identifier[injectingXInclude] operator[SEP] identifier[xIncludeAttributes] , identifier[source] , identifier[node] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[XPointerResourceException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[XIncludeResourceException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[XPointerException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[XIncludeFatalException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[XPathException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] Keyword[instanceof] identifier[XIncludeFatalException] operator[SEP] { Keyword[throw] operator[SEP] identifier[XIncludeFatalException] operator[SEP] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[XIncludeFatalException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { Keyword[if] operator[SEP] identifier[isInjectingXInclude] operator[SEP] operator[SEP] operator[SEP] { identifier[endingInjectXInclude] operator[SEP] operator[SEP] operator[SEP] } } }
public ApiResponse<ApiAsyncSuccessResponse> getUsersAsyncWithHttpInfo(String aioId, Integer limit, Integer offset, String order, String sortBy, String filterName, String filterParameters, String roles, String skills, Boolean userEnabled, String userValid) throws ApiException { com.squareup.okhttp.Call call = getUsersAsyncValidateBeforeCall(aioId, limit, offset, order, sortBy, filterName, filterParameters, roles, skills, userEnabled, userValid, null, null); Type localVarReturnType = new TypeToken<ApiAsyncSuccessResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
class class_name[name] begin[{] method[getUsersAsyncWithHttpInfo, return_type[type[ApiResponse]], modifier[public], parameter[aioId, limit, offset, order, sortBy, filterName, filterParameters, roles, skills, userEnabled, userValid]] begin[{] local_variable[type[com], call] local_variable[type[Type], localVarReturnType] return[call[apiClient.execute, parameter[member[.call], member[.localVarReturnType]]]] end[}] END[}]
Keyword[public] identifier[ApiResponse] operator[<] identifier[ApiAsyncSuccessResponse] operator[>] identifier[getUsersAsyncWithHttpInfo] operator[SEP] identifier[String] identifier[aioId] , identifier[Integer] identifier[limit] , identifier[Integer] identifier[offset] , identifier[String] identifier[order] , identifier[String] identifier[sortBy] , identifier[String] identifier[filterName] , identifier[String] identifier[filterParameters] , identifier[String] identifier[roles] , identifier[String] identifier[skills] , identifier[Boolean] identifier[userEnabled] , identifier[String] identifier[userValid] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[getUsersAsyncValidateBeforeCall] operator[SEP] identifier[aioId] , identifier[limit] , identifier[offset] , identifier[order] , identifier[sortBy] , identifier[filterName] , identifier[filterParameters] , identifier[roles] , identifier[skills] , identifier[userEnabled] , identifier[userValid] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[ApiAsyncSuccessResponse] operator[>] operator[SEP] operator[SEP] { } operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[apiClient] operator[SEP] identifier[execute] operator[SEP] identifier[call] , identifier[localVarReturnType] operator[SEP] operator[SEP] }
public static String describeExtensionContext(StructureDefinition ext) { CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); for (StringType t : ext.getContext()) b.append(t.getValue()); if (!ext.hasContextType()) throw new Error("no context type on "+ext.getUrl()); switch (ext.getContextType()) { case DATATYPE: return "Use on data type: "+b.toString(); case EXTENSION: return "Use on extension: "+b.toString(); case RESOURCE: return "Use on element: "+b.toString(); case MAPPING: return "Use where element has mapping: "+b.toString(); default: return "??"; } }
class class_name[name] begin[{] method[describeExtensionContext, return_type[type[String]], modifier[public static], parameter[ext]] begin[{] local_variable[type[CommaSeparatedStringBuilder], b] ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getContext, postfix_operators=[], prefix_operators=[], qualifier=ext, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=t)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringType, sub_type=None))), label=None) if[call[ext.hasContextType, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no context type on "), operandr=MethodInvocation(arguments=[], member=getUrl, postfix_operators=[], prefix_operators=[], qualifier=ext, 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=Error, sub_type=None)), label=None) else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=['DATATYPE'], statements=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Use on data type: "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), operator=+), label=None)]), SwitchStatementCase(case=['EXTENSION'], statements=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Use on extension: "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), operator=+), label=None)]), SwitchStatementCase(case=['RESOURCE'], statements=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Use on element: "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), operator=+), label=None)]), SwitchStatementCase(case=['MAPPING'], statements=[ReturnStatement(expression=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Use where element has mapping: "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), operator=+), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="??"), label=None)])], expression=MethodInvocation(arguments=[], member=getContextType, postfix_operators=[], prefix_operators=[], qualifier=ext, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[describeExtensionContext] operator[SEP] identifier[StructureDefinition] identifier[ext] operator[SEP] { identifier[CommaSeparatedStringBuilder] identifier[b] operator[=] Keyword[new] identifier[CommaSeparatedStringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[StringType] identifier[t] operator[:] identifier[ext] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[b] operator[SEP] identifier[append] operator[SEP] identifier[t] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ext] operator[SEP] identifier[hasContextType] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[Error] operator[SEP] literal[String] operator[+] identifier[ext] operator[SEP] identifier[getUrl] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[ext] operator[SEP] identifier[getContextType] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[DATATYPE] operator[:] Keyword[return] literal[String] operator[+] identifier[b] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[EXTENSION] operator[:] Keyword[return] literal[String] operator[+] identifier[b] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[RESOURCE] operator[:] Keyword[return] literal[String] operator[+] identifier[b] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[MAPPING] operator[:] Keyword[return] literal[String] operator[+] identifier[b] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[return] literal[String] operator[SEP] } }
public int writeDependency(Object id, ValueSet valueSet) { final String methodName = "writeDependency()"; int rc = NO_EXCEPTION; if (valueSet.size() == 0) { if (tc.isDebugEnabled()) Tr.debug(tc, methodName, "cacheName=" + this.cacheName + " valueSet=0"); } if (!this.disableDependencyId) { if (delayOffload) { ValueSet vs = auxDataDependencyTable.getEntries(id); if (vs == null) { if (valueSet.size() <= auxDataDependencyTable.delayOffloadEntriesLimit) { Result result = writeValueSetEntry(DEP_ID_DATA, id, null, valueSet, !ADD_IF_NEW); rc = result.returnCode; boolean bComplete = result.bComplete; returnToResultPool(result); if (rc != DISK_EXCEPTION && !bComplete) { rc = auxDataDependencyTable.add(id, valueSet); } } else { rc = writeValueSet(DEP_ID_DATA, id, valueSet, !ALL); // valueSet may be empty after writeValueSet this.cache.getCacheStatisticsListener().depIdsOffloadedToDisk(id); } } else { vs.union(valueSet); if (vs.size() > auxDataDependencyTable.delayOffloadEntriesLimit) { auxDataDependencyTable.removeDependency(id); rc = writeValueSet(DEP_ID_DATA, id, vs, ALL); // valueSet may be empty after writeValueSet if (rc != NO_EXCEPTION) { valueSet.clear(); valueSet.addAll(vs); } this.cache.getCacheStatisticsListener().depIdsOffloadedToDisk(id); } } } else { rc = writeValueSet(DEP_ID_DATA, id, valueSet, !ALL); // valueSet may be empty after writeValueSet } } return rc; }
class class_name[name] begin[{] method[writeDependency, return_type[type[int]], modifier[public], parameter[id, valueSet]] begin[{] local_variable[type[String], methodName] local_variable[type[int], rc] if[binary_operation[call[valueSet.size, parameter[]], ==, literal[0]]] begin[{] if[call[tc.isDebugEnabled, parameter[]]] begin[{] call[Tr.debug, parameter[member[.tc], member[.methodName], binary_operation[binary_operation[literal["cacheName="], +, THIS[member[None.cacheName]]], +, literal[" valueSet=0"]]]] else begin[{] None end[}] else begin[{] None end[}] if[THIS[member[None.disableDependencyId]]] begin[{] if[member[.delayOffload]] begin[{] local_variable[type[ValueSet], vs] if[binary_operation[member[.vs], ==, literal[null]]] begin[{] if[binary_operation[call[valueSet.size, parameter[]], <=, member[auxDataDependencyTable.delayOffloadEntriesLimit]]] begin[{] local_variable[type[Result], result] assign[member[.rc], member[result.returnCode]] local_variable[type[boolean], bComplete] call[.returnToResultPool, parameter[member[.result]]] if[binary_operation[binary_operation[member[.rc], !=, member[.DISK_EXCEPTION]], &&, member[.bComplete]]] begin[{] assign[member[.rc], call[auxDataDependencyTable.add, parameter[member[.id], member[.valueSet]]]] else begin[{] None end[}] else begin[{] assign[member[.rc], call[.writeValueSet, parameter[member[.DEP_ID_DATA], member[.id], member[.valueSet], member[.ALL]]]] THIS[member[None.cache]call[None.getCacheStatisticsListener, parameter[]]call[None.depIdsOffloadedToDisk, parameter[member[.id]]]] end[}] else begin[{] call[vs.union, parameter[member[.valueSet]]] if[binary_operation[call[vs.size, parameter[]], >, member[auxDataDependencyTable.delayOffloadEntriesLimit]]] begin[{] call[auxDataDependencyTable.removeDependency, parameter[member[.id]]] assign[member[.rc], call[.writeValueSet, parameter[member[.DEP_ID_DATA], member[.id], member[.vs], member[.ALL]]]] if[binary_operation[member[.rc], !=, member[.NO_EXCEPTION]]] begin[{] call[valueSet.clear, parameter[]] call[valueSet.addAll, parameter[member[.vs]]] else begin[{] None end[}] THIS[member[None.cache]call[None.getCacheStatisticsListener, parameter[]]call[None.depIdsOffloadedToDisk, parameter[member[.id]]]] else begin[{] None end[}] end[}] else begin[{] assign[member[.rc], call[.writeValueSet, parameter[member[.DEP_ID_DATA], member[.id], member[.valueSet], member[.ALL]]]] end[}] else begin[{] None end[}] return[member[.rc]] end[}] END[}]
Keyword[public] Keyword[int] identifier[writeDependency] operator[SEP] identifier[Object] identifier[id] , identifier[ValueSet] identifier[valueSet] operator[SEP] { Keyword[final] identifier[String] identifier[methodName] operator[=] literal[String] operator[SEP] Keyword[int] identifier[rc] operator[=] identifier[NO_EXCEPTION] operator[SEP] Keyword[if] operator[SEP] identifier[valueSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[methodName] , literal[String] operator[+] Keyword[this] operator[SEP] identifier[cacheName] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[disableDependencyId] operator[SEP] { Keyword[if] operator[SEP] identifier[delayOffload] operator[SEP] { identifier[ValueSet] identifier[vs] operator[=] identifier[auxDataDependencyTable] operator[SEP] identifier[getEntries] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vs] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[valueSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<=] identifier[auxDataDependencyTable] operator[SEP] identifier[delayOffloadEntriesLimit] operator[SEP] { identifier[Result] identifier[result] operator[=] identifier[writeValueSetEntry] operator[SEP] identifier[DEP_ID_DATA] , identifier[id] , Other[null] , identifier[valueSet] , operator[!] identifier[ADD_IF_NEW] operator[SEP] operator[SEP] identifier[rc] operator[=] identifier[result] operator[SEP] identifier[returnCode] operator[SEP] Keyword[boolean] identifier[bComplete] operator[=] identifier[result] operator[SEP] identifier[bComplete] operator[SEP] identifier[returnToResultPool] operator[SEP] identifier[result] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rc] operator[!=] identifier[DISK_EXCEPTION] operator[&&] operator[!] identifier[bComplete] operator[SEP] { identifier[rc] operator[=] identifier[auxDataDependencyTable] operator[SEP] identifier[add] operator[SEP] identifier[id] , identifier[valueSet] operator[SEP] operator[SEP] } } Keyword[else] { identifier[rc] operator[=] identifier[writeValueSet] operator[SEP] identifier[DEP_ID_DATA] , identifier[id] , identifier[valueSet] , operator[!] identifier[ALL] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[cache] operator[SEP] identifier[getCacheStatisticsListener] operator[SEP] operator[SEP] operator[SEP] identifier[depIdsOffloadedToDisk] operator[SEP] identifier[id] operator[SEP] operator[SEP] } } Keyword[else] { identifier[vs] operator[SEP] identifier[union] operator[SEP] identifier[valueSet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] identifier[auxDataDependencyTable] operator[SEP] identifier[delayOffloadEntriesLimit] operator[SEP] { identifier[auxDataDependencyTable] operator[SEP] identifier[removeDependency] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[rc] operator[=] identifier[writeValueSet] operator[SEP] identifier[DEP_ID_DATA] , identifier[id] , identifier[vs] , identifier[ALL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rc] operator[!=] identifier[NO_EXCEPTION] operator[SEP] { identifier[valueSet] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[valueSet] operator[SEP] identifier[addAll] operator[SEP] identifier[vs] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[cache] operator[SEP] identifier[getCacheStatisticsListener] operator[SEP] operator[SEP] operator[SEP] identifier[depIdsOffloadedToDisk] operator[SEP] identifier[id] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[rc] operator[=] identifier[writeValueSet] operator[SEP] identifier[DEP_ID_DATA] , identifier[id] , identifier[valueSet] , operator[!] identifier[ALL] operator[SEP] operator[SEP] } } Keyword[return] identifier[rc] operator[SEP] }
DataSource getFastDatasource() { if(delegatedDataSource==null){ delegatedDataSource = dbms.getFastDataSource(this); if(delegatedDataSource == null){ throw new RuntimeException("Unable to obtain datasource from dbms"); } } return delegatedDataSource; }
class class_name[name] begin[{] method[getFastDatasource, return_type[type[DataSource]], modifier[default], parameter[]] begin[{] if[binary_operation[member[.delegatedDataSource], ==, literal[null]]] begin[{] assign[member[.delegatedDataSource], call[dbms.getFastDataSource, parameter[THIS[]]]] if[binary_operation[member[.delegatedDataSource], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to obtain datasource from dbms")], 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[}] return[member[.delegatedDataSource]] end[}] END[}]
identifier[DataSource] identifier[getFastDatasource] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[delegatedDataSource] operator[==] Other[null] operator[SEP] { identifier[delegatedDataSource] operator[=] identifier[dbms] operator[SEP] identifier[getFastDataSource] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[delegatedDataSource] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[delegatedDataSource] operator[SEP] }
List<Integer> simulateStatementBackwards(final int backtrackPosition) { // search for previous zero-position in stackSizes int currentPosition = backtrackPosition; // check against stack size before the instruction was executed while (stackSizes.get(currentPosition).getLeft() > 0) { currentPosition--; } return Stream.iterate(backtrackPosition, c -> --c).limit(backtrackPosition - currentPosition + 1) .collect(LinkedList::new, Collection::add, Collection::addAll); }
class class_name[name] begin[{] method[simulateStatementBackwards, return_type[type[List]], modifier[default], parameter[backtrackPosition]] begin[{] local_variable[type[int], currentPosition] while[binary_operation[call[stackSizes.get, parameter[member[.currentPosition]]], >, literal[0]]] begin[{] member[.currentPosition] end[}] return[call[Stream.iterate, parameter[member[.backtrackPosition], LambdaExpression(body=MemberReference(member=c, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]), parameters=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]] end[}] END[}]
identifier[List] operator[<] identifier[Integer] operator[>] identifier[simulateStatementBackwards] operator[SEP] Keyword[final] Keyword[int] identifier[backtrackPosition] operator[SEP] { Keyword[int] identifier[currentPosition] operator[=] identifier[backtrackPosition] operator[SEP] Keyword[while] operator[SEP] identifier[stackSizes] operator[SEP] identifier[get] operator[SEP] identifier[currentPosition] operator[SEP] operator[SEP] identifier[getLeft] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[currentPosition] operator[--] operator[SEP] } Keyword[return] identifier[Stream] operator[SEP] identifier[iterate] operator[SEP] identifier[backtrackPosition] , identifier[c] operator[->] operator[--] identifier[c] operator[SEP] operator[SEP] identifier[limit] operator[SEP] identifier[backtrackPosition] operator[-] identifier[currentPosition] operator[+] Other[1] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[LinkedList] operator[::] Keyword[new] , identifier[Collection] operator[::] identifier[add] , identifier[Collection] operator[::] identifier[addAll] operator[SEP] operator[SEP] }
@Override public ListObjectPoliciesResult listObjectPolicies(ListObjectPoliciesRequest request) { request = beforeClientExecution(request); return executeListObjectPolicies(request); }
class class_name[name] begin[{] method[listObjectPolicies, return_type[type[ListObjectPoliciesResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeListObjectPolicies, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ListObjectPoliciesResult] identifier[listObjectPolicies] operator[SEP] identifier[ListObjectPoliciesRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeListObjectPolicies] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void registerFont(Typeface face, String name, Font.Style style, String... ligatureGlyphs) { Pair<String,Font.Style> key = Pair.create(name, style); fonts.put(key, face); ligatureHacks.put(key, ligatureGlyphs); }
class class_name[name] begin[{] method[registerFont, return_type[void], modifier[public], parameter[face, name, style, ligatureGlyphs]] begin[{] local_variable[type[Pair], key] call[fonts.put, parameter[member[.key], member[.face]]] call[ligatureHacks.put, parameter[member[.key], member[.ligatureGlyphs]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerFont] operator[SEP] identifier[Typeface] identifier[face] , identifier[String] identifier[name] , identifier[Font] operator[SEP] identifier[Style] identifier[style] , identifier[String] operator[...] identifier[ligatureGlyphs] operator[SEP] { identifier[Pair] operator[<] identifier[String] , identifier[Font] operator[SEP] identifier[Style] operator[>] identifier[key] operator[=] identifier[Pair] operator[SEP] identifier[create] operator[SEP] identifier[name] , identifier[style] operator[SEP] operator[SEP] identifier[fonts] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[face] operator[SEP] operator[SEP] identifier[ligatureHacks] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[ligatureGlyphs] operator[SEP] operator[SEP] }
@Override public StmtIterator getMetadata() { final Model output = ModelFactory.createDefaultModel(); addMetadata( output ); return output.listStatements(); }
class class_name[name] begin[{] method[getMetadata, return_type[type[StmtIterator]], modifier[public], parameter[]] begin[{] local_variable[type[Model], output] call[.addMetadata, parameter[member[.output]]] return[call[output.listStatements, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[StmtIterator] identifier[getMetadata] operator[SEP] operator[SEP] { Keyword[final] identifier[Model] identifier[output] operator[=] identifier[ModelFactory] operator[SEP] identifier[createDefaultModel] operator[SEP] operator[SEP] operator[SEP] identifier[addMetadata] operator[SEP] identifier[output] operator[SEP] operator[SEP] Keyword[return] identifier[output] operator[SEP] identifier[listStatements] operator[SEP] operator[SEP] operator[SEP] }
protected String getDisplayNameOf(Method e, T i) { Class<?> c = e.getDeclaringClass(); String key = displayNameOf(i); if (key.length()==0) return c.getSimpleName()+"."+e.getName(); try { ResourceBundleHolder rb = ResourceBundleHolder.get( c.getClassLoader().loadClass(c.getPackage().getName() + ".Messages")); return rb.format(key); } catch (ClassNotFoundException x) { LOGGER.log(WARNING, "Failed to load "+x.getMessage()+" for "+e.toString(),x); return key; } catch (MissingResourceException x) { LOGGER.log(WARNING, "Could not find key '" + key + "' in " + c.getPackage().getName() + ".Messages", x); return key; } }
class class_name[name] begin[{] method[getDisplayNameOf, return_type[type[String]], modifier[protected], parameter[e, i]] begin[{] local_variable[type[Class], c] local_variable[type[String], key] if[binary_operation[call[key.length, parameter[]], ==, literal[0]]] begin[{] return[binary_operation[binary_operation[call[c.getSimpleName, parameter[]], +, literal["."]], +, call[e.getName, parameter[]]]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getPackage, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".Messages"), operator=+)], member=loadClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=ResourceBundleHolder, selectors=[], type_arguments=None), name=rb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceBundleHolder, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=rb, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to load "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for "), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=x, types=['ClassNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not find key '"), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' in "), operator=+), operandr=MethodInvocation(arguments=[], member=getPackage, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".Messages"), operator=+), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=x, types=['MissingResourceException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] identifier[String] identifier[getDisplayNameOf] operator[SEP] identifier[Method] identifier[e] , identifier[T] identifier[i] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[c] operator[=] identifier[e] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[key] operator[=] identifier[displayNameOf] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] identifier[c] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[ResourceBundleHolder] identifier[rb] operator[=] identifier[ResourceBundleHolder] operator[SEP] identifier[get] operator[SEP] identifier[c] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[loadClass] operator[SEP] identifier[c] operator[SEP] identifier[getPackage] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[rb] operator[SEP] identifier[format] operator[SEP] identifier[key] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[x] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[x] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[x] operator[SEP] operator[SEP] Keyword[return] identifier[key] operator[SEP] } Keyword[catch] operator[SEP] identifier[MissingResourceException] identifier[x] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[c] operator[SEP] identifier[getPackage] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[x] operator[SEP] operator[SEP] Keyword[return] identifier[key] operator[SEP] } }
public <T extends Evaluation> T evaluate(DataSetIterator iterator, List<String> labelsList, int topN) { if (labelsList == null) labelsList = iterator.getLabels(); Layer outputLayer = getOutputLayer(0); if(getConfiguration().isValidateOutputLayerConfig()){ OutputLayerUtil.validateOutputLayerForClassifierEvaluation(outputLayer.conf().getLayer(), Evaluation.class); } return (T)doEvaluation(iterator, new org.deeplearning4j.eval.Evaluation(labelsList, topN))[0]; }
class class_name[name] begin[{] method[evaluate, return_type[type[T]], modifier[public], parameter[iterator, labelsList, topN]] begin[{] if[binary_operation[member[.labelsList], ==, literal[null]]] begin[{] assign[member[.labelsList], call[iterator.getLabels, parameter[]]] else begin[{] None end[}] local_variable[type[Layer], outputLayer] if[call[.getConfiguration, parameter[]]] begin[{] call[OutputLayerUtil.validateOutputLayerForClassifierEvaluation, parameter[call[outputLayer.conf, parameter[]], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Evaluation, sub_type=None))]] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=iterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=labelsList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=topN, 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=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=deeplearning4j, sub_type=ReferenceType(arguments=None, dimensions=None, name=eval, sub_type=ReferenceType(arguments=None, dimensions=None, name=Evaluation, sub_type=None)))))], member=doEvaluation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Evaluation] operator[>] identifier[T] identifier[evaluate] operator[SEP] identifier[DataSetIterator] identifier[iterator] , identifier[List] operator[<] identifier[String] operator[>] identifier[labelsList] , Keyword[int] identifier[topN] operator[SEP] { Keyword[if] operator[SEP] identifier[labelsList] operator[==] Other[null] operator[SEP] identifier[labelsList] operator[=] identifier[iterator] operator[SEP] identifier[getLabels] operator[SEP] operator[SEP] operator[SEP] identifier[Layer] identifier[outputLayer] operator[=] identifier[getOutputLayer] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[isValidateOutputLayerConfig] operator[SEP] operator[SEP] operator[SEP] { identifier[OutputLayerUtil] operator[SEP] identifier[validateOutputLayerForClassifierEvaluation] operator[SEP] identifier[outputLayer] operator[SEP] identifier[conf] operator[SEP] operator[SEP] operator[SEP] identifier[getLayer] operator[SEP] operator[SEP] , identifier[Evaluation] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[doEvaluation] operator[SEP] identifier[iterator] , Keyword[new] identifier[org] operator[SEP] identifier[deeplearning4j] operator[SEP] identifier[eval] operator[SEP] identifier[Evaluation] operator[SEP] identifier[labelsList] , identifier[topN] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] }
public static IndentingWriter wrap(Appendable delegate, Indentation indentation) { return delegate instanceof IndentingWriter ? ((IndentingWriter) delegate).withIndentation(indentation) : new IndentingWriter(delegate, indentation); }
class class_name[name] begin[{] method[wrap, return_type[type[IndentingWriter]], modifier[public static], parameter[delegate, indentation]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=delegate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=IndentingWriter, sub_type=None), operator=instanceof), if_false=ClassCreator(arguments=[MemberReference(member=delegate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=indentation, 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=IndentingWriter, sub_type=None)), if_true=Cast(expression=MemberReference(member=delegate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IndentingWriter, sub_type=None)))] end[}] END[}]
Keyword[public] Keyword[static] identifier[IndentingWriter] identifier[wrap] operator[SEP] identifier[Appendable] identifier[delegate] , identifier[Indentation] identifier[indentation] operator[SEP] { Keyword[return] identifier[delegate] Keyword[instanceof] identifier[IndentingWriter] operator[?] operator[SEP] operator[SEP] identifier[IndentingWriter] operator[SEP] identifier[delegate] operator[SEP] operator[SEP] identifier[withIndentation] operator[SEP] identifier[indentation] operator[SEP] operator[:] Keyword[new] identifier[IndentingWriter] operator[SEP] identifier[delegate] , identifier[indentation] operator[SEP] operator[SEP] }
public static void formatFileHeader(String fileName, Transaction tx) { tx.concurrencyMgr().modifyFile(fileName); // header should be the first block of the given file if (VanillaDb.fileMgr().size(fileName) == 0) { FileHeaderFormatter fhf = new FileHeaderFormatter(); Buffer buff = tx.bufferMgr().pinNew(fileName, fhf); tx.bufferMgr().unpin(buff); } }
class class_name[name] begin[{] method[formatFileHeader, return_type[void], modifier[public static], parameter[fileName, tx]] begin[{] call[tx.concurrencyMgr, parameter[]] if[binary_operation[call[VanillaDb.fileMgr, parameter[]], ==, literal[0]]] begin[{] local_variable[type[FileHeaderFormatter], fhf] local_variable[type[Buffer], buff] call[tx.bufferMgr, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[formatFileHeader] operator[SEP] identifier[String] identifier[fileName] , identifier[Transaction] identifier[tx] operator[SEP] { identifier[tx] operator[SEP] identifier[concurrencyMgr] operator[SEP] operator[SEP] operator[SEP] identifier[modifyFile] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[VanillaDb] operator[SEP] identifier[fileMgr] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] identifier[fileName] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[FileHeaderFormatter] identifier[fhf] operator[=] Keyword[new] identifier[FileHeaderFormatter] operator[SEP] operator[SEP] operator[SEP] identifier[Buffer] identifier[buff] operator[=] identifier[tx] operator[SEP] identifier[bufferMgr] operator[SEP] operator[SEP] operator[SEP] identifier[pinNew] operator[SEP] identifier[fileName] , identifier[fhf] operator[SEP] operator[SEP] identifier[tx] operator[SEP] identifier[bufferMgr] operator[SEP] operator[SEP] operator[SEP] identifier[unpin] operator[SEP] identifier[buff] operator[SEP] operator[SEP] } }
@Override public int lastIndexOf(long elem) { // Find the location to insert the object at int pos=binarySearch(elem); // Not found if(pos<0) return -1; // Found one, iterate forwards to the last one while(pos<(size-1) && elementData[pos+1]==elem) pos++; return pos; }
class class_name[name] begin[{] method[lastIndexOf, return_type[type[int]], modifier[public], parameter[elem]] begin[{] local_variable[type[int], pos] if[binary_operation[member[.pos], <, literal[0]]] begin[{] return[literal[1]] else begin[{] None end[}] while[binary_operation[binary_operation[member[.pos], <, binary_operation[member[.size], -, literal[1]]], &&, binary_operation[member[.elementData], ==, member[.elem]]]] begin[{] member[.pos] end[}] return[member[.pos]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[lastIndexOf] operator[SEP] Keyword[long] identifier[elem] operator[SEP] { Keyword[int] identifier[pos] operator[=] identifier[binarySearch] operator[SEP] identifier[elem] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[<] Other[0] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[pos] operator[<] operator[SEP] identifier[size] operator[-] Other[1] operator[SEP] operator[&&] identifier[elementData] operator[SEP] identifier[pos] operator[+] Other[1] operator[SEP] operator[==] identifier[elem] operator[SEP] identifier[pos] operator[++] operator[SEP] Keyword[return] identifier[pos] operator[SEP] }
public ServiceFuture<StreamingPolicyInner> getAsync(String resourceGroupName, String accountName, String streamingPolicyName, final ServiceCallback<StreamingPolicyInner> serviceCallback) { return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, streamingPolicyName), serviceCallback); }
class class_name[name] begin[{] method[getAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, accountName, streamingPolicyName, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.getWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.accountName], member[.streamingPolicyName]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[StreamingPolicyInner] operator[>] identifier[getAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[accountName] , identifier[String] identifier[streamingPolicyName] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[StreamingPolicyInner] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[getWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[accountName] , identifier[streamingPolicyName] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public Field generateHiveTypeInfoFieldForMetadataRecord(HiveTypeInfo hiveTypeInfo) { Map<String, Field> fields = new HashMap<>(); fields.put(HiveMetastoreUtil.TYPE, Field.create(hiveTypeInfo.getHiveType().name())); fields.put(HiveMetastoreUtil.EXTRA_INFO, generateExtraInfoFieldForMetadataRecord(hiveTypeInfo)); fields.put(HiveMetastoreUtil.COMMENT, Field.create(Field.Type.STRING, hiveTypeInfo.getComment())); return Field.create(fields); }
class class_name[name] begin[{] method[generateHiveTypeInfoFieldForMetadataRecord, return_type[type[Field]], modifier[public], parameter[hiveTypeInfo]] begin[{] local_variable[type[Map], fields] call[fields.put, parameter[member[HiveMetastoreUtil.TYPE], call[Field.create, parameter[call[hiveTypeInfo.getHiveType, parameter[]]]]]] call[fields.put, parameter[member[HiveMetastoreUtil.EXTRA_INFO], call[.generateExtraInfoFieldForMetadataRecord, parameter[member[.hiveTypeInfo]]]]] call[fields.put, parameter[member[HiveMetastoreUtil.COMMENT], call[Field.create, parameter[member[Field.Type.STRING], call[hiveTypeInfo.getComment, parameter[]]]]]] return[call[Field.create, parameter[member[.fields]]]] end[}] END[}]
Keyword[public] identifier[Field] identifier[generateHiveTypeInfoFieldForMetadataRecord] operator[SEP] identifier[HiveTypeInfo] identifier[hiveTypeInfo] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[Field] operator[>] identifier[fields] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[put] operator[SEP] identifier[HiveMetastoreUtil] operator[SEP] identifier[TYPE] , identifier[Field] operator[SEP] identifier[create] operator[SEP] identifier[hiveTypeInfo] operator[SEP] identifier[getHiveType] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[put] operator[SEP] identifier[HiveMetastoreUtil] operator[SEP] identifier[EXTRA_INFO] , identifier[generateExtraInfoFieldForMetadataRecord] operator[SEP] identifier[hiveTypeInfo] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[put] operator[SEP] identifier[HiveMetastoreUtil] operator[SEP] identifier[COMMENT] , identifier[Field] operator[SEP] identifier[create] operator[SEP] identifier[Field] operator[SEP] identifier[Type] operator[SEP] identifier[STRING] , identifier[hiveTypeInfo] operator[SEP] identifier[getComment] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Field] operator[SEP] identifier[create] operator[SEP] identifier[fields] operator[SEP] operator[SEP] }
public S isNotInstanceOf(Class<?> type) { objects.assertIsNotInstanceOf(description, actual, type); return myself; }
class class_name[name] begin[{] method[isNotInstanceOf, return_type[type[S]], modifier[public], parameter[type]] begin[{] call[objects.assertIsNotInstanceOf, parameter[member[.description], member[.actual], member[.type]]] return[member[.myself]] end[}] END[}]
Keyword[public] identifier[S] identifier[isNotInstanceOf] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[SEP] { identifier[objects] operator[SEP] identifier[assertIsNotInstanceOf] operator[SEP] identifier[description] , identifier[actual] , identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[myself] operator[SEP] }
public static int decodeDesc(byte[] src, int srcOffset, BigInteger[] valueRef) throws CorruptEncodingException { int headerSize; int bytesLength; byte[] bytes; try { int header = src[srcOffset]; if (header == NULL_BYTE_HIGH || header == NULL_BYTE_LOW) { valueRef[0] = null; return 1; } header &= 0xff; if (header > 1 && header < 0xfe) { if (header < 0x80) { bytesLength = 0x80 - header; } else { bytesLength = header - 0x7f; } headerSize = 1; } else { bytesLength = Math.abs(DataDecoder.decodeInt(src, srcOffset + 1)); headerSize = 5; } bytes = new byte[bytesLength]; srcOffset += headerSize; for (int i=0; i<bytesLength; i++) { bytes[i] = (byte) ~src[srcOffset + i]; } } catch (IndexOutOfBoundsException e) { throw new CorruptEncodingException(null, e); } valueRef[0] = new BigInteger(bytes); return headerSize + bytesLength; }
class class_name[name] begin[{] method[decodeDesc, return_type[type[int]], modifier[public static], parameter[src, srcOffset, valueRef]] begin[{] local_variable[type[int], headerSize] local_variable[type[int], bytesLength] local_variable[type[byte], bytes] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=srcOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=header)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NULL_BYTE_HIGH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=NULL_BYTE_LOW, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=&=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xff)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xfe), operator=<), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytesLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=srcOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=decodeInt, postfix_operators=[], prefix_operators=[], qualifier=DataDecoder, selectors=[], type_arguments=None)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=headerSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x80), operator=<), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytesLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x7f), operator=-)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytesLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x80), operandr=MemberReference(member=header, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=headerSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ArrayCreator(dimensions=[MemberReference(member=bytesLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=srcOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=headerSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Cast(expression=MemberReference(member=src, postfix_operators=[], prefix_operators=['~'], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=srcOffset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type=BasicType(dimensions=[], name=byte))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bytesLength, 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)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=CorruptEncodingException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IndexOutOfBoundsException']))], finally_block=None, label=None, resources=None) assign[member[.valueRef], ClassCreator(arguments=[MemberReference(member=bytes, 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=BigInteger, sub_type=None))] return[binary_operation[member[.headerSize], +, member[.bytesLength]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[decodeDesc] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[src] , Keyword[int] identifier[srcOffset] , identifier[BigInteger] operator[SEP] operator[SEP] identifier[valueRef] operator[SEP] Keyword[throws] identifier[CorruptEncodingException] { Keyword[int] identifier[headerSize] operator[SEP] Keyword[int] identifier[bytesLength] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] operator[SEP] Keyword[try] { Keyword[int] identifier[header] operator[=] identifier[src] operator[SEP] identifier[srcOffset] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[header] operator[==] identifier[NULL_BYTE_HIGH] operator[||] identifier[header] operator[==] identifier[NULL_BYTE_LOW] operator[SEP] { identifier[valueRef] operator[SEP] Other[0] operator[SEP] operator[=] Other[null] operator[SEP] Keyword[return] Other[1] operator[SEP] } identifier[header] operator[&=] literal[Integer] operator[SEP] Keyword[if] operator[SEP] identifier[header] operator[>] Other[1] operator[&&] identifier[header] operator[<] literal[Integer] operator[SEP] { Keyword[if] operator[SEP] identifier[header] operator[<] literal[Integer] operator[SEP] { identifier[bytesLength] operator[=] literal[Integer] operator[-] identifier[header] operator[SEP] } Keyword[else] { identifier[bytesLength] operator[=] identifier[header] operator[-] literal[Integer] operator[SEP] } identifier[headerSize] operator[=] Other[1] operator[SEP] } Keyword[else] { identifier[bytesLength] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[DataDecoder] operator[SEP] identifier[decodeInt] operator[SEP] identifier[src] , identifier[srcOffset] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[headerSize] operator[=] Other[5] operator[SEP] } identifier[bytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[bytesLength] operator[SEP] operator[SEP] identifier[srcOffset] operator[+=] identifier[headerSize] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[bytesLength] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[bytes] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[~] identifier[src] operator[SEP] identifier[srcOffset] operator[+] identifier[i] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IndexOutOfBoundsException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CorruptEncodingException] operator[SEP] Other[null] , identifier[e] operator[SEP] operator[SEP] } identifier[valueRef] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] identifier[BigInteger] operator[SEP] identifier[bytes] operator[SEP] operator[SEP] Keyword[return] identifier[headerSize] operator[+] identifier[bytesLength] operator[SEP] }
public java.util.List<Location> getLocations() { if (locations == null) { locations = new com.amazonaws.internal.SdkInternalList<Location>(); } return locations; }
class class_name[name] begin[{] method[getLocations, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.locations], ==, literal[null]]] begin[{] assign[member[.locations], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Location, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.locations]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[Location] operator[>] identifier[getLocations] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[locations] operator[==] Other[null] operator[SEP] { identifier[locations] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[Location] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[locations] operator[SEP] }
public void toRSL(StringBuffer buf, boolean explicitConcat) { buf.append("( "); buf.append( getAttribute() ); buf.append(" = "); Iterator iterator = values.iterator(); Binding binding; while(iterator.hasNext()) { binding = (Binding)iterator.next(); binding.toRSL(buf, explicitConcat); if (iterator.hasNext()) buf.append(" "); } buf.append(" )"); }
class class_name[name] begin[{] method[toRSL, return_type[void], modifier[public], parameter[buf, explicitConcat]] begin[{] call[buf.append, parameter[literal["( "]]] call[buf.append, parameter[call[.getAttribute, parameter[]]]] call[buf.append, parameter[literal[" = "]]] local_variable[type[Iterator], iterator] local_variable[type[Binding], binding] while[call[iterator.hasNext, parameter[]]] begin[{] assign[member[.binding], Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Binding, sub_type=None))] call[binding.toRSL, parameter[member[.buf], member[.explicitConcat]]] if[call[iterator.hasNext, parameter[]]] begin[{] call[buf.append, parameter[literal[" "]]] else begin[{] None end[}] end[}] call[buf.append, parameter[literal[" )"]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[toRSL] operator[SEP] identifier[StringBuffer] identifier[buf] , Keyword[boolean] identifier[explicitConcat] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[getAttribute] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Iterator] identifier[iterator] operator[=] identifier[values] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[Binding] identifier[binding] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[binding] operator[=] operator[SEP] identifier[Binding] operator[SEP] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[binding] operator[SEP] identifier[toRSL] operator[SEP] identifier[buf] , identifier[explicitConcat] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public AT_Row setHtmlElementTranslator(HtmlElementTranslator htmlElementTranslator) { if(this.hasCells()){ for(AT_Cell cell : this.getCells()){ cell.getContext().setHtmlElementTranslator(htmlElementTranslator); } } return this; }
class class_name[name] begin[{] method[setHtmlElementTranslator, return_type[type[AT_Row]], modifier[public], parameter[htmlElementTranslator]] begin[{] if[THIS[call[None.hasCells, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getContext, postfix_operators=[], prefix_operators=[], qualifier=cell, selectors=[MethodInvocation(arguments=[MemberReference(member=htmlElementTranslator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setHtmlElementTranslator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getCells, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cell)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AT_Cell, sub_type=None))), label=None) else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[AT_Row] identifier[setHtmlElementTranslator] operator[SEP] identifier[HtmlElementTranslator] identifier[htmlElementTranslator] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[hasCells] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[AT_Cell] identifier[cell] operator[:] Keyword[this] operator[SEP] identifier[getCells] operator[SEP] operator[SEP] operator[SEP] { identifier[cell] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[setHtmlElementTranslator] operator[SEP] identifier[htmlElementTranslator] operator[SEP] operator[SEP] } } Keyword[return] Keyword[this] operator[SEP] }
public Observable<ImageKnowledge> visualSearchAsync(VisualSearchOptionalParameter visualSearchOptionalParameter) { return visualSearchWithServiceResponseAsync(visualSearchOptionalParameter).map(new Func1<ServiceResponse<ImageKnowledge>, ImageKnowledge>() { @Override public ImageKnowledge call(ServiceResponse<ImageKnowledge> response) { return response.body(); } }); }
class class_name[name] begin[{] method[visualSearchAsync, return_type[type[Observable]], modifier[public], parameter[visualSearchOptionalParameter]] begin[{] return[call[.visualSearchWithServiceResponseAsync, parameter[member[.visualSearchOptionalParameter]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ImageKnowledge] operator[>] identifier[visualSearchAsync] operator[SEP] identifier[VisualSearchOptionalParameter] identifier[visualSearchOptionalParameter] operator[SEP] { Keyword[return] identifier[visualSearchWithServiceResponseAsync] operator[SEP] identifier[visualSearchOptionalParameter] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[ImageKnowledge] operator[>] , identifier[ImageKnowledge] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[ImageKnowledge] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[ImageKnowledge] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public boolean release() { if (this.released) { // already (marked as) released... return false; } this.released = true; if (this.childCount == 0) { if (this.parent == null) { return true; } else { assert (this.parent.childCount > 0); this.parent.childCount--; if ((this.parent.childCount == 0) && (this.parent.released)) { return true; } } } return false; }
class class_name[name] begin[{] method[release, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[THIS[member[None.released]]] begin[{] return[literal[false]] else begin[{] None end[}] assign[THIS[member[None.released]], literal[true]] if[binary_operation[THIS[member[None.childCount]], ==, literal[0]]] begin[{] if[binary_operation[THIS[member[None.parent]], ==, literal[null]]] begin[{] return[literal[true]] else begin[{] AssertStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=parent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=childCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None, value=None) THIS[member[None.parent]member[None.childCount]] if[binary_operation[binary_operation[THIS[member[None.parent]member[None.childCount]], ==, literal[0]], &&, THIS[]]] begin[{] return[literal[true]] else begin[{] None end[}] end[}] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[release] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[released] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[this] operator[SEP] identifier[released] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[childCount] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[parent] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[assert] operator[SEP] Keyword[this] operator[SEP] identifier[parent] operator[SEP] identifier[childCount] operator[>] Other[0] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[parent] operator[SEP] identifier[childCount] operator[--] operator[SEP] Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[parent] operator[SEP] identifier[childCount] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] Keyword[this] operator[SEP] identifier[parent] operator[SEP] identifier[released] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
public LinearClassifier<L,F> trainSemiSupGE(GeneralDataset<L, F> labeledDataset, List<? extends Datum<L, F>> unlabeledDataList) { List<F> GEFeatures = getHighPrecisionFeatures(labeledDataset,0.9,10); return trainSemiSupGE(labeledDataset, unlabeledDataList, GEFeatures,0.5); }
class class_name[name] begin[{] method[trainSemiSupGE, return_type[type[LinearClassifier]], modifier[public], parameter[labeledDataset, unlabeledDataList]] begin[{] local_variable[type[List], GEFeatures] return[call[.trainSemiSupGE, parameter[member[.labeledDataset], member[.unlabeledDataList], member[.GEFeatures], literal[0.5]]]] end[}] END[}]
Keyword[public] identifier[LinearClassifier] operator[<] identifier[L] , identifier[F] operator[>] identifier[trainSemiSupGE] operator[SEP] identifier[GeneralDataset] operator[<] identifier[L] , identifier[F] operator[>] identifier[labeledDataset] , identifier[List] operator[<] operator[?] Keyword[extends] identifier[Datum] operator[<] identifier[L] , identifier[F] operator[>] operator[>] identifier[unlabeledDataList] operator[SEP] { identifier[List] operator[<] identifier[F] operator[>] identifier[GEFeatures] operator[=] identifier[getHighPrecisionFeatures] operator[SEP] identifier[labeledDataset] , literal[Float] , Other[10] operator[SEP] operator[SEP] Keyword[return] identifier[trainSemiSupGE] operator[SEP] identifier[labeledDataset] , identifier[unlabeledDataList] , identifier[GEFeatures] , literal[Float] operator[SEP] operator[SEP] }
public static Object getApiValue(Value value) { if (value instanceof BooleanValue) { return ((BooleanValue) value).getValue(); } else if (value instanceof NumberValue) { if (Strings.isNullOrEmpty(((NumberValue) value).getValue())) { return null; } else { try { return NumberFormat.getInstance().parse(((NumberValue) value).getValue()); } catch (ParseException e) { throw new IllegalStateException( "Received invalid number format from API: " + ((NumberValue) value).getValue()); } } } else if (value instanceof TextValue) { return ((TextValue) value).getValue(); } else if (value instanceof DateTimeValue) { return ((DateTimeValue) value).getValue(); } else if (value instanceof DateValue) { return ((DateValue) value).getValue(); } else if (value instanceof TargetingValue) { return ((TargetingValue) value).getValue(); } else if (value instanceof SetValue) { Value[] setValues = ((SetValue) value).getValues(); Set<Object> apiValue = new LinkedHashSet<Object>(); if (setValues != null) { for (Value setValue : setValues) { validateSetValueEntryForSet(getApiValue(setValue), apiValue); apiValue.add(getApiValue(setValue)); } } return apiValue; } else { throw new IllegalArgumentException("Unsupported Value type [" + value.getClass() + "]"); } }
class class_name[name] begin[{] method[getApiValue, return_type[type[Object]], modifier[public static], parameter[value]] begin[{] if[binary_operation[member[.value], instanceof, type[BooleanValue]]] begin[{] return[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BooleanValue, sub_type=None))] else begin[{] if[binary_operation[member[.value], instanceof, type[NumberValue]]] begin[{] if[call[Strings.isNullOrEmpty, parameter[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=NumberValue, sub_type=None))]]] begin[{] return[literal[null]] else begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=NumberFormat, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=NumberValue, sub_type=None))], member=parse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Received invalid number format from API: "), operandr=Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=NumberValue, sub_type=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)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException']))], finally_block=None, label=None, resources=None) end[}] else begin[{] if[binary_operation[member[.value], instanceof, type[TextValue]]] begin[{] return[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TextValue, sub_type=None))] else begin[{] if[binary_operation[member[.value], instanceof, type[DateTimeValue]]] begin[{] return[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DateTimeValue, sub_type=None))] else begin[{] if[binary_operation[member[.value], instanceof, type[DateValue]]] begin[{] return[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=DateValue, sub_type=None))] else begin[{] if[binary_operation[member[.value], instanceof, type[TargetingValue]]] begin[{] return[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TargetingValue, sub_type=None))] else begin[{] if[binary_operation[member[.value], instanceof, type[SetValue]]] begin[{] local_variable[type[Value], setValues] local_variable[type[Set], apiValue] if[binary_operation[member[.setValues], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=setValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getApiValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=apiValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validateSetValueEntryForSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=setValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getApiValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=apiValue, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=setValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=setValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Value, sub_type=None))), label=None) else begin[{] None end[}] return[member[.apiValue]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported Value type ["), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[getApiValue] operator[SEP] identifier[Value] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[BooleanValue] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[BooleanValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[NumberValue] operator[SEP] { Keyword[if] operator[SEP] identifier[Strings] operator[SEP] identifier[isNullOrEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[NumberValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[try] { Keyword[return] identifier[NumberFormat] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[parse] operator[SEP] operator[SEP] operator[SEP] identifier[NumberValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ParseException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] operator[SEP] operator[SEP] identifier[NumberValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[TextValue] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[TextValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[DateTimeValue] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[DateTimeValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[DateValue] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[DateValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[TargetingValue] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[TargetingValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[SetValue] operator[SEP] { identifier[Value] operator[SEP] operator[SEP] identifier[setValues] operator[=] operator[SEP] operator[SEP] identifier[SetValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Object] operator[>] identifier[apiValue] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[setValues] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[Value] identifier[setValue] operator[:] identifier[setValues] operator[SEP] { identifier[validateSetValueEntryForSet] operator[SEP] identifier[getApiValue] operator[SEP] identifier[setValue] operator[SEP] , identifier[apiValue] operator[SEP] operator[SEP] identifier[apiValue] operator[SEP] identifier[add] operator[SEP] identifier[getApiValue] operator[SEP] identifier[setValue] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[apiValue] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } }
protected void setPriority(int priority) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setPriority", ""+priority); this.priority = priority; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "setPriority"); }
class class_name[name] begin[{] method[setPriority, return_type[void], modifier[protected], parameter[priority]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["setPriority"], binary_operation[literal[""], +, member[.priority]]]] else begin[{] None end[}] assign[THIS[member[None.priority]], member[.priority]] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.exit, parameter[THIS[], member[.tc], literal["setPriority"]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[setPriority] operator[SEP] Keyword[int] identifier[priority] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , literal[String] operator[+] identifier[priority] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[priority] operator[=] identifier[priority] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public InputStream getInputStream(String bucketName, String key) throws AmazonServiceException, AmazonClientException, InterruptedException, IOException { Supplier<File> tempFileSupplier = ExceptionSoftener.softenSupplier(() -> Files.createTempFile(FileSystems.getDefault() .getPath(tmpDirectory), "micro-s3", "file") .toFile()); return getInputStream(bucketName, key, tempFileSupplier); }
class class_name[name] begin[{] method[getInputStream, return_type[type[InputStream]], modifier[public], parameter[bucketName, key]] begin[{] local_variable[type[Supplier], tempFileSupplier] return[call[.getInputStream, parameter[member[.bucketName], member[.key], member[.tempFileSupplier]]]] end[}] END[}]
Keyword[public] identifier[InputStream] identifier[getInputStream] operator[SEP] identifier[String] identifier[bucketName] , identifier[String] identifier[key] operator[SEP] Keyword[throws] identifier[AmazonServiceException] , identifier[AmazonClientException] , identifier[InterruptedException] , identifier[IOException] { identifier[Supplier] operator[<] identifier[File] operator[>] identifier[tempFileSupplier] operator[=] identifier[ExceptionSoftener] operator[SEP] identifier[softenSupplier] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[Files] operator[SEP] identifier[createTempFile] operator[SEP] identifier[FileSystems] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] identifier[tmpDirectory] operator[SEP] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[toFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getInputStream] operator[SEP] identifier[bucketName] , identifier[key] , identifier[tempFileSupplier] operator[SEP] operator[SEP] }
@Override public OrderAnalyzerResult analyze() { seenFamily = null; final PersonNavigator navigator = new PersonNavigator(person); for (final Family family : navigator.getFamilies()) { setCurrentDate(null); setSeenEvent(null); checkFamily(family); } return getResult(); }
class class_name[name] begin[{] method[analyze, return_type[type[OrderAnalyzerResult]], modifier[public], parameter[]] begin[{] assign[member[.seenFamily], literal[null]] local_variable[type[PersonNavigator], navigator] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setCurrentDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setSeenEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=family, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkFamily, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getFamilies, postfix_operators=[], prefix_operators=[], qualifier=navigator, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=family)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Family, sub_type=None))), label=None) return[call[.getResult, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[OrderAnalyzerResult] identifier[analyze] operator[SEP] operator[SEP] { identifier[seenFamily] operator[=] Other[null] operator[SEP] Keyword[final] identifier[PersonNavigator] identifier[navigator] operator[=] Keyword[new] identifier[PersonNavigator] operator[SEP] identifier[person] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Family] identifier[family] operator[:] identifier[navigator] operator[SEP] identifier[getFamilies] operator[SEP] operator[SEP] operator[SEP] { identifier[setCurrentDate] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[setSeenEvent] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[checkFamily] operator[SEP] identifier[family] operator[SEP] operator[SEP] } Keyword[return] identifier[getResult] operator[SEP] operator[SEP] operator[SEP] }
public Matrix4f setFromIntrinsic(float alphaX, float alphaY, float gamma, float u0, float v0, int imgWidth, int imgHeight, float near, float far) { float l00 = 2.0f / imgWidth; float l11 = 2.0f / imgHeight; float l22 = 2.0f / (near - far); this.m00 = l00 * alphaX; this.m01 = 0.0f; this.m02 = 0.0f; this.m03 = 0.0f; this.m10 = l00 * gamma; this.m11 = l11 * alphaY; this.m12 = 0.0f; this.m13 = 0.0f; this.m20 = l00 * u0 - 1.0f; this.m21 = l11 * v0 - 1.0f; this.m22 = l22 * -(near + far) + (far + near) / (near - far); this.m23 = -1.0f; this.m30 = 0.0f; this.m31 = 0.0f; this.m32 = l22 * -near * far; this.m33 = 0.0f; this.properties = PROPERTY_PERSPECTIVE; return this; }
class class_name[name] begin[{] method[setFromIntrinsic, return_type[type[Matrix4f]], modifier[public], parameter[alphaX, alphaY, gamma, u0, v0, imgWidth, imgHeight, near, far]] begin[{] local_variable[type[float], l00] local_variable[type[float], l11] local_variable[type[float], l22] assign[THIS[member[None.m00]], binary_operation[member[.l00], *, member[.alphaX]]] assign[THIS[member[None.m01]], literal[0.0f]] assign[THIS[member[None.m02]], literal[0.0f]] assign[THIS[member[None.m03]], literal[0.0f]] assign[THIS[member[None.m10]], binary_operation[member[.l00], *, member[.gamma]]] assign[THIS[member[None.m11]], binary_operation[member[.l11], *, member[.alphaY]]] assign[THIS[member[None.m12]], literal[0.0f]] assign[THIS[member[None.m13]], literal[0.0f]] assign[THIS[member[None.m20]], binary_operation[binary_operation[member[.l00], *, member[.u0]], -, literal[1.0f]]] assign[THIS[member[None.m21]], binary_operation[binary_operation[member[.l11], *, member[.v0]], -, literal[1.0f]]] assign[THIS[member[None.m22]], binary_operation[binary_operation[member[.l22], *, binary_operation[member[.near], +, member[.far]]], +, binary_operation[binary_operation[member[.far], +, member[.near]], /, binary_operation[member[.near], -, member[.far]]]]] assign[THIS[member[None.m23]], literal[1.0f]] assign[THIS[member[None.m30]], literal[0.0f]] assign[THIS[member[None.m31]], literal[0.0f]] assign[THIS[member[None.m32]], binary_operation[binary_operation[member[.l22], *, member[.near]], *, member[.far]]] assign[THIS[member[None.m33]], literal[0.0f]] assign[THIS[member[None.properties]], member[.PROPERTY_PERSPECTIVE]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Matrix4f] identifier[setFromIntrinsic] operator[SEP] Keyword[float] identifier[alphaX] , Keyword[float] identifier[alphaY] , Keyword[float] identifier[gamma] , Keyword[float] identifier[u0] , Keyword[float] identifier[v0] , Keyword[int] identifier[imgWidth] , Keyword[int] identifier[imgHeight] , Keyword[float] identifier[near] , Keyword[float] identifier[far] operator[SEP] { Keyword[float] identifier[l00] operator[=] literal[Float] operator[/] identifier[imgWidth] operator[SEP] Keyword[float] identifier[l11] operator[=] literal[Float] operator[/] identifier[imgHeight] operator[SEP] Keyword[float] identifier[l22] operator[=] literal[Float] operator[/] operator[SEP] identifier[near] operator[-] identifier[far] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[m00] operator[=] identifier[l00] operator[*] identifier[alphaX] operator[SEP] Keyword[this] operator[SEP] identifier[m01] operator[=] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[m02] operator[=] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[m03] operator[=] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[m10] operator[=] identifier[l00] operator[*] identifier[gamma] operator[SEP] Keyword[this] operator[SEP] identifier[m11] operator[=] identifier[l11] operator[*] identifier[alphaY] operator[SEP] Keyword[this] operator[SEP] identifier[m12] operator[=] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[m13] operator[=] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[m20] operator[=] identifier[l00] operator[*] identifier[u0] operator[-] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[m21] operator[=] identifier[l11] operator[*] identifier[v0] operator[-] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[m22] operator[=] identifier[l22] operator[*] operator[-] operator[SEP] identifier[near] operator[+] identifier[far] operator[SEP] operator[+] operator[SEP] identifier[far] operator[+] identifier[near] operator[SEP] operator[/] operator[SEP] identifier[near] operator[-] identifier[far] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[m23] operator[=] operator[-] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[m30] operator[=] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[m31] operator[=] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[m32] operator[=] identifier[l22] operator[*] operator[-] identifier[near] operator[*] identifier[far] operator[SEP] Keyword[this] operator[SEP] identifier[m33] operator[=] literal[Float] operator[SEP] Keyword[this] operator[SEP] identifier[properties] operator[=] identifier[PROPERTY_PERSPECTIVE] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static <T> T invokeExactConstructor(final Class<T> cls, Object[] args, Class<?>[] parameterTypes) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException { args = ArrayUtils.nullToEmpty(args); parameterTypes = ArrayUtils.nullToEmpty(parameterTypes); final Constructor<T> ctor = getAccessibleConstructor(cls, parameterTypes); if (ctor == null) { throw new NoSuchMethodException( "No such accessible constructor on object: "+ cls.getName()); } return ctor.newInstance(args); }
class class_name[name] begin[{] method[invokeExactConstructor, return_type[type[T]], modifier[public static], parameter[cls, args, parameterTypes]] begin[{] assign[member[.args], call[ArrayUtils.nullToEmpty, parameter[member[.args]]]] assign[member[.parameterTypes], call[ArrayUtils.nullToEmpty, parameter[member[.parameterTypes]]]] local_variable[type[Constructor], ctor] if[binary_operation[member[.ctor], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No such accessible constructor on object: "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=cls, 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=NoSuchMethodException, sub_type=None)), label=None) else begin[{] None end[}] return[call[ctor.newInstance, parameter[member[.args]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[invokeExactConstructor] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[cls] , identifier[Object] operator[SEP] operator[SEP] identifier[args] , identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[parameterTypes] operator[SEP] Keyword[throws] identifier[NoSuchMethodException] , identifier[IllegalAccessException] , identifier[InvocationTargetException] , identifier[InstantiationException] { identifier[args] operator[=] identifier[ArrayUtils] operator[SEP] identifier[nullToEmpty] operator[SEP] identifier[args] operator[SEP] operator[SEP] identifier[parameterTypes] operator[=] identifier[ArrayUtils] operator[SEP] identifier[nullToEmpty] operator[SEP] identifier[parameterTypes] operator[SEP] operator[SEP] Keyword[final] identifier[Constructor] operator[<] identifier[T] operator[>] identifier[ctor] operator[=] identifier[getAccessibleConstructor] operator[SEP] identifier[cls] , identifier[parameterTypes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ctor] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NoSuchMethodException] operator[SEP] literal[String] operator[+] identifier[cls] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ctor] operator[SEP] identifier[newInstance] operator[SEP] identifier[args] operator[SEP] operator[SEP] }
@Override public ModuleBuild build(String mid, IResource resource, HttpServletRequest request, List<ICacheKeyGenerator> inKeyGens) throws Exception { // Manage life span of thread locals used by this module builder if (isFeatureDependent) { threadLocalRequest.set(request); threadLocalDependentFeatures.set(null); } try { return super.build(mid, resource, request, inKeyGens); } finally { if (isFeatureDependent) { threadLocalRequest.remove(); threadLocalDependentFeatures.remove(); } } }
class class_name[name] begin[{] method[build, return_type[type[ModuleBuild]], modifier[public], parameter[mid, resource, request, inKeyGens]] begin[{] if[member[.isFeatureDependent]] begin[{] call[threadLocalRequest.set, parameter[member[.request]]] call[threadLocalDependentFeatures.set, parameter[literal[null]]] else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=SuperMethodInvocation(arguments=[MemberReference(member=mid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inKeyGens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=isFeatureDependent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=threadLocalRequest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=threadLocalDependentFeatures, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ModuleBuild] identifier[build] operator[SEP] identifier[String] identifier[mid] , identifier[IResource] identifier[resource] , identifier[HttpServletRequest] identifier[request] , identifier[List] operator[<] identifier[ICacheKeyGenerator] operator[>] identifier[inKeyGens] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[isFeatureDependent] operator[SEP] { identifier[threadLocalRequest] operator[SEP] identifier[set] operator[SEP] identifier[request] operator[SEP] operator[SEP] identifier[threadLocalDependentFeatures] operator[SEP] identifier[set] operator[SEP] Other[null] operator[SEP] operator[SEP] } Keyword[try] { Keyword[return] Keyword[super] operator[SEP] identifier[build] operator[SEP] identifier[mid] , identifier[resource] , identifier[request] , identifier[inKeyGens] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[isFeatureDependent] operator[SEP] { identifier[threadLocalRequest] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] identifier[threadLocalDependentFeatures] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } } }
public synchronized void download(StaplerRequest req, StaplerResponse rsp) throws InterruptedException, IOException { rsp.setStatus(HttpServletResponse.SC_OK); // server->client channel. // this is created first, and this controls the lifespan of the channel rsp.addHeader("Transfer-Encoding", "chunked"); OutputStream out = rsp.getOutputStream(); if (DIY_CHUNKING) { out = new ChunkedOutputStream(out); } // send something out so that the client will see the HTTP headers out.write(0); out.flush(); {// wait until we have the other channel long end = System.currentTimeMillis() + CONNECTION_TIMEOUT; while (upload == null && System.currentTimeMillis() < end) { LOGGER.log(Level.FINE, "Waiting for upload stream for {0}: {1}", new Object[] {uuid, this}); wait(1000); } if (upload == null) { throw new IOException("HTTP full-duplex channel timeout: " + uuid); } LOGGER.log(Level.FINE, "Received upload stream {0} for {1}: {2}", new Object[] {upload, uuid, this}); } try { run(upload, out); } finally { // publish that we are done completed = true; notify(); } }
class class_name[name] begin[{] method[download, return_type[void], modifier[synchronized public], parameter[req, rsp]] begin[{] call[rsp.setStatus, parameter[member[HttpServletResponse.SC_OK]]] call[rsp.addHeader, parameter[literal["Transfer-Encoding"], literal["chunked"]]] local_variable[type[OutputStream], out] if[member[.DIY_CHUNKING]] begin[{] assign[member[.out], ClassCreator(arguments=[MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChunkedOutputStream, sub_type=None))] else begin[{] None end[}] call[out.write, parameter[literal[0]]] call[out.flush, parameter[]] local_variable[type[long], end] while[binary_operation[binary_operation[member[.upload], ==, literal[null]], &&, binary_operation[call[System.currentTimeMillis, parameter[]], <, member[.end]]]] begin[{] call[LOGGER.log, parameter[member[Level.FINE], literal["Waiting for upload stream for {0}: {1}"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=uuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] call[.wait, parameter[literal[1000]]] end[}] if[binary_operation[member[.upload], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="HTTP full-duplex channel timeout: "), operandr=MemberReference(member=uuid, 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=IOException, sub_type=None)), label=None) else begin[{] None end[}] call[LOGGER.log, parameter[member[Level.FINE], literal["Received upload stream {0} for {1}: {2}"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=upload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uuid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=upload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=run, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=completed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=notify, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[download] operator[SEP] identifier[StaplerRequest] identifier[req] , identifier[StaplerResponse] identifier[rsp] operator[SEP] Keyword[throws] identifier[InterruptedException] , identifier[IOException] { identifier[rsp] operator[SEP] identifier[setStatus] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[SC_OK] operator[SEP] operator[SEP] identifier[rsp] operator[SEP] identifier[addHeader] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[OutputStream] identifier[out] operator[=] identifier[rsp] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DIY_CHUNKING] operator[SEP] { identifier[out] operator[=] Keyword[new] identifier[ChunkedOutputStream] operator[SEP] identifier[out] operator[SEP] operator[SEP] } identifier[out] operator[SEP] identifier[write] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] { Keyword[long] identifier[end] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[+] identifier[CONNECTION_TIMEOUT] operator[SEP] Keyword[while] operator[SEP] identifier[upload] operator[==] Other[null] operator[&&] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[<] identifier[end] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[uuid] , Keyword[this] } operator[SEP] operator[SEP] identifier[wait] operator[SEP] Other[1000] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[upload] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[uuid] operator[SEP] operator[SEP] } identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[upload] , identifier[uuid] , Keyword[this] } operator[SEP] operator[SEP] } Keyword[try] { identifier[run] operator[SEP] identifier[upload] , identifier[out] operator[SEP] operator[SEP] } Keyword[finally] { identifier[completed] operator[=] literal[boolean] operator[SEP] identifier[notify] operator[SEP] operator[SEP] operator[SEP] } }
public final V set(int index, V value) { int size = this.size; if (index < 0 || index >= size) { throw new IndexOutOfBoundsException(); } int valueDataIndex = 1 + (index << 1); V result = valueAtDataIndex(valueDataIndex); this.data[valueDataIndex] = value; return result; }
class class_name[name] begin[{] method[set, return_type[type[V]], modifier[final public], parameter[index, value]] begin[{] local_variable[type[int], size] if[binary_operation[binary_operation[member[.index], <, literal[0]], ||, binary_operation[member[.index], >=, member[.size]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], valueDataIndex] local_variable[type[V], result] assign[THIS[member[None.data]ArraySelector(index=MemberReference(member=valueDataIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], member[.value]] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[final] identifier[V] identifier[set] operator[SEP] Keyword[int] identifier[index] , identifier[V] identifier[value] operator[SEP] { Keyword[int] identifier[size] operator[=] Keyword[this] operator[SEP] identifier[size] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[<] Other[0] operator[||] identifier[index] operator[>=] identifier[size] operator[SEP] { Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[valueDataIndex] operator[=] Other[1] operator[+] operator[SEP] identifier[index] operator[<<] Other[1] operator[SEP] operator[SEP] identifier[V] identifier[result] operator[=] identifier[valueAtDataIndex] operator[SEP] identifier[valueDataIndex] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[data] operator[SEP] identifier[valueDataIndex] operator[SEP] operator[=] identifier[value] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
@Override public BundleHashcodeType getBundleHashcodeType(String requestedPath) { BundleHashcodeType typeBundleHashcode = BundleHashcodeType.UNKNOW_BUNDLE; String[] pathInfos = PathNormalizer.extractBundleInfoFromPath(requestedPath, bundlePrefixes); if (pathInfos != null) { String bundlePrefix = pathInfos[0]; String bundleId = pathInfos[1]; String variantKey = pathInfos[2]; String hashcode = pathInfos[3]; JoinableResourceBundle bundle = resolveBundleForPath(bundleId); if (bundle != null) { String bundleHashcode = bundle.getBundleDataHashCode(variantKey); if (hashcode == null && bundleHashcode == null || hashcode != null && hashcode.equals(bundleHashcode) && ((bundlePrefix == null && bundle.getBundlePrefix() == null) || (bundlePrefix != null && bundlePrefix.equals(bundle.getBundlePrefix())))) { typeBundleHashcode = BundleHashcodeType.VALID_HASHCODE; } else { typeBundleHashcode = BundleHashcodeType.INVALID_HASHCODE; } } } return typeBundleHashcode; }
class class_name[name] begin[{] method[getBundleHashcodeType, return_type[type[BundleHashcodeType]], modifier[public], parameter[requestedPath]] begin[{] local_variable[type[BundleHashcodeType], typeBundleHashcode] local_variable[type[String], pathInfos] if[binary_operation[member[.pathInfos], !=, literal[null]]] begin[{] local_variable[type[String], bundlePrefix] local_variable[type[String], bundleId] local_variable[type[String], variantKey] local_variable[type[String], hashcode] local_variable[type[JoinableResourceBundle], bundle] if[binary_operation[member[.bundle], !=, literal[null]]] begin[{] local_variable[type[String], bundleHashcode] if[binary_operation[binary_operation[binary_operation[member[.hashcode], ==, literal[null]], &&, binary_operation[member[.bundleHashcode], ==, literal[null]]], ||, binary_operation[binary_operation[binary_operation[member[.hashcode], !=, literal[null]], &&, call[hashcode.equals, parameter[member[.bundleHashcode]]]], &&, binary_operation[binary_operation[binary_operation[member[.bundlePrefix], ==, literal[null]], &&, binary_operation[call[bundle.getBundlePrefix, parameter[]], ==, literal[null]]], ||, binary_operation[binary_operation[member[.bundlePrefix], !=, literal[null]], &&, call[bundlePrefix.equals, parameter[call[bundle.getBundlePrefix, parameter[]]]]]]]]] begin[{] assign[member[.typeBundleHashcode], member[BundleHashcodeType.VALID_HASHCODE]] else begin[{] assign[member[.typeBundleHashcode], member[BundleHashcodeType.INVALID_HASHCODE]] end[}] else begin[{] None end[}] else begin[{] None end[}] return[member[.typeBundleHashcode]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[BundleHashcodeType] identifier[getBundleHashcodeType] operator[SEP] identifier[String] identifier[requestedPath] operator[SEP] { identifier[BundleHashcodeType] identifier[typeBundleHashcode] operator[=] identifier[BundleHashcodeType] operator[SEP] identifier[UNKNOW_BUNDLE] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[pathInfos] operator[=] identifier[PathNormalizer] operator[SEP] identifier[extractBundleInfoFromPath] operator[SEP] identifier[requestedPath] , identifier[bundlePrefixes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pathInfos] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[bundlePrefix] operator[=] identifier[pathInfos] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[String] identifier[bundleId] operator[=] identifier[pathInfos] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[String] identifier[variantKey] operator[=] identifier[pathInfos] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[String] identifier[hashcode] operator[=] identifier[pathInfos] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[JoinableResourceBundle] identifier[bundle] operator[=] identifier[resolveBundleForPath] operator[SEP] identifier[bundleId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bundle] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[bundleHashcode] operator[=] identifier[bundle] operator[SEP] identifier[getBundleDataHashCode] operator[SEP] identifier[variantKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hashcode] operator[==] Other[null] operator[&&] identifier[bundleHashcode] operator[==] Other[null] operator[||] identifier[hashcode] operator[!=] Other[null] operator[&&] identifier[hashcode] operator[SEP] identifier[equals] operator[SEP] identifier[bundleHashcode] operator[SEP] operator[&&] operator[SEP] operator[SEP] identifier[bundlePrefix] operator[==] Other[null] operator[&&] identifier[bundle] operator[SEP] identifier[getBundlePrefix] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[bundlePrefix] operator[!=] Other[null] operator[&&] identifier[bundlePrefix] operator[SEP] identifier[equals] operator[SEP] identifier[bundle] operator[SEP] identifier[getBundlePrefix] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[typeBundleHashcode] operator[=] identifier[BundleHashcodeType] operator[SEP] identifier[VALID_HASHCODE] operator[SEP] } Keyword[else] { identifier[typeBundleHashcode] operator[=] identifier[BundleHashcodeType] operator[SEP] identifier[INVALID_HASHCODE] operator[SEP] } } } Keyword[return] identifier[typeBundleHashcode] operator[SEP] }
public static String wrap(String line, int widthInCharacters, String indent) { StringBuilder buffer = new StringBuilder(); int lineCount = 1; int spaceIndex; // if indent is null, then do not indent the wrapped lines indent = (indent != null ? indent : EMPTY_STRING); while (line.length() > widthInCharacters) { spaceIndex = line.substring(0, widthInCharacters).lastIndexOf(SINGLE_SPACE); buffer.append(lineCount++ > 1 ? indent : EMPTY_STRING); // throws IndexOutOfBoundsException if spaceIndex is -1, implying no word boundary was found within // the given width; this also avoids the infinite loop buffer.append(line.substring(0, spaceIndex)); buffer.append(LINE_SEPARATOR); // possible infinite loop if spaceIndex is -1, see comment above line = line.substring(spaceIndex + 1); } buffer.append(lineCount > 1 ? indent : EMPTY_STRING); buffer.append(line); return buffer.toString(); }
class class_name[name] begin[{] method[wrap, return_type[type[String]], modifier[public static], parameter[line, widthInCharacters, indent]] begin[{] local_variable[type[StringBuilder], buffer] local_variable[type[int], lineCount] local_variable[type[int], spaceIndex] assign[member[.indent], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=indent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=EMPTY_STRING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=indent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))] while[binary_operation[call[line.length, parameter[]], >, member[.widthInCharacters]]] begin[{] assign[member[.spaceIndex], call[line.substring, parameter[literal[0], member[.widthInCharacters]]]] call[buffer.append, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=lineCount, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), if_false=MemberReference(member=EMPTY_STRING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=indent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]] call[buffer.append, parameter[call[line.substring, parameter[literal[0], member[.spaceIndex]]]]] call[buffer.append, parameter[member[.LINE_SEPARATOR]]] assign[member[.line], call[line.substring, parameter[binary_operation[member[.spaceIndex], +, literal[1]]]]] end[}] call[buffer.append, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=lineCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), if_false=MemberReference(member=EMPTY_STRING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=indent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]] call[buffer.append, parameter[member[.line]]] return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[wrap] operator[SEP] identifier[String] identifier[line] , Keyword[int] identifier[widthInCharacters] , identifier[String] identifier[indent] operator[SEP] { identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[lineCount] operator[=] Other[1] operator[SEP] Keyword[int] identifier[spaceIndex] operator[SEP] identifier[indent] operator[=] operator[SEP] identifier[indent] operator[!=] Other[null] operator[?] identifier[indent] operator[:] identifier[EMPTY_STRING] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[widthInCharacters] operator[SEP] { identifier[spaceIndex] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[widthInCharacters] operator[SEP] operator[SEP] identifier[lastIndexOf] operator[SEP] identifier[SINGLE_SPACE] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[lineCount] operator[++] operator[>] Other[1] operator[?] identifier[indent] operator[:] identifier[EMPTY_STRING] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[spaceIndex] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[LINE_SEPARATOR] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] identifier[spaceIndex] operator[+] Other[1] operator[SEP] operator[SEP] } identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[lineCount] operator[>] Other[1] operator[?] identifier[indent] operator[:] identifier[EMPTY_STRING] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(EmailChannelRequest emailChannelRequest, ProtocolMarshaller protocolMarshaller) { if (emailChannelRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(emailChannelRequest.getConfigurationSet(), CONFIGURATIONSET_BINDING); protocolMarshaller.marshall(emailChannelRequest.getEnabled(), ENABLED_BINDING); protocolMarshaller.marshall(emailChannelRequest.getFromAddress(), FROMADDRESS_BINDING); protocolMarshaller.marshall(emailChannelRequest.getIdentity(), IDENTITY_BINDING); protocolMarshaller.marshall(emailChannelRequest.getRoleArn(), ROLEARN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[emailChannelRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.emailChannelRequest], ==, 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=getConfigurationSet, postfix_operators=[], prefix_operators=[], qualifier=emailChannelRequest, selectors=[], type_arguments=None), MemberReference(member=CONFIGURATIONSET_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=getEnabled, postfix_operators=[], prefix_operators=[], qualifier=emailChannelRequest, selectors=[], type_arguments=None), MemberReference(member=ENABLED_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=getFromAddress, postfix_operators=[], prefix_operators=[], qualifier=emailChannelRequest, selectors=[], type_arguments=None), MemberReference(member=FROMADDRESS_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=getIdentity, postfix_operators=[], prefix_operators=[], qualifier=emailChannelRequest, selectors=[], type_arguments=None), MemberReference(member=IDENTITY_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=emailChannelRequest, selectors=[], type_arguments=None), MemberReference(member=ROLEARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[EmailChannelRequest] identifier[emailChannelRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[emailChannelRequest] 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[emailChannelRequest] operator[SEP] identifier[getConfigurationSet] operator[SEP] operator[SEP] , identifier[CONFIGURATIONSET_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[emailChannelRequest] operator[SEP] identifier[getEnabled] operator[SEP] operator[SEP] , identifier[ENABLED_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[emailChannelRequest] operator[SEP] identifier[getFromAddress] operator[SEP] operator[SEP] , identifier[FROMADDRESS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[emailChannelRequest] operator[SEP] identifier[getIdentity] operator[SEP] operator[SEP] , identifier[IDENTITY_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[emailChannelRequest] operator[SEP] identifier[getRoleArn] operator[SEP] operator[SEP] , identifier[ROLEARN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Override public void error(final MessageItem messageItem) { getLogger().error(messageItem.getMarker(), messageItem.getText()); throwError(messageItem, null); }
class class_name[name] begin[{] method[error, return_type[void], modifier[public], parameter[messageItem]] begin[{] call[.getLogger, parameter[]] call[.throwError, parameter[member[.messageItem], literal[null]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[error] operator[SEP] Keyword[final] identifier[MessageItem] identifier[messageItem] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] identifier[messageItem] operator[SEP] identifier[getMarker] operator[SEP] operator[SEP] , identifier[messageItem] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[throwError] operator[SEP] identifier[messageItem] , Other[null] operator[SEP] operator[SEP] }
public void marshall(GetCrawlersRequest getCrawlersRequest, ProtocolMarshaller protocolMarshaller) { if (getCrawlersRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getCrawlersRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(getCrawlersRequest.getNextToken(), NEXTTOKEN_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[getCrawlersRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.getCrawlersRequest], ==, 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=getMaxResults, postfix_operators=[], prefix_operators=[], qualifier=getCrawlersRequest, selectors=[], type_arguments=None), MemberReference(member=MAXRESULTS_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=getNextToken, postfix_operators=[], prefix_operators=[], qualifier=getCrawlersRequest, selectors=[], type_arguments=None), MemberReference(member=NEXTTOKEN_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[GetCrawlersRequest] identifier[getCrawlersRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[getCrawlersRequest] 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[getCrawlersRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getCrawlersRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_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 void marshall(EncryptionKey encryptionKey, ProtocolMarshaller protocolMarshaller) { if (encryptionKey == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(encryptionKey.getId(), ID_BINDING); protocolMarshaller.marshall(encryptionKey.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[encryptionKey, protocolMarshaller]] begin[{] if[binary_operation[member[.encryptionKey], ==, 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=getId, postfix_operators=[], prefix_operators=[], qualifier=encryptionKey, 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=getType, postfix_operators=[], prefix_operators=[], qualifier=encryptionKey, 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[EncryptionKey] identifier[encryptionKey] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[encryptionKey] 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[encryptionKey] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[ID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[encryptionKey] 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] } }
protected int exportTemplateResource(CmsStaticExportData data, StringBuffer cookies) throws IOException { String vfsName = data.getVfsName(); String rfsName = data.getRfsName(); CmsStaticExportManager manager = OpenCms.getStaticExportManager(); String exportUrlStr; if (rfsName.contains(manager.getRfsPrefix(vfsName))) { LOG.info("rfsName " + rfsName + " contains rfsPrefix " + manager.getRfsPrefix(vfsName)); exportUrlStr = manager.getExportUrl() + rfsName; } else { exportUrlStr = manager.getExportUrl() + manager.getRfsPrefix(vfsName) + rfsName; } if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_SENDING_REQUEST_2, rfsName, exportUrlStr)); } // setup the connection and request the resource URL exportUrl = new URL(exportUrlStr); HttpURLConnection.setFollowRedirects(false); HttpURLConnection urlcon = (HttpURLConnection)exportUrl.openConnection(); // set request type to GET urlcon.setRequestMethod(REQUEST_METHOD_GET); // add special export header urlcon.setRequestProperty(CmsRequestUtil.HEADER_OPENCMS_EXPORT, CmsStringUtil.TRUE); // add additional headers if available if (manager.getAcceptLanguageHeader() != null) { urlcon.setRequestProperty(CmsRequestUtil.HEADER_ACCEPT_LANGUAGE, manager.getAcceptLanguageHeader()); } else { urlcon.setRequestProperty(CmsRequestUtil.HEADER_ACCEPT_LANGUAGE, manager.getDefaultAcceptLanguageHeader()); } if (manager.getAcceptCharsetHeader() != null) { urlcon.setRequestProperty(CmsRequestUtil.HEADER_ACCEPT_CHARSET, manager.getAcceptCharsetHeader()); } else { urlcon.setRequestProperty(CmsRequestUtil.HEADER_ACCEPT_CHARSET, manager.getDefaultAcceptCharsetHeader()); } // get the last modified date and add it to the request String exportFileName = CmsFileUtil.normalizePath(manager.getExportPath(vfsName) + rfsName); File exportFile = new File(exportFileName); long dateLastModified = exportFile.lastModified(); // system folder case if (vfsName.startsWith(CmsWorkplace.VFS_PATH_SYSTEM) || OpenCms.getSiteManager().startsWithShared(vfsName)) { // iterate over all rules Iterator<CmsStaticExportRfsRule> it = manager.getRfsRules().iterator(); while (it.hasNext()) { CmsStaticExportRfsRule rule = it.next(); if (rule.match(vfsName)) { exportFileName = CmsFileUtil.normalizePath(rule.getExportPath() + rfsName); exportFile = new File(exportFileName); if (dateLastModified > exportFile.lastModified()) { dateLastModified = exportFile.lastModified(); } } } } urlcon.setIfModifiedSince(dateLastModified); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_IF_MODIFIED_SINCE_SET_2, exportFile.getName(), new Long((dateLastModified / 1000) * 1000))); } if (cookies.length() > 0) { // set the cookies, included the session id to keep the same session urlcon.setRequestProperty(REQUEST_PROPERTY_COOKIE, cookies.toString()); } // now perform the request urlcon.connect(); int status = urlcon.getResponseCode(); if (cookies.length() == 0) { //Now retrieve the cookies. The jsessionid is here cookies.append(urlcon.getHeaderField(HEADER_FIELD_SET_COOKIE)); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_STATICEXPORT_COOKIES_1, cookies)); } } urlcon.disconnect(); if (LOG.isInfoEnabled()) { LOG.info( Messages.get().getBundle().key( Messages.LOG_REQUEST_RESULT_3, rfsName, exportUrlStr, new Integer(status))); } return status; }
class class_name[name] begin[{] method[exportTemplateResource, return_type[type[int]], modifier[protected], parameter[data, cookies]] begin[{] local_variable[type[String], vfsName] local_variable[type[String], rfsName] local_variable[type[CmsStaticExportManager], manager] local_variable[type[String], exportUrlStr] if[call[rfsName.contains, parameter[call[manager.getRfsPrefix, parameter[member[.vfsName]]]]]] begin[{] call[LOG.info, parameter[binary_operation[binary_operation[binary_operation[literal["rfsName "], +, member[.rfsName]], +, literal[" contains rfsPrefix "]], +, call[manager.getRfsPrefix, parameter[member[.vfsName]]]]]] assign[member[.exportUrlStr], binary_operation[call[manager.getExportUrl, parameter[]], +, member[.rfsName]]] else begin[{] assign[member[.exportUrlStr], binary_operation[binary_operation[call[manager.getExportUrl, parameter[]], +, call[manager.getRfsPrefix, parameter[member[.vfsName]]]], +, member[.rfsName]]] end[}] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] local_variable[type[URL], exportUrl] call[HttpURLConnection.setFollowRedirects, parameter[literal[false]]] local_variable[type[HttpURLConnection], urlcon] call[urlcon.setRequestMethod, parameter[member[.REQUEST_METHOD_GET]]] call[urlcon.setRequestProperty, parameter[member[CmsRequestUtil.HEADER_OPENCMS_EXPORT], member[CmsStringUtil.TRUE]]] if[binary_operation[call[manager.getAcceptLanguageHeader, parameter[]], !=, literal[null]]] begin[{] call[urlcon.setRequestProperty, parameter[member[CmsRequestUtil.HEADER_ACCEPT_LANGUAGE], call[manager.getAcceptLanguageHeader, parameter[]]]] else begin[{] call[urlcon.setRequestProperty, parameter[member[CmsRequestUtil.HEADER_ACCEPT_LANGUAGE], call[manager.getDefaultAcceptLanguageHeader, parameter[]]]] end[}] if[binary_operation[call[manager.getAcceptCharsetHeader, parameter[]], !=, literal[null]]] begin[{] call[urlcon.setRequestProperty, parameter[member[CmsRequestUtil.HEADER_ACCEPT_CHARSET], call[manager.getAcceptCharsetHeader, parameter[]]]] else begin[{] call[urlcon.setRequestProperty, parameter[member[CmsRequestUtil.HEADER_ACCEPT_CHARSET], call[manager.getDefaultAcceptCharsetHeader, parameter[]]]] end[}] local_variable[type[String], exportFileName] local_variable[type[File], exportFile] local_variable[type[long], dateLastModified] if[binary_operation[call[vfsName.startsWith, parameter[member[CmsWorkplace.VFS_PATH_SYSTEM]]], ||, call[OpenCms.getSiteManager, parameter[]]]] begin[{] local_variable[type[Iterator], it] while[call[it.hasNext, parameter[]]] begin[{] local_variable[type[CmsStaticExportRfsRule], rule] if[call[rule.match, parameter[member[.vfsName]]]] begin[{] assign[member[.exportFileName], call[CmsFileUtil.normalizePath, parameter[binary_operation[call[rule.getExportPath, parameter[]], +, member[.rfsName]]]]] assign[member[.exportFile], ClassCreator(arguments=[MemberReference(member=exportFileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] if[binary_operation[member[.dateLastModified], >, call[exportFile.lastModified, parameter[]]]] begin[{] assign[member[.dateLastModified], call[exportFile.lastModified, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] end[}] else begin[{] None end[}] call[urlcon.setIfModifiedSince, parameter[member[.dateLastModified]]] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] if[binary_operation[call[cookies.length, parameter[]], >, literal[0]]] begin[{] call[urlcon.setRequestProperty, parameter[member[.REQUEST_PROPERTY_COOKIE], call[cookies.toString, parameter[]]]] else begin[{] None end[}] call[urlcon.connect, parameter[]] local_variable[type[int], status] if[binary_operation[call[cookies.length, parameter[]], ==, literal[0]]] begin[{] call[cookies.append, parameter[call[urlcon.getHeaderField, parameter[member[.HEADER_FIELD_SET_COOKIE]]]]] if[call[LOG.isDebugEnabled, parameter[]]] begin[{] call[LOG.debug, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] else begin[{] None end[}] call[urlcon.disconnect, parameter[]] if[call[LOG.isInfoEnabled, parameter[]]] begin[{] call[LOG.info, parameter[call[Messages.get, parameter[]]]] else begin[{] None end[}] return[member[.status]] end[}] END[}]
Keyword[protected] Keyword[int] identifier[exportTemplateResource] operator[SEP] identifier[CmsStaticExportData] identifier[data] , identifier[StringBuffer] identifier[cookies] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[vfsName] operator[=] identifier[data] operator[SEP] identifier[getVfsName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[rfsName] operator[=] identifier[data] operator[SEP] identifier[getRfsName] operator[SEP] operator[SEP] operator[SEP] identifier[CmsStaticExportManager] identifier[manager] operator[=] identifier[OpenCms] operator[SEP] identifier[getStaticExportManager] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[exportUrlStr] operator[SEP] Keyword[if] operator[SEP] identifier[rfsName] operator[SEP] identifier[contains] operator[SEP] identifier[manager] operator[SEP] identifier[getRfsPrefix] operator[SEP] identifier[vfsName] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[rfsName] operator[+] literal[String] operator[+] identifier[manager] operator[SEP] identifier[getRfsPrefix] operator[SEP] identifier[vfsName] operator[SEP] operator[SEP] operator[SEP] identifier[exportUrlStr] operator[=] identifier[manager] operator[SEP] identifier[getExportUrl] operator[SEP] operator[SEP] operator[+] identifier[rfsName] operator[SEP] } Keyword[else] { identifier[exportUrlStr] operator[=] identifier[manager] operator[SEP] identifier[getExportUrl] operator[SEP] operator[SEP] operator[+] identifier[manager] operator[SEP] identifier[getRfsPrefix] operator[SEP] identifier[vfsName] operator[SEP] operator[+] identifier[rfsName] operator[SEP] } Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_SENDING_REQUEST_2] , identifier[rfsName] , identifier[exportUrlStr] operator[SEP] operator[SEP] operator[SEP] } identifier[URL] identifier[exportUrl] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[exportUrlStr] operator[SEP] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[setFollowRedirects] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[HttpURLConnection] identifier[urlcon] operator[=] operator[SEP] identifier[HttpURLConnection] operator[SEP] identifier[exportUrl] operator[SEP] identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[urlcon] operator[SEP] identifier[setRequestMethod] operator[SEP] identifier[REQUEST_METHOD_GET] operator[SEP] operator[SEP] identifier[urlcon] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[CmsRequestUtil] operator[SEP] identifier[HEADER_OPENCMS_EXPORT] , identifier[CmsStringUtil] operator[SEP] identifier[TRUE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[manager] operator[SEP] identifier[getAcceptLanguageHeader] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[urlcon] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[CmsRequestUtil] operator[SEP] identifier[HEADER_ACCEPT_LANGUAGE] , identifier[manager] operator[SEP] identifier[getAcceptLanguageHeader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[urlcon] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[CmsRequestUtil] operator[SEP] identifier[HEADER_ACCEPT_LANGUAGE] , identifier[manager] operator[SEP] identifier[getDefaultAcceptLanguageHeader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[manager] operator[SEP] identifier[getAcceptCharsetHeader] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[urlcon] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[CmsRequestUtil] operator[SEP] identifier[HEADER_ACCEPT_CHARSET] , identifier[manager] operator[SEP] identifier[getAcceptCharsetHeader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[urlcon] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[CmsRequestUtil] operator[SEP] identifier[HEADER_ACCEPT_CHARSET] , identifier[manager] operator[SEP] identifier[getDefaultAcceptCharsetHeader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[exportFileName] operator[=] identifier[CmsFileUtil] operator[SEP] identifier[normalizePath] operator[SEP] identifier[manager] operator[SEP] identifier[getExportPath] operator[SEP] identifier[vfsName] operator[SEP] operator[+] identifier[rfsName] operator[SEP] operator[SEP] identifier[File] identifier[exportFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[exportFileName] operator[SEP] operator[SEP] Keyword[long] identifier[dateLastModified] operator[=] identifier[exportFile] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vfsName] operator[SEP] identifier[startsWith] operator[SEP] identifier[CmsWorkplace] operator[SEP] identifier[VFS_PATH_SYSTEM] operator[SEP] operator[||] identifier[OpenCms] operator[SEP] identifier[getSiteManager] operator[SEP] operator[SEP] operator[SEP] identifier[startsWithShared] operator[SEP] identifier[vfsName] operator[SEP] operator[SEP] { identifier[Iterator] operator[<] identifier[CmsStaticExportRfsRule] operator[>] identifier[it] operator[=] identifier[manager] operator[SEP] identifier[getRfsRules] operator[SEP] operator[SEP] 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[CmsStaticExportRfsRule] identifier[rule] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rule] operator[SEP] identifier[match] operator[SEP] identifier[vfsName] operator[SEP] operator[SEP] { identifier[exportFileName] operator[=] identifier[CmsFileUtil] operator[SEP] identifier[normalizePath] operator[SEP] identifier[rule] operator[SEP] identifier[getExportPath] operator[SEP] operator[SEP] operator[+] identifier[rfsName] operator[SEP] operator[SEP] identifier[exportFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[exportFileName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dateLastModified] operator[>] identifier[exportFile] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] { identifier[dateLastModified] operator[=] identifier[exportFile] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] } } } } identifier[urlcon] operator[SEP] identifier[setIfModifiedSince] operator[SEP] identifier[dateLastModified] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_IF_MODIFIED_SINCE_SET_2] , identifier[exportFile] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Keyword[new] identifier[Long] operator[SEP] operator[SEP] identifier[dateLastModified] operator[/] Other[1000] operator[SEP] operator[*] Other[1000] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cookies] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[urlcon] operator[SEP] identifier[setRequestProperty] operator[SEP] identifier[REQUEST_PROPERTY_COOKIE] , identifier[cookies] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[urlcon] operator[SEP] identifier[connect] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[status] operator[=] identifier[urlcon] operator[SEP] identifier[getResponseCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cookies] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[cookies] operator[SEP] identifier[append] operator[SEP] identifier[urlcon] operator[SEP] identifier[getHeaderField] operator[SEP] identifier[HEADER_FIELD_SET_COOKIE] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_STATICEXPORT_COOKIES_1] , identifier[cookies] operator[SEP] operator[SEP] operator[SEP] } } identifier[urlcon] operator[SEP] identifier[disconnect] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[LOG_REQUEST_RESULT_3] , identifier[rfsName] , identifier[exportUrlStr] , Keyword[new] identifier[Integer] operator[SEP] identifier[status] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[status] operator[SEP] }
public static String mapToPtPath(final String aBasePath, final String aID, final String aEncapsulatedName) { final String ptPath; Objects.requireNonNull(aID); if (aEncapsulatedName == null) { ptPath = concat(aBasePath, mapToPtPath(aID)); } else { ptPath = concat(aBasePath, mapToPtPath(aID), encodeID(aEncapsulatedName)); } return ptPath; }
class class_name[name] begin[{] method[mapToPtPath, return_type[type[String]], modifier[public static], parameter[aBasePath, aID, aEncapsulatedName]] begin[{] local_variable[type[String], ptPath] call[Objects.requireNonNull, parameter[member[.aID]]] if[binary_operation[member[.aEncapsulatedName], ==, literal[null]]] begin[{] assign[member[.ptPath], call[.concat, parameter[member[.aBasePath], call[.mapToPtPath, parameter[member[.aID]]]]]] else begin[{] assign[member[.ptPath], call[.concat, parameter[member[.aBasePath], call[.mapToPtPath, parameter[member[.aID]]], call[.encodeID, parameter[member[.aEncapsulatedName]]]]]] end[}] return[member[.ptPath]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[mapToPtPath] operator[SEP] Keyword[final] identifier[String] identifier[aBasePath] , Keyword[final] identifier[String] identifier[aID] , Keyword[final] identifier[String] identifier[aEncapsulatedName] operator[SEP] { Keyword[final] identifier[String] identifier[ptPath] operator[SEP] identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[aID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aEncapsulatedName] operator[==] Other[null] operator[SEP] { identifier[ptPath] operator[=] identifier[concat] operator[SEP] identifier[aBasePath] , identifier[mapToPtPath] operator[SEP] identifier[aID] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[ptPath] operator[=] identifier[concat] operator[SEP] identifier[aBasePath] , identifier[mapToPtPath] operator[SEP] identifier[aID] operator[SEP] , identifier[encodeID] operator[SEP] identifier[aEncapsulatedName] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ptPath] operator[SEP] }
public FessMessages addErrorsInvalidStrIsIncluded(String property, String arg0, String arg1) { assertPropertyNotNull(property); add(property, new UserMessage(ERRORS_invalid_str_is_included, arg0, arg1)); return this; }
class class_name[name] begin[{] method[addErrorsInvalidStrIsIncluded, return_type[type[FessMessages]], modifier[public], parameter[property, arg0, arg1]] begin[{] call[.assertPropertyNotNull, parameter[member[.property]]] call[.add, parameter[member[.property], ClassCreator(arguments=[MemberReference(member=ERRORS_invalid_str_is_included, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=arg0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=arg1, 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=UserMessage, sub_type=None))]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[FessMessages] identifier[addErrorsInvalidStrIsIncluded] operator[SEP] identifier[String] identifier[property] , identifier[String] identifier[arg0] , identifier[String] identifier[arg1] operator[SEP] { identifier[assertPropertyNotNull] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[property] , Keyword[new] identifier[UserMessage] operator[SEP] identifier[ERRORS_invalid_str_is_included] , identifier[arg0] , identifier[arg1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void perform(TaskRequest req, TaskResponse res) { HttpServletResponse resp = (HttpServletResponse) response.evaluate(req, res); Integer sc = (Integer) statusCode.evaluate(req, res); resp.setStatus(sc); }
class class_name[name] begin[{] method[perform, return_type[void], modifier[public], parameter[req, res]] begin[{] local_variable[type[HttpServletResponse], resp] local_variable[type[Integer], sc] call[resp.setStatus, parameter[member[.sc]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[perform] operator[SEP] identifier[TaskRequest] identifier[req] , identifier[TaskResponse] identifier[res] operator[SEP] { identifier[HttpServletResponse] identifier[resp] operator[=] operator[SEP] identifier[HttpServletResponse] operator[SEP] identifier[response] operator[SEP] identifier[evaluate] operator[SEP] identifier[req] , identifier[res] operator[SEP] operator[SEP] identifier[Integer] identifier[sc] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[statusCode] operator[SEP] identifier[evaluate] operator[SEP] identifier[req] , identifier[res] operator[SEP] operator[SEP] identifier[resp] operator[SEP] identifier[setStatus] operator[SEP] identifier[sc] operator[SEP] operator[SEP] }
public void marshall(DestinationSettings destinationSettings, ProtocolMarshaller protocolMarshaller) { if (destinationSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(destinationSettings.getS3Settings(), S3SETTINGS_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[destinationSettings, protocolMarshaller]] begin[{] if[binary_operation[member[.destinationSettings], ==, 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=getS3Settings, postfix_operators=[], prefix_operators=[], qualifier=destinationSettings, selectors=[], type_arguments=None), MemberReference(member=S3SETTINGS_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[DestinationSettings] identifier[destinationSettings] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[destinationSettings] 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[destinationSettings] operator[SEP] identifier[getS3Settings] operator[SEP] operator[SEP] , identifier[S3SETTINGS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private static Integer[] intersectedDocList(int[] facetDocList, Integer[] docSet) { if (facetDocList != null && docSet != null) { Integer[] c = new Integer[Math.min(facetDocList.length, docSet.length)]; int ai = 0; int bi = 0; int ci = 0; while (ai < facetDocList.length && bi < docSet.length) { if (facetDocList[ai] < docSet[bi]) { ai++; } else if (facetDocList[ai] > docSet[bi]) { bi++; } else { if (ci == 0 || facetDocList[ai] != c[ci - 1]) { c[ci++] = facetDocList[ai]; } ai++; bi++; } } return Arrays.copyOfRange(c, 0, ci); } return new Integer[] {}; }
class class_name[name] begin[{] method[intersectedDocList, return_type[type[Integer]], modifier[private static], parameter[facetDocList, docSet]] begin[{] if[binary_operation[binary_operation[member[.facetDocList], !=, literal[null]], &&, binary_operation[member[.docSet], !=, literal[null]]]] begin[{] local_variable[type[Integer], c] local_variable[type[int], ai] local_variable[type[int], bi] local_variable[type[int], ci] while[binary_operation[binary_operation[member[.ai], <, member[facetDocList.length]], &&, binary_operation[member[.bi], <, member[docSet.length]]]] begin[{] if[binary_operation[member[.facetDocList], <, member[.docSet]]] begin[{] member[.ai] else begin[{] if[binary_operation[member[.facetDocList], >, member[.docSet]]] begin[{] member[.bi] else begin[{] if[binary_operation[binary_operation[member[.ci], ==, literal[0]], ||, binary_operation[member[.facetDocList], !=, member[.c]]]] begin[{] assign[member[.c], member[.facetDocList]] else begin[{] None end[}] member[.ai] member[.bi] end[}] end[}] end[}] return[call[Arrays.copyOfRange, parameter[member[.c], literal[0], member[.ci]]]] else begin[{] None end[}] return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))] end[}] END[}]
Keyword[private] Keyword[static] identifier[Integer] operator[SEP] operator[SEP] identifier[intersectedDocList] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[facetDocList] , identifier[Integer] operator[SEP] operator[SEP] identifier[docSet] operator[SEP] { Keyword[if] operator[SEP] identifier[facetDocList] operator[!=] Other[null] operator[&&] identifier[docSet] operator[!=] Other[null] operator[SEP] { identifier[Integer] operator[SEP] operator[SEP] identifier[c] operator[=] Keyword[new] identifier[Integer] operator[SEP] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[facetDocList] operator[SEP] identifier[length] , identifier[docSet] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[ai] operator[=] Other[0] operator[SEP] Keyword[int] identifier[bi] operator[=] Other[0] operator[SEP] Keyword[int] identifier[ci] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[ai] operator[<] identifier[facetDocList] operator[SEP] identifier[length] operator[&&] identifier[bi] operator[<] identifier[docSet] operator[SEP] identifier[length] operator[SEP] { Keyword[if] operator[SEP] identifier[facetDocList] operator[SEP] identifier[ai] operator[SEP] operator[<] identifier[docSet] operator[SEP] identifier[bi] operator[SEP] operator[SEP] { identifier[ai] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[facetDocList] operator[SEP] identifier[ai] operator[SEP] operator[>] identifier[docSet] operator[SEP] identifier[bi] operator[SEP] operator[SEP] { identifier[bi] operator[++] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[ci] operator[==] Other[0] operator[||] identifier[facetDocList] operator[SEP] identifier[ai] operator[SEP] operator[!=] identifier[c] operator[SEP] identifier[ci] operator[-] Other[1] operator[SEP] operator[SEP] { identifier[c] operator[SEP] identifier[ci] operator[++] operator[SEP] operator[=] identifier[facetDocList] operator[SEP] identifier[ai] operator[SEP] operator[SEP] } identifier[ai] operator[++] operator[SEP] identifier[bi] operator[++] operator[SEP] } } Keyword[return] identifier[Arrays] operator[SEP] identifier[copyOfRange] operator[SEP] identifier[c] , Other[0] , identifier[ci] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[Integer] operator[SEP] operator[SEP] { } operator[SEP] }
public void setBinary(File binary) { options.get(BINARY).setValue(BINARY.sanitize(binary)); }
class class_name[name] begin[{] method[setBinary, return_type[void], modifier[public], parameter[binary]] begin[{] call[options.get, parameter[member[.BINARY]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setBinary] operator[SEP] identifier[File] identifier[binary] operator[SEP] { identifier[options] operator[SEP] identifier[get] operator[SEP] identifier[BINARY] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[BINARY] operator[SEP] identifier[sanitize] operator[SEP] identifier[binary] operator[SEP] operator[SEP] operator[SEP] }
@Pure public Rectangle2d toBounds2D() { int startIndex = this.id.indexOf('#'); if (startIndex <= 0) { return null; } try { int endIndex = this.id.indexOf(';', startIndex); if (endIndex <= startIndex) { return null; } final long minx = Long.parseLong(this.id.substring(startIndex + 1, endIndex)); startIndex = endIndex + 1; endIndex = this.id.indexOf(';', startIndex); if (endIndex <= startIndex) { return null; } final long miny = Long.parseLong(this.id.substring(startIndex, endIndex)); startIndex = endIndex + 1; endIndex = this.id.indexOf(';', startIndex); if (endIndex <= startIndex) { return null; } final long maxx = Long.parseLong(this.id.substring(startIndex, endIndex)); startIndex = endIndex + 1; final long maxy = Long.parseLong(this.id.substring(startIndex)); final Rectangle2d r = new Rectangle2d(); r.setFromCorners(minx, miny, maxx, maxy); return r; } catch (Throwable exception) { // } return null; }
class class_name[name] begin[{] method[toBounds2D, return_type[type[Rectangle2d]], modifier[public], parameter[]] begin[{] local_variable[type[int], startIndex] if[binary_operation[member[.startIndex], <=, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=';'), MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=endIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), name=minx)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=';'), MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), name=miny)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=';'), MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), name=maxx)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), name=maxy)], modifiers={'final'}, type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Rectangle2d, sub_type=None)), name=r)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Rectangle2d, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=minx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=miny, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setFromCorners, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['Throwable']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
annotation[@] identifier[Pure] Keyword[public] identifier[Rectangle2d] identifier[toBounds2D] operator[SEP] operator[SEP] { Keyword[int] identifier[startIndex] operator[=] Keyword[this] operator[SEP] identifier[id] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[startIndex] operator[<=] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[try] { Keyword[int] identifier[endIndex] operator[=] Keyword[this] operator[SEP] identifier[id] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[startIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[endIndex] operator[<=] identifier[startIndex] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] Keyword[long] identifier[minx] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] Keyword[this] operator[SEP] identifier[id] operator[SEP] identifier[substring] operator[SEP] identifier[startIndex] operator[+] Other[1] , identifier[endIndex] operator[SEP] operator[SEP] operator[SEP] identifier[startIndex] operator[=] identifier[endIndex] operator[+] Other[1] operator[SEP] identifier[endIndex] operator[=] Keyword[this] operator[SEP] identifier[id] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[startIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[endIndex] operator[<=] identifier[startIndex] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] Keyword[long] identifier[miny] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] Keyword[this] operator[SEP] identifier[id] operator[SEP] identifier[substring] operator[SEP] identifier[startIndex] , identifier[endIndex] operator[SEP] operator[SEP] operator[SEP] identifier[startIndex] operator[=] identifier[endIndex] operator[+] Other[1] operator[SEP] identifier[endIndex] operator[=] Keyword[this] operator[SEP] identifier[id] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[startIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[endIndex] operator[<=] identifier[startIndex] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] Keyword[long] identifier[maxx] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] Keyword[this] operator[SEP] identifier[id] operator[SEP] identifier[substring] operator[SEP] identifier[startIndex] , identifier[endIndex] operator[SEP] operator[SEP] operator[SEP] identifier[startIndex] operator[=] identifier[endIndex] operator[+] Other[1] operator[SEP] Keyword[final] Keyword[long] identifier[maxy] operator[=] identifier[Long] operator[SEP] identifier[parseLong] operator[SEP] Keyword[this] operator[SEP] identifier[id] operator[SEP] identifier[substring] operator[SEP] identifier[startIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Rectangle2d] identifier[r] operator[=] Keyword[new] identifier[Rectangle2d] operator[SEP] operator[SEP] operator[SEP] identifier[r] operator[SEP] identifier[setFromCorners] operator[SEP] identifier[minx] , identifier[miny] , identifier[maxx] , identifier[maxy] operator[SEP] operator[SEP] Keyword[return] identifier[r] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[exception] operator[SEP] { } Keyword[return] Other[null] operator[SEP] }
public ApiResponse<List<FactionWarfareSystemsResponse>> getFwSystemsWithHttpInfo(String datasource, String ifNoneMatch) throws ApiException { com.squareup.okhttp.Call call = getFwSystemsValidateBeforeCall(datasource, ifNoneMatch, null); Type localVarReturnType = new TypeToken<List<FactionWarfareSystemsResponse>>() { }.getType(); return apiClient.execute(call, localVarReturnType); }
class class_name[name] begin[{] method[getFwSystemsWithHttpInfo, return_type[type[ApiResponse]], modifier[public], parameter[datasource, ifNoneMatch]] begin[{] local_variable[type[com], call] local_variable[type[Type], localVarReturnType] return[call[apiClient.execute, parameter[member[.call], member[.localVarReturnType]]]] end[}] END[}]
Keyword[public] identifier[ApiResponse] operator[<] identifier[List] operator[<] identifier[FactionWarfareSystemsResponse] operator[>] operator[>] identifier[getFwSystemsWithHttpInfo] operator[SEP] identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[getFwSystemsValidateBeforeCall] operator[SEP] identifier[datasource] , identifier[ifNoneMatch] , Other[null] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[List] operator[<] identifier[FactionWarfareSystemsResponse] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[apiClient] operator[SEP] identifier[execute] operator[SEP] identifier[call] , identifier[localVarReturnType] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public Query limit(int limit) { if (limit < 0) { throw new IllegalArgumentException(format("Limit of %d is negative.", limit)); } if (limit > MAX_LIMIT) { throw new IllegalArgumentException( format("Limit of %d is greater than %d.", limit, MAX_LIMIT) ); } params.put(PARAMETER_LIMIT, Integer.toString(limit)); return (Query) this; }
class class_name[name] begin[{] method[limit, return_type[type[Query]], modifier[public], parameter[limit]] begin[{] if[binary_operation[member[.limit], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Limit of %d is negative."), MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.limit], >, member[.MAX_LIMIT]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Limit of %d is greater than %d."), MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=MAX_LIMIT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[params.put, parameter[member[.PARAMETER_LIMIT], call[Integer.toString, parameter[member[.limit]]]]] return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Query, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Query] identifier[limit] operator[SEP] Keyword[int] identifier[limit] operator[SEP] { Keyword[if] operator[SEP] identifier[limit] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[limit] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[limit] operator[>] identifier[MAX_LIMIT] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[limit] , identifier[MAX_LIMIT] operator[SEP] operator[SEP] operator[SEP] } identifier[params] operator[SEP] identifier[put] operator[SEP] identifier[PARAMETER_LIMIT] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Query] operator[SEP] Keyword[this] operator[SEP] }
public MuServer start() { if (httpPort < 0 && httpsPort < 0) { throw new IllegalArgumentException("No ports were configured. Please call MuServerBuilder.withHttpPort(int) or MuServerBuilder.withHttpsPort(int)"); } ServerSettings settings = new ServerSettings(minimumGzipSize, maxHeadersSize, maxUrlSize, gzipEnabled, mimeTypesToGzip); NettyHandlerAdapter nettyHandlerAdapter = new NettyHandlerAdapter(handlers); NioEventLoopGroup bossGroup = new NioEventLoopGroup(1); NioEventLoopGroup workerGroup = new NioEventLoopGroup(); List<Channel> channels = new ArrayList<>(); Runnable shutdown = () -> { try { for (Channel channel : channels) { channel.close().sync(); } bossGroup.shutdownGracefully(0, 0, TimeUnit.MILLISECONDS).sync(); workerGroup.shutdownGracefully(0, 0, TimeUnit.MILLISECONDS).sync(); } catch (Exception e) { log.info("Error while shutting down. Will ignore. Error was: " + e.getMessage()); } }; try { GlobalTrafficShapingHandler trafficShapingHandler = new GlobalTrafficShapingHandler(workerGroup, 0, 0, 1000); MuStatsImpl stats = new MuStatsImpl(trafficShapingHandler.trafficCounter()); AtomicReference<MuServer> serverRef = new AtomicReference<>(); SslContextProvider sslContextProvider = null; Channel httpChannel = httpPort < 0 ? null : createChannel(bossGroup, workerGroup, nettyHandlerAdapter, host, httpPort, null, trafficShapingHandler, stats, serverRef, settings, false); Channel httpsChannel; boolean http2Enabled = Toggles.http2; if (httpsPort < 0) { httpsChannel = null; } else { SSLContextBuilder toUse = this.sslContextBuilder != null ? this.sslContextBuilder : SSLContextBuilder.unsignedLocalhostCertBuilder(); SslContext nettySslContext = toUse.toNettySslContext(http2Enabled); log.debug("SSL Context is " + nettySslContext); sslContextProvider = new SslContextProvider(nettySslContext); httpsChannel = createChannel(bossGroup, workerGroup, nettyHandlerAdapter, host, httpsPort, sslContextProvider, trafficShapingHandler, stats, serverRef, settings, http2Enabled); } URI uri = null; if (httpChannel != null) { channels.add(httpChannel); uri = getUriFromChannel(httpChannel, "http", host); } URI httpsUri = null; if (httpsChannel != null) { channels.add(httpsChannel); httpsUri = getUriFromChannel(httpsChannel, "https", host); } InetSocketAddress serverAddress = (InetSocketAddress) channels.get(0).localAddress(); MuServer server = new MuServerImpl(uri, httpsUri, shutdown, stats, serverAddress, sslContextProvider, http2Enabled); serverRef.set(server); if (addShutdownHook) { Runtime.getRuntime().addShutdownHook(new Thread(server::stop)); } return server; } catch (Exception ex) { shutdown.run(); throw new MuException("Error while starting server", ex); } }
class class_name[name] begin[{] method[start, return_type[type[MuServer]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[member[.httpPort], <, literal[0]], &&, binary_operation[member[.httpsPort], <, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No ports were configured. Please call MuServerBuilder.withHttpPort(int) or MuServerBuilder.withHttpsPort(int)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[ServerSettings], settings] local_variable[type[NettyHandlerAdapter], nettyHandlerAdapter] local_variable[type[NioEventLoopGroup], bossGroup] local_variable[type[NioEventLoopGroup], workerGroup] local_variable[type[List], channels] local_variable[type[Runnable], shutdown] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=workerGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GlobalTrafficShapingHandler, sub_type=None)), name=trafficShapingHandler)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GlobalTrafficShapingHandler, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=trafficCounter, postfix_operators=[], prefix_operators=[], qualifier=trafficShapingHandler, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MuStatsImpl, sub_type=None)), name=stats)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MuStatsImpl, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=AtomicReference, sub_type=None)), name=serverRef)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MuServer, sub_type=None))], dimensions=[], name=AtomicReference, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=sslContextProvider)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SslContextProvider, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=httpPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), if_false=MethodInvocation(arguments=[MemberReference(member=bossGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=workerGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nettyHandlerAdapter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=trafficShapingHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=serverRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=settings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=createChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), name=httpChannel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Channel, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=httpsChannel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Channel, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=http2, postfix_operators=[], prefix_operators=[], qualifier=Toggles, selectors=[]), name=http2Enabled)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=httpsPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sslContextBuilder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MethodInvocation(arguments=[], member=unsignedLocalhostCertBuilder, postfix_operators=[], prefix_operators=[], qualifier=SSLContextBuilder, selectors=[], type_arguments=None), if_true=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=sslContextBuilder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), name=toUse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SSLContextBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=http2Enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toNettySslContext, postfix_operators=[], prefix_operators=[], qualifier=toUse, selectors=[], type_arguments=None), name=nettySslContext)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SslContext, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SSL Context is "), operandr=MemberReference(member=nettySslContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sslContextProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=nettySslContext, 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=SslContextProvider, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=httpsChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=bossGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=workerGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nettyHandlerAdapter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpsPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sslContextProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=trafficShapingHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=serverRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=settings, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=http2Enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=httpsChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=uri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=httpChannel, 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=httpChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=channels, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=httpChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="http"), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUriFromChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=httpsUri)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=httpsChannel, 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=httpsChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=channels, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=httpsUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=httpsChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="https"), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUriFromChannel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=channels, selectors=[MethodInvocation(arguments=[], member=localAddress, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None)), name=serverAddress)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpsUri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=shutdown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=serverAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sslContextProvider, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=http2Enabled, 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=MuServerImpl, sub_type=None)), name=server)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MuServer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=server, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=serverRef, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=addShutdownHook, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getRuntime, postfix_operators=[], prefix_operators=[], qualifier=Runtime, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[MethodReference(expression=MemberReference(member=server, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Thread, sub_type=None))], member=addShutdownHook, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), ReturnStatement(expression=MemberReference(member=server, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=shutdown, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while starting server"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MuException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[MuServer] identifier[start] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[httpPort] operator[<] Other[0] operator[&&] identifier[httpsPort] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[ServerSettings] identifier[settings] operator[=] Keyword[new] identifier[ServerSettings] operator[SEP] identifier[minimumGzipSize] , identifier[maxHeadersSize] , identifier[maxUrlSize] , identifier[gzipEnabled] , identifier[mimeTypesToGzip] operator[SEP] operator[SEP] identifier[NettyHandlerAdapter] identifier[nettyHandlerAdapter] operator[=] Keyword[new] identifier[NettyHandlerAdapter] operator[SEP] identifier[handlers] operator[SEP] operator[SEP] identifier[NioEventLoopGroup] identifier[bossGroup] operator[=] Keyword[new] identifier[NioEventLoopGroup] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[NioEventLoopGroup] identifier[workerGroup] operator[=] Keyword[new] identifier[NioEventLoopGroup] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Channel] operator[>] identifier[channels] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Runnable] identifier[shutdown] operator[=] operator[SEP] operator[SEP] operator[->] { Keyword[try] { Keyword[for] operator[SEP] identifier[Channel] identifier[channel] operator[:] identifier[channels] operator[SEP] { identifier[channel] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[sync] operator[SEP] operator[SEP] operator[SEP] } identifier[bossGroup] operator[SEP] identifier[shutdownGracefully] operator[SEP] Other[0] , Other[0] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] identifier[sync] operator[SEP] operator[SEP] operator[SEP] identifier[workerGroup] operator[SEP] identifier[shutdownGracefully] operator[SEP] Other[0] , Other[0] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] identifier[sync] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] Keyword[try] { identifier[GlobalTrafficShapingHandler] identifier[trafficShapingHandler] operator[=] Keyword[new] identifier[GlobalTrafficShapingHandler] operator[SEP] identifier[workerGroup] , Other[0] , Other[0] , Other[1000] operator[SEP] operator[SEP] identifier[MuStatsImpl] identifier[stats] operator[=] Keyword[new] identifier[MuStatsImpl] operator[SEP] identifier[trafficShapingHandler] operator[SEP] identifier[trafficCounter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AtomicReference] operator[<] identifier[MuServer] operator[>] identifier[serverRef] operator[=] Keyword[new] identifier[AtomicReference] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[SslContextProvider] identifier[sslContextProvider] operator[=] Other[null] operator[SEP] identifier[Channel] identifier[httpChannel] operator[=] identifier[httpPort] operator[<] Other[0] operator[?] Other[null] operator[:] identifier[createChannel] operator[SEP] identifier[bossGroup] , identifier[workerGroup] , identifier[nettyHandlerAdapter] , identifier[host] , identifier[httpPort] , Other[null] , identifier[trafficShapingHandler] , identifier[stats] , identifier[serverRef] , identifier[settings] , literal[boolean] operator[SEP] operator[SEP] identifier[Channel] identifier[httpsChannel] operator[SEP] Keyword[boolean] identifier[http2Enabled] operator[=] identifier[Toggles] operator[SEP] identifier[http2] operator[SEP] Keyword[if] operator[SEP] identifier[httpsPort] operator[<] Other[0] operator[SEP] { identifier[httpsChannel] operator[=] Other[null] operator[SEP] } Keyword[else] { identifier[SSLContextBuilder] identifier[toUse] operator[=] Keyword[this] operator[SEP] identifier[sslContextBuilder] operator[!=] Other[null] operator[?] Keyword[this] operator[SEP] identifier[sslContextBuilder] operator[:] identifier[SSLContextBuilder] operator[SEP] identifier[unsignedLocalhostCertBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[SslContext] identifier[nettySslContext] operator[=] identifier[toUse] operator[SEP] identifier[toNettySslContext] operator[SEP] identifier[http2Enabled] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[nettySslContext] operator[SEP] operator[SEP] identifier[sslContextProvider] operator[=] Keyword[new] identifier[SslContextProvider] operator[SEP] identifier[nettySslContext] operator[SEP] operator[SEP] identifier[httpsChannel] operator[=] identifier[createChannel] operator[SEP] identifier[bossGroup] , identifier[workerGroup] , identifier[nettyHandlerAdapter] , identifier[host] , identifier[httpsPort] , identifier[sslContextProvider] , identifier[trafficShapingHandler] , identifier[stats] , identifier[serverRef] , identifier[settings] , identifier[http2Enabled] operator[SEP] operator[SEP] } identifier[URI] identifier[uri] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[httpChannel] operator[!=] Other[null] operator[SEP] { identifier[channels] operator[SEP] identifier[add] operator[SEP] identifier[httpChannel] operator[SEP] operator[SEP] identifier[uri] operator[=] identifier[getUriFromChannel] operator[SEP] identifier[httpChannel] , literal[String] , identifier[host] operator[SEP] operator[SEP] } identifier[URI] identifier[httpsUri] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[httpsChannel] operator[!=] Other[null] operator[SEP] { identifier[channels] operator[SEP] identifier[add] operator[SEP] identifier[httpsChannel] operator[SEP] operator[SEP] identifier[httpsUri] operator[=] identifier[getUriFromChannel] operator[SEP] identifier[httpsChannel] , literal[String] , identifier[host] operator[SEP] operator[SEP] } identifier[InetSocketAddress] identifier[serverAddress] operator[=] operator[SEP] identifier[InetSocketAddress] operator[SEP] identifier[channels] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[localAddress] operator[SEP] operator[SEP] operator[SEP] identifier[MuServer] identifier[server] operator[=] Keyword[new] identifier[MuServerImpl] operator[SEP] identifier[uri] , identifier[httpsUri] , identifier[shutdown] , identifier[stats] , identifier[serverAddress] , identifier[sslContextProvider] , identifier[http2Enabled] operator[SEP] operator[SEP] identifier[serverRef] operator[SEP] identifier[set] operator[SEP] identifier[server] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[addShutdownHook] operator[SEP] { identifier[Runtime] operator[SEP] identifier[getRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[addShutdownHook] operator[SEP] Keyword[new] identifier[Thread] operator[SEP] identifier[server] operator[::] identifier[stop] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[server] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[shutdown] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[MuException] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] } }
public GetDiscoveredResourceCountsResult withResourceCounts(ResourceCount... resourceCounts) { if (this.resourceCounts == null) { setResourceCounts(new com.amazonaws.internal.SdkInternalList<ResourceCount>(resourceCounts.length)); } for (ResourceCount ele : resourceCounts) { this.resourceCounts.add(ele); } return this; }
class class_name[name] begin[{] method[withResourceCounts, return_type[type[GetDiscoveredResourceCountsResult]], modifier[public], parameter[resourceCounts]] begin[{] if[binary_operation[THIS[member[None.resourceCounts]], ==, literal[null]]] begin[{] call[.setResourceCounts, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=resourceCounts, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ResourceCount, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=resourceCounts, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=resourceCounts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ResourceCount, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[GetDiscoveredResourceCountsResult] identifier[withResourceCounts] operator[SEP] identifier[ResourceCount] operator[...] identifier[resourceCounts] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[resourceCounts] operator[==] Other[null] operator[SEP] { identifier[setResourceCounts] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ResourceCount] operator[>] operator[SEP] identifier[resourceCounts] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[ResourceCount] identifier[ele] operator[:] identifier[resourceCounts] operator[SEP] { Keyword[this] operator[SEP] identifier[resourceCounts] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
protected String getLockToken(String tokenHash) { for (String token : tokens.keySet()) { if (tokens.get(token).equals(tokenHash)) { return token; } } return null; }
class class_name[name] begin[{] method[getLockToken, return_type[type[String]], modifier[protected], parameter[tokenHash]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[MethodInvocation(arguments=[MemberReference(member=tokenHash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], 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=[ReturnStatement(expression=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=token)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getLockToken] operator[SEP] identifier[String] identifier[tokenHash] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[token] operator[:] identifier[tokens] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[get] operator[SEP] identifier[token] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[tokenHash] operator[SEP] operator[SEP] { Keyword[return] identifier[token] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
private static byte[] makeRandomChallenge(final Random random) throws AuthenticationException { final byte[] rval = new byte[8]; synchronized (random) { random.nextBytes(rval); } return rval; }
class class_name[name] begin[{] method[makeRandomChallenge, return_type[type[byte]], modifier[private static], parameter[random]] begin[{] local_variable[type[byte], rval] SYNCHRONIZED[member[.random]] BEGIN[{] call[random.nextBytes, parameter[member[.rval]]] END[}] return[member[.rval]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[makeRandomChallenge] operator[SEP] Keyword[final] identifier[Random] identifier[random] operator[SEP] Keyword[throws] identifier[AuthenticationException] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[rval] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[8] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[random] operator[SEP] { identifier[random] operator[SEP] identifier[nextBytes] operator[SEP] identifier[rval] operator[SEP] operator[SEP] } Keyword[return] identifier[rval] operator[SEP] }
public Vector<Object> createSpecification(Vector<Object> specificationParams) { try { Specification specification = XmlRpcDataMarshaller.toSpecification( specificationParams ); specification = service.createSpecification( specification ); log.debug( "Created specification: " + specification.getName() ); return specification.marshallize(); } catch (Exception e) { return errorAsVector( e, SPECIFICATION_CREATE_FAILED ); } }
class class_name[name] begin[{] method[createSpecification, return_type[type[Vector]], modifier[public], parameter[specificationParams]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=specificationParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toSpecification, postfix_operators=[], prefix_operators=[], qualifier=XmlRpcDataMarshaller, selectors=[], type_arguments=None), name=specification)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Specification, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=specification, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=specification, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createSpecification, postfix_operators=[], prefix_operators=[], qualifier=service, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Created specification: "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=specification, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=marshallize, postfix_operators=[], prefix_operators=[], qualifier=specification, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SPECIFICATION_CREATE_FAILED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=errorAsVector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Vector] operator[<] identifier[Object] operator[>] identifier[createSpecification] operator[SEP] identifier[Vector] operator[<] identifier[Object] operator[>] identifier[specificationParams] operator[SEP] { Keyword[try] { identifier[Specification] identifier[specification] operator[=] identifier[XmlRpcDataMarshaller] operator[SEP] identifier[toSpecification] operator[SEP] identifier[specificationParams] operator[SEP] operator[SEP] identifier[specification] operator[=] identifier[service] operator[SEP] identifier[createSpecification] operator[SEP] identifier[specification] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[specification] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[specification] operator[SEP] identifier[marshallize] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] identifier[errorAsVector] operator[SEP] identifier[e] , identifier[SPECIFICATION_CREATE_FAILED] operator[SEP] operator[SEP] } }
public Observable<ServiceResponse<Page<RecordSetInner>>> listByDnsZoneNextWithServiceResponseAsync(final String nextPageLink) { return listByDnsZoneNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<RecordSetInner>>, Observable<ServiceResponse<Page<RecordSetInner>>>>() { @Override public Observable<ServiceResponse<Page<RecordSetInner>>> call(ServiceResponse<Page<RecordSetInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listByDnsZoneNextWithServiceResponseAsync(nextPageLink)); } }); }
class class_name[name] begin[{] method[listByDnsZoneNextWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink]] begin[{] return[call[.listByDnsZoneNextSinglePageAsync, parameter[member[.nextPageLink]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RecordSetInner] operator[>] operator[>] operator[>] identifier[listByDnsZoneNextWithServiceResponseAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[listByDnsZoneNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] identifier[concatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RecordSetInner] operator[>] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RecordSetInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RecordSetInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[RecordSetInner] operator[>] operator[>] identifier[page] operator[SEP] { identifier[String] identifier[nextPageLink] operator[=] identifier[page] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextPageLink] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP] } Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[page] operator[SEP] operator[SEP] identifier[concatWith] operator[SEP] identifier[listByDnsZoneNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public MutableInt mapInput(final IntUnaryOperator fn) { final MutableInt host = this; return new MutableInt() { @Override public MutableInt set(final int value) { host.set(fn.applyAsInt(value)); return this; } }; }
class class_name[name] begin[{] method[mapInput, return_type[type[MutableInt]], modifier[public], parameter[fn]] begin[{] local_variable[type[MutableInt], host] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=applyAsInt, postfix_operators=[], prefix_operators=[], qualifier=fn, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=host, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=set, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=value, type=BasicType(dimensions=[], name=int), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=MutableInt, sub_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=MutableInt, sub_type=None))] end[}] END[}]
Keyword[public] identifier[MutableInt] identifier[mapInput] operator[SEP] Keyword[final] identifier[IntUnaryOperator] identifier[fn] operator[SEP] { Keyword[final] identifier[MutableInt] identifier[host] operator[=] Keyword[this] operator[SEP] Keyword[return] Keyword[new] identifier[MutableInt] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[MutableInt] identifier[set] operator[SEP] Keyword[final] Keyword[int] identifier[value] operator[SEP] { identifier[host] operator[SEP] identifier[set] operator[SEP] identifier[fn] operator[SEP] identifier[applyAsInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] } } operator[SEP] }
public void set(String fieldName, Object value) throws IOException { getValueMarshaller(fieldName).setWritableObject(struct, value); LOG.debug("Set {}={}", fieldName, value); }
class class_name[name] begin[{] method[set, return_type[void], modifier[public], parameter[fieldName, value]] begin[{] call[.getValueMarshaller, parameter[member[.fieldName]]] call[LOG.debug, parameter[literal["Set {}={}"], member[.fieldName], member[.value]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[set] operator[SEP] identifier[String] identifier[fieldName] , identifier[Object] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] { identifier[getValueMarshaller] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] identifier[setWritableObject] operator[SEP] identifier[struct] , identifier[value] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[fieldName] , identifier[value] operator[SEP] operator[SEP] }
private static void parseSsextensions(JSONObject modelJSON, Diagram current) throws JSONException { if (modelJSON.has("ssextensions")) { JSONArray array = modelJSON.getJSONArray("ssextensions"); for (int i = 0; i < array.length(); i++) { current.addSsextension(array.getString(i)); } } }
class class_name[name] begin[{] method[parseSsextensions, return_type[void], modifier[private static], parameter[modelJSON, current]] begin[{] if[call[modelJSON.has, parameter[literal["ssextensions"]]]] begin[{] local_variable[type[JSONArray], array] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=array, selectors=[], type_arguments=None)], member=addSsextension, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=array, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[parseSsextensions] operator[SEP] identifier[JSONObject] identifier[modelJSON] , identifier[Diagram] identifier[current] operator[SEP] Keyword[throws] identifier[JSONException] { Keyword[if] operator[SEP] identifier[modelJSON] operator[SEP] identifier[has] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[JSONArray] identifier[array] operator[=] identifier[modelJSON] operator[SEP] identifier[getJSONArray] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[array] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[current] operator[SEP] identifier[addSsextension] operator[SEP] identifier[array] operator[SEP] identifier[getString] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } }
public static String suggestPrefix(String uri){ if(uri==null) uri = ""; return suggested.getProperty(uri); }
class class_name[name] begin[{] method[suggestPrefix, return_type[type[String]], modifier[public static], parameter[uri]] begin[{] if[binary_operation[member[.uri], ==, literal[null]]] begin[{] assign[member[.uri], literal[""]] else begin[{] None end[}] return[call[suggested.getProperty, parameter[member[.uri]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[suggestPrefix] operator[SEP] identifier[String] identifier[uri] operator[SEP] { Keyword[if] operator[SEP] identifier[uri] operator[==] Other[null] operator[SEP] identifier[uri] operator[=] literal[String] operator[SEP] Keyword[return] identifier[suggested] operator[SEP] identifier[getProperty] operator[SEP] identifier[uri] operator[SEP] operator[SEP] }
@Override public List<Version<T>> findVersionsBetween(Timestamp start, Timestamp end) { return query().findVersionsBetween(start, end); }
class class_name[name] begin[{] method[findVersionsBetween, return_type[type[List]], modifier[public], parameter[start, end]] begin[{] return[call[.query, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[Version] operator[<] identifier[T] operator[>] operator[>] identifier[findVersionsBetween] operator[SEP] identifier[Timestamp] identifier[start] , identifier[Timestamp] identifier[end] operator[SEP] { Keyword[return] identifier[query] operator[SEP] operator[SEP] operator[SEP] identifier[findVersionsBetween] operator[SEP] identifier[start] , identifier[end] operator[SEP] operator[SEP] }
@OnMessage public void onMessage(String message, Session session) { RequestParser parser = new RequestParser(); try { if (!parser.parseRequest(message)) { respondWithErrorMessage(parser.getErrorMessage(), parser.getFailedStatus(), session); return; } } catch (IOException e) { respondWithErrorMessage(parser.getErrorMessage() + " " + e.getMessage(), parser.getFailedStatus(), session, e); return; } MessageType messageType = parser.getMessageType(); if (MessageType.PROCESS_UPDATES.equals(messageType)) { ProgressUpdatesRequest progressUpdatesRequest = parser.<ProgressUpdatesRequest>getData(); onProgressUpdateRequest(progressUpdatesRequest, session); } }
class class_name[name] begin[{] method[onMessage, return_type[void], modifier[public], parameter[message, session]] begin[{] local_variable[type[RequestParser], parser] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseRequest, postfix_operators=[], prefix_operators=['!'], qualifier=parser, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getFailedStatus, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=respondWithErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MethodInvocation(arguments=[], member=getFailedStatus, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=respondWithErrorMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=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[MessageType], messageType] if[call[MessageType.PROCESS_UPDATES.equals, parameter[member[.messageType]]]] begin[{] local_variable[type[ProgressUpdatesRequest], progressUpdatesRequest] call[.onProgressUpdateRequest, parameter[member[.progressUpdatesRequest], member[.session]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[OnMessage] Keyword[public] Keyword[void] identifier[onMessage] operator[SEP] identifier[String] identifier[message] , identifier[Session] identifier[session] operator[SEP] { identifier[RequestParser] identifier[parser] operator[=] Keyword[new] identifier[RequestParser] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] operator[!] identifier[parser] operator[SEP] identifier[parseRequest] operator[SEP] identifier[message] operator[SEP] operator[SEP] { identifier[respondWithErrorMessage] operator[SEP] identifier[parser] operator[SEP] identifier[getErrorMessage] operator[SEP] operator[SEP] , identifier[parser] operator[SEP] identifier[getFailedStatus] operator[SEP] operator[SEP] , identifier[session] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[respondWithErrorMessage] operator[SEP] identifier[parser] operator[SEP] identifier[getErrorMessage] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[parser] operator[SEP] identifier[getFailedStatus] operator[SEP] operator[SEP] , identifier[session] , identifier[e] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[MessageType] identifier[messageType] operator[=] identifier[parser] operator[SEP] identifier[getMessageType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[MessageType] operator[SEP] identifier[PROCESS_UPDATES] operator[SEP] identifier[equals] operator[SEP] identifier[messageType] operator[SEP] operator[SEP] { identifier[ProgressUpdatesRequest] identifier[progressUpdatesRequest] operator[=] identifier[parser] operator[SEP] operator[<] identifier[ProgressUpdatesRequest] operator[>] identifier[getData] operator[SEP] operator[SEP] operator[SEP] identifier[onProgressUpdateRequest] operator[SEP] identifier[progressUpdatesRequest] , identifier[session] operator[SEP] operator[SEP] } }
public static Throwable trySetAccessible(AccessibleObject object, boolean checkAccessible) { if (checkAccessible && !PlatformDependent0.isExplicitTryReflectionSetAccessible()) { return new UnsupportedOperationException("Reflective setAccessible(true) disabled"); } try { object.setAccessible(true); return null; } catch (SecurityException e) { return e; } catch (RuntimeException e) { return handleInaccessibleObjectException(e); } }
class class_name[name] begin[{] method[trySetAccessible, return_type[type[Throwable]], modifier[public static], parameter[object, checkAccessible]] begin[{] if[binary_operation[member[.checkAccessible], &&, call[PlatformDependent0.isExplicitTryReflectionSetAccessible, parameter[]]]] begin[{] return[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Reflective setAccessible(true) disabled")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None))] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SecurityException'])), CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleInaccessibleObjectException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Throwable] identifier[trySetAccessible] operator[SEP] identifier[AccessibleObject] identifier[object] , Keyword[boolean] identifier[checkAccessible] operator[SEP] { Keyword[if] operator[SEP] identifier[checkAccessible] operator[&&] operator[!] identifier[PlatformDependent0] operator[SEP] identifier[isExplicitTryReflectionSetAccessible] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[object] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[catch] operator[SEP] identifier[SecurityException] identifier[e] operator[SEP] { Keyword[return] identifier[e] operator[SEP] } Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[e] operator[SEP] { Keyword[return] identifier[handleInaccessibleObjectException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
private <T extends NotificationViewData> List<T> reallyFilterNotifications(List<T> notifications, List<String> notificationTypesToInclude) { return notifications .stream() .filter(notification -> notificationTypesToInclude.contains(notification.getType().name())) .collect(Collectors.toList()); }
class class_name[name] begin[{] method[reallyFilterNotifications, return_type[type[List]], modifier[private], parameter[notifications, notificationTypesToInclude]] begin[{] return[call[notifications.stream, parameter[]]] end[}] END[}]
Keyword[private] operator[<] identifier[T] Keyword[extends] identifier[NotificationViewData] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[reallyFilterNotifications] operator[SEP] identifier[List] operator[<] identifier[T] operator[>] identifier[notifications] , identifier[List] operator[<] identifier[String] operator[>] identifier[notificationTypesToInclude] operator[SEP] { Keyword[return] identifier[notifications] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[notification] operator[->] identifier[notificationTypesToInclude] operator[SEP] identifier[contains] operator[SEP] identifier[notification] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public final void constantExpression() throws RecognitionException { int constantExpression_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 107) ) { return; } // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1115:5: ( expression ) // src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1115:7: expression { pushFollow(FOLLOW_expression_in_constantExpression4858); expression(); state._fsp--; if (state.failed) return; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving if ( state.backtracking>0 ) { memoize(input, 107, constantExpression_StartIndex); } } }
class class_name[name] begin[{] method[constantExpression, return_type[void], modifier[final public], parameter[]] begin[{] local_variable[type[int], constantExpression_StartIndex] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=107)], member=alreadyParsedRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_expression_in_constantExpression4858, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=expression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None))])], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), 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=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=107), MemberReference(member=constantExpression_StartIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=memoize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[constantExpression] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { Keyword[int] identifier[constantExpression_StartIndex] operator[=] identifier[input] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[>] Other[0] operator[&&] identifier[alreadyParsedRule] operator[SEP] identifier[input] , Other[107] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } { identifier[pushFollow] operator[SEP] identifier[FOLLOW_expression_in_constantExpression4858] operator[SEP] operator[SEP] identifier[expression] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] operator[SEP] } } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[>] Other[0] operator[SEP] { identifier[memoize] operator[SEP] identifier[input] , Other[107] , identifier[constantExpression_StartIndex] operator[SEP] operator[SEP] } } }
@Weight(Weight.Unit.VARIABLE) @Nonnull public static StackTraceElement stackElement() { final StackTraceElement[] allElements = Thread.currentThread().getStackTrace(); return allElements[2]; }
class class_name[name] begin[{] method[stackElement, return_type[type[StackTraceElement]], modifier[public static], parameter[]] begin[{] local_variable[type[StackTraceElement], allElements] return[member[.allElements]] end[}] END[}]
annotation[@] identifier[Weight] operator[SEP] identifier[Weight] operator[SEP] identifier[Unit] operator[SEP] identifier[VARIABLE] operator[SEP] annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[StackTraceElement] identifier[stackElement] operator[SEP] operator[SEP] { Keyword[final] identifier[StackTraceElement] operator[SEP] operator[SEP] identifier[allElements] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[allElements] operator[SEP] Other[2] operator[SEP] operator[SEP] }
public void addPodClassPath(String pod, PathImpl classPath) { PodConfigLocal config = getPodLocal(pod); synchronized (config) { config.addClassPath(classPath); } }
class class_name[name] begin[{] method[addPodClassPath, return_type[void], modifier[public], parameter[pod, classPath]] begin[{] local_variable[type[PodConfigLocal], config] SYNCHRONIZED[member[.config]] BEGIN[{] call[config.addClassPath, parameter[member[.classPath]]] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addPodClassPath] operator[SEP] identifier[String] identifier[pod] , identifier[PathImpl] identifier[classPath] operator[SEP] { identifier[PodConfigLocal] identifier[config] operator[=] identifier[getPodLocal] operator[SEP] identifier[pod] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[config] operator[SEP] { identifier[config] operator[SEP] identifier[addClassPath] operator[SEP] identifier[classPath] operator[SEP] operator[SEP] } }
public static Stream<MutableIntTuple> stream( Order order, IntTuple min, IntTuple max) { if (order == null) { return null; } Utils.checkForEqualSize(min, max); MutableIntTuple localMin = IntTuples.copy(min); MutableIntTuple localMax = IntTuples.copy(max); IntTupleRangeSpliterator spliterator = new IntTupleRangeSpliterator( order, localMin, localMax); return StreamSupport.stream(spliterator, false); }
class class_name[name] begin[{] method[stream, return_type[type[Stream]], modifier[public static], parameter[order, min, max]] begin[{] if[binary_operation[member[.order], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] call[Utils.checkForEqualSize, parameter[member[.min], member[.max]]] local_variable[type[MutableIntTuple], localMin] local_variable[type[MutableIntTuple], localMax] local_variable[type[IntTupleRangeSpliterator], spliterator] return[call[StreamSupport.stream, parameter[member[.spliterator], literal[false]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Stream] operator[<] identifier[MutableIntTuple] operator[>] identifier[stream] operator[SEP] identifier[Order] identifier[order] , identifier[IntTuple] identifier[min] , identifier[IntTuple] identifier[max] operator[SEP] { Keyword[if] operator[SEP] identifier[order] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Utils] operator[SEP] identifier[checkForEqualSize] operator[SEP] identifier[min] , identifier[max] operator[SEP] operator[SEP] identifier[MutableIntTuple] identifier[localMin] operator[=] identifier[IntTuples] operator[SEP] identifier[copy] operator[SEP] identifier[min] operator[SEP] operator[SEP] identifier[MutableIntTuple] identifier[localMax] operator[=] identifier[IntTuples] operator[SEP] identifier[copy] operator[SEP] identifier[max] operator[SEP] operator[SEP] identifier[IntTupleRangeSpliterator] identifier[spliterator] operator[=] Keyword[new] identifier[IntTupleRangeSpliterator] operator[SEP] identifier[order] , identifier[localMin] , identifier[localMax] operator[SEP] operator[SEP] Keyword[return] identifier[StreamSupport] operator[SEP] identifier[stream] operator[SEP] identifier[spliterator] , literal[boolean] operator[SEP] operator[SEP] }
public static Map<String, List<Object>> convertAttributeValuesToMultiValuedObjects(final Map<String, Object> attributes) { val entries = attributes.entrySet(); return entries .stream() .collect(Collectors.toMap(Map.Entry::getKey, entry -> { val value = entry.getValue(); return CollectionUtils.toCollection(value, ArrayList.class); })); }
class class_name[name] begin[{] method[convertAttributeValuesToMultiValuedObjects, return_type[type[Map]], modifier[public static], parameter[attributes]] begin[{] local_variable[type[val], entries] return[call[entries.stream, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[Object] operator[>] operator[>] identifier[convertAttributeValuesToMultiValuedObjects] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[attributes] operator[SEP] { identifier[val] identifier[entries] operator[=] identifier[attributes] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[entries] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toMap] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[::] identifier[getKey] , identifier[entry] operator[->] { identifier[val] identifier[value] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[CollectionUtils] operator[SEP] identifier[toCollection] operator[SEP] identifier[value] , identifier[ArrayList] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] operator[SEP] }
public Cookie get(String cookieName) { AssertParameter.notNull(cookieName, "Cookie name"); return cookies.get(cookieName); }
class class_name[name] begin[{] method[get, return_type[type[Cookie]], modifier[public], parameter[cookieName]] begin[{] call[AssertParameter.notNull, parameter[member[.cookieName], literal["Cookie name"]]] return[call[cookies.get, parameter[member[.cookieName]]]] end[}] END[}]
Keyword[public] identifier[Cookie] identifier[get] operator[SEP] identifier[String] identifier[cookieName] operator[SEP] { identifier[AssertParameter] operator[SEP] identifier[notNull] operator[SEP] identifier[cookieName] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[cookies] operator[SEP] identifier[get] operator[SEP] identifier[cookieName] operator[SEP] operator[SEP] }
private void createResultSubClassesMultipleJoinedTables(List result, ClassDescriptor cld, boolean wholeTree) { List tmp = (List) superClassMultipleJoinedTablesMap.get(cld.getClassOfObject()); if(tmp != null) { result.addAll(tmp); if(wholeTree) { for(int i = 0; i < tmp.size(); i++) { Class subClass = (Class) tmp.get(i); ClassDescriptor subCld = getDescriptorFor(subClass); createResultSubClassesMultipleJoinedTables(result, subCld, wholeTree); } } } }
class class_name[name] begin[{] method[createResultSubClassesMultipleJoinedTables, return_type[void], modifier[private], parameter[result, cld, wholeTree]] begin[{] local_variable[type[List], tmp] if[binary_operation[member[.tmp], !=, literal[null]]] begin[{] call[result.addAll, parameter[member[.tmp]]] if[member[.wholeTree]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), name=subClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=subClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDescriptorFor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=subCld)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassDescriptor, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subCld, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=wholeTree, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createResultSubClassesMultipleJoinedTables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[createResultSubClassesMultipleJoinedTables] operator[SEP] identifier[List] identifier[result] , identifier[ClassDescriptor] identifier[cld] , Keyword[boolean] identifier[wholeTree] operator[SEP] { identifier[List] identifier[tmp] operator[=] operator[SEP] identifier[List] operator[SEP] identifier[superClassMultipleJoinedTablesMap] operator[SEP] identifier[get] operator[SEP] identifier[cld] operator[SEP] identifier[getClassOfObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmp] operator[!=] Other[null] operator[SEP] { identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[tmp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[wholeTree] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[tmp] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Class] identifier[subClass] operator[=] operator[SEP] identifier[Class] operator[SEP] identifier[tmp] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ClassDescriptor] identifier[subCld] operator[=] identifier[getDescriptorFor] operator[SEP] identifier[subClass] operator[SEP] operator[SEP] identifier[createResultSubClassesMultipleJoinedTables] operator[SEP] identifier[result] , identifier[subCld] , identifier[wholeTree] operator[SEP] operator[SEP] } } } }
public static int findAvailablePortFrom(int minPort) { for (int port = minPort; port < PORT_RANGE_MAX; port++) { if (isPortAvailable(port)) { return port; } } throw new IllegalStateException( String.format("Could not find an available tcp port in the range [%d, %d]", minPort, PORT_RANGE_MAX)); }
class class_name[name] begin[{] method[findAvailablePortFrom, return_type[type[int]], modifier[public static], parameter[minPort]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isPortAvailable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=PORT_RANGE_MAX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=minPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=port)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=port, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not find an available tcp port in the range [%d, %d]"), MemberReference(member=minPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PORT_RANGE_MAX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[findAvailablePortFrom] operator[SEP] Keyword[int] identifier[minPort] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[port] operator[=] identifier[minPort] operator[SEP] identifier[port] operator[<] identifier[PORT_RANGE_MAX] operator[SEP] identifier[port] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[isPortAvailable] operator[SEP] identifier[port] operator[SEP] operator[SEP] { Keyword[return] identifier[port] operator[SEP] } } Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[minPort] , identifier[PORT_RANGE_MAX] operator[SEP] operator[SEP] operator[SEP] }
@Nonnull public static String getFormatted (@Nonnull final BigInteger aValue, @Nonnull final Locale aDisplayLocale) { ValueEnforcer.notNull (aValue, "Value"); ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale"); return NumberFormat.getIntegerInstance (aDisplayLocale).format (aValue); }
class class_name[name] begin[{] method[getFormatted, return_type[type[String]], modifier[public static], parameter[aValue, aDisplayLocale]] begin[{] call[ValueEnforcer.notNull, parameter[member[.aValue], literal["Value"]]] call[ValueEnforcer.notNull, parameter[member[.aDisplayLocale], literal["DisplayLocale"]]] return[call[NumberFormat.getIntegerInstance, parameter[member[.aDisplayLocale]]]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[String] identifier[getFormatted] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[BigInteger] identifier[aValue] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Locale] identifier[aDisplayLocale] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aValue] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aDisplayLocale] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[NumberFormat] operator[SEP] identifier[getIntegerInstance] operator[SEP] identifier[aDisplayLocale] operator[SEP] operator[SEP] identifier[format] operator[SEP] identifier[aValue] operator[SEP] operator[SEP] }
private boolean validParameter(final String s) { final String[] tokens = PARAMS_REGEX.split(s); if (tokens.length != 2) { return false; } final char first = s.charAt(0); String second = tokens[1]; if (second.endsWith(VARARGS_SUFFIX)) { // value encoding / return type var args, mangle argument second = varargsRoot(second); } if (first == 'E') { if (isWildcard(second)) { return true; } // Verify value encoding exists as an enum if (getValueEncoding(second) != null) { return true; } // Fallback to verification based on all character discriminators for (final Character c : second.toCharArray()) { if (getValueEncoding(c) == null) { return false; } } return true; } else if (first == 'F') { // Verify return type exists as an enum if (ReturnType.getReturnType(second) != null) { return true; } } return false; }
class class_name[name] begin[{] method[validParameter, return_type[type[boolean]], modifier[private], parameter[s]] begin[{] local_variable[type[String], tokens] if[binary_operation[member[tokens.length], !=, literal[2]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[char], first] local_variable[type[String], second] if[call[second.endsWith, parameter[member[.VARARGS_SUFFIX]]]] begin[{] assign[member[.second], call[.varargsRoot, parameter[member[.second]]]] else begin[{] None end[}] if[binary_operation[member[.first], ==, literal['E']]] begin[{] if[call[.isWildcard, parameter[member[.second]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[call[.getValueEncoding, parameter[member[.second]]], !=, literal[null]]] begin[{] return[literal[true]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValueEncoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=toCharArray, postfix_operators=[], prefix_operators=[], qualifier=second, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Character, sub_type=None))), label=None) return[literal[true]] else begin[{] if[binary_operation[member[.first], ==, literal['F']]] begin[{] if[binary_operation[call[ReturnType.getReturnType, parameter[member[.second]]], !=, literal[null]]] begin[{] return[literal[true]] else begin[{] None end[}] else begin[{] None end[}] end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[validParameter] operator[SEP] Keyword[final] identifier[String] identifier[s] operator[SEP] { Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[tokens] operator[=] identifier[PARAMS_REGEX] operator[SEP] identifier[split] operator[SEP] identifier[s] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tokens] operator[SEP] identifier[length] operator[!=] Other[2] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[final] Keyword[char] identifier[first] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[String] identifier[second] operator[=] identifier[tokens] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[second] operator[SEP] identifier[endsWith] operator[SEP] identifier[VARARGS_SUFFIX] operator[SEP] operator[SEP] { identifier[second] operator[=] identifier[varargsRoot] operator[SEP] identifier[second] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[first] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[isWildcard] operator[SEP] identifier[second] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[getValueEncoding] operator[SEP] identifier[second] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] identifier[Character] identifier[c] operator[:] identifier[second] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[getValueEncoding] operator[SEP] identifier[c] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[first] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[ReturnType] operator[SEP] identifier[getReturnType] operator[SEP] identifier[second] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }