code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
private boolean checkVarContextProvider(final TypeMirror typeMirror) { final TypeElement element = (TypeElement) types.asElement(typeMirror); if (varContextProviders.contains(typeMirror)) { // this VarContextProvider is already processed return true; } if (!element.getKind().isInterface()) { //check whether class is interface messager.printMessage( Diagnostic.Kind.ERROR, format( "%s should be interface", element ), element ); return false; } boolean extendsVariableContext = extendsVariableContext(element); if (!extendsVariableContext) { //check whether interface extends VariableContext messager.printMessage( Diagnostic.Kind.ERROR, format( "%s should be extending %s", element, VariableContext.class.getName() ), element ); return false; } final List<Variable> elements = new ArrayList<>(); final VarContextProvider varContextProvider = element.getAnnotation(VarContextProvider.class); if (varContextProvider == null) { //must be annotated with @VarContextProvider messager.printMessage( Diagnostic.Kind.ERROR, format( "%s should be annotated with @VarContextProvider", element ), element ); return false; } //check methods of interface for (Element enclosed : element.getEnclosedElements()) { final Var annotation = enclosed.getAnnotation(Var.class); if (annotation != null) { final ExecutableType executableType = (ExecutableType) enclosed.asType(); final Name simpleName = enclosed.getSimpleName(); // check name of method //should not have method with names info, debug, error,... final List<String> logLevelsMethodNames = Arrays.stream( LogLevel.values() ) .map( LogLevel::getLevelMethodName ) .collect( Collectors.toList() ); //should not have method with names infoEvent, debugEvent, errorEvent,... final List<String> logEventMethodNames = Arrays.stream( LogLevel.values() ) .map( LogLevel::getLogEventMethodName ) .collect( Collectors.toList() ); List<String> loggingEventFieldNames = Arrays.stream(LoggingEvent.class.getDeclaredFields()).map(e -> e.getName()).collect(Collectors.toList()); if ( simpleName.contentEquals("log") || //should not have method with name log logLevelsMethodNames.stream().anyMatch(simpleName::contentEquals) || logEventMethodNames.stream().anyMatch(simpleName::contentEquals) || loggingEventFieldNames.stream().anyMatch(simpleName::contentEquals) ) { messager.printMessage( Diagnostic.Kind.ERROR, format( "%s interface cannot have method named %s", element, simpleName ), element ); return false; } if (!executableType.getReturnType().toString().equals(typeMirror.toString())) { //check return type messager.printMessage( Diagnostic.Kind.ERROR, format( "%s.%s method must have return type %s", element, simpleName, element ), element ); return false; } if (executableType.getParameterTypes().size() != 1) { //check number of parameters messager.printMessage( Diagnostic.Kind.ERROR, format( "%s.%s method must have exactly one argument", element, simpleName ), element); return false; } if (elements.stream().map(Variable::getName).anyMatch(e -> e.contentEquals(simpleName))) { //check whether there is no method with same name messager.printMessage( Diagnostic.Kind.ERROR, format( "%s.%s method cannot be overloaded", element, simpleName ), element ); return false; } elements.add(new Variable(simpleName, executableType.getParameterTypes().get(0))); } } if (elements.isEmpty()) { // messager.printMessage( Diagnostic.Kind.WARNING, format( "%s has no @Var annotated methods", element ), element ); } varsHashMap.put(typeMirror, new VariableContextProvider(typeMirror, elements, varContextProvider.parametrization())); varContextProviders.add(typeMirror); return true; }
class class_name[name] begin[{] method[checkVarContextProvider, return_type[type[boolean]], modifier[private], parameter[typeMirror]] begin[{] local_variable[type[TypeElement], element] if[call[varContextProviders.contains, parameter[member[.typeMirror]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[call[element.getKind, parameter[]]] begin[{] call[messager.printMessage, parameter[member[Diagnostic.Kind.ERROR], call[.format, parameter[literal["%s should be interface"], member[.element]]], member[.element]]] return[literal[false]] else begin[{] None end[}] local_variable[type[boolean], extendsVariableContext] if[member[.extendsVariableContext]] begin[{] call[messager.printMessage, parameter[member[Diagnostic.Kind.ERROR], call[.format, parameter[literal["%s should be extending %s"], member[.element], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=VariableContext, sub_type=None))]], member[.element]]] return[literal[false]] else begin[{] None end[}] local_variable[type[List], elements] local_variable[type[VarContextProvider], varContextProvider] if[binary_operation[member[.varContextProvider], ==, literal[null]]] begin[{] call[messager.printMessage, parameter[member[Diagnostic.Kind.ERROR], call[.format, parameter[literal["%s should be annotated with @VarContextProvider"], member[.element]]], member[.element]]] return[literal[false]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Var, sub_type=None))], member=getAnnotation, postfix_operators=[], prefix_operators=[], qualifier=enclosed, selectors=[], type_arguments=None), name=annotation)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Var, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=annotation, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=asType, postfix_operators=[], prefix_operators=[], qualifier=enclosed, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=ExecutableType, sub_type=None)), name=executableType)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ExecutableType, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=enclosed, selectors=[], type_arguments=None), name=simpleName)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Name, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=LogLevel, selectors=[], type_arguments=None)], member=stream, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=LogLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=getLevelMethodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toList, postfix_operators=[], prefix_operators=[], qualifier=Collectors, selectors=[], type_arguments=None)], member=collect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=logLevelsMethodNames)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=LogLevel, selectors=[], type_arguments=None)], member=stream, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=LogLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=getLogEventMethodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toList, postfix_operators=[], prefix_operators=[], qualifier=Collectors, selectors=[], type_arguments=None)], member=collect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=logEventMethodNames)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getDeclaredFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=LoggingEvent, sub_type=None))], member=stream, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), parameters=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toList, postfix_operators=[], prefix_operators=[], qualifier=Collectors, selectors=[], type_arguments=None)], member=collect, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=loggingEventFieldNames)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="log")], member=contentEquals, postfix_operators=[], prefix_operators=[], qualifier=simpleName, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=logLevelsMethodNames, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=contentEquals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=anyMatch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=logEventMethodNames, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=contentEquals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=anyMatch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), operandr=MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=loggingEventFieldNames, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=contentEquals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=anyMatch, 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=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=Diagnostic.Kind, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s interface cannot have method named %s"), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printMessage, postfix_operators=[], prefix_operators=[], qualifier=messager, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=getReturnType, postfix_operators=[], prefix_operators=['!'], qualifier=executableType, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=typeMirror, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=Diagnostic.Kind, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.%s method must have return type %s"), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printMessage, postfix_operators=[], prefix_operators=[], qualifier=messager, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=executableType, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=Diagnostic.Kind, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.%s method must have exactly one argument"), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printMessage, postfix_operators=[], prefix_operators=[], qualifier=messager, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=stream, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=Variable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=map, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contentEquals, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), parameters=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=anyMatch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=Diagnostic.Kind, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s.%s method cannot be overloaded"), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=printMessage, postfix_operators=[], prefix_operators=[], qualifier=messager, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=simpleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=executableType, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Variable, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getEnclosedElements, postfix_operators=[], prefix_operators=[], qualifier=element, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=enclosed)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))), label=None) if[call[elements.isEmpty, parameter[]]] begin[{] call[messager.printMessage, parameter[member[Diagnostic.Kind.WARNING], call[.format, parameter[literal["%s has no @Var annotated methods"], member[.element]]], member[.element]]] else begin[{] None end[}] call[varsHashMap.put, parameter[member[.typeMirror], ClassCreator(arguments=[MemberReference(member=typeMirror, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=elements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=parametrization, postfix_operators=[], prefix_operators=[], qualifier=varContextProvider, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=VariableContextProvider, sub_type=None))]] call[varContextProviders.add, parameter[member[.typeMirror]]] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[checkVarContextProvider] operator[SEP] Keyword[final] identifier[TypeMirror] identifier[typeMirror] operator[SEP] { Keyword[final] identifier[TypeElement] identifier[element] operator[=] operator[SEP] identifier[TypeElement] operator[SEP] identifier[types] operator[SEP] identifier[asElement] operator[SEP] identifier[typeMirror] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[varContextProviders] operator[SEP] identifier[contains] operator[SEP] identifier[typeMirror] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[element] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[SEP] identifier[isInterface] operator[SEP] operator[SEP] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[Diagnostic] operator[SEP] identifier[Kind] operator[SEP] identifier[ERROR] , identifier[format] operator[SEP] literal[String] , identifier[element] operator[SEP] , identifier[element] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[boolean] identifier[extendsVariableContext] operator[=] identifier[extendsVariableContext] operator[SEP] identifier[element] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[extendsVariableContext] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[Diagnostic] operator[SEP] identifier[Kind] operator[SEP] identifier[ERROR] , identifier[format] operator[SEP] literal[String] , identifier[element] , identifier[VariableContext] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] , identifier[element] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[final] identifier[List] operator[<] identifier[Variable] operator[>] identifier[elements] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[VarContextProvider] identifier[varContextProvider] operator[=] identifier[element] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[VarContextProvider] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[varContextProvider] operator[==] Other[null] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[Diagnostic] operator[SEP] identifier[Kind] operator[SEP] identifier[ERROR] , identifier[format] operator[SEP] literal[String] , identifier[element] operator[SEP] , identifier[element] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] identifier[Element] identifier[enclosed] operator[:] identifier[element] operator[SEP] identifier[getEnclosedElements] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[Var] identifier[annotation] operator[=] identifier[enclosed] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[Var] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[annotation] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[ExecutableType] identifier[executableType] operator[=] operator[SEP] identifier[ExecutableType] operator[SEP] identifier[enclosed] operator[SEP] identifier[asType] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Name] identifier[simpleName] operator[=] identifier[enclosed] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[logLevelsMethodNames] operator[=] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[LogLevel] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[LogLevel] operator[::] identifier[getLevelMethodName] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[logEventMethodNames] operator[=] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[LogLevel] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[LogLevel] operator[::] identifier[getLogEventMethodName] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[loggingEventFieldNames] operator[=] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[LoggingEvent] operator[SEP] Keyword[class] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[e] operator[->] identifier[e] operator[SEP] identifier[getName] 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] Keyword[if] operator[SEP] identifier[simpleName] operator[SEP] identifier[contentEquals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[logLevelsMethodNames] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[anyMatch] operator[SEP] identifier[simpleName] operator[::] identifier[contentEquals] operator[SEP] operator[||] identifier[logEventMethodNames] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[anyMatch] operator[SEP] identifier[simpleName] operator[::] identifier[contentEquals] operator[SEP] operator[||] identifier[loggingEventFieldNames] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[anyMatch] operator[SEP] identifier[simpleName] operator[::] identifier[contentEquals] operator[SEP] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[Diagnostic] operator[SEP] identifier[Kind] operator[SEP] identifier[ERROR] , identifier[format] operator[SEP] literal[String] , identifier[element] , identifier[simpleName] operator[SEP] , identifier[element] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[executableType] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[typeMirror] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[Diagnostic] operator[SEP] identifier[Kind] operator[SEP] identifier[ERROR] , identifier[format] operator[SEP] literal[String] , identifier[element] , identifier[simpleName] , identifier[element] operator[SEP] , identifier[element] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[executableType] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] Other[1] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[Diagnostic] operator[SEP] identifier[Kind] operator[SEP] identifier[ERROR] , identifier[format] operator[SEP] literal[String] , identifier[element] , identifier[simpleName] operator[SEP] , identifier[element] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[elements] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Variable] operator[::] identifier[getName] operator[SEP] operator[SEP] identifier[anyMatch] operator[SEP] identifier[e] operator[->] identifier[e] operator[SEP] identifier[contentEquals] operator[SEP] identifier[simpleName] operator[SEP] operator[SEP] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[Diagnostic] operator[SEP] identifier[Kind] operator[SEP] identifier[ERROR] , identifier[format] operator[SEP] literal[String] , identifier[element] , identifier[simpleName] operator[SEP] , identifier[element] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[elements] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Variable] operator[SEP] identifier[simpleName] , identifier[executableType] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[elements] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[messager] operator[SEP] identifier[printMessage] operator[SEP] identifier[Diagnostic] operator[SEP] identifier[Kind] operator[SEP] identifier[WARNING] , identifier[format] operator[SEP] literal[String] , identifier[element] operator[SEP] , identifier[element] operator[SEP] operator[SEP] } identifier[varsHashMap] operator[SEP] identifier[put] operator[SEP] identifier[typeMirror] , Keyword[new] identifier[VariableContextProvider] operator[SEP] identifier[typeMirror] , identifier[elements] , identifier[varContextProvider] operator[SEP] identifier[parametrization] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[varContextProviders] operator[SEP] identifier[add] operator[SEP] identifier[typeMirror] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public GroupReduceOperator<T, T> first(int n) { if (n < 1) { throw new InvalidProgramException("Parameter n of first(n) must be at least 1."); } return reduceGroup(new FirstReducer<T>(n)); }
class class_name[name] begin[{] method[first, return_type[type[GroupReduceOperator]], modifier[public], parameter[n]] begin[{] if[binary_operation[member[.n], <, literal[1]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter n of first(n) must be at least 1.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidProgramException, sub_type=None)), label=None) else begin[{] None end[}] return[call[.reduceGroup, parameter[ClassCreator(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=FirstReducer, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[GroupReduceOperator] operator[<] identifier[T] , identifier[T] operator[>] identifier[first] operator[SEP] Keyword[int] identifier[n] operator[SEP] { Keyword[if] operator[SEP] identifier[n] operator[<] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidProgramException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[reduceGroup] operator[SEP] Keyword[new] identifier[FirstReducer] operator[<] identifier[T] operator[>] operator[SEP] identifier[n] operator[SEP] operator[SEP] operator[SEP] }
@Override public <T> Flowable<Tx<T>> get(@Nonnull ResultSetMapper<? extends T> mapper) { Preconditions.checkNotNull(mapper, "mapper cannot be null"); return Flowable.defer(() -> { AtomicReference<Connection> connection = new AtomicReference<Connection>(); Flowable<T> o = Update.<T>createReturnGeneratedKeys( // update.updateBuilder.connections // .map(c -> Util.toTransactedConnection(connection, c)), update.parameterGroupsToFlowable(), update.updateBuilder.sql, mapper, false); return o.materialize() // .flatMap(n -> Tx.toTx(n, connection.get(), db)) // .doOnNext(tx -> { if (tx.isComplete()) { ((TxImpl<T>) tx).connection().commit(); } }); }); }
class class_name[name] begin[{] method[get, return_type[type[Flowable]], modifier[public], parameter[mapper]] begin[{] call[Preconditions.checkNotNull, parameter[member[.mapper], literal["mapper cannot be null"]]] return[call[Flowable.defer, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None))], dimensions=None, name=AtomicReference, sub_type=None)), name=connection)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None))], dimensions=[], name=AtomicReference, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toTransactedConnection, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None), parameters=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=map, postfix_operators=[], prefix_operators=[], qualifier=update.updateBuilder.connections, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=parameterGroupsToFlowable, postfix_operators=[], prefix_operators=[], qualifier=update, selectors=[], type_arguments=None), MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=update.updateBuilder, selectors=[]), MemberReference(member=mapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=Update, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))]), name=o)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Flowable, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=materialize, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=connection, selectors=[], type_arguments=None), MemberReference(member=db, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toTx, postfix_operators=[], prefix_operators=[], qualifier=Tx, selectors=[], type_arguments=None), parameters=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=flatMap, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[LambdaExpression(body=[IfStatement(condition=MethodInvocation(arguments=[], member=isComplete, postfix_operators=[], prefix_operators=[], qualifier=tx, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=tx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=TxImpl, sub_type=None)), label=None)]))], parameters=[MemberReference(member=tx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=doOnNext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], parameters=[])]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[Flowable] operator[<] identifier[Tx] operator[<] identifier[T] operator[>] operator[>] identifier[get] operator[SEP] annotation[@] identifier[Nonnull] identifier[ResultSetMapper] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[mapper] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[mapper] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[Flowable] operator[SEP] identifier[defer] operator[SEP] operator[SEP] operator[SEP] operator[->] { identifier[AtomicReference] operator[<] identifier[Connection] operator[>] identifier[connection] operator[=] Keyword[new] identifier[AtomicReference] operator[<] identifier[Connection] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Flowable] operator[<] identifier[T] operator[>] identifier[o] operator[=] identifier[Update] operator[SEP] operator[<] identifier[T] operator[>] identifier[createReturnGeneratedKeys] operator[SEP] identifier[update] operator[SEP] identifier[updateBuilder] operator[SEP] identifier[connections] operator[SEP] identifier[map] operator[SEP] identifier[c] operator[->] identifier[Util] operator[SEP] identifier[toTransactedConnection] operator[SEP] identifier[connection] , identifier[c] operator[SEP] operator[SEP] , identifier[update] operator[SEP] identifier[parameterGroupsToFlowable] operator[SEP] operator[SEP] , identifier[update] operator[SEP] identifier[updateBuilder] operator[SEP] identifier[sql] , identifier[mapper] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[o] operator[SEP] identifier[materialize] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] identifier[n] operator[->] identifier[Tx] operator[SEP] identifier[toTx] operator[SEP] identifier[n] , identifier[connection] operator[SEP] identifier[get] operator[SEP] operator[SEP] , identifier[db] operator[SEP] operator[SEP] operator[SEP] identifier[doOnNext] operator[SEP] identifier[tx] operator[->] { Keyword[if] operator[SEP] identifier[tx] operator[SEP] identifier[isComplete] operator[SEP] operator[SEP] operator[SEP] { operator[SEP] operator[SEP] identifier[TxImpl] operator[<] identifier[T] operator[>] operator[SEP] identifier[tx] operator[SEP] operator[SEP] identifier[connection] operator[SEP] operator[SEP] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } operator[SEP] operator[SEP] }
@Override public void start(Xid xid, int flags) throws XAException { try { if (xid == null) { throw new XAException(XAException.XAER_INVAL); } // if resuming or joining an existing transaction if (flags == TMRESUME) { this.xaConnection.resumeTransactionalBranch(xid); } else if (flags == TMJOIN || flags == TMNOFLAGS) { this.xaConnection.startTransactionalBranch(xid); } LOG.debug("PhynixxXAResource[" + this.getId() + "]:start xid='" + xid + "' flags='" + ConstantsPrinter.getXAResourceMessage(flags) + "'" + " Connected to " + this.xaConnection); // start monitoring the timeout this.setTimeOutActive(true); } catch (XAException xaExc) { LOG.error("PhynixxXAResource[" + this.getId() + "]:start xid='" + xid // maybe null, but doesn't matter for logging + "' flags='" + ConstantsPrinter.getXAResourceMessage(flags) + "'" + " ERROR " + ConstantsPrinter.getXAErrorCode(xaExc.errorCode)); throw xaExc; } catch (Exception ex) { LOG.error("PhynixxXAResource.start(" + xid + "," + flags + ") on XAResourceProgressState " + this.xaId + " :: " + ex + "\n" + ExceptionUtils.getStackTrace(ex)); throw new DelegatedRuntimeException("start(" + xid + "," + flags + ") on XAResourceProgressState " + this.xaId, ex); } }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[xid, flags]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=xid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=XAER_INVAL, postfix_operators=[], prefix_operators=[], qualifier=XAException, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XAException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TMRESUME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TMJOIN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TMNOFLAGS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=xaConnection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=xid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startTransactionalBranch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=xaConnection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=xid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resumeTransactionalBranch, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PhynixxXAResource["), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]:start xid='"), operator=+), operandr=MemberReference(member=xid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' flags='"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getXAResourceMessage, postfix_operators=[], prefix_operators=[], qualifier=ConstantsPrinter, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Connected to "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=xaConnection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setTimeOutActive, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PhynixxXAResource["), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]:start xid='"), operator=+), operandr=MemberReference(member=xid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' flags='"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getXAResourceMessage, postfix_operators=[], prefix_operators=[], qualifier=ConstantsPrinter, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ERROR "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=errorCode, postfix_operators=[], prefix_operators=[], qualifier=xaExc, selectors=[])], member=getXAErrorCode, postfix_operators=[], prefix_operators=[], qualifier=ConstantsPrinter, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=xaExc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=xaExc, types=['XAException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PhynixxXAResource.start("), operandr=MemberReference(member=xid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") on XAResourceProgressState "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=xaId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" :: "), operator=+), operandr=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtils, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="start("), operandr=MemberReference(member=xid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=","), operator=+), operandr=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") on XAResourceProgressState "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=xaId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+), 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=DelegatedRuntimeException, 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[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[start] operator[SEP] identifier[Xid] identifier[xid] , Keyword[int] identifier[flags] operator[SEP] Keyword[throws] identifier[XAException] { Keyword[try] { Keyword[if] operator[SEP] identifier[xid] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[XAException] operator[SEP] identifier[XAException] operator[SEP] identifier[XAER_INVAL] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[flags] operator[==] identifier[TMRESUME] operator[SEP] { Keyword[this] operator[SEP] identifier[xaConnection] operator[SEP] identifier[resumeTransactionalBranch] operator[SEP] identifier[xid] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[flags] operator[==] identifier[TMJOIN] operator[||] identifier[flags] operator[==] identifier[TMNOFLAGS] operator[SEP] { Keyword[this] operator[SEP] identifier[xaConnection] operator[SEP] identifier[startTransactionalBranch] operator[SEP] identifier[xid] operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[xid] operator[+] literal[String] operator[+] identifier[ConstantsPrinter] operator[SEP] identifier[getXAResourceMessage] operator[SEP] identifier[flags] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[xaConnection] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setTimeOutActive] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[XAException] identifier[xaExc] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[xid] operator[+] literal[String] operator[+] identifier[ConstantsPrinter] operator[SEP] identifier[getXAResourceMessage] operator[SEP] identifier[flags] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[ConstantsPrinter] operator[SEP] identifier[getXAErrorCode] operator[SEP] identifier[xaExc] operator[SEP] identifier[errorCode] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[xaExc] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[xid] operator[+] literal[String] operator[+] identifier[flags] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[xaId] operator[+] literal[String] operator[+] identifier[ex] operator[+] literal[String] operator[+] identifier[ExceptionUtils] operator[SEP] identifier[getStackTrace] operator[SEP] identifier[ex] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DelegatedRuntimeException] operator[SEP] literal[String] operator[+] identifier[xid] operator[+] literal[String] operator[+] identifier[flags] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[xaId] , identifier[ex] operator[SEP] operator[SEP] } }
public static syslog_server[] modify(nitro_service client, syslog_server[] resources) throws Exception { if(resources == null) throw new Exception("Null resource array"); for(int i = 0; i < resources.length; i++) { resources[i].validate("modify"); } if(resources.length == 1) return ((syslog_server[]) resources[0].update_resource(client)); return ((syslog_server[]) update_bulk_request(client, resources)); }
class class_name[name] begin[{] method[modify, return_type[type[syslog_server]], modifier[public static], parameter[client, resources]] begin[{] if[binary_operation[member[.resources], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Null resource array")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="modify")], member=validate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=resources, 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) if[binary_operation[member[resources.length], ==, literal[1]]] begin[{] return[Cast(expression=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update_resource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[None], name=syslog_server, sub_type=None))] else begin[{] None end[}] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=client, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update_bulk_request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=syslog_server, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[syslog_server] operator[SEP] operator[SEP] identifier[modify] operator[SEP] identifier[nitro_service] identifier[client] , identifier[syslog_server] operator[SEP] operator[SEP] identifier[resources] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[resources] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[Exception] 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[resources] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[validate] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[resources] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[syslog_server] operator[SEP] operator[SEP] operator[SEP] identifier[resources] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[update_resource] operator[SEP] identifier[client] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[syslog_server] operator[SEP] operator[SEP] operator[SEP] identifier[update_bulk_request] operator[SEP] identifier[client] , identifier[resources] operator[SEP] operator[SEP] operator[SEP] }
public static Object getCellValue(Cell cell, CellType cellType, final boolean isTrimCellValue) { return getCellValue(cell, cellType, isTrimCellValue ? new TrimEditor() : null); }
class class_name[name] begin[{] method[getCellValue, return_type[type[Object]], modifier[public static], parameter[cell, cellType, isTrimCellValue]] begin[{] return[call[.getCellValue, parameter[member[.cell], member[.cellType], TernaryExpression(condition=MemberReference(member=isTrimCellValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TrimEditor, sub_type=None)))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[getCellValue] operator[SEP] identifier[Cell] identifier[cell] , identifier[CellType] identifier[cellType] , Keyword[final] Keyword[boolean] identifier[isTrimCellValue] operator[SEP] { Keyword[return] identifier[getCellValue] operator[SEP] identifier[cell] , identifier[cellType] , identifier[isTrimCellValue] operator[?] Keyword[new] identifier[TrimEditor] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] operator[SEP] }
public long getLastLoggedZxid() { File[] files = getLogFiles(logDir.listFiles(), 0); long maxLog=files.length>0? Util.getZxidFromName(files[files.length-1].getName(),"log"):-1; // if a log file is more recent we must scan it to find // the highest zxid long zxid = maxLog; try { FileTxnLog txn = new FileTxnLog(logDir); TxnIterator itr = txn.read(maxLog); while (true) { if(!itr.next()) break; TxnHeader hdr = itr.getHeader(); zxid = hdr.getZxid(); } } catch (IOException e) { LOG.warn("Unexpected exception", e); } return zxid; }
class class_name[name] begin[{] method[getLastLoggedZxid, return_type[type[long]], modifier[public], parameter[]] begin[{] local_variable[type[File], files] local_variable[type[long], maxLog] local_variable[type[long], zxid] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=logDir, 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=FileTxnLog, sub_type=None)), name=txn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileTxnLog, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=maxLog, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=txn, selectors=[], type_arguments=None), name=itr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TxnIterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=['!'], qualifier=itr, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getHeader, postfix_operators=[], prefix_operators=[], qualifier=itr, selectors=[], type_arguments=None), name=hdr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TxnHeader, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=zxid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getZxid, postfix_operators=[], prefix_operators=[], qualifier=hdr, selectors=[], type_arguments=None)), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected exception"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) return[member[.zxid]] end[}] END[}]
Keyword[public] Keyword[long] identifier[getLastLoggedZxid] operator[SEP] operator[SEP] { identifier[File] operator[SEP] operator[SEP] identifier[files] operator[=] identifier[getLogFiles] operator[SEP] identifier[logDir] operator[SEP] identifier[listFiles] operator[SEP] operator[SEP] , Other[0] operator[SEP] operator[SEP] Keyword[long] identifier[maxLog] operator[=] identifier[files] operator[SEP] identifier[length] operator[>] Other[0] operator[?] identifier[Util] operator[SEP] identifier[getZxidFromName] operator[SEP] identifier[files] operator[SEP] identifier[files] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[:] operator[-] Other[1] operator[SEP] Keyword[long] identifier[zxid] operator[=] identifier[maxLog] operator[SEP] Keyword[try] { identifier[FileTxnLog] identifier[txn] operator[=] Keyword[new] identifier[FileTxnLog] operator[SEP] identifier[logDir] operator[SEP] operator[SEP] identifier[TxnIterator] identifier[itr] operator[=] identifier[txn] operator[SEP] identifier[read] operator[SEP] identifier[maxLog] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[itr] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] identifier[TxnHeader] identifier[hdr] operator[=] identifier[itr] operator[SEP] identifier[getHeader] operator[SEP] operator[SEP] operator[SEP] identifier[zxid] operator[=] identifier[hdr] operator[SEP] identifier[getZxid] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[zxid] operator[SEP] }
public LeapSecondEvent getNextEvent(long utc) { ExtendedLSE[] events = this.getEventsInDescendingOrder(); LeapSecondEvent result = null; for (int i = 0; i < events.length; i++) { ExtendedLSE lse = events[i]; if (utc >= lse.utc()) { break; } else { result = lse; } } return result; }
class class_name[name] begin[{] method[getNextEvent, return_type[type[LeapSecondEvent]], modifier[public], parameter[utc]] begin[{] local_variable[type[ExtendedLSE], events] local_variable[type[LeapSecondEvent], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=events, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=lse)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExtendedLSE, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=utc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=utc, postfix_operators=[], prefix_operators=[], qualifier=lse, selectors=[], type_arguments=None), operator=>=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=lse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=events, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[LeapSecondEvent] identifier[getNextEvent] operator[SEP] Keyword[long] identifier[utc] operator[SEP] { identifier[ExtendedLSE] operator[SEP] operator[SEP] identifier[events] operator[=] Keyword[this] operator[SEP] identifier[getEventsInDescendingOrder] operator[SEP] operator[SEP] operator[SEP] identifier[LeapSecondEvent] identifier[result] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[events] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ExtendedLSE] identifier[lse] operator[=] identifier[events] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[utc] operator[>=] identifier[lse] operator[SEP] identifier[utc] operator[SEP] operator[SEP] operator[SEP] { Keyword[break] operator[SEP] } Keyword[else] { identifier[result] operator[=] identifier[lse] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public ConstructorDoc[] constructors(boolean filter) { Names names = tsym.name.table.names; List<ConstructorDocImpl> constructors = List.nil(); for (Scope.Entry e = tsym.members().elems; e != null; e = e.sibling) { if (e.sym != null && e.sym.kind == Kinds.MTH && e.sym.name == names.init) { MethodSymbol s = (MethodSymbol)e.sym; if (!filter || env.shouldDocument(s)) { constructors = constructors.prepend(env.getConstructorDoc(s)); } } } //### Cache constructors here? return constructors.toArray(new ConstructorDocImpl[constructors.length()]); }
class class_name[name] begin[{] method[constructors, return_type[type[ConstructorDoc]], modifier[public], parameter[filter]] begin[{] local_variable[type[Names], names] local_variable[type[List], constructors] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=sym, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=kind, postfix_operators=[], prefix_operators=[], qualifier=e.sym, selectors=[]), operandr=MemberReference(member=MTH, postfix_operators=[], prefix_operators=[], qualifier=Kinds, selectors=[]), operator===), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=e.sym, selectors=[]), operandr=MemberReference(member=init, postfix_operators=[], prefix_operators=[], qualifier=names, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=sym, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MethodSymbol, sub_type=None)), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodSymbol, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=filter, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=shouldDocument, postfix_operators=[], prefix_operators=[], qualifier=env, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=constructors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConstructorDoc, postfix_operators=[], prefix_operators=[], qualifier=env, selectors=[], type_arguments=None)], member=prepend, postfix_operators=[], prefix_operators=[], qualifier=constructors, selectors=[], type_arguments=None)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=members, postfix_operators=[], prefix_operators=[], qualifier=tsym, selectors=[MemberReference(member=elems, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Scope, sub_type=ReferenceType(arguments=None, dimensions=None, name=Entry, sub_type=None))), update=[Assignment(expressionl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=sibling, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[]))]), label=None) return[call[constructors.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=constructors, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConstructorDocImpl, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[ConstructorDoc] operator[SEP] operator[SEP] identifier[constructors] operator[SEP] Keyword[boolean] identifier[filter] operator[SEP] { identifier[Names] identifier[names] operator[=] identifier[tsym] operator[SEP] identifier[name] operator[SEP] identifier[table] operator[SEP] identifier[names] operator[SEP] identifier[List] operator[<] identifier[ConstructorDocImpl] operator[>] identifier[constructors] operator[=] identifier[List] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Scope] operator[SEP] identifier[Entry] identifier[e] operator[=] identifier[tsym] operator[SEP] identifier[members] operator[SEP] operator[SEP] operator[SEP] identifier[elems] operator[SEP] identifier[e] operator[!=] Other[null] operator[SEP] identifier[e] operator[=] identifier[e] operator[SEP] identifier[sibling] operator[SEP] { Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[sym] operator[!=] Other[null] operator[&&] identifier[e] operator[SEP] identifier[sym] operator[SEP] identifier[kind] operator[==] identifier[Kinds] operator[SEP] identifier[MTH] operator[&&] identifier[e] operator[SEP] identifier[sym] operator[SEP] identifier[name] operator[==] identifier[names] operator[SEP] identifier[init] operator[SEP] { identifier[MethodSymbol] identifier[s] operator[=] operator[SEP] identifier[MethodSymbol] operator[SEP] identifier[e] operator[SEP] identifier[sym] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[filter] operator[||] identifier[env] operator[SEP] identifier[shouldDocument] operator[SEP] identifier[s] operator[SEP] operator[SEP] { identifier[constructors] operator[=] identifier[constructors] operator[SEP] identifier[prepend] operator[SEP] identifier[env] operator[SEP] identifier[getConstructorDoc] operator[SEP] identifier[s] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] identifier[constructors] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[ConstructorDocImpl] operator[SEP] identifier[constructors] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public boolean isStale( File mergeFile ) { // // We can write to the file if it doesn't exist yet. // if ( ! _strutsConfigFile.exists() ) { return true; } long lastWrite = _strutsConfigFile.lastModified(); if ( mergeFile != null && mergeFile.exists() && mergeFile.lastModified() > lastWrite ) { return true; } if ( _sourceFile.lastModified() > lastWrite ) { return true; } return false; }
class class_name[name] begin[{] method[isStale, return_type[type[boolean]], modifier[public], parameter[mergeFile]] begin[{] if[call[_strutsConfigFile.exists, parameter[]]] begin[{] return[literal[true]] else begin[{] None end[}] local_variable[type[long], lastWrite] if[binary_operation[binary_operation[binary_operation[member[.mergeFile], !=, literal[null]], &&, call[mergeFile.exists, parameter[]]], &&, binary_operation[call[mergeFile.lastModified, parameter[]], >, member[.lastWrite]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[call[_sourceFile.lastModified, parameter[]], >, member[.lastWrite]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isStale] operator[SEP] identifier[File] identifier[mergeFile] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[_strutsConfigFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[long] identifier[lastWrite] operator[=] identifier[_strutsConfigFile] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mergeFile] operator[!=] Other[null] operator[&&] identifier[mergeFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[&&] identifier[mergeFile] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[>] identifier[lastWrite] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[_sourceFile] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] operator[>] identifier[lastWrite] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public AlgorithmStatusDetails withValidationStatuses(AlgorithmStatusItem... validationStatuses) { if (this.validationStatuses == null) { setValidationStatuses(new java.util.ArrayList<AlgorithmStatusItem>(validationStatuses.length)); } for (AlgorithmStatusItem ele : validationStatuses) { this.validationStatuses.add(ele); } return this; }
class class_name[name] begin[{] method[withValidationStatuses, return_type[type[AlgorithmStatusDetails]], modifier[public], parameter[validationStatuses]] begin[{] if[binary_operation[THIS[member[None.validationStatuses]], ==, literal[null]]] begin[{] call[.setValidationStatuses, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=validationStatuses, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AlgorithmStatusItem, sub_type=None))], dimensions=None, name=ArrayList, 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=validationStatuses, 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=validationStatuses, 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=AlgorithmStatusItem, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[AlgorithmStatusDetails] identifier[withValidationStatuses] operator[SEP] identifier[AlgorithmStatusItem] operator[...] identifier[validationStatuses] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[validationStatuses] operator[==] Other[null] operator[SEP] { identifier[setValidationStatuses] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[AlgorithmStatusItem] operator[>] operator[SEP] identifier[validationStatuses] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[AlgorithmStatusItem] identifier[ele] operator[:] identifier[validationStatuses] operator[SEP] { Keyword[this] operator[SEP] identifier[validationStatuses] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public void setTitle(String title) { put(PdfName.TITLE, new PdfString(title, PdfObject.TEXT_UNICODE)); }
class class_name[name] begin[{] method[setTitle, return_type[void], modifier[public], parameter[title]] begin[{] call[.put, parameter[member[PdfName.TITLE], ClassCreator(arguments=[MemberReference(member=title, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=TEXT_UNICODE, postfix_operators=[], prefix_operators=[], qualifier=PdfObject, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PdfString, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setTitle] operator[SEP] identifier[String] identifier[title] operator[SEP] { identifier[put] operator[SEP] identifier[PdfName] operator[SEP] identifier[TITLE] , Keyword[new] identifier[PdfString] operator[SEP] identifier[title] , identifier[PdfObject] operator[SEP] identifier[TEXT_UNICODE] operator[SEP] operator[SEP] operator[SEP] }
private boolean visitColumnsAndColumnFacets(VisitContext context, VisitCallback callback, boolean visitRows) { if (visitRows) { setRowIndex(-1); } if (getChildCount() > 0) { for (UIComponent column : getChildren()) { if (column instanceof UIColumn) { VisitResult result = context.invokeVisitCallback(column, callback); // visit the column directly if (result == VisitResult.COMPLETE) { return true; } if (column.getFacetCount() > 0) { for (UIComponent columnFacet : column.getFacets().values()) { if (columnFacet.visitTree(context, callback)) { return true; } } } } } } return false; }
class class_name[name] begin[{] method[visitColumnsAndColumnFacets, return_type[type[boolean]], modifier[private], parameter[context, callback, visitRows]] begin[{] if[member[.visitRows]] begin[{] call[.setRowIndex, parameter[literal[1]]] else begin[{] None end[}] if[binary_operation[call[.getChildCount, parameter[]], >, literal[0]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=UIColumn, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invokeVisitCallback, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=VisitResult, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=COMPLETE, postfix_operators=[], prefix_operators=[], qualifier=VisitResult, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getFacetCount, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=callback, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitTree, postfix_operators=[], prefix_operators=[], qualifier=columnFacet, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getFacets, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=columnFacet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UIComponent, sub_type=None))), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=column)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UIComponent, sub_type=None))), label=None) else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[visitColumnsAndColumnFacets] operator[SEP] identifier[VisitContext] identifier[context] , identifier[VisitCallback] identifier[callback] , Keyword[boolean] identifier[visitRows] operator[SEP] { Keyword[if] operator[SEP] identifier[visitRows] operator[SEP] { identifier[setRowIndex] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[for] operator[SEP] identifier[UIComponent] identifier[column] operator[:] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[column] Keyword[instanceof] identifier[UIColumn] operator[SEP] { identifier[VisitResult] identifier[result] operator[=] identifier[context] operator[SEP] identifier[invokeVisitCallback] operator[SEP] identifier[column] , identifier[callback] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] identifier[VisitResult] operator[SEP] identifier[COMPLETE] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[column] operator[SEP] identifier[getFacetCount] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[for] operator[SEP] identifier[UIComponent] identifier[columnFacet] operator[:] identifier[column] operator[SEP] identifier[getFacets] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[columnFacet] operator[SEP] identifier[visitTree] operator[SEP] identifier[context] , identifier[callback] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } } } } Keyword[return] literal[boolean] operator[SEP] }
public JTSGeometryExpression<Geometry> envelope() { if (envelope == null) { envelope = JTSGeometryExpressions.geometryOperation(SpatialOps.ENVELOPE, mixin); } return envelope; }
class class_name[name] begin[{] method[envelope, return_type[type[JTSGeometryExpression]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.envelope], ==, literal[null]]] begin[{] assign[member[.envelope], call[JTSGeometryExpressions.geometryOperation, parameter[member[SpatialOps.ENVELOPE], member[.mixin]]]] else begin[{] None end[}] return[member[.envelope]] end[}] END[}]
Keyword[public] identifier[JTSGeometryExpression] operator[<] identifier[Geometry] operator[>] identifier[envelope] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[envelope] operator[==] Other[null] operator[SEP] { identifier[envelope] operator[=] identifier[JTSGeometryExpressions] operator[SEP] identifier[geometryOperation] operator[SEP] identifier[SpatialOps] operator[SEP] identifier[ENVELOPE] , identifier[mixin] operator[SEP] operator[SEP] } Keyword[return] identifier[envelope] operator[SEP] }
public static Method getPropertyGetterMethod(Class clazz, String property) { String methodName = "get" + property.substring(0, 1).toUpperCase() + property.substring(1); Method method; try { method = clazz.getMethod(methodName); } catch (NoSuchMethodException e) { try { methodName = "is" + property.substring(0, 1).toUpperCase() + property.substring(1); method = clazz.getMethod(methodName); } catch (NoSuchMethodException e1) { throw new SofaRpcRuntimeException("No getter method for " + clazz.getName() + "#" + property, e); } } return method; }
class class_name[name] begin[{] method[getPropertyGetterMethod, return_type[type[Method]], modifier[public static], parameter[clazz, property]] begin[{] local_variable[type[String], methodName] local_variable[type[Method], method] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="is"), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[MethodInvocation(arguments=[], member=toUpperCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None), operator=+)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No getter method for "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=clazz, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="#"), operator=+), operandr=MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=SofaRpcRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchMethodException']))], finally_block=None, label=None, resources=None) return[member[.method]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Method] identifier[getPropertyGetterMethod] operator[SEP] identifier[Class] identifier[clazz] , identifier[String] identifier[property] operator[SEP] { identifier[String] identifier[methodName] operator[=] literal[String] operator[+] identifier[property] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[+] identifier[property] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[Method] identifier[method] operator[SEP] Keyword[try] { identifier[method] operator[=] identifier[clazz] operator[SEP] identifier[getMethod] operator[SEP] identifier[methodName] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e] operator[SEP] { Keyword[try] { identifier[methodName] operator[=] literal[String] operator[+] identifier[property] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[+] identifier[property] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[method] operator[=] identifier[clazz] operator[SEP] identifier[getMethod] operator[SEP] identifier[methodName] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchMethodException] identifier[e1] operator[SEP] { Keyword[throw] Keyword[new] identifier[SofaRpcRuntimeException] operator[SEP] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[property] , identifier[e] operator[SEP] operator[SEP] } } Keyword[return] identifier[method] operator[SEP] }
public ServiceFuture<List<StorageAccountInner>> listAsync(final ServiceCallback<List<StorageAccountInner>> serviceCallback) { return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); }
class class_name[name] begin[{] method[listAsync, return_type[type[ServiceFuture]], modifier[public], parameter[serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.listWithServiceResponseAsync, parameter[]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[StorageAccountInner] operator[>] operator[>] identifier[listAsync] operator[SEP] Keyword[final] identifier[ServiceCallback] operator[<] identifier[List] operator[<] identifier[StorageAccountInner] operator[>] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[listWithServiceResponseAsync] operator[SEP] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public TemplateInstanceExecution templateInstanceExecution(String sourceName, ExpressionEngine expressionEngine) { // Transforms each parameter in a name/value pair, using only the source name as input Map<String, String> sourceNameInput = Collections.singletonMap("sourceName", sourceName); Map<String, String> parameterMap = Maps.transformValues( Maps.uniqueIndex( parameters, TemplateParameter::getName ), parameter -> expressionEngine.render(parameter.getExpression(), sourceNameInput) ); // Concatenates the maps Map<String, String> inputMap = new HashMap<>(sourceNameInput); inputMap.putAll(parameterMap); // Resolves the final expression return new TemplateInstanceExecution( value -> expressionEngine.render(value, inputMap), parameterMap ); }
class class_name[name] begin[{] method[templateInstanceExecution, return_type[type[TemplateInstanceExecution]], modifier[public], parameter[sourceName, expressionEngine]] begin[{] local_variable[type[Map], sourceNameInput] local_variable[type[Map], parameterMap] local_variable[type[Map], inputMap] call[inputMap.putAll, parameter[member[.parameterMap]]] return[ClassCreator(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inputMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=render, postfix_operators=[], prefix_operators=[], qualifier=expressionEngine, selectors=[], type_arguments=None), parameters=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), MemberReference(member=parameterMap, 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=TemplateInstanceExecution, sub_type=None))] end[}] END[}]
Keyword[public] identifier[TemplateInstanceExecution] identifier[templateInstanceExecution] operator[SEP] identifier[String] identifier[sourceName] , identifier[ExpressionEngine] identifier[expressionEngine] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[sourceNameInput] operator[=] identifier[Collections] operator[SEP] identifier[singletonMap] operator[SEP] literal[String] , identifier[sourceName] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parameterMap] operator[=] identifier[Maps] operator[SEP] identifier[transformValues] operator[SEP] identifier[Maps] operator[SEP] identifier[uniqueIndex] operator[SEP] identifier[parameters] , identifier[TemplateParameter] operator[::] identifier[getName] operator[SEP] , identifier[parameter] operator[->] identifier[expressionEngine] operator[SEP] identifier[render] operator[SEP] identifier[parameter] operator[SEP] identifier[getExpression] operator[SEP] operator[SEP] , identifier[sourceNameInput] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[inputMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] identifier[sourceNameInput] operator[SEP] operator[SEP] identifier[inputMap] operator[SEP] identifier[putAll] operator[SEP] identifier[parameterMap] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[TemplateInstanceExecution] operator[SEP] identifier[value] operator[->] identifier[expressionEngine] operator[SEP] identifier[render] operator[SEP] identifier[value] , identifier[inputMap] operator[SEP] , identifier[parameterMap] operator[SEP] operator[SEP] }
private void checkProperties(NodePropertiesInfo currentNodePropertiesInfo) throws RepositoryException { if (currentNodePropertiesInfo.getNode().getQPath().isDescendantOf(Constants.JCR_VERSION_STORAGE_PATH) && currentNodePropertiesInfo.getNode().getPrimaryTypeName().equals(Constants.NT_FROZENNODE)) { InternalQName fptName = null; List<InternalQName> fmtNames = new ArrayList<InternalQName>(); // get frozenPrimaryType and frozenMixinTypes try { for (ImportPropertyData propertyData : currentNodePropertiesInfo.getProperties()) { if (propertyData.getQName().equals(Constants.JCR_FROZENPRIMARYTYPE)) { fptName = InternalQName.parse(ValueDataUtil.getString(propertyData.getValues().get(0))); } else if (propertyData.getQName().equals(Constants.JCR_FROZENMIXINTYPES)) { for (ValueData valueData : propertyData.getValues()) { fmtNames.add(InternalQName.parse(ValueDataUtil.getString(valueData))); } } } } catch (IllegalStateException e) { throw new RepositoryException(e.getMessage(), e); } catch (IllegalNameException e) { throw new RepositoryException(e.getMessage(), e); } InternalQName nodePrimaryTypeName = currentNodePropertiesInfo.getNode().getPrimaryTypeName(); InternalQName[] nodeMixinTypeName = currentNodePropertiesInfo.getNode().getMixinTypeNames(); for (ImportPropertyData propertyData : currentNodePropertiesInfo.getProperties()) { PropertyDefinitionDatas defs = nodeTypeDataManager.getPropertyDefinitions(propertyData.getQName(), nodePrimaryTypeName, nodeMixinTypeName); if (defs == null || (defs != null && defs.getAnyDefinition().isResidualSet())) { PropertyDefinitionDatas vhdefs = nodeTypeDataManager.getPropertyDefinitions(propertyData.getQName(), fptName, fmtNames.toArray(new InternalQName[fmtNames.size()])); if (vhdefs != null) { boolean isMultivalue = (vhdefs.getDefinition(true) != null ? true : false); propertyData.setMultivalue(isMultivalue); } } } } }
class class_name[name] begin[{] method[checkProperties, return_type[void], modifier[private], parameter[currentNodePropertiesInfo]] begin[{] if[binary_operation[call[currentNodePropertiesInfo.getNode, parameter[]], &&, call[currentNodePropertiesInfo.getNode, parameter[]]]] begin[{] local_variable[type[InternalQName], fptName] local_variable[type[List], fmtNames] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getQName, postfix_operators=[], prefix_operators=[], qualifier=propertyData, selectors=[MethodInvocation(arguments=[MemberReference(member=JCR_FROZENPRIMARYTYPE, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=getQName, postfix_operators=[], prefix_operators=[], qualifier=propertyData, selectors=[MethodInvocation(arguments=[MemberReference(member=JCR_FROZENMIXINTYPES, postfix_operators=[], prefix_operators=[], qualifier=Constants, 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=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=valueData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=ValueDataUtil, selectors=[], type_arguments=None)], member=parse, postfix_operators=[], prefix_operators=[], qualifier=InternalQName, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=fmtNames, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getValues, postfix_operators=[], prefix_operators=[], qualifier=propertyData, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=valueData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ValueData, sub_type=None))), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fptName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValues, postfix_operators=[], prefix_operators=[], qualifier=propertyData, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=getString, postfix_operators=[], prefix_operators=[], qualifier=ValueDataUtil, selectors=[], type_arguments=None)], member=parse, postfix_operators=[], prefix_operators=[], qualifier=InternalQName, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=currentNodePropertiesInfo, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=propertyData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ImportPropertyData, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RepositoryException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalStateException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RepositoryException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalNameException']))], finally_block=None, label=None, resources=None) local_variable[type[InternalQName], nodePrimaryTypeName] local_variable[type[InternalQName], nodeMixinTypeName] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getQName, postfix_operators=[], prefix_operators=[], qualifier=propertyData, selectors=[], type_arguments=None), MemberReference(member=nodePrimaryTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nodeMixinTypeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPropertyDefinitions, postfix_operators=[], prefix_operators=[], qualifier=nodeTypeDataManager, selectors=[], type_arguments=None), name=defs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDefinitionDatas, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=defs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=defs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=getAnyDefinition, postfix_operators=[], prefix_operators=[], qualifier=defs, selectors=[MethodInvocation(arguments=[], member=isResidualSet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getQName, postfix_operators=[], prefix_operators=[], qualifier=propertyData, selectors=[], type_arguments=None), MemberReference(member=fptName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=fmtNames, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InternalQName, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=fmtNames, selectors=[], type_arguments=None)], member=getPropertyDefinitions, postfix_operators=[], prefix_operators=[], qualifier=nodeTypeDataManager, selectors=[], type_arguments=None), name=vhdefs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDefinitionDatas, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=vhdefs, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getDefinition, postfix_operators=[], prefix_operators=[], qualifier=vhdefs, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), name=isMultivalue)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=isMultivalue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMultivalue, postfix_operators=[], prefix_operators=[], qualifier=propertyData, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getProperties, postfix_operators=[], prefix_operators=[], qualifier=currentNodePropertiesInfo, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=propertyData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ImportPropertyData, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkProperties] operator[SEP] identifier[NodePropertiesInfo] identifier[currentNodePropertiesInfo] operator[SEP] Keyword[throws] identifier[RepositoryException] { Keyword[if] operator[SEP] identifier[currentNodePropertiesInfo] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] identifier[getQPath] operator[SEP] operator[SEP] operator[SEP] identifier[isDescendantOf] operator[SEP] identifier[Constants] operator[SEP] identifier[JCR_VERSION_STORAGE_PATH] operator[SEP] operator[&&] identifier[currentNodePropertiesInfo] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] identifier[getPrimaryTypeName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[Constants] operator[SEP] identifier[NT_FROZENNODE] operator[SEP] operator[SEP] { identifier[InternalQName] identifier[fptName] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[InternalQName] operator[>] identifier[fmtNames] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[InternalQName] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] identifier[ImportPropertyData] identifier[propertyData] operator[:] identifier[currentNodePropertiesInfo] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[propertyData] operator[SEP] identifier[getQName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[Constants] operator[SEP] identifier[JCR_FROZENPRIMARYTYPE] operator[SEP] operator[SEP] { identifier[fptName] operator[=] identifier[InternalQName] operator[SEP] identifier[parse] operator[SEP] identifier[ValueDataUtil] operator[SEP] identifier[getString] operator[SEP] identifier[propertyData] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[propertyData] operator[SEP] identifier[getQName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[Constants] operator[SEP] identifier[JCR_FROZENMIXINTYPES] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[ValueData] identifier[valueData] operator[:] identifier[propertyData] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] { identifier[fmtNames] operator[SEP] identifier[add] operator[SEP] identifier[InternalQName] operator[SEP] identifier[parse] operator[SEP] identifier[ValueDataUtil] operator[SEP] identifier[getString] operator[SEP] identifier[valueData] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[catch] operator[SEP] identifier[IllegalStateException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RepositoryException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalNameException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RepositoryException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } identifier[InternalQName] identifier[nodePrimaryTypeName] operator[=] identifier[currentNodePropertiesInfo] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] identifier[getPrimaryTypeName] operator[SEP] operator[SEP] operator[SEP] identifier[InternalQName] operator[SEP] operator[SEP] identifier[nodeMixinTypeName] operator[=] identifier[currentNodePropertiesInfo] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] operator[SEP] identifier[getMixinTypeNames] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ImportPropertyData] identifier[propertyData] operator[:] identifier[currentNodePropertiesInfo] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] { identifier[PropertyDefinitionDatas] identifier[defs] operator[=] identifier[nodeTypeDataManager] operator[SEP] identifier[getPropertyDefinitions] operator[SEP] identifier[propertyData] operator[SEP] identifier[getQName] operator[SEP] operator[SEP] , identifier[nodePrimaryTypeName] , identifier[nodeMixinTypeName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[defs] operator[==] Other[null] operator[||] operator[SEP] identifier[defs] operator[!=] Other[null] operator[&&] identifier[defs] operator[SEP] identifier[getAnyDefinition] operator[SEP] operator[SEP] operator[SEP] identifier[isResidualSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[PropertyDefinitionDatas] identifier[vhdefs] operator[=] identifier[nodeTypeDataManager] operator[SEP] identifier[getPropertyDefinitions] operator[SEP] identifier[propertyData] operator[SEP] identifier[getQName] operator[SEP] operator[SEP] , identifier[fptName] , identifier[fmtNames] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[InternalQName] operator[SEP] identifier[fmtNames] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vhdefs] operator[!=] Other[null] operator[SEP] { Keyword[boolean] identifier[isMultivalue] operator[=] operator[SEP] identifier[vhdefs] operator[SEP] identifier[getDefinition] operator[SEP] literal[boolean] operator[SEP] operator[!=] Other[null] operator[?] literal[boolean] operator[:] literal[boolean] operator[SEP] operator[SEP] identifier[propertyData] operator[SEP] identifier[setMultivalue] operator[SEP] identifier[isMultivalue] operator[SEP] operator[SEP] } } } } }
void putInt(ByteBuffer buf, int adr, int x) { buf.elems[adr ] = (byte)((x >> 24) & 0xFF); buf.elems[adr+1] = (byte)((x >> 16) & 0xFF); buf.elems[adr+2] = (byte)((x >> 8) & 0xFF); buf.elems[adr+3] = (byte)((x ) & 0xFF); }
class class_name[name] begin[{] method[putInt, return_type[void], modifier[default], parameter[buf, adr, x]] begin[{] assign[member[buf.elems], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), type=BasicType(dimensions=[], name=byte))] assign[member[buf.elems], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), type=BasicType(dimensions=[], name=byte))] assign[member[buf.elems], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), type=BasicType(dimensions=[], name=byte))] assign[member[buf.elems], Cast(expression=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFF), operator=&), type=BasicType(dimensions=[], name=byte))] end[}] END[}]
Keyword[void] identifier[putInt] operator[SEP] identifier[ByteBuffer] identifier[buf] , Keyword[int] identifier[adr] , Keyword[int] identifier[x] operator[SEP] { identifier[buf] operator[SEP] identifier[elems] operator[SEP] identifier[adr] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[x] operator[>] operator[>] Other[24] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[elems] operator[SEP] identifier[adr] operator[+] Other[1] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[x] operator[>] operator[>] Other[16] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[elems] operator[SEP] identifier[adr] operator[+] Other[2] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[x] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[elems] operator[SEP] identifier[adr] operator[+] Other[3] operator[SEP] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[x] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] }
public java.util.List<ImportInstanceVolumeDetailItem> getVolumes() { if (volumes == null) { volumes = new com.amazonaws.internal.SdkInternalList<ImportInstanceVolumeDetailItem>(); } return volumes; }
class class_name[name] begin[{] method[getVolumes, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.volumes], ==, literal[null]]] begin[{] assign[member[.volumes], 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=ImportInstanceVolumeDetailItem, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.volumes]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[ImportInstanceVolumeDetailItem] operator[>] identifier[getVolumes] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[volumes] operator[==] Other[null] operator[SEP] { identifier[volumes] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ImportInstanceVolumeDetailItem] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[volumes] operator[SEP] }
public synchronized void setupCustomCommandSerializerAndDeserializer(CommandSerializer commandSerializer, CommandDeserializer commandDeserializer) { checkState(!isInitialized()); this.commandSerializer = commandSerializer; this.commandDeserializer = commandDeserializer; }
class class_name[name] begin[{] method[setupCustomCommandSerializerAndDeserializer, return_type[void], modifier[synchronized public], parameter[commandSerializer, commandDeserializer]] begin[{] call[.checkState, parameter[call[.isInitialized, parameter[]]]] assign[THIS[member[None.commandSerializer]], member[.commandSerializer]] assign[THIS[member[None.commandDeserializer]], member[.commandDeserializer]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[setupCustomCommandSerializerAndDeserializer] operator[SEP] identifier[CommandSerializer] identifier[commandSerializer] , identifier[CommandDeserializer] identifier[commandDeserializer] operator[SEP] { identifier[checkState] operator[SEP] operator[!] identifier[isInitialized] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[commandSerializer] operator[=] identifier[commandSerializer] operator[SEP] Keyword[this] operator[SEP] identifier[commandDeserializer] operator[=] identifier[commandDeserializer] operator[SEP] }
protected Map<String, Object> parseResponseObject(Response response) throws IOException { return parseResponse(response).parseObject(); }
class class_name[name] begin[{] method[parseResponseObject, return_type[type[Map]], modifier[protected], parameter[response]] begin[{] return[call[.parseResponse, parameter[member[.response]]]] end[}] END[}]
Keyword[protected] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[parseResponseObject] operator[SEP] identifier[Response] identifier[response] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[parseResponse] operator[SEP] identifier[response] operator[SEP] operator[SEP] identifier[parseObject] operator[SEP] operator[SEP] operator[SEP] }
@Override @SuppressWarnings("unchecked") public void initialize() { // grab a handle to the hash table from the iteration broker if (taskContext instanceof AbstractIterativePactTask) { AbstractIterativePactTask<?, ?> iterativeTaskContext = (AbstractIterativePactTask<?, ?>) taskContext; String identifier = iterativeTaskContext.brokerKey(); this.hashTable = (CompactingHashTable<IT1>) SolutionSetBroker.instance().get(identifier); } else { throw new RuntimeException("The task context of this driver is no iterative task context."); } TaskConfig config = taskContext.getTaskConfig(); ClassLoader classLoader = taskContext.getUserCodeClassLoader(); TypeSerializer<IT1> solutionSetSerializer = this.hashTable.getBuildSideSerializer(); TypeSerializer<IT2> probeSideSerializer = taskContext.<IT2>getInputSerializer(0).getSerializer(); TypeComparatorFactory<IT2> probeSideComparatorFactory = config.getDriverComparator(0, classLoader); TypeComparator<IT1> solutionSetComparator = this.hashTable.getBuildSideComparator().duplicate(); this.probeSideComparator = probeSideComparatorFactory.createComparator(); solutionSideRecord = solutionSetSerializer.createInstance(); probeSideRecord = probeSideSerializer.createInstance(); TypePairComparatorFactory<IT1, IT2> factory = taskContext.getTaskConfig().getPairComparatorFactory(taskContext.getUserCodeClassLoader()); pairComparator = factory.createComparator21(solutionSetComparator, this.probeSideComparator); }
class class_name[name] begin[{] method[initialize, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.taskContext], instanceof, type[AbstractIterativePactTask]]] begin[{] local_variable[type[AbstractIterativePactTask], iterativeTaskContext] local_variable[type[String], identifier] assign[THIS[member[None.hashTable]], Cast(expression=MethodInvocation(arguments=[], member=instance, postfix_operators=[], prefix_operators=[], qualifier=SolutionSetBroker, selectors=[MethodInvocation(arguments=[MemberReference(member=identifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IT1, sub_type=None))], dimensions=[], name=CompactingHashTable, sub_type=None))] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The task context of this driver is no iterative task context.")], 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) end[}] local_variable[type[TaskConfig], config] local_variable[type[ClassLoader], classLoader] local_variable[type[TypeSerializer], solutionSetSerializer] local_variable[type[TypeSerializer], probeSideSerializer] local_variable[type[TypeComparatorFactory], probeSideComparatorFactory] local_variable[type[TypeComparator], solutionSetComparator] assign[THIS[member[None.probeSideComparator]], call[probeSideComparatorFactory.createComparator, parameter[]]] assign[member[.solutionSideRecord], call[solutionSetSerializer.createInstance, parameter[]]] assign[member[.probeSideRecord], call[probeSideSerializer.createInstance, parameter[]]] local_variable[type[TypePairComparatorFactory], factory] assign[member[.pairComparator], call[factory.createComparator21, parameter[member[.solutionSetComparator], THIS[member[None.probeSideComparator]]]]] end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[initialize] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[taskContext] Keyword[instanceof] identifier[AbstractIterativePactTask] operator[SEP] { identifier[AbstractIterativePactTask] operator[<] operator[?] , operator[?] operator[>] identifier[iterativeTaskContext] operator[=] operator[SEP] identifier[AbstractIterativePactTask] operator[<] operator[?] , operator[?] operator[>] operator[SEP] identifier[taskContext] operator[SEP] identifier[String] identifier[identifier] operator[=] identifier[iterativeTaskContext] operator[SEP] identifier[brokerKey] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[hashTable] operator[=] operator[SEP] identifier[CompactingHashTable] operator[<] identifier[IT1] operator[>] operator[SEP] identifier[SolutionSetBroker] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[identifier] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[TaskConfig] identifier[config] operator[=] identifier[taskContext] operator[SEP] identifier[getTaskConfig] operator[SEP] operator[SEP] operator[SEP] identifier[ClassLoader] identifier[classLoader] operator[=] identifier[taskContext] operator[SEP] identifier[getUserCodeClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[TypeSerializer] operator[<] identifier[IT1] operator[>] identifier[solutionSetSerializer] operator[=] Keyword[this] operator[SEP] identifier[hashTable] operator[SEP] identifier[getBuildSideSerializer] operator[SEP] operator[SEP] operator[SEP] identifier[TypeSerializer] operator[<] identifier[IT2] operator[>] identifier[probeSideSerializer] operator[=] identifier[taskContext] operator[SEP] operator[<] identifier[IT2] operator[>] identifier[getInputSerializer] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getSerializer] operator[SEP] operator[SEP] operator[SEP] identifier[TypeComparatorFactory] operator[<] identifier[IT2] operator[>] identifier[probeSideComparatorFactory] operator[=] identifier[config] operator[SEP] identifier[getDriverComparator] operator[SEP] Other[0] , identifier[classLoader] operator[SEP] operator[SEP] identifier[TypeComparator] operator[<] identifier[IT1] operator[>] identifier[solutionSetComparator] operator[=] Keyword[this] operator[SEP] identifier[hashTable] operator[SEP] identifier[getBuildSideComparator] operator[SEP] operator[SEP] operator[SEP] identifier[duplicate] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[probeSideComparator] operator[=] identifier[probeSideComparatorFactory] operator[SEP] identifier[createComparator] operator[SEP] operator[SEP] operator[SEP] identifier[solutionSideRecord] operator[=] identifier[solutionSetSerializer] operator[SEP] identifier[createInstance] operator[SEP] operator[SEP] operator[SEP] identifier[probeSideRecord] operator[=] identifier[probeSideSerializer] operator[SEP] identifier[createInstance] operator[SEP] operator[SEP] operator[SEP] identifier[TypePairComparatorFactory] operator[<] identifier[IT1] , identifier[IT2] operator[>] identifier[factory] operator[=] identifier[taskContext] operator[SEP] identifier[getTaskConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getPairComparatorFactory] operator[SEP] identifier[taskContext] operator[SEP] identifier[getUserCodeClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pairComparator] operator[=] identifier[factory] operator[SEP] identifier[createComparator21] operator[SEP] identifier[solutionSetComparator] , Keyword[this] operator[SEP] identifier[probeSideComparator] operator[SEP] operator[SEP] }
public static Number toNumber(String str, Number defaultValue) { try { // float if (str.indexOf('.') != -1) { return new BigDecimal(str); } // integer BigInteger bi = new BigInteger(str); int l = bi.bitLength(); if (l < 32) return new Integer(bi.intValue()); if (l < 64) return new Long(bi.longValue()); return bi; } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); return defaultValue; } }
class class_name[name] begin[{] method[toNumber, return_type[type[Number]], modifier[public static], parameter[str, defaultValue]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=str, 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=BigDecimal, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=str, 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)), name=bi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=bitLength, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None), name=l)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=<), else_statement=None, label=None, then_statement=ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=intValue, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=64), operator=<), else_statement=None, label=None, then_statement=ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=longValue, postfix_operators=[], prefix_operators=[], qualifier=bi, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None)), label=None)), ReturnStatement(expression=MemberReference(member=bi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rethrowIfNecessary, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtil, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Number] identifier[toNumber] operator[SEP] identifier[String] identifier[str] , identifier[Number] identifier[defaultValue] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[str] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { Keyword[return] Keyword[new] identifier[BigDecimal] operator[SEP] identifier[str] operator[SEP] operator[SEP] } identifier[BigInteger] identifier[bi] operator[=] Keyword[new] identifier[BigInteger] operator[SEP] identifier[str] operator[SEP] operator[SEP] Keyword[int] identifier[l] operator[=] identifier[bi] operator[SEP] identifier[bitLength] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l] operator[<] Other[32] operator[SEP] Keyword[return] Keyword[new] identifier[Integer] operator[SEP] identifier[bi] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l] operator[<] Other[64] operator[SEP] Keyword[return] Keyword[new] identifier[Long] operator[SEP] identifier[bi] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[bi] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[ExceptionUtil] operator[SEP] identifier[rethrowIfNecessary] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[return] identifier[defaultValue] operator[SEP] } }
public static <N extends Number> LongStream buildLongStream(Collection<N> numberCollection) { return numberCollection.stream().mapToLong(Number::longValue); }
class class_name[name] begin[{] method[buildLongStream, return_type[type[LongStream]], modifier[public static], parameter[numberCollection]] begin[{] return[call[numberCollection.stream, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[N] Keyword[extends] identifier[Number] operator[>] identifier[LongStream] identifier[buildLongStream] operator[SEP] identifier[Collection] operator[<] identifier[N] operator[>] identifier[numberCollection] operator[SEP] { Keyword[return] identifier[numberCollection] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[mapToLong] operator[SEP] identifier[Number] operator[::] identifier[longValue] operator[SEP] operator[SEP] }
public static MessageSendResult messageMassSendall(String access_token, MassMessage massMessage) { String str = JsonUtil.toJSONString(massMessage); return messageMassSendall(access_token, str); }
class class_name[name] begin[{] method[messageMassSendall, return_type[type[MessageSendResult]], modifier[public static], parameter[access_token, massMessage]] begin[{] local_variable[type[String], str] return[call[.messageMassSendall, parameter[member[.access_token], member[.str]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MessageSendResult] identifier[messageMassSendall] operator[SEP] identifier[String] identifier[access_token] , identifier[MassMessage] identifier[massMessage] operator[SEP] { identifier[String] identifier[str] operator[=] identifier[JsonUtil] operator[SEP] identifier[toJSONString] operator[SEP] identifier[massMessage] operator[SEP] operator[SEP] Keyword[return] identifier[messageMassSendall] operator[SEP] identifier[access_token] , identifier[str] operator[SEP] operator[SEP] }
protected String determineSegmentValue(Properties params) { String segmentValue = params.getProperty( SEGMENT_VALUE_PARAM ); if ( StringHelper.isEmpty( segmentValue ) ) { segmentValue = determineDefaultSegmentValue( params ); } return segmentValue; }
class class_name[name] begin[{] method[determineSegmentValue, return_type[type[String]], modifier[protected], parameter[params]] begin[{] local_variable[type[String], segmentValue] if[call[StringHelper.isEmpty, parameter[member[.segmentValue]]]] begin[{] assign[member[.segmentValue], call[.determineDefaultSegmentValue, parameter[member[.params]]]] else begin[{] None end[}] return[member[.segmentValue]] end[}] END[}]
Keyword[protected] identifier[String] identifier[determineSegmentValue] operator[SEP] identifier[Properties] identifier[params] operator[SEP] { identifier[String] identifier[segmentValue] operator[=] identifier[params] operator[SEP] identifier[getProperty] operator[SEP] identifier[SEGMENT_VALUE_PARAM] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StringHelper] operator[SEP] identifier[isEmpty] operator[SEP] identifier[segmentValue] operator[SEP] operator[SEP] { identifier[segmentValue] operator[=] identifier[determineDefaultSegmentValue] operator[SEP] identifier[params] operator[SEP] operator[SEP] } Keyword[return] identifier[segmentValue] operator[SEP] }
private void updateShapeOffset() { int offsetX = scroller.getOffsetX(); int offsetY = scroller.getOffsetY(); shape.setOffset(offsetX, offsetY); }
class class_name[name] begin[{] method[updateShapeOffset, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[int], offsetX] local_variable[type[int], offsetY] call[shape.setOffset, parameter[member[.offsetX], member[.offsetY]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[updateShapeOffset] operator[SEP] operator[SEP] { Keyword[int] identifier[offsetX] operator[=] identifier[scroller] operator[SEP] identifier[getOffsetX] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[offsetY] operator[=] identifier[scroller] operator[SEP] identifier[getOffsetY] operator[SEP] operator[SEP] operator[SEP] identifier[shape] operator[SEP] identifier[setOffset] operator[SEP] identifier[offsetX] , identifier[offsetY] operator[SEP] operator[SEP] }
public static Date addHours(Date d, int hours) { Calendar cal = Calendar.getInstance(); cal.setTime(d); cal.add(Calendar.HOUR_OF_DAY, hours); return cal.getTime(); }
class class_name[name] begin[{] method[addHours, return_type[type[Date]], modifier[public static], parameter[d, hours]] begin[{] local_variable[type[Calendar], cal] call[cal.setTime, parameter[member[.d]]] call[cal.add, parameter[member[Calendar.HOUR_OF_DAY], member[.hours]]] return[call[cal.getTime, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Date] identifier[addHours] operator[SEP] identifier[Date] identifier[d] , Keyword[int] identifier[hours] operator[SEP] { identifier[Calendar] identifier[cal] operator[=] identifier[Calendar] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[setTime] operator[SEP] identifier[d] operator[SEP] operator[SEP] identifier[cal] operator[SEP] identifier[add] operator[SEP] identifier[Calendar] operator[SEP] identifier[HOUR_OF_DAY] , identifier[hours] operator[SEP] operator[SEP] Keyword[return] identifier[cal] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] }
public void addReaction(Emoji emoji, boolean you) { Optional<Reaction> reaction = reactions.stream().filter(r -> emoji.equalsEmoji(r.getEmoji())).findAny(); reaction.ifPresent(r -> ((ReactionImpl) r).incrementCount(you)); if (!reaction.isPresent()) { reactions.add(new ReactionImpl(this, emoji, 1, you)); } }
class class_name[name] begin[{] method[addReaction, return_type[void], modifier[public], parameter[emoji, you]] begin[{] local_variable[type[Optional], reaction] call[reaction.ifPresent, parameter[LambdaExpression(body=Cast(expression=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ReactionImpl, sub_type=None)), parameters=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] if[call[reaction.isPresent, parameter[]]] begin[{] call[reactions.add, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=emoji, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=you, 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=ReactionImpl, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addReaction] operator[SEP] identifier[Emoji] identifier[emoji] , Keyword[boolean] identifier[you] operator[SEP] { identifier[Optional] operator[<] identifier[Reaction] operator[>] identifier[reaction] operator[=] identifier[reactions] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[r] operator[->] identifier[emoji] operator[SEP] identifier[equalsEmoji] operator[SEP] identifier[r] operator[SEP] identifier[getEmoji] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[findAny] operator[SEP] operator[SEP] operator[SEP] identifier[reaction] operator[SEP] identifier[ifPresent] operator[SEP] identifier[r] operator[->] operator[SEP] operator[SEP] identifier[ReactionImpl] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[incrementCount] operator[SEP] identifier[you] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[reaction] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { identifier[reactions] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ReactionImpl] operator[SEP] Keyword[this] , identifier[emoji] , Other[1] , identifier[you] operator[SEP] operator[SEP] operator[SEP] } }
public DMatrixRMaj getQ(DMatrixRMaj Q ) { Q = UtilDecompositons_DDRM.checkIdentity(Q,N,N); for( int j = N-2; j >= 0; j-- ) { u[j+1] = 1; for( int i = j+2; i < N; i++ ) { u[i] = QH.get(i,j); } QrHelperFunctions_DDRM.rank1UpdateMultR(Q, u, gammas[j], j + 1, j + 1, N, b); } return Q; }
class class_name[name] begin[{] method[getQ, return_type[type[DMatrixRMaj]], modifier[public], parameter[Q]] begin[{] assign[member[.Q], call[UtilDecompositons_DDRM.checkIdentity, parameter[member[.Q], member[.N], member[.N]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=QH, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=+), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=Q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=u, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=gammas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rank1UpdateMultR, postfix_operators=[], prefix_operators=[], qualifier=QrHelperFunctions_DDRM, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.Q]] end[}] END[}]
Keyword[public] identifier[DMatrixRMaj] identifier[getQ] operator[SEP] identifier[DMatrixRMaj] identifier[Q] operator[SEP] { identifier[Q] operator[=] identifier[UtilDecompositons_DDRM] operator[SEP] identifier[checkIdentity] operator[SEP] identifier[Q] , identifier[N] , identifier[N] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[N] operator[-] Other[2] operator[SEP] identifier[j] operator[>=] Other[0] operator[SEP] identifier[j] operator[--] operator[SEP] { identifier[u] operator[SEP] identifier[j] operator[+] Other[1] operator[SEP] operator[=] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[j] operator[+] Other[2] operator[SEP] identifier[i] operator[<] identifier[N] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[u] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[QH] operator[SEP] identifier[get] operator[SEP] identifier[i] , identifier[j] operator[SEP] operator[SEP] } identifier[QrHelperFunctions_DDRM] operator[SEP] identifier[rank1UpdateMultR] operator[SEP] identifier[Q] , identifier[u] , identifier[gammas] operator[SEP] identifier[j] operator[SEP] , identifier[j] operator[+] Other[1] , identifier[j] operator[+] Other[1] , identifier[N] , identifier[b] operator[SEP] operator[SEP] } Keyword[return] identifier[Q] operator[SEP] }
public FileEventOptions kind(final WatchEvent.Kind<Path> kind) { requireNonNull(kind, "WatchEvent.Kind required."); kinds.add(kind); return this; }
class class_name[name] begin[{] method[kind, return_type[type[FileEventOptions]], modifier[public], parameter[kind]] begin[{] call[.requireNonNull, parameter[member[.kind], literal["WatchEvent.Kind required."]]] call[kinds.add, parameter[member[.kind]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[FileEventOptions] identifier[kind] operator[SEP] Keyword[final] identifier[WatchEvent] operator[SEP] identifier[Kind] operator[<] identifier[Path] operator[>] identifier[kind] operator[SEP] { identifier[requireNonNull] operator[SEP] identifier[kind] , literal[String] operator[SEP] operator[SEP] identifier[kinds] operator[SEP] identifier[add] operator[SEP] identifier[kind] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
static public void configHttpFileSystemProxy(FileSystemOptions fsOptions, String webProxyHost, Integer webProxyPort, String webProxyUserName, String webProxyPassword){ if (webProxyHost != null && webProxyPort != null){ HttpFileSystemConfigBuilder.getInstance().setProxyHost(fsOptions, webProxyHost); HttpFileSystemConfigBuilder.getInstance().setProxyPort(fsOptions, webProxyPort); if (webProxyUserName != null){ StaticUserAuthenticator auth = new StaticUserAuthenticator(webProxyUserName, webProxyPassword, null); HttpFileSystemConfigBuilder.getInstance().setProxyAuthenticator(fsOptions, auth); } } }
class class_name[name] begin[{] method[configHttpFileSystemProxy, return_type[void], modifier[public static], parameter[fsOptions, webProxyHost, webProxyPort, webProxyUserName, webProxyPassword]] begin[{] if[binary_operation[binary_operation[member[.webProxyHost], !=, literal[null]], &&, binary_operation[member[.webProxyPort], !=, literal[null]]]] begin[{] call[HttpFileSystemConfigBuilder.getInstance, parameter[]] call[HttpFileSystemConfigBuilder.getInstance, parameter[]] if[binary_operation[member[.webProxyUserName], !=, literal[null]]] begin[{] local_variable[type[StaticUserAuthenticator], auth] call[HttpFileSystemConfigBuilder.getInstance, parameter[]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[static] Keyword[public] Keyword[void] identifier[configHttpFileSystemProxy] operator[SEP] identifier[FileSystemOptions] identifier[fsOptions] , identifier[String] identifier[webProxyHost] , identifier[Integer] identifier[webProxyPort] , identifier[String] identifier[webProxyUserName] , identifier[String] identifier[webProxyPassword] operator[SEP] { Keyword[if] operator[SEP] identifier[webProxyHost] operator[!=] Other[null] operator[&&] identifier[webProxyPort] operator[!=] Other[null] operator[SEP] { identifier[HttpFileSystemConfigBuilder] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[setProxyHost] operator[SEP] identifier[fsOptions] , identifier[webProxyHost] operator[SEP] operator[SEP] identifier[HttpFileSystemConfigBuilder] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[setProxyPort] operator[SEP] identifier[fsOptions] , identifier[webProxyPort] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[webProxyUserName] operator[!=] Other[null] operator[SEP] { identifier[StaticUserAuthenticator] identifier[auth] operator[=] Keyword[new] identifier[StaticUserAuthenticator] operator[SEP] identifier[webProxyUserName] , identifier[webProxyPassword] , Other[null] operator[SEP] operator[SEP] identifier[HttpFileSystemConfigBuilder] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[setProxyAuthenticator] operator[SEP] identifier[fsOptions] , identifier[auth] operator[SEP] operator[SEP] } } }
protected void handleEvents(final String EVENT_TYPE) { super.handleEvents(EVENT_TYPE); if ("FINISHED".equals(EVENT_TYPE)) { if ( gauge.isHighlightSections() ) { redraw(); } } else if ("ANGLE".equals(EVENT_TYPE)) { double currentValue = (needleRotate.getAngle() + START_ANGLE - 180) / angleStep + gauge.getMinValue(); lcdText.setText((String.format(locale, formatString, currentValue))); if (gauge.isLcdVisible()) { lcdText.setAlignment(Pos.CENTER_RIGHT); lcdText.setTranslateX((width - lcdText.getPrefWidth()) * 0.5); } else { lcdText.setAlignment(Pos.CENTER); lcdText.setTranslateX((width - lcdText.getLayoutBounds().getWidth()) * 0.5); } } else if ("VISIBILITY".equals(EVENT_TYPE)) { enableNode(ledCanvas, gauge.isLedVisible()); enableNode(titleText, !gauge.getTitle().isEmpty()); enableNode(unitText, !gauge.getUnit().isEmpty()); enableNode(lcd,gauge.isLcdVisible()); enableNode(lcdText,gauge.isValueVisible()); enableNode(threshold, gauge.isThresholdVisible()); enableNode(average, gauge.isAverageVisible()); boolean markersVisible = gauge.getMarkersVisible(); for (Shape shape : markerMap.values()) { Helper.enableNode(shape, markersVisible); } resize(); redraw(); } else if ("LED".equals(EVENT_TYPE)) { if (gauge.isLedVisible()) { drawLed(led); } } else if ("LCD".equals(EVENT_TYPE)) { if (gauge.isLcdVisible()) redraw(); } else if ("RECALC".equals(EVENT_TYPE)) { angleStep = gauge.getAngleStep(); if (gauge.getValue() < gauge.getMinValue()) { oldValue = gauge.getMinValue(); } if (gauge.getValue() > gauge.getMaxValue()) { oldValue = gauge.getMaxValue(); } redraw(); rotateNeedle(); } }
class class_name[name] begin[{] method[handleEvents, return_type[void], modifier[protected], parameter[EVENT_TYPE]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=EVENT_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleEvents, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) if[literal["FINISHED"]] begin[{] if[call[gauge.isHighlightSections, parameter[]]] begin[{] call[.redraw, parameter[]] else begin[{] None end[}] else begin[{] if[literal["ANGLE"]] begin[{] local_variable[type[double], currentValue] call[lcdText.setText, parameter[call[String.format, parameter[member[.locale], member[.formatString], member[.currentValue]]]]] if[call[gauge.isLcdVisible, parameter[]]] begin[{] call[lcdText.setAlignment, parameter[member[Pos.CENTER_RIGHT]]] call[lcdText.setTranslateX, parameter[binary_operation[binary_operation[member[.width], -, call[lcdText.getPrefWidth, parameter[]]], *, literal[0.5]]]] else begin[{] call[lcdText.setAlignment, parameter[member[Pos.CENTER]]] call[lcdText.setTranslateX, parameter[binary_operation[binary_operation[member[.width], -, call[lcdText.getLayoutBounds, parameter[]]], *, literal[0.5]]]] end[}] else begin[{] if[literal["VISIBILITY"]] begin[{] call[.enableNode, parameter[member[.ledCanvas], call[gauge.isLedVisible, parameter[]]]] call[.enableNode, parameter[member[.titleText], call[gauge.getTitle, parameter[]]]] call[.enableNode, parameter[member[.unitText], call[gauge.getUnit, parameter[]]]] call[.enableNode, parameter[member[.lcd], call[gauge.isLcdVisible, parameter[]]]] call[.enableNode, parameter[member[.lcdText], call[gauge.isValueVisible, parameter[]]]] call[.enableNode, parameter[member[.threshold], call[gauge.isThresholdVisible, parameter[]]]] call[.enableNode, parameter[member[.average], call[gauge.isAverageVisible, parameter[]]]] local_variable[type[boolean], markersVisible] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=shape, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=markersVisible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=enableNode, postfix_operators=[], prefix_operators=[], qualifier=Helper, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=markerMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=shape)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Shape, sub_type=None))), label=None) call[.resize, parameter[]] call[.redraw, parameter[]] else begin[{] if[literal["LED"]] begin[{] if[call[gauge.isLedVisible, parameter[]]] begin[{] call[.drawLed, parameter[member[.led]]] else begin[{] None end[}] else begin[{] if[literal["LCD"]] begin[{] if[call[gauge.isLcdVisible, parameter[]]] begin[{] call[.redraw, parameter[]] else begin[{] None end[}] else begin[{] if[literal["RECALC"]] begin[{] assign[member[.angleStep], call[gauge.getAngleStep, parameter[]]] if[binary_operation[call[gauge.getValue, parameter[]], <, call[gauge.getMinValue, parameter[]]]] begin[{] assign[member[.oldValue], call[gauge.getMinValue, parameter[]]] else begin[{] None end[}] if[binary_operation[call[gauge.getValue, parameter[]], >, call[gauge.getMaxValue, parameter[]]]] begin[{] assign[member[.oldValue], call[gauge.getMaxValue, parameter[]]] else begin[{] None end[}] call[.redraw, parameter[]] call[.rotateNeedle, parameter[]] else begin[{] None end[}] end[}] end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[handleEvents] operator[SEP] Keyword[final] identifier[String] identifier[EVENT_TYPE] operator[SEP] { Keyword[super] operator[SEP] identifier[handleEvents] operator[SEP] identifier[EVENT_TYPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[EVENT_TYPE] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[gauge] operator[SEP] identifier[isHighlightSections] operator[SEP] operator[SEP] operator[SEP] { identifier[redraw] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[EVENT_TYPE] operator[SEP] operator[SEP] { Keyword[double] identifier[currentValue] operator[=] operator[SEP] identifier[needleRotate] operator[SEP] identifier[getAngle] operator[SEP] operator[SEP] operator[+] identifier[START_ANGLE] operator[-] Other[180] operator[SEP] operator[/] identifier[angleStep] operator[+] identifier[gauge] operator[SEP] identifier[getMinValue] operator[SEP] operator[SEP] operator[SEP] identifier[lcdText] operator[SEP] identifier[setText] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[locale] , identifier[formatString] , identifier[currentValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gauge] operator[SEP] identifier[isLcdVisible] operator[SEP] operator[SEP] operator[SEP] { identifier[lcdText] operator[SEP] identifier[setAlignment] operator[SEP] identifier[Pos] operator[SEP] identifier[CENTER_RIGHT] operator[SEP] operator[SEP] identifier[lcdText] operator[SEP] identifier[setTranslateX] operator[SEP] operator[SEP] identifier[width] operator[-] identifier[lcdText] operator[SEP] identifier[getPrefWidth] operator[SEP] operator[SEP] operator[SEP] operator[*] literal[Float] operator[SEP] operator[SEP] } Keyword[else] { identifier[lcdText] operator[SEP] identifier[setAlignment] operator[SEP] identifier[Pos] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] identifier[lcdText] operator[SEP] identifier[setTranslateX] operator[SEP] operator[SEP] identifier[width] operator[-] identifier[lcdText] operator[SEP] identifier[getLayoutBounds] operator[SEP] operator[SEP] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[SEP] operator[*] literal[Float] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[EVENT_TYPE] operator[SEP] operator[SEP] { identifier[enableNode] operator[SEP] identifier[ledCanvas] , identifier[gauge] operator[SEP] identifier[isLedVisible] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enableNode] operator[SEP] identifier[titleText] , operator[!] identifier[gauge] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enableNode] operator[SEP] identifier[unitText] , operator[!] identifier[gauge] operator[SEP] identifier[getUnit] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enableNode] operator[SEP] identifier[lcd] , identifier[gauge] operator[SEP] identifier[isLcdVisible] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enableNode] operator[SEP] identifier[lcdText] , identifier[gauge] operator[SEP] identifier[isValueVisible] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enableNode] operator[SEP] identifier[threshold] , identifier[gauge] operator[SEP] identifier[isThresholdVisible] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[enableNode] operator[SEP] identifier[average] , identifier[gauge] operator[SEP] identifier[isAverageVisible] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[markersVisible] operator[=] identifier[gauge] operator[SEP] identifier[getMarkersVisible] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Shape] identifier[shape] operator[:] identifier[markerMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[Helper] operator[SEP] identifier[enableNode] operator[SEP] identifier[shape] , identifier[markersVisible] operator[SEP] operator[SEP] } identifier[resize] operator[SEP] operator[SEP] operator[SEP] identifier[redraw] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[EVENT_TYPE] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[gauge] operator[SEP] identifier[isLedVisible] operator[SEP] operator[SEP] operator[SEP] { identifier[drawLed] operator[SEP] identifier[led] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[EVENT_TYPE] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[gauge] operator[SEP] identifier[isLcdVisible] operator[SEP] operator[SEP] operator[SEP] identifier[redraw] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[EVENT_TYPE] operator[SEP] operator[SEP] { identifier[angleStep] operator[=] identifier[gauge] operator[SEP] identifier[getAngleStep] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gauge] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[<] identifier[gauge] operator[SEP] identifier[getMinValue] operator[SEP] operator[SEP] operator[SEP] { identifier[oldValue] operator[=] identifier[gauge] operator[SEP] identifier[getMinValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[gauge] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[>] identifier[gauge] operator[SEP] identifier[getMaxValue] operator[SEP] operator[SEP] operator[SEP] { identifier[oldValue] operator[=] identifier[gauge] operator[SEP] identifier[getMaxValue] operator[SEP] operator[SEP] operator[SEP] } identifier[redraw] operator[SEP] operator[SEP] operator[SEP] identifier[rotateNeedle] operator[SEP] operator[SEP] operator[SEP] } }
public static Float getFloatProperty(String key, boolean required) { Float value = null; String stringValue = getProperty(key, required); if (stringValue != null) { value = Float.valueOf(stringValue); } return value; }
class class_name[name] begin[{] method[getFloatProperty, return_type[type[Float]], modifier[public static], parameter[key, required]] begin[{] local_variable[type[Float], value] local_variable[type[String], stringValue] if[binary_operation[member[.stringValue], !=, literal[null]]] begin[{] assign[member[.value], call[Float.valueOf, parameter[member[.stringValue]]]] else begin[{] None end[}] return[member[.value]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Float] identifier[getFloatProperty] operator[SEP] identifier[String] identifier[key] , Keyword[boolean] identifier[required] operator[SEP] { identifier[Float] identifier[value] operator[=] Other[null] operator[SEP] identifier[String] identifier[stringValue] operator[=] identifier[getProperty] operator[SEP] identifier[key] , identifier[required] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[stringValue] operator[!=] Other[null] operator[SEP] { identifier[value] operator[=] identifier[Float] operator[SEP] identifier[valueOf] operator[SEP] identifier[stringValue] operator[SEP] operator[SEP] } Keyword[return] identifier[value] operator[SEP] }
private void doUnescape(StringBuilder sb, String str, int firstAmp) { sb.append(str, 0, firstAmp); int len = str.length(); for (int i = firstAmp; i < len; i++) { char c = str.charAt(i); if (c == '&') { int nextIdx = i + 1; int semiColonIdx = str.indexOf(';', nextIdx); if (semiColonIdx == -1) { sb.append(c); continue; } int amphersandIdx = str.indexOf('&', i + 1); if (amphersandIdx != -1 && amphersandIdx < semiColonIdx) { // Then the text looks like &...&...; sb.append(c); continue; } String entityContent = str.substring(nextIdx, semiColonIdx); int entityValue = -1; int entityContentLen = entityContent.length(); if (entityContentLen > 0) { if (entityContent.charAt(0) == '#') { // escaped value content is an integer (decimal or // hexidecimal) if (entityContentLen > 1) { char isHexChar = entityContent.charAt(1); try { switch (isHexChar) { case 'X' : case 'x' : { entityValue = Integer.parseInt(entityContent.substring(2), 16); break; } default : { entityValue = Integer.parseInt(entityContent.substring(1), 10); } } if (entityValue > 0xFFFF) { entityValue = -1; } } catch (NumberFormatException e) { entityValue = -1; } } } else { // escaped value content is an entity name entityValue = this.entityValue(entityContent); } } if (entityValue == -1) { sb.append('&'); sb.append(entityContent); sb.append(';'); } else { sb.append(Character.toChars(entityValue)); } i = semiColonIdx; // move index up to the semi-colon } else { sb.append(c); } } }
class class_name[name] begin[{] method[doUnescape, return_type[void], modifier[private], parameter[sb, str, firstAmp]] begin[{] call[sb.append, parameter[member[.str], literal[0], member[.firstAmp]]] local_variable[type[int], len] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='&'), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=nextIdx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=';'), MemberReference(member=nextIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), name=semiColonIdx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=semiColonIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='&'), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), name=amphersandIdx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=amphersandIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=amphersandIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=semiColonIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=nextIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=semiColonIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), name=entityContent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=entityValue)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=entityContent, selectors=[], type_arguments=None), name=entityContentLen)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=entityContentLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=entityContent, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='#'), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entityValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=entityContent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=entityValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=entityContentLen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=entityContent, selectors=[], type_arguments=None), name=isHexChar)], modifiers=set(), type=BasicType(dimensions=[], name=char)), TryStatement(block=[SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='X'), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='x')], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entityValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=entityContent, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entityValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=entityContent, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)), label=None)])])], expression=MemberReference(member=isHexChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=entityValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xFFFF), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entityValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entityValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)]))]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=entityValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=entityValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toChars, postfix_operators=[], prefix_operators=[], qualifier=Character, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, 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='&')], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entityContent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=';')], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=semiColonIdx, 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=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=firstAmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[doUnescape] operator[SEP] identifier[StringBuilder] identifier[sb] , identifier[String] identifier[str] , Keyword[int] identifier[firstAmp] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[str] , Other[0] , identifier[firstAmp] operator[SEP] operator[SEP] Keyword[int] identifier[len] operator[=] identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[firstAmp] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[int] identifier[nextIdx] operator[=] identifier[i] operator[+] Other[1] operator[SEP] Keyword[int] identifier[semiColonIdx] operator[=] identifier[str] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[nextIdx] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[semiColonIdx] operator[==] operator[-] Other[1] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[int] identifier[amphersandIdx] operator[=] identifier[str] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[amphersandIdx] operator[!=] operator[-] Other[1] operator[&&] identifier[amphersandIdx] operator[<] identifier[semiColonIdx] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } identifier[String] identifier[entityContent] operator[=] identifier[str] operator[SEP] identifier[substring] operator[SEP] identifier[nextIdx] , identifier[semiColonIdx] operator[SEP] operator[SEP] Keyword[int] identifier[entityValue] operator[=] operator[-] Other[1] operator[SEP] Keyword[int] identifier[entityContentLen] operator[=] identifier[entityContent] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entityContentLen] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[entityContent] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[entityContentLen] operator[>] Other[1] operator[SEP] { Keyword[char] identifier[isHexChar] operator[=] identifier[entityContent] operator[SEP] identifier[charAt] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[try] { Keyword[switch] operator[SEP] identifier[isHexChar] operator[SEP] { Keyword[case] literal[String] operator[:] Keyword[case] literal[String] operator[:] { identifier[entityValue] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[entityContent] operator[SEP] identifier[substring] operator[SEP] Other[2] operator[SEP] , Other[16] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[default] operator[:] { identifier[entityValue] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[entityContent] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] , Other[10] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[entityValue] operator[>] literal[Integer] operator[SEP] { identifier[entityValue] operator[=] operator[-] Other[1] operator[SEP] } } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { identifier[entityValue] operator[=] operator[-] Other[1] operator[SEP] } } } Keyword[else] { identifier[entityValue] operator[=] Keyword[this] operator[SEP] identifier[entityValue] operator[SEP] identifier[entityContent] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[entityValue] operator[==] operator[-] Other[1] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[entityContent] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[Character] operator[SEP] identifier[toChars] operator[SEP] identifier[entityValue] operator[SEP] operator[SEP] operator[SEP] } identifier[i] operator[=] identifier[semiColonIdx] operator[SEP] } Keyword[else] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] } } }
public void removeMembershipEventListener(MembershipEventListener listener) { SecurityHelper.validateSecurityPermission(PermissionConstants.MANAGE_LISTENERS); listeners.remove(listener); }
class class_name[name] begin[{] method[removeMembershipEventListener, return_type[void], modifier[public], parameter[listener]] begin[{] call[SecurityHelper.validateSecurityPermission, parameter[member[PermissionConstants.MANAGE_LISTENERS]]] call[listeners.remove, parameter[member[.listener]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[removeMembershipEventListener] operator[SEP] identifier[MembershipEventListener] identifier[listener] operator[SEP] { identifier[SecurityHelper] operator[SEP] identifier[validateSecurityPermission] operator[SEP] identifier[PermissionConstants] operator[SEP] identifier[MANAGE_LISTENERS] operator[SEP] operator[SEP] identifier[listeners] operator[SEP] identifier[remove] operator[SEP] identifier[listener] operator[SEP] operator[SEP] }
public void select(SelectRequest request) { call( new PostRequest(path("select")) .setParam("gateId", request.getGateId()) .setParam("organization", request.getOrganization()) .setParam("projectId", request.getProjectId()) .setParam("projectKey", request.getProjectKey()) .setMediaType(MediaTypes.JSON) ).content(); }
class class_name[name] begin[{] method[select, return_type[void], modifier[public], parameter[request]] begin[{] call[.call, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="select")], member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="gateId"), MethodInvocation(arguments=[], member=getGateId, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)], member=setParam, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="organization"), MethodInvocation(arguments=[], member=getOrganization, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)], member=setParam, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="projectId"), MethodInvocation(arguments=[], member=getProjectId, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)], member=setParam, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="projectKey"), MethodInvocation(arguments=[], member=getProjectKey, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None)], member=setParam, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=JSON, postfix_operators=[], prefix_operators=[], qualifier=MediaTypes, selectors=[])], member=setMediaType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PostRequest, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[select] operator[SEP] identifier[SelectRequest] identifier[request] operator[SEP] { identifier[call] operator[SEP] Keyword[new] identifier[PostRequest] operator[SEP] identifier[path] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[setParam] operator[SEP] literal[String] , identifier[request] operator[SEP] identifier[getGateId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setParam] operator[SEP] literal[String] , identifier[request] operator[SEP] identifier[getOrganization] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setParam] operator[SEP] literal[String] , identifier[request] operator[SEP] identifier[getProjectId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setParam] operator[SEP] literal[String] , identifier[request] operator[SEP] identifier[getProjectKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setMediaType] operator[SEP] identifier[MediaTypes] operator[SEP] identifier[JSON] operator[SEP] operator[SEP] operator[SEP] identifier[content] operator[SEP] operator[SEP] operator[SEP] }
private void add( final List<String> arguments, final String argument ) { if( argument != null && argument.trim().length() > 0 ) { arguments.add( argument ); } }
class class_name[name] begin[{] method[add, return_type[void], modifier[private], parameter[arguments, argument]] begin[{] if[binary_operation[binary_operation[member[.argument], !=, literal[null]], &&, binary_operation[call[argument.trim, parameter[]], >, literal[0]]]] begin[{] call[arguments.add, parameter[member[.argument]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[add] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[arguments] , Keyword[final] identifier[String] identifier[argument] operator[SEP] { Keyword[if] operator[SEP] identifier[argument] operator[!=] Other[null] operator[&&] identifier[argument] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[arguments] operator[SEP] identifier[add] operator[SEP] identifier[argument] operator[SEP] operator[SEP] } }
@Override @Transactional(enabled = false) public CommerceAccount createCommerceAccount(long commerceAccountId) { return commerceAccountPersistence.create(commerceAccountId); }
class class_name[name] begin[{] method[createCommerceAccount, return_type[type[CommerceAccount]], modifier[public], parameter[commerceAccountId]] begin[{] return[call[commerceAccountPersistence.create, parameter[member[.commerceAccountId]]]] end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[Transactional] operator[SEP] identifier[enabled] operator[=] literal[boolean] operator[SEP] Keyword[public] identifier[CommerceAccount] identifier[createCommerceAccount] operator[SEP] Keyword[long] identifier[commerceAccountId] operator[SEP] { Keyword[return] identifier[commerceAccountPersistence] operator[SEP] identifier[create] operator[SEP] identifier[commerceAccountId] operator[SEP] operator[SEP] }
@Override @SuppressWarnings("unchecked") public T create() { try { return (T) Thread.currentThread().getContextClassLoader().loadClass(className).newInstance(); } catch (Exception e) { throw new RuntimeException(e); } }
class class_name[name] begin[{] method[create, return_type[type[T]], modifier[public], parameter[]] begin[{] TryStatement(block=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=getContextClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[T] identifier[create] operator[SEP] operator[SEP] { Keyword[try] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[loadClass] operator[SEP] identifier[className] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static void setVisibleDuration(Duration duration) { BEHAVIOR.setVisibleDuration(duration == null ? Duration.millis(1500) : duration); }
class class_name[name] begin[{] method[setVisibleDuration, return_type[void], modifier[public static], parameter[duration]] begin[{] call[BEHAVIOR.setVisibleDuration, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=duration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=duration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1500)], member=millis, postfix_operators=[], prefix_operators=[], qualifier=Duration, selectors=[], type_arguments=None))]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setVisibleDuration] operator[SEP] identifier[Duration] identifier[duration] operator[SEP] { identifier[BEHAVIOR] operator[SEP] identifier[setVisibleDuration] operator[SEP] identifier[duration] operator[==] Other[null] operator[?] identifier[Duration] operator[SEP] identifier[millis] operator[SEP] Other[1500] operator[SEP] operator[:] identifier[duration] operator[SEP] operator[SEP] }
public AT_Context setFrameLeftRightMargin(int frameLeft, int frameRight){ if(frameRight>-1 && frameLeft>-1){ this.frameLeftMargin = frameLeft; this.frameRightMargin = frameRight; } return this; }
class class_name[name] begin[{] method[setFrameLeftRightMargin, return_type[type[AT_Context]], modifier[public], parameter[frameLeft, frameRight]] begin[{] if[binary_operation[binary_operation[member[.frameRight], >, literal[1]], &&, binary_operation[member[.frameLeft], >, literal[1]]]] begin[{] assign[THIS[member[None.frameLeftMargin]], member[.frameLeft]] assign[THIS[member[None.frameRightMargin]], member[.frameRight]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[AT_Context] identifier[setFrameLeftRightMargin] operator[SEP] Keyword[int] identifier[frameLeft] , Keyword[int] identifier[frameRight] operator[SEP] { Keyword[if] operator[SEP] identifier[frameRight] operator[>] operator[-] Other[1] operator[&&] identifier[frameLeft] operator[>] operator[-] Other[1] operator[SEP] { Keyword[this] operator[SEP] identifier[frameLeftMargin] operator[=] identifier[frameLeft] operator[SEP] Keyword[this] operator[SEP] identifier[frameRightMargin] operator[=] identifier[frameRight] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override public String getText() { int car = FIRST_NAMES.length - 1; return FIRST_NAMES[RAND.nextInt(car) + 1]; }
class class_name[name] begin[{] method[getText, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[int], car] return[member[.FIRST_NAMES]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getText] operator[SEP] operator[SEP] { Keyword[int] identifier[car] operator[=] identifier[FIRST_NAMES] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] Keyword[return] identifier[FIRST_NAMES] operator[SEP] identifier[RAND] operator[SEP] identifier[nextInt] operator[SEP] identifier[car] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] }
public static int getLoadVoltTablesMagicSeriazlizedSize(Table catTable, boolean isPartitioned) { // code below is used to compute the right value slowly /* StoredProcedureInvocation spi = new StoredProcedureInvocation(); spi.setProcName("@LoadVoltTableSP"); if (isPartitioned) { spi.setParams(0, catTable.getTypeName(), null); } else { spi.setParams(0, catTable.getTypeName(), null); } int size = spi.getSerializedSizeForOriginalVersion() + 4; int realSize = size - catTable.getTypeName().getBytes(Constants.UTF8ENCODING).length; System.err.printf("@LoadVoltTable** padding size: %d or %d\n", size, realSize); return size; */ // Magic size of @LoadVoltTable* StoredProcedureInvocation int tableNameLengthInBytes = catTable.getTypeName().getBytes(Constants.UTF8ENCODING).length; int metadataSize = 41 + // serialized size for original version tableNameLengthInBytes; if (isPartitioned) { metadataSize += 5; } return metadataSize; }
class class_name[name] begin[{] method[getLoadVoltTablesMagicSeriazlizedSize, return_type[type[int]], modifier[public static], parameter[catTable, isPartitioned]] begin[{] local_variable[type[int], tableNameLengthInBytes] local_variable[type[int], metadataSize] if[member[.isPartitioned]] begin[{] assign[member[.metadataSize], literal[5]] else begin[{] None end[}] return[member[.metadataSize]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[getLoadVoltTablesMagicSeriazlizedSize] operator[SEP] identifier[Table] identifier[catTable] , Keyword[boolean] identifier[isPartitioned] operator[SEP] { Keyword[int] identifier[tableNameLengthInBytes] operator[=] identifier[catTable] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] identifier[Constants] operator[SEP] identifier[UTF8ENCODING] operator[SEP] operator[SEP] identifier[length] operator[SEP] Keyword[int] identifier[metadataSize] operator[=] Other[41] operator[+] identifier[tableNameLengthInBytes] operator[SEP] Keyword[if] operator[SEP] identifier[isPartitioned] operator[SEP] { identifier[metadataSize] operator[+=] Other[5] operator[SEP] } Keyword[return] identifier[metadataSize] operator[SEP] }
@Override public CompletableFuture<Acknowledge> deregisterApplication( final ApplicationStatus finalStatus, @Nullable final String diagnostics) { log.info("Shut down cluster because application is in {}, diagnostics {}.", finalStatus, diagnostics); try { internalDeregisterApplication(finalStatus, diagnostics); } catch (ResourceManagerException e) { log.warn("Could not properly shutdown the application.", e); } return CompletableFuture.completedFuture(Acknowledge.get()); }
class class_name[name] begin[{] method[deregisterApplication, return_type[type[CompletableFuture]], modifier[public], parameter[finalStatus, diagnostics]] begin[{] call[log.info, parameter[literal["Shut down cluster because application is in {}, diagnostics {}."], member[.finalStatus], member[.diagnostics]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=finalStatus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=diagnostics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=internalDeregisterApplication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not properly shutdown the application."), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ResourceManagerException']))], finally_block=None, label=None, resources=None) return[call[CompletableFuture.completedFuture, parameter[call[Acknowledge.get, parameter[]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CompletableFuture] operator[<] identifier[Acknowledge] operator[>] identifier[deregisterApplication] operator[SEP] Keyword[final] identifier[ApplicationStatus] identifier[finalStatus] , annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[diagnostics] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[finalStatus] , identifier[diagnostics] operator[SEP] operator[SEP] Keyword[try] { identifier[internalDeregisterApplication] operator[SEP] identifier[finalStatus] , identifier[diagnostics] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ResourceManagerException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[CompletableFuture] operator[SEP] identifier[completedFuture] operator[SEP] identifier[Acknowledge] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static WxaEntrustwebData generatePapayWxaEntrustweb(PapayEntrustweb papayEntrustweb, String key) { Map<String, String> map = MapUtil.objectToMap(papayEntrustweb); String sign = SignatureUtil.generateSign(map, "HMAC-SHA256", key); papayEntrustweb.setSign(sign); WxaEntrustwebData wxaEntrustwebData = new WxaEntrustwebData(); wxaEntrustwebData.setAppId(papayEntrustweb.getAppid()); wxaEntrustwebData.setExtraData(papayEntrustweb); wxaEntrustwebData.setPath("pages/index/index"); return wxaEntrustwebData; }
class class_name[name] begin[{] method[generatePapayWxaEntrustweb, return_type[type[WxaEntrustwebData]], modifier[public static], parameter[papayEntrustweb, key]] begin[{] local_variable[type[Map], map] local_variable[type[String], sign] call[papayEntrustweb.setSign, parameter[member[.sign]]] local_variable[type[WxaEntrustwebData], wxaEntrustwebData] call[wxaEntrustwebData.setAppId, parameter[call[papayEntrustweb.getAppid, parameter[]]]] call[wxaEntrustwebData.setExtraData, parameter[member[.papayEntrustweb]]] call[wxaEntrustwebData.setPath, parameter[literal["pages/index/index"]]] return[member[.wxaEntrustwebData]] end[}] END[}]
Keyword[public] Keyword[static] identifier[WxaEntrustwebData] identifier[generatePapayWxaEntrustweb] operator[SEP] identifier[PapayEntrustweb] identifier[papayEntrustweb] , identifier[String] identifier[key] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[=] identifier[MapUtil] operator[SEP] identifier[objectToMap] operator[SEP] identifier[papayEntrustweb] operator[SEP] operator[SEP] identifier[String] identifier[sign] operator[=] identifier[SignatureUtil] operator[SEP] identifier[generateSign] operator[SEP] identifier[map] , literal[String] , identifier[key] operator[SEP] operator[SEP] identifier[papayEntrustweb] operator[SEP] identifier[setSign] operator[SEP] identifier[sign] operator[SEP] operator[SEP] identifier[WxaEntrustwebData] identifier[wxaEntrustwebData] operator[=] Keyword[new] identifier[WxaEntrustwebData] operator[SEP] operator[SEP] operator[SEP] identifier[wxaEntrustwebData] operator[SEP] identifier[setAppId] operator[SEP] identifier[papayEntrustweb] operator[SEP] identifier[getAppid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[wxaEntrustwebData] operator[SEP] identifier[setExtraData] operator[SEP] identifier[papayEntrustweb] operator[SEP] operator[SEP] identifier[wxaEntrustwebData] operator[SEP] identifier[setPath] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[wxaEntrustwebData] operator[SEP] }
@Deprecated public static JpaModule newServerModule(EntityManagerFactory emFactory, EntityManager em, TransactionRunner transactionRunner) { JpaModuleConfig config = new JpaModuleConfig(); config.exposeAllEntities(emFactory); return new JpaModule(config, emFactory, () -> em, transactionRunner); }
class class_name[name] begin[{] method[newServerModule, return_type[type[JpaModule]], modifier[public static], parameter[emFactory, em, transactionRunner]] begin[{] local_variable[type[JpaModuleConfig], config] call[config.exposeAllEntities, parameter[member[.emFactory]]] return[ClassCreator(arguments=[MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=emFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), LambdaExpression(body=MemberReference(member=em, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), parameters=[]), MemberReference(member=transactionRunner, 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=JpaModule, sub_type=None))] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[JpaModule] identifier[newServerModule] operator[SEP] identifier[EntityManagerFactory] identifier[emFactory] , identifier[EntityManager] identifier[em] , identifier[TransactionRunner] identifier[transactionRunner] operator[SEP] { identifier[JpaModuleConfig] identifier[config] operator[=] Keyword[new] identifier[JpaModuleConfig] operator[SEP] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[exposeAllEntities] operator[SEP] identifier[emFactory] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[JpaModule] operator[SEP] identifier[config] , identifier[emFactory] , operator[SEP] operator[SEP] operator[->] identifier[em] , identifier[transactionRunner] operator[SEP] operator[SEP] }
public LocalDateTime toLocalDateTime(String s) throws SQLException { if (s == null) { return null; } int slen = s.length(); // convert postgres's infinity values to internal infinity magic value if (slen == 8 && s.equals("infinity")) { return LocalDateTime.MAX; } if (slen == 9 && s.equals("-infinity")) { return LocalDateTime.MIN; } ParsedTimestamp ts = parseBackendTimestamp(s); // intentionally ignore time zone // 2004-10-19 10:23:54+03:00 is 2004-10-19 10:23:54 locally LocalDateTime result = LocalDateTime.of(ts.year, ts.month, ts.day, ts.hour, ts.minute, ts.second, ts.nanos); if (ts.era == GregorianCalendar.BC) { return result.with(ChronoField.ERA, IsoEra.BCE.getValue()); } else { return result; } }
class class_name[name] begin[{] method[toLocalDateTime, return_type[type[LocalDateTime]], modifier[public], parameter[s]] begin[{] if[binary_operation[member[.s], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], slen] if[binary_operation[binary_operation[member[.slen], ==, literal[8]], &&, call[s.equals, parameter[literal["infinity"]]]]] begin[{] return[member[LocalDateTime.MAX]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.slen], ==, literal[9]], &&, call[s.equals, parameter[literal["-infinity"]]]]] begin[{] return[member[LocalDateTime.MIN]] else begin[{] None end[}] local_variable[type[ParsedTimestamp], ts] local_variable[type[LocalDateTime], result] if[binary_operation[member[ts.era], ==, member[GregorianCalendar.BC]]] begin[{] return[call[result.with, parameter[member[ChronoField.ERA], call[IsoEra.BCE.getValue, parameter[]]]]] else begin[{] return[member[.result]] end[}] end[}] END[}]
Keyword[public] identifier[LocalDateTime] identifier[toLocalDateTime] operator[SEP] identifier[String] identifier[s] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[slen] operator[=] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[slen] operator[==] Other[8] operator[&&] identifier[s] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[LocalDateTime] operator[SEP] identifier[MAX] operator[SEP] } Keyword[if] operator[SEP] identifier[slen] operator[==] Other[9] operator[&&] identifier[s] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[LocalDateTime] operator[SEP] identifier[MIN] operator[SEP] } identifier[ParsedTimestamp] identifier[ts] operator[=] identifier[parseBackendTimestamp] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[LocalDateTime] identifier[result] operator[=] identifier[LocalDateTime] operator[SEP] identifier[of] operator[SEP] identifier[ts] operator[SEP] identifier[year] , identifier[ts] operator[SEP] identifier[month] , identifier[ts] operator[SEP] identifier[day] , identifier[ts] operator[SEP] identifier[hour] , identifier[ts] operator[SEP] identifier[minute] , identifier[ts] operator[SEP] identifier[second] , identifier[ts] operator[SEP] identifier[nanos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ts] operator[SEP] identifier[era] operator[==] identifier[GregorianCalendar] operator[SEP] identifier[BC] operator[SEP] { Keyword[return] identifier[result] operator[SEP] identifier[with] operator[SEP] identifier[ChronoField] operator[SEP] identifier[ERA] , identifier[IsoEra] operator[SEP] identifier[BCE] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[result] operator[SEP] } }
private void populateSettings() { settings = new Settings(); if (dataDirectory != null) { settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDirectory); } else { final File jarPath = new File(DependencyCheckScanAgent.class.getProtectionDomain().getCodeSource().getLocation().getPath()); final File base = jarPath.getParentFile(); final String sub = settings.getString(Settings.KEYS.DATA_DIRECTORY); final File dataDir = new File(base, sub); settings.setString(Settings.KEYS.DATA_DIRECTORY, dataDir.getAbsolutePath()); } if (propertiesFilePath != null) { try { settings.mergeProperties(propertiesFilePath); LOGGER.info("Successfully loaded user-defined properties"); } catch (IOException e) { LOGGER.error("Unable to merge user-defined properties", e); LOGGER.error("Continuing execution"); } } settings.setBoolean(Settings.KEYS.AUTO_UPDATE, autoUpdate); settings.setStringIfNotEmpty(Settings.KEYS.PROXY_SERVER, proxyServer); settings.setStringIfNotEmpty(Settings.KEYS.PROXY_PORT, proxyPort); settings.setStringIfNotEmpty(Settings.KEYS.PROXY_USERNAME, proxyUsername); settings.setStringIfNotEmpty(Settings.KEYS.PROXY_PASSWORD, proxyPassword); settings.setStringIfNotEmpty(Settings.KEYS.CONNECTION_TIMEOUT, connectionTimeout); settings.setStringIfNotEmpty(Settings.KEYS.SUPPRESSION_FILE, suppressionFile); settings.setStringIfNotEmpty(Settings.KEYS.CVE_CPE_STARTS_WITH_FILTER, cpeStartsWithFilter); settings.setBoolean(Settings.KEYS.ANALYZER_CENTRAL_ENABLED, centralAnalyzerEnabled); settings.setStringIfNotEmpty(Settings.KEYS.ANALYZER_CENTRAL_URL, centralUrl); settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_ENABLED, nexusAnalyzerEnabled); settings.setStringIfNotEmpty(Settings.KEYS.ANALYZER_NEXUS_URL, nexusUrl); settings.setBoolean(Settings.KEYS.ANALYZER_NEXUS_USES_PROXY, nexusUsesProxy); settings.setStringIfNotEmpty(Settings.KEYS.DB_DRIVER_NAME, databaseDriverName); settings.setStringIfNotEmpty(Settings.KEYS.DB_DRIVER_PATH, databaseDriverPath); settings.setStringIfNotEmpty(Settings.KEYS.DB_CONNECTION_STRING, connectionString); settings.setStringIfNotEmpty(Settings.KEYS.DB_USER, databaseUser); settings.setStringIfNotEmpty(Settings.KEYS.DB_PASSWORD, databasePassword); settings.setStringIfNotEmpty(Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS, zipExtensions); settings.setStringIfNotEmpty(Settings.KEYS.CVE_MODIFIED_JSON, cveUrlModified); settings.setStringIfNotEmpty(Settings.KEYS.CVE_BASE_JSON, cveUrlBase); settings.setStringIfNotEmpty(Settings.KEYS.ANALYZER_ASSEMBLY_DOTNET_PATH, pathToCore); }
class class_name[name] begin[{] method[populateSettings, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.settings], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Settings, sub_type=None))] if[binary_operation[member[.dataDirectory], !=, literal[null]]] begin[{] call[settings.setString, parameter[member[Settings.KEYS.DATA_DIRECTORY], member[.dataDirectory]]] else begin[{] local_variable[type[File], jarPath] local_variable[type[File], base] local_variable[type[String], sub] local_variable[type[File], dataDir] call[settings.setString, parameter[member[Settings.KEYS.DATA_DIRECTORY], call[dataDir.getAbsolutePath, parameter[]]]] end[}] if[binary_operation[member[.propertiesFilePath], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=propertiesFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mergeProperties, postfix_operators=[], prefix_operators=[], qualifier=settings, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Successfully loaded user-defined properties")], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to merge user-defined properties"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Continuing execution")], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] call[settings.setBoolean, parameter[member[Settings.KEYS.AUTO_UPDATE], member[.autoUpdate]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.PROXY_SERVER], member[.proxyServer]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.PROXY_PORT], member[.proxyPort]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.PROXY_USERNAME], member[.proxyUsername]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.PROXY_PASSWORD], member[.proxyPassword]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.CONNECTION_TIMEOUT], member[.connectionTimeout]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.SUPPRESSION_FILE], member[.suppressionFile]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.CVE_CPE_STARTS_WITH_FILTER], member[.cpeStartsWithFilter]]] call[settings.setBoolean, parameter[member[Settings.KEYS.ANALYZER_CENTRAL_ENABLED], member[.centralAnalyzerEnabled]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.ANALYZER_CENTRAL_URL], member[.centralUrl]]] call[settings.setBoolean, parameter[member[Settings.KEYS.ANALYZER_NEXUS_ENABLED], member[.nexusAnalyzerEnabled]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.ANALYZER_NEXUS_URL], member[.nexusUrl]]] call[settings.setBoolean, parameter[member[Settings.KEYS.ANALYZER_NEXUS_USES_PROXY], member[.nexusUsesProxy]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.DB_DRIVER_NAME], member[.databaseDriverName]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.DB_DRIVER_PATH], member[.databaseDriverPath]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.DB_CONNECTION_STRING], member[.connectionString]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.DB_USER], member[.databaseUser]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.DB_PASSWORD], member[.databasePassword]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.ADDITIONAL_ZIP_EXTENSIONS], member[.zipExtensions]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.CVE_MODIFIED_JSON], member[.cveUrlModified]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.CVE_BASE_JSON], member[.cveUrlBase]]] call[settings.setStringIfNotEmpty, parameter[member[Settings.KEYS.ANALYZER_ASSEMBLY_DOTNET_PATH], member[.pathToCore]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[populateSettings] operator[SEP] operator[SEP] { identifier[settings] operator[=] Keyword[new] identifier[Settings] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dataDirectory] operator[!=] Other[null] operator[SEP] { identifier[settings] operator[SEP] identifier[setString] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[DATA_DIRECTORY] , identifier[dataDirectory] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] identifier[File] identifier[jarPath] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[DependencyCheckScanAgent] operator[SEP] Keyword[class] operator[SEP] identifier[getProtectionDomain] operator[SEP] operator[SEP] operator[SEP] identifier[getCodeSource] operator[SEP] operator[SEP] operator[SEP] identifier[getLocation] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[base] operator[=] identifier[jarPath] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[sub] operator[=] identifier[settings] operator[SEP] identifier[getString] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[DATA_DIRECTORY] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[dataDir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[base] , identifier[sub] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setString] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[DATA_DIRECTORY] , identifier[dataDir] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[propertiesFilePath] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[settings] operator[SEP] identifier[mergeProperties] operator[SEP] identifier[propertiesFilePath] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] } } identifier[settings] operator[SEP] identifier[setBoolean] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[AUTO_UPDATE] , identifier[autoUpdate] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[PROXY_SERVER] , identifier[proxyServer] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[PROXY_PORT] , identifier[proxyPort] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[PROXY_USERNAME] , identifier[proxyUsername] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[PROXY_PASSWORD] , identifier[proxyPassword] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[CONNECTION_TIMEOUT] , identifier[connectionTimeout] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[SUPPRESSION_FILE] , identifier[suppressionFile] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[CVE_CPE_STARTS_WITH_FILTER] , identifier[cpeStartsWithFilter] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setBoolean] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[ANALYZER_CENTRAL_ENABLED] , identifier[centralAnalyzerEnabled] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[ANALYZER_CENTRAL_URL] , identifier[centralUrl] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setBoolean] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[ANALYZER_NEXUS_ENABLED] , identifier[nexusAnalyzerEnabled] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[ANALYZER_NEXUS_URL] , identifier[nexusUrl] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setBoolean] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[ANALYZER_NEXUS_USES_PROXY] , identifier[nexusUsesProxy] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[DB_DRIVER_NAME] , identifier[databaseDriverName] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[DB_DRIVER_PATH] , identifier[databaseDriverPath] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[DB_CONNECTION_STRING] , identifier[connectionString] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[DB_USER] , identifier[databaseUser] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[DB_PASSWORD] , identifier[databasePassword] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[ADDITIONAL_ZIP_EXTENSIONS] , identifier[zipExtensions] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[CVE_MODIFIED_JSON] , identifier[cveUrlModified] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[CVE_BASE_JSON] , identifier[cveUrlBase] operator[SEP] operator[SEP] identifier[settings] operator[SEP] identifier[setStringIfNotEmpty] operator[SEP] identifier[Settings] operator[SEP] identifier[KEYS] operator[SEP] identifier[ANALYZER_ASSEMBLY_DOTNET_PATH] , identifier[pathToCore] operator[SEP] operator[SEP] }
@Override public List<com.enioka.jqm.api.Deliverable> getJobDeliverables(int idJob) { try { return target.path("ji/" + idJob + "/files").request().get(new GenericType<List<Deliverable>>() { }); } catch (BadRequestException e) { throw new JqmInvalidRequestException(e.getResponse().readEntity(String.class), e); } catch (Exception e) { throw new JqmClientException(e); } }
class class_name[name] begin[{] method[getJobDeliverables, return_type[type[List]], modifier[public], parameter[idJob]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ji/"), operandr=MemberReference(member=idJob, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/files"), operator=+)], member=path, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[MethodInvocation(arguments=[], member=request, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[ClassCreator(arguments=[], body=[], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Deliverable, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=GenericType, sub_type=None))], member=get, 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=[MethodInvocation(arguments=[], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=readEntity, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JqmInvalidRequestException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BadRequestException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JqmClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[com] operator[SEP] identifier[enioka] operator[SEP] identifier[jqm] operator[SEP] identifier[api] operator[SEP] identifier[Deliverable] operator[>] identifier[getJobDeliverables] operator[SEP] Keyword[int] identifier[idJob] operator[SEP] { Keyword[try] { Keyword[return] identifier[target] operator[SEP] identifier[path] operator[SEP] literal[String] operator[+] identifier[idJob] operator[+] literal[String] operator[SEP] operator[SEP] identifier[request] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Keyword[new] identifier[GenericType] operator[<] identifier[List] operator[<] identifier[Deliverable] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[BadRequestException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[JqmInvalidRequestException] operator[SEP] identifier[e] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] operator[SEP] identifier[readEntity] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[JqmClientException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static String format (Object message, Object... args) { return new LogBuilder(message, args).toString(); }
class class_name[name] begin[{] method[format, return_type[type[String]], modifier[public static], parameter[message, args]] begin[{] return[ClassCreator(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=LogBuilder, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[format] operator[SEP] identifier[Object] identifier[message] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[return] Keyword[new] identifier[LogBuilder] operator[SEP] identifier[message] , identifier[args] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public synchronized static JMX reconnect() { try { ClientCache cache = null; cache = ClientCacheFactory.getAnyInstance(); if(cache != null && !cache.isClosed()) { cache.close(); } } catch (Exception e) { System.out.println("Cache was closed"); } if(jmx != null) { jmx.dispose(); jmx = null; } return getJmx(); }
class class_name[name] begin[{] method[reconnect, return_type[type[JMX]], modifier[synchronized public static], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=cache)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClientCache, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getAnyInstance, postfix_operators=[], prefix_operators=[], qualifier=ClientCacheFactory, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isClosed, postfix_operators=[], prefix_operators=['!'], qualifier=cache, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cache was closed")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, 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) if[binary_operation[member[.jmx], !=, literal[null]]] begin[{] call[jmx.dispose, parameter[]] assign[member[.jmx], literal[null]] else begin[{] None end[}] return[call[.getJmx, parameter[]]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[static] identifier[JMX] identifier[reconnect] operator[SEP] operator[SEP] { Keyword[try] { identifier[ClientCache] identifier[cache] operator[=] Other[null] operator[SEP] identifier[cache] operator[=] identifier[ClientCacheFactory] operator[SEP] identifier[getAnyInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cache] operator[!=] Other[null] operator[&&] operator[!] identifier[cache] operator[SEP] identifier[isClosed] operator[SEP] operator[SEP] operator[SEP] { identifier[cache] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[jmx] operator[!=] Other[null] operator[SEP] { identifier[jmx] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP] identifier[jmx] operator[=] Other[null] operator[SEP] } Keyword[return] identifier[getJmx] operator[SEP] operator[SEP] operator[SEP] }
public void setCommerceNotificationQueueEntryLocalService( com.liferay.commerce.notification.service.CommerceNotificationQueueEntryLocalService commerceNotificationQueueEntryLocalService) { this.commerceNotificationQueueEntryLocalService = commerceNotificationQueueEntryLocalService; }
class class_name[name] begin[{] method[setCommerceNotificationQueueEntryLocalService, return_type[void], modifier[public], parameter[commerceNotificationQueueEntryLocalService]] begin[{] assign[THIS[member[None.commerceNotificationQueueEntryLocalService]], member[.commerceNotificationQueueEntryLocalService]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setCommerceNotificationQueueEntryLocalService] operator[SEP] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[notification] operator[SEP] identifier[service] operator[SEP] identifier[CommerceNotificationQueueEntryLocalService] identifier[commerceNotificationQueueEntryLocalService] operator[SEP] { Keyword[this] operator[SEP] identifier[commerceNotificationQueueEntryLocalService] operator[=] identifier[commerceNotificationQueueEntryLocalService] operator[SEP] }
public static void saveUserPreferences(IProject project, final UserPreferences userPrefs) throws CoreException { FileOutput userPrefsOutput = new FileOutput() { @Override public void writeFile(OutputStream os) throws IOException { userPrefs.write(os); } @Override public String getTaskDescription() { return "writing user preferences"; } }; if (project != null) { // Make the new user preferences current for the project project.setSessionProperty(SESSION_PROPERTY_USERPREFS, userPrefs); IFile userPrefsFile = getUserPreferencesFile(project); ensureReadWrite(userPrefsFile); IO.writeFile(userPrefsFile, userPrefsOutput, null); if (project.getFile(DEPRECATED_PREFS_PATH).equals(userPrefsFile)) { String message = "Found old style FindBugs preferences for project '" + project.getName() + "'. This preferences are not at the default location: '" + DEFAULT_PREFS_PATH + "'." + " Please move '" + DEPRECATED_PREFS_PATH + "' to '" + DEFAULT_PREFS_PATH + "'."; getDefault().logWarning(message); } } else { // write the workspace preferences to the eclipse preference store ByteArrayOutputStream bos = new ByteArrayOutputStream(10000); try { userPrefs.write(bos); } catch (IOException e) { getDefault().logException(e, "Failed to write user preferences"); return; } Properties props = new Properties(); try { props.load(new ByteArrayInputStream(bos.toByteArray())); } catch (IOException e) { getDefault().logException(e, "Failed to save user preferences"); return; } IPreferenceStore store = getDefault().getPreferenceStore(); // Reset any existing custom group entries resetStore(store, UserPreferences.KEY_PLUGIN); resetStore(store, UserPreferences.KEY_EXCLUDE_BUGS); resetStore(store, UserPreferences.KEY_EXCLUDE_FILTER); resetStore(store, UserPreferences.KEY_INCLUDE_FILTER); for (Entry<Object, Object> entry : props.entrySet()) { store.putValue((String) entry.getKey(), (String) entry.getValue()); } if(store instanceof IPersistentPreferenceStore){ IPersistentPreferenceStore store2 = (IPersistentPreferenceStore) store; try { store2.save(); } catch (IOException e) { getDefault().logException(e, "Failed to save user preferences"); } } } }
class class_name[name] begin[{] method[saveUserPreferences, return_type[void], modifier[public static], parameter[project, userPrefs]] begin[{] local_variable[type[FileOutput], userPrefsOutput] if[binary_operation[member[.project], !=, literal[null]]] begin[{] call[project.setSessionProperty, parameter[member[.SESSION_PROPERTY_USERPREFS], member[.userPrefs]]] local_variable[type[IFile], userPrefsFile] call[.ensureReadWrite, parameter[member[.userPrefsFile]]] call[IO.writeFile, parameter[member[.userPrefsFile], member[.userPrefsOutput], literal[null]]] if[call[project.getFile, parameter[member[.DEPRECATED_PREFS_PATH]]]] begin[{] local_variable[type[String], message] call[.getDefault, parameter[]] else begin[{] None end[}] else begin[{] local_variable[type[ByteArrayOutputStream], bos] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=userPrefs, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to write user preferences")], member=logException, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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[Properties], props] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=bos, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None))], member=load, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to save user preferences")], member=logException, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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[IPreferenceStore], store] call[.resetStore, parameter[member[.store], member[UserPreferences.KEY_PLUGIN]]] call[.resetStore, parameter[member[.store], member[UserPreferences.KEY_EXCLUDE_BUGS]]] call[.resetStore, parameter[member[.store], member[UserPreferences.KEY_EXCLUDE_FILTER]]] call[.resetStore, parameter[member[.store], member[UserPreferences.KEY_INCLUDE_FILTER]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), Cast(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=putValue, postfix_operators=[], prefix_operators=[], qualifier=store, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=props, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) if[binary_operation[member[.store], instanceof, type[IPersistentPreferenceStore]]] begin[{] local_variable[type[IPersistentPreferenceStore], store2] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=save, postfix_operators=[], prefix_operators=[], qualifier=store2, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to save user preferences")], member=logException, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[saveUserPreferences] operator[SEP] identifier[IProject] identifier[project] , Keyword[final] identifier[UserPreferences] identifier[userPrefs] operator[SEP] Keyword[throws] identifier[CoreException] { identifier[FileOutput] identifier[userPrefsOutput] operator[=] Keyword[new] identifier[FileOutput] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[writeFile] operator[SEP] identifier[OutputStream] identifier[os] operator[SEP] Keyword[throws] identifier[IOException] { identifier[userPrefs] operator[SEP] identifier[write] operator[SEP] identifier[os] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getTaskDescription] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } } operator[SEP] Keyword[if] operator[SEP] identifier[project] operator[!=] Other[null] operator[SEP] { identifier[project] operator[SEP] identifier[setSessionProperty] operator[SEP] identifier[SESSION_PROPERTY_USERPREFS] , identifier[userPrefs] operator[SEP] operator[SEP] identifier[IFile] identifier[userPrefsFile] operator[=] identifier[getUserPreferencesFile] operator[SEP] identifier[project] operator[SEP] operator[SEP] identifier[ensureReadWrite] operator[SEP] identifier[userPrefsFile] operator[SEP] operator[SEP] identifier[IO] operator[SEP] identifier[writeFile] operator[SEP] identifier[userPrefsFile] , identifier[userPrefsOutput] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[project] operator[SEP] identifier[getFile] operator[SEP] identifier[DEPRECATED_PREFS_PATH] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[userPrefsFile] operator[SEP] operator[SEP] { identifier[String] identifier[message] operator[=] literal[String] operator[+] identifier[project] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[DEFAULT_PREFS_PATH] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[DEPRECATED_PREFS_PATH] operator[+] literal[String] operator[+] identifier[DEFAULT_PREFS_PATH] operator[+] literal[String] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[logWarning] operator[SEP] identifier[message] operator[SEP] operator[SEP] } } Keyword[else] { identifier[ByteArrayOutputStream] identifier[bos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] Other[10000] operator[SEP] operator[SEP] Keyword[try] { identifier[userPrefs] operator[SEP] identifier[write] operator[SEP] identifier[bos] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[logException] operator[SEP] identifier[e] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[Properties] identifier[props] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[props] operator[SEP] identifier[load] operator[SEP] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[bos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[logException] operator[SEP] identifier[e] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[IPreferenceStore] identifier[store] operator[=] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[getPreferenceStore] operator[SEP] operator[SEP] operator[SEP] identifier[resetStore] operator[SEP] identifier[store] , identifier[UserPreferences] operator[SEP] identifier[KEY_PLUGIN] operator[SEP] operator[SEP] identifier[resetStore] operator[SEP] identifier[store] , identifier[UserPreferences] operator[SEP] identifier[KEY_EXCLUDE_BUGS] operator[SEP] operator[SEP] identifier[resetStore] operator[SEP] identifier[store] , identifier[UserPreferences] operator[SEP] identifier[KEY_EXCLUDE_FILTER] operator[SEP] operator[SEP] identifier[resetStore] operator[SEP] identifier[store] , identifier[UserPreferences] operator[SEP] identifier[KEY_INCLUDE_FILTER] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[entry] operator[:] identifier[props] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[store] operator[SEP] identifier[putValue] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , operator[SEP] identifier[String] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[store] Keyword[instanceof] identifier[IPersistentPreferenceStore] operator[SEP] { identifier[IPersistentPreferenceStore] identifier[store2] operator[=] operator[SEP] identifier[IPersistentPreferenceStore] operator[SEP] identifier[store] operator[SEP] Keyword[try] { identifier[store2] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[logException] operator[SEP] identifier[e] , literal[String] operator[SEP] operator[SEP] } } } }
public static <C extends Comparable> Ordering<Range<C>> orderingByUpperEndpoint() { return new Ordering<Range<C>>() { @Override public int compare(final Range<C> left, final Range<C> right) { return ComparisonChain.start() .compare(left.hasUpperBound(), right.hasUpperBound()) .compare(left.upperEndpoint(), right.upperEndpoint()) .result(); } }; }
class class_name[name] begin[{] method[orderingByUpperEndpoint, return_type[type[Ordering]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=start, postfix_operators=[], prefix_operators=[], qualifier=ComparisonChain, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=hasUpperBound, postfix_operators=[], prefix_operators=[], qualifier=left, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=hasUpperBound, postfix_operators=[], prefix_operators=[], qualifier=right, selectors=[], type_arguments=None)], member=compare, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=upperEndpoint, postfix_operators=[], prefix_operators=[], qualifier=left, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=upperEndpoint, postfix_operators=[], prefix_operators=[], qualifier=right, selectors=[], type_arguments=None)], member=compare, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=result, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=compare, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=left, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None))], dimensions=[], name=Range, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=right, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None))], dimensions=[], name=Range, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=int), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None))], dimensions=[], name=Range, sub_type=None))], dimensions=None, name=Ordering, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[C] Keyword[extends] identifier[Comparable] operator[>] identifier[Ordering] operator[<] identifier[Range] operator[<] identifier[C] operator[>] operator[>] identifier[orderingByUpperEndpoint] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Ordering] operator[<] identifier[Range] operator[<] identifier[C] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compare] operator[SEP] Keyword[final] identifier[Range] operator[<] identifier[C] operator[>] identifier[left] , Keyword[final] identifier[Range] operator[<] identifier[C] operator[>] identifier[right] operator[SEP] { Keyword[return] identifier[ComparisonChain] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[compare] operator[SEP] identifier[left] operator[SEP] identifier[hasUpperBound] operator[SEP] operator[SEP] , identifier[right] operator[SEP] identifier[hasUpperBound] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[compare] operator[SEP] identifier[left] operator[SEP] identifier[upperEndpoint] operator[SEP] operator[SEP] , identifier[right] operator[SEP] identifier[upperEndpoint] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] }
static EntityManager createProxy(final HibernateEntityManagerFactory factory) { final EntityManagerInterceptor handler = new EntityManagerInterceptor(factory); final Enhancer e = new Enhancer(); // make sure we're Serializable and have a write replace method e.setInterfaces(new Class[] { EntityManager.class, Serializable.class, IWriteReplace.class }); e.setSuperclass(Object.class); e.setCallback(handler); e.setNamingPolicy(new DefaultNamingPolicy() { @Override public String getClassName(final String prefix, final String source, final Object key, final Predicate names) { return super.getClassName("CROQUET_ENTITY_MANAGER_PROXY_" + prefix, source, key, names); } }); LOG.trace("Created proxy for an EntityManager"); return (EntityManager)e.create(); }
class class_name[name] begin[{] method[createProxy, return_type[type[EntityManager]], modifier[static], parameter[factory]] begin[{] local_variable[type[EntityManagerInterceptor], handler] local_variable[type[Enhancer], e] call[e.setInterfaces, parameter[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EntityManager, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Serializable, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IWriteReplace, sub_type=None))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Class, sub_type=None))]] call[e.setSuperclass, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] call[e.setCallback, parameter[member[.handler]]] call[e.setNamingPolicy, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=SuperMethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CROQUET_ENTITY_MANAGER_PROXY_"), operandr=MemberReference(member=prefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getClassName, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=getClassName, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=prefix, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=source, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=key, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=names, type=ReferenceType(arguments=None, dimensions=[], name=Predicate, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultNamingPolicy, sub_type=None))]] call[LOG.trace, parameter[literal["Created proxy for an EntityManager"]]] return[Cast(expression=MethodInvocation(arguments=[], member=create, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EntityManager, sub_type=None))] end[}] END[}]
Keyword[static] identifier[EntityManager] identifier[createProxy] operator[SEP] Keyword[final] identifier[HibernateEntityManagerFactory] identifier[factory] operator[SEP] { Keyword[final] identifier[EntityManagerInterceptor] identifier[handler] operator[=] Keyword[new] identifier[EntityManagerInterceptor] operator[SEP] identifier[factory] operator[SEP] operator[SEP] Keyword[final] identifier[Enhancer] identifier[e] operator[=] Keyword[new] identifier[Enhancer] operator[SEP] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setInterfaces] operator[SEP] Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[EntityManager] operator[SEP] Keyword[class] , identifier[Serializable] operator[SEP] Keyword[class] , identifier[IWriteReplace] operator[SEP] Keyword[class] } operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setSuperclass] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setCallback] operator[SEP] identifier[handler] operator[SEP] operator[SEP] identifier[e] operator[SEP] identifier[setNamingPolicy] operator[SEP] Keyword[new] identifier[DefaultNamingPolicy] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getClassName] operator[SEP] Keyword[final] identifier[String] identifier[prefix] , Keyword[final] identifier[String] identifier[source] , Keyword[final] identifier[Object] identifier[key] , Keyword[final] identifier[Predicate] identifier[names] operator[SEP] { Keyword[return] Keyword[super] operator[SEP] identifier[getClassName] operator[SEP] literal[String] operator[+] identifier[prefix] , identifier[source] , identifier[key] , identifier[names] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[EntityManager] operator[SEP] identifier[e] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] }
@Nonnull public CSSSimpleValueWithUnit setValue (@Nonnull final BigDecimal aValue) { m_aValue = ValueEnforcer.notNull (aValue, "Value"); return this; }
class class_name[name] begin[{] method[setValue, return_type[type[CSSSimpleValueWithUnit]], modifier[public], parameter[aValue]] begin[{] assign[member[.m_aValue], call[ValueEnforcer.notNull, parameter[member[.aValue], literal["Value"]]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] identifier[CSSSimpleValueWithUnit] identifier[setValue] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[BigDecimal] identifier[aValue] operator[SEP] { identifier[m_aValue] operator[=] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aValue] , literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void beforeOverrideMethod(CtClass targetClass, String targetMethodName, String body) throws CannotCompileException, AfterBurnerImpossibleException, NotFoundException { InsertableMethod insertableMethod = new InsertableMethodBuilder(this, signatureExtractor).insertIntoClass(targetClass).beforeOverrideMethod(targetMethodName).withBody(body).createInsertableMethod(); addOrInsertMethod(insertableMethod); }
class class_name[name] begin[{] method[beforeOverrideMethod, return_type[void], modifier[public], parameter[targetClass, targetMethodName, body]] begin[{] local_variable[type[InsertableMethod], insertableMethod] call[.addOrInsertMethod, parameter[member[.insertableMethod]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[beforeOverrideMethod] operator[SEP] identifier[CtClass] identifier[targetClass] , identifier[String] identifier[targetMethodName] , identifier[String] identifier[body] operator[SEP] Keyword[throws] identifier[CannotCompileException] , identifier[AfterBurnerImpossibleException] , identifier[NotFoundException] { identifier[InsertableMethod] identifier[insertableMethod] operator[=] Keyword[new] identifier[InsertableMethodBuilder] operator[SEP] Keyword[this] , identifier[signatureExtractor] operator[SEP] operator[SEP] identifier[insertIntoClass] operator[SEP] identifier[targetClass] operator[SEP] operator[SEP] identifier[beforeOverrideMethod] operator[SEP] identifier[targetMethodName] operator[SEP] operator[SEP] identifier[withBody] operator[SEP] identifier[body] operator[SEP] operator[SEP] identifier[createInsertableMethod] operator[SEP] operator[SEP] operator[SEP] identifier[addOrInsertMethod] operator[SEP] identifier[insertableMethod] operator[SEP] operator[SEP] }
protected void awaitForPushToFinish(Future<?> future, long timeout, TimeUnit unit) { final boolean debugEnabled = log.isDebugEnabled(); try { if (debugEnabled) log.debug("wait for state push to cache loader to finish"); future.get(timeout, unit); } catch (TimeoutException e) { if (debugEnabled) log.debug("timed out waiting for state push to cache loader to finish"); } catch (ExecutionException e) { if (debugEnabled) log.debug("exception reported waiting for state push to cache loader to finish"); } catch (InterruptedException ie) { /* Re-assert the thread's interrupted status */ Thread.currentThread().interrupt(); if (trace) log.trace("wait for state push to cache loader to finish was interrupted"); } }
class class_name[name] begin[{] method[awaitForPushToFinish, return_type[void], modifier[protected], parameter[future, timeout, unit]] begin[{] local_variable[type[boolean], debugEnabled] TryStatement(block=[IfStatement(condition=MemberReference(member=debugEnabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="wait for state push to cache loader to finish")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=future, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MemberReference(member=debugEnabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="timed out waiting for state push to cache loader to finish")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TimeoutException'])), CatchClause(block=[IfStatement(condition=MemberReference(member=debugEnabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="exception reported waiting for state push to cache loader to finish")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ExecutionException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=trace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="wait for state push to cache loader to finish was interrupted")], member=trace, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ie, types=['InterruptedException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[awaitForPushToFinish] operator[SEP] identifier[Future] operator[<] operator[?] operator[>] identifier[future] , Keyword[long] identifier[timeout] , identifier[TimeUnit] identifier[unit] operator[SEP] { Keyword[final] Keyword[boolean] identifier[debugEnabled] operator[=] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[debugEnabled] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[future] operator[SEP] identifier[get] operator[SEP] identifier[timeout] , identifier[unit] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TimeoutException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[debugEnabled] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ExecutionException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[debugEnabled] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ie] operator[SEP] { identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trace] operator[SEP] identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public ConstraintMatch addConstraintMatch(List<Object> justificationList, Score score) { this.score = this.score.add(score); ConstraintMatch constraintMatch = new ConstraintMatch(constraintPackage, constraintName, justificationList, score); boolean added = constraintMatchSet.add(constraintMatch); if (!added) { throw new IllegalStateException("The constraintMatchTotal (" + this + ") could not add constraintMatch (" + constraintMatch + ") to its constraintMatchSet (" + constraintMatchSet + ")."); } return constraintMatch; }
class class_name[name] begin[{] method[addConstraintMatch, return_type[type[ConstraintMatch]], modifier[public], parameter[justificationList, score]] begin[{] assign[THIS[member[None.score]], THIS[member[None.score]call[None.add, parameter[member[.score]]]]] local_variable[type[ConstraintMatch], constraintMatch] local_variable[type[boolean], added] if[member[.added]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The constraintMatchTotal ("), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") could not add constraintMatch ("), operator=+), operandr=MemberReference(member=constraintMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") to its constraintMatchSet ("), operator=+), operandr=MemberReference(member=constraintMatchSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.constraintMatch]] end[}] END[}]
Keyword[public] identifier[ConstraintMatch] identifier[addConstraintMatch] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] identifier[justificationList] , identifier[Score] identifier[score] operator[SEP] { Keyword[this] operator[SEP] identifier[score] operator[=] Keyword[this] operator[SEP] identifier[score] operator[SEP] identifier[add] operator[SEP] identifier[score] operator[SEP] operator[SEP] identifier[ConstraintMatch] identifier[constraintMatch] operator[=] Keyword[new] identifier[ConstraintMatch] operator[SEP] identifier[constraintPackage] , identifier[constraintName] , identifier[justificationList] , identifier[score] operator[SEP] operator[SEP] Keyword[boolean] identifier[added] operator[=] identifier[constraintMatchSet] operator[SEP] identifier[add] operator[SEP] identifier[constraintMatch] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[added] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] Keyword[this] operator[+] literal[String] operator[+] identifier[constraintMatch] operator[+] literal[String] operator[+] identifier[constraintMatchSet] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[constraintMatch] operator[SEP] }
private static String breakExtractor(String formula) { boolean finalBreak = false; int innerMostBracket = formula.lastIndexOf("("); if (innerMostBracket<0) return formula; String finalformula = formula.substring(0, innerMostBracket); String multipliedformula = ""; String formulaEnd = ""; String multiple = ""; for (int f = innerMostBracket + 1; f < formula.length(); f++) { char thisChar = formula.charAt(f); if ( finalBreak ) { if ( isDigit(thisChar) ){ multiple += thisChar; } else { formulaEnd = formula.substring(f, formula.length()); break; } }else { if ( thisChar == ')' ) { finalBreak = true; }else multipliedformula += thisChar; } } finalformula += muliplier(multipliedformula, multiple.isEmpty() ? 1:Integer.valueOf(multiple)) + formulaEnd; if (finalformula.contains("(")) return breakExtractor(finalformula); else return finalformula; }
class class_name[name] begin[{] method[breakExtractor, return_type[type[String]], modifier[private static], parameter[formula]] begin[{] local_variable[type[boolean], finalBreak] local_variable[type[int], innerMostBracket] if[binary_operation[member[.innerMostBracket], <, literal[0]]] begin[{] return[member[.formula]] else begin[{] None end[}] local_variable[type[String], finalformula] local_variable[type[String], multipliedformula] local_variable[type[String], formulaEnd] local_variable[type[String], multiple] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=formula, selectors=[], type_arguments=None), name=thisChar)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=MemberReference(member=finalBreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=thisChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=')'), operator===), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=multipliedformula, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=thisChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=finalBreak, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=thisChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isDigit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=formulaEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=formula, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=formula, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=multiple, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=thisChar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=formula, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=innerMostBracket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=f)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=f, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.finalformula], binary_operation[call[.muliplier, parameter[member[.multipliedformula], TernaryExpression(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=multiple, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[MemberReference(member=multiple, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]], +, member[.formulaEnd]]] if[call[finalformula.contains, parameter[literal["("]]]] begin[{] return[call[.breakExtractor, parameter[member[.finalformula]]]] else begin[{] return[member[.finalformula]] end[}] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[breakExtractor] operator[SEP] identifier[String] identifier[formula] operator[SEP] { Keyword[boolean] identifier[finalBreak] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[innerMostBracket] operator[=] identifier[formula] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[innerMostBracket] operator[<] Other[0] operator[SEP] Keyword[return] identifier[formula] operator[SEP] identifier[String] identifier[finalformula] operator[=] identifier[formula] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[innerMostBracket] operator[SEP] operator[SEP] identifier[String] identifier[multipliedformula] operator[=] literal[String] operator[SEP] identifier[String] identifier[formulaEnd] operator[=] literal[String] operator[SEP] identifier[String] identifier[multiple] operator[=] literal[String] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[f] operator[=] identifier[innerMostBracket] operator[+] Other[1] operator[SEP] identifier[f] operator[<] identifier[formula] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[f] operator[++] operator[SEP] { Keyword[char] identifier[thisChar] operator[=] identifier[formula] operator[SEP] identifier[charAt] operator[SEP] identifier[f] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[finalBreak] operator[SEP] { Keyword[if] operator[SEP] identifier[isDigit] operator[SEP] identifier[thisChar] operator[SEP] operator[SEP] { identifier[multiple] operator[+=] identifier[thisChar] operator[SEP] } Keyword[else] { identifier[formulaEnd] operator[=] identifier[formula] operator[SEP] identifier[substring] operator[SEP] identifier[f] , identifier[formula] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[thisChar] operator[==] literal[String] operator[SEP] { identifier[finalBreak] operator[=] literal[boolean] operator[SEP] } Keyword[else] identifier[multipliedformula] operator[+=] identifier[thisChar] operator[SEP] } } identifier[finalformula] operator[+=] identifier[muliplier] operator[SEP] identifier[multipliedformula] , identifier[multiple] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[?] Other[1] operator[:] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[multiple] operator[SEP] operator[SEP] operator[+] identifier[formulaEnd] operator[SEP] Keyword[if] operator[SEP] identifier[finalformula] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[breakExtractor] operator[SEP] identifier[finalformula] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[finalformula] operator[SEP] }
public StreamInfo readStreamInfo() throws IOException { readStreamSync(); Metadata metadata = readNextMetadata(); if (!(metadata instanceof StreamInfo)) throw new IOException("StreamInfo metadata block missing"); return (StreamInfo) metadata; }
class class_name[name] begin[{] method[readStreamInfo, return_type[type[StreamInfo]], modifier[public], parameter[]] begin[{] call[.readStreamSync, parameter[]] local_variable[type[Metadata], metadata] if[binary_operation[member[.metadata], instanceof, type[StreamInfo]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="StreamInfo metadata block missing")], 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[}] return[Cast(expression=MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=StreamInfo, sub_type=None))] end[}] END[}]
Keyword[public] identifier[StreamInfo] identifier[readStreamInfo] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[readStreamSync] operator[SEP] operator[SEP] operator[SEP] identifier[Metadata] identifier[metadata] operator[=] identifier[readNextMetadata] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[metadata] Keyword[instanceof] identifier[StreamInfo] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[StreamInfo] operator[SEP] identifier[metadata] operator[SEP] }
protected Response buildAuthenticationResponse(final OpenIdService service, final Map<String, String> parameters, final boolean successFullAuthentication, final String id, final ParameterList parameterList) { val response = serverManager.authResponse(parameterList, id, id, successFullAuthentication, true); parameters.putAll(response.getParameterMap()); LOGGER.debug("Parameters passed for the OpenID response are [{}]", parameters.keySet()); return buildRedirect(service, parameters); }
class class_name[name] begin[{] method[buildAuthenticationResponse, return_type[type[Response]], modifier[protected], parameter[service, parameters, successFullAuthentication, id, parameterList]] begin[{] local_variable[type[val], response] call[parameters.putAll, parameter[call[response.getParameterMap, parameter[]]]] call[LOGGER.debug, parameter[literal["Parameters passed for the OpenID response are [{}]"], call[parameters.keySet, parameter[]]]] return[call[.buildRedirect, parameter[member[.service], member[.parameters]]]] end[}] END[}]
Keyword[protected] identifier[Response] identifier[buildAuthenticationResponse] operator[SEP] Keyword[final] identifier[OpenIdService] identifier[service] , Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parameters] , Keyword[final] Keyword[boolean] identifier[successFullAuthentication] , Keyword[final] identifier[String] identifier[id] , Keyword[final] identifier[ParameterList] identifier[parameterList] operator[SEP] { identifier[val] identifier[response] operator[=] identifier[serverManager] operator[SEP] identifier[authResponse] operator[SEP] identifier[parameterList] , identifier[id] , identifier[id] , identifier[successFullAuthentication] , literal[boolean] operator[SEP] operator[SEP] identifier[parameters] operator[SEP] identifier[putAll] operator[SEP] identifier[response] operator[SEP] identifier[getParameterMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[parameters] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[buildRedirect] operator[SEP] identifier[service] , identifier[parameters] operator[SEP] operator[SEP] }
@Override public boolean logout() throws LoginException { if (mSubject.isReadOnly()) { throw new LoginException("logout Failed: Subject is Readonly."); } if (mUser != null) { mSubject.getPrincipals().remove(mUser); } return true; }
class class_name[name] begin[{] method[logout, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[call[mSubject.isReadOnly, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="logout Failed: Subject is Readonly.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LoginException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.mUser], !=, literal[null]]] begin[{] call[mSubject.getPrincipals, parameter[]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[logout] operator[SEP] operator[SEP] Keyword[throws] identifier[LoginException] { Keyword[if] operator[SEP] identifier[mSubject] operator[SEP] identifier[isReadOnly] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[LoginException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[mUser] operator[!=] Other[null] operator[SEP] { identifier[mSubject] operator[SEP] identifier[getPrincipals] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[mUser] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static base_response export(nitro_service client, sslfipskey resource) throws Exception { sslfipskey exportresource = new sslfipskey(); exportresource.fipskeyname = resource.fipskeyname; exportresource.key = resource.key; return exportresource.perform_operation(client,"export"); }
class class_name[name] begin[{] method[export, return_type[type[base_response]], modifier[public static], parameter[client, resource]] begin[{] local_variable[type[sslfipskey], exportresource] assign[member[exportresource.fipskeyname], member[resource.fipskeyname]] assign[member[exportresource.key], member[resource.key]] return[call[exportresource.perform_operation, parameter[member[.client], literal["export"]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[base_response] identifier[export] operator[SEP] identifier[nitro_service] identifier[client] , identifier[sslfipskey] identifier[resource] operator[SEP] Keyword[throws] identifier[Exception] { identifier[sslfipskey] identifier[exportresource] operator[=] Keyword[new] identifier[sslfipskey] operator[SEP] operator[SEP] operator[SEP] identifier[exportresource] operator[SEP] identifier[fipskeyname] operator[=] identifier[resource] operator[SEP] identifier[fipskeyname] operator[SEP] identifier[exportresource] operator[SEP] identifier[key] operator[=] identifier[resource] operator[SEP] identifier[key] operator[SEP] Keyword[return] identifier[exportresource] operator[SEP] identifier[perform_operation] operator[SEP] identifier[client] , literal[String] operator[SEP] operator[SEP] }
public void setScheme( String scheme ) { _scheme = null; if ( scheme != null && scheme.length() > 0 ) { _scheme = scheme; } }
class class_name[name] begin[{] method[setScheme, return_type[void], modifier[public], parameter[scheme]] begin[{] assign[member[._scheme], literal[null]] if[binary_operation[binary_operation[member[.scheme], !=, literal[null]], &&, binary_operation[call[scheme.length, parameter[]], >, literal[0]]]] begin[{] assign[member[._scheme], member[.scheme]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setScheme] operator[SEP] identifier[String] identifier[scheme] operator[SEP] { identifier[_scheme] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[scheme] operator[!=] Other[null] operator[&&] identifier[scheme] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[_scheme] operator[=] identifier[scheme] operator[SEP] } }
public static long putFromByteArray(Cache cache, String resource, byte [] data) throws CacheException { if(cache == null) { logger.error("cache reference must not be null"); throw new CacheException("invalid cache"); } ByteArrayInputStream input = null; OutputStream output = null; try { output = cache.put(resource); if(output != null) { input = new ByteArrayInputStream(data); long copied = Streams.copy(input, output); logger.trace("copied {} bytes into cache", copied); return copied; } } catch (IOException e) { logger.error("error copying data from byte array to cache", e); throw new CacheException("error copying data from byte array to cache", e); } finally { Streams.safelyClose(input); Streams.safelyClose(output); } return -1; }
class class_name[name] begin[{] method[putFromByteArray, return_type[type[long]], modifier[public static], parameter[cache, resource, data]] begin[{] if[binary_operation[member[.cache], ==, literal[null]]] begin[{] call[logger.error, parameter[literal["cache reference must not be null"]]] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid cache")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CacheException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[ByteArrayInputStream], input] local_variable[type[OutputStream], output] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=cache, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=data, 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=ByteArrayInputStream, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=Streams, selectors=[], type_arguments=None), name=copied)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="copied {} bytes into cache"), MemberReference(member=copied, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=copied, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error copying data from byte array to cache"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error copying data from byte array to cache"), 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=CacheException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=safelyClose, postfix_operators=[], prefix_operators=[], qualifier=Streams, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=safelyClose, postfix_operators=[], prefix_operators=[], qualifier=Streams, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[literal[1]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[long] identifier[putFromByteArray] operator[SEP] identifier[Cache] identifier[cache] , identifier[String] identifier[resource] , Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[SEP] Keyword[throws] identifier[CacheException] { Keyword[if] operator[SEP] identifier[cache] operator[==] Other[null] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CacheException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[ByteArrayInputStream] identifier[input] operator[=] Other[null] operator[SEP] identifier[OutputStream] identifier[output] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[output] operator[=] identifier[cache] operator[SEP] identifier[put] operator[SEP] identifier[resource] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[output] operator[!=] Other[null] operator[SEP] { identifier[input] operator[=] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[data] operator[SEP] operator[SEP] Keyword[long] identifier[copied] operator[=] identifier[Streams] operator[SEP] identifier[copy] operator[SEP] identifier[input] , identifier[output] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[copied] operator[SEP] operator[SEP] Keyword[return] identifier[copied] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[CacheException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[Streams] operator[SEP] identifier[safelyClose] operator[SEP] identifier[input] operator[SEP] operator[SEP] identifier[Streams] operator[SEP] identifier[safelyClose] operator[SEP] identifier[output] operator[SEP] operator[SEP] } Keyword[return] operator[-] Other[1] operator[SEP] }
protected ValueSet readAndDeleteInvalidationFile() { final String methodName = "readAndDeleteInvalidationFile()"; final File f = new File(invalidationFileName); final CacheOnDisk cod = this; this.valueSet = new ValueSet(1); if (f.exists()) { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { FileInputStream fis = null; ObjectInputStream ois = null; try { fis = new FileInputStream(f); ois = new ObjectInputStream(fis); int size = ois.readInt(); cod.valueSet = new ValueSet(size); for (int i = 0; i < size; i++) { cod.valueSet.add(ois.readObject()); } } catch (Throwable t1) { com.ibm.ws.ffdc.FFDCFilter.processException(t1, "com.ibm.ws.cache.CacheOnDisk.readAndDeleteInvalidationFile", "1056", cod); traceDebug(methodName, "cacheName=" + cod.cacheName + "\nException: " + ExceptionUtility.getStackTrace(t1)); } finally { try { if (ois != null) { ois.close(); } if (fis != null) { fis.close(); } f.delete(); } catch (Throwable t2) { com.ibm.ws.ffdc.FFDCFilter .processException(t2, "com.ibm.ws.cache.CacheOnDisk.readAndDeleteInvalidationFile", "1068", cod); traceDebug(methodName, "cacheName=" + cod.cacheName + "\nException: " + ExceptionUtility.getStackTrace(t2)); } } return null; } }); } traceDebug(methodName, "cacheName=" + this.cacheName + " " + invalidationFileName + " valueSet=" + valueSet.size()); return this.valueSet; }
class class_name[name] begin[{] method[readAndDeleteInvalidationFile, return_type[type[ValueSet]], modifier[protected], parameter[]] begin[{] local_variable[type[String], methodName] local_variable[type[File], f] local_variable[type[CacheOnDisk], cod] assign[THIS[member[None.valueSet]], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ValueSet, sub_type=None))] if[call[f.exists, parameter[]]] begin[{] call[AccessController.doPrivileged, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=fis)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=ois)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ObjectInputStream, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=fis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ois, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=fis, 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=ObjectInputStream, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None), name=size)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=valueSet, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=size, 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=ValueSet, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=readObject, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=cod.valueSet, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.cache.CacheOnDisk.readAndDeleteInvalidationFile"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1056"), MemberReference(member=cod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ffdc.FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cacheName="), operandr=MemberReference(member=cacheName, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nException: "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=t1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtility, selectors=[], type_arguments=None), operator=+)], member=traceDebug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t1, types=['Throwable']))], finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ois, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=ois, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=fis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=fis, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=delete, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=t2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="com.ibm.ws.cache.CacheOnDisk.readAndDeleteInvalidationFile"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1068"), MemberReference(member=cod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=com.ibm.ws.ffdc.FFDCFilter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cacheName="), operandr=MemberReference(member=cacheName, postfix_operators=[], prefix_operators=[], qualifier=cod, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\nException: "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=t2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtility, selectors=[], type_arguments=None), operator=+)], member=traceDebug, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t2, types=['Throwable']))], finally_block=None, label=None, resources=None)], label=None, resources=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, 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=PrivilegedAction, sub_type=None))]] else begin[{] None end[}] call[.traceDebug, parameter[member[.methodName], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["cacheName="], +, THIS[member[None.cacheName]]], +, literal[" "]], +, member[.invalidationFileName]], +, literal[" valueSet="]], +, call[valueSet.size, parameter[]]]]] return[THIS[member[None.valueSet]]] end[}] END[}]
Keyword[protected] identifier[ValueSet] identifier[readAndDeleteInvalidationFile] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[methodName] operator[=] literal[String] operator[SEP] Keyword[final] identifier[File] identifier[f] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[invalidationFileName] operator[SEP] operator[SEP] Keyword[final] identifier[CacheOnDisk] identifier[cod] operator[=] Keyword[this] operator[SEP] Keyword[this] operator[SEP] identifier[valueSet] operator[=] Keyword[new] identifier[ValueSet] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[SEP] operator[SEP] { Keyword[public] identifier[Object] identifier[run] operator[SEP] operator[SEP] { identifier[FileInputStream] identifier[fis] operator[=] Other[null] operator[SEP] identifier[ObjectInputStream] identifier[ois] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[fis] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[f] operator[SEP] operator[SEP] identifier[ois] operator[=] Keyword[new] identifier[ObjectInputStream] operator[SEP] identifier[fis] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[ois] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] identifier[cod] operator[SEP] identifier[valueSet] operator[=] Keyword[new] identifier[ValueSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[cod] operator[SEP] identifier[valueSet] operator[SEP] identifier[add] operator[SEP] identifier[ois] operator[SEP] identifier[readObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t1] operator[SEP] { identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ffdc] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[t1] , literal[String] , literal[String] , identifier[cod] operator[SEP] operator[SEP] identifier[traceDebug] operator[SEP] identifier[methodName] , literal[String] operator[+] identifier[cod] operator[SEP] identifier[cacheName] operator[+] literal[String] operator[+] identifier[ExceptionUtility] operator[SEP] identifier[getStackTrace] operator[SEP] identifier[t1] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[try] { Keyword[if] operator[SEP] identifier[ois] operator[!=] Other[null] operator[SEP] { identifier[ois] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[fis] operator[!=] Other[null] operator[SEP] { identifier[fis] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } identifier[f] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t2] operator[SEP] { identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ws] operator[SEP] identifier[ffdc] operator[SEP] identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[t2] , literal[String] , literal[String] , identifier[cod] operator[SEP] operator[SEP] identifier[traceDebug] operator[SEP] identifier[methodName] , literal[String] operator[+] identifier[cod] operator[SEP] identifier[cacheName] operator[+] literal[String] operator[+] identifier[ExceptionUtility] operator[SEP] identifier[getStackTrace] operator[SEP] identifier[t2] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] } } operator[SEP] operator[SEP] } identifier[traceDebug] operator[SEP] identifier[methodName] , literal[String] operator[+] Keyword[this] operator[SEP] identifier[cacheName] operator[+] literal[String] operator[+] identifier[invalidationFileName] operator[+] literal[String] operator[+] identifier[valueSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[valueSet] operator[SEP] }
public static String execute(String fileName, boolean redirectOutput, String... arguments) throws PyException { Properties properties = new Properties(); properties.setProperty("python.home", StaticConfiguration.JYTHON_HOME); properties.setProperty("python.path", StaticConfiguration.FORMATTER_DIR); PythonInterpreter.initialize(System.getProperties(), properties, new String[] {""}); try (PythonInterpreter interp = new PythonInterpreter(new org.python.core.PyStringMap(), new org.python.core.PySystemState())) { StringWriter output = null; if (redirectOutput) { output = new StringWriter(); interp.setOut(output); interp.setErr(output); } interp.cleanup(); interp.exec("import sys;sys.argv[1:]= [r'" + StringUtils.join(arguments, "','") + "']"); interp.exec("__name__ = '__main__'"); interp.exec("execfile(r'" + fileName + "')"); return redirectOutput ? output.toString() : null; } }
class class_name[name] begin[{] method[execute, return_type[type[String]], modifier[public static], parameter[fileName, redirectOutput, arguments]] begin[{] local_variable[type[Properties], properties] call[properties.setProperty, parameter[literal["python.home"], member[StaticConfiguration.JYTHON_HOME]]] call[properties.setProperty, parameter[literal["python.path"], member[StaticConfiguration.FORMATTER_DIR]]] call[PythonInterpreter.initialize, parameter[call[System.getProperties, parameter[]], member[.properties], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=output)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringWriter, sub_type=None)), IfStatement(condition=MemberReference(member=redirectOutput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringWriter, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setOut, postfix_operators=[], prefix_operators=[], qualifier=interp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setErr, postfix_operators=[], prefix_operators=[], qualifier=interp, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=cleanup, postfix_operators=[], prefix_operators=[], qualifier=interp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="import sys;sys.argv[1:]= [r'"), operandr=MethodInvocation(arguments=[MemberReference(member=arguments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="','")], member=join, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="']"), operator=+)], member=exec, postfix_operators=[], prefix_operators=[], qualifier=interp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="__name__ = '__main__'")], member=exec, postfix_operators=[], prefix_operators=[], qualifier=interp, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="execfile(r'"), operandr=MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="')"), operator=+)], member=exec, postfix_operators=[], prefix_operators=[], qualifier=interp, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=TernaryExpression(condition=MemberReference(member=redirectOutput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None)), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=interp, type=ReferenceType(arguments=None, dimensions=[], name=PythonInterpreter, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[], 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=python, sub_type=ReferenceType(arguments=None, dimensions=None, name=core, sub_type=ReferenceType(arguments=None, dimensions=None, name=PyStringMap, sub_type=None))))), ClassCreator(arguments=[], 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=python, sub_type=ReferenceType(arguments=None, dimensions=None, name=core, sub_type=ReferenceType(arguments=None, dimensions=None, name=PySystemState, sub_type=None)))))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PythonInterpreter, sub_type=None)))]) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[execute] operator[SEP] identifier[String] identifier[fileName] , Keyword[boolean] identifier[redirectOutput] , identifier[String] operator[...] identifier[arguments] operator[SEP] Keyword[throws] identifier[PyException] { identifier[Properties] identifier[properties] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[StaticConfiguration] operator[SEP] identifier[JYTHON_HOME] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , identifier[StaticConfiguration] operator[SEP] identifier[FORMATTER_DIR] operator[SEP] operator[SEP] identifier[PythonInterpreter] operator[SEP] identifier[initialize] operator[SEP] identifier[System] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] , identifier[properties] , Keyword[new] identifier[String] operator[SEP] operator[SEP] { literal[String] } operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[PythonInterpreter] identifier[interp] operator[=] Keyword[new] identifier[PythonInterpreter] operator[SEP] Keyword[new] identifier[org] operator[SEP] identifier[python] operator[SEP] identifier[core] operator[SEP] identifier[PyStringMap] operator[SEP] operator[SEP] , Keyword[new] identifier[org] operator[SEP] identifier[python] operator[SEP] identifier[core] operator[SEP] identifier[PySystemState] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[StringWriter] identifier[output] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[redirectOutput] operator[SEP] { identifier[output] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] identifier[interp] operator[SEP] identifier[setOut] operator[SEP] identifier[output] operator[SEP] operator[SEP] identifier[interp] operator[SEP] identifier[setErr] operator[SEP] identifier[output] operator[SEP] operator[SEP] } identifier[interp] operator[SEP] identifier[cleanup] operator[SEP] operator[SEP] operator[SEP] identifier[interp] operator[SEP] identifier[exec] operator[SEP] literal[String] operator[+] identifier[StringUtils] operator[SEP] identifier[join] operator[SEP] identifier[arguments] , literal[String] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[interp] operator[SEP] identifier[exec] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[interp] operator[SEP] identifier[exec] operator[SEP] literal[String] operator[+] identifier[fileName] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[redirectOutput] operator[?] identifier[output] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] } }
public void deleteObjectRow(TableDefinition tableDef, String objID) { deleteRow(SpiderService.objectsStoreName(tableDef), objID); }
class class_name[name] begin[{] method[deleteObjectRow, return_type[void], modifier[public], parameter[tableDef, objID]] begin[{] call[.deleteRow, parameter[call[SpiderService.objectsStoreName, parameter[member[.tableDef]]], member[.objID]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[deleteObjectRow] operator[SEP] identifier[TableDefinition] identifier[tableDef] , identifier[String] identifier[objID] operator[SEP] { identifier[deleteRow] operator[SEP] identifier[SpiderService] operator[SEP] identifier[objectsStoreName] operator[SEP] identifier[tableDef] operator[SEP] , identifier[objID] operator[SEP] operator[SEP] }
private final Boolean getBoolean(NamedList<Object> response, String... args) { Object objectItem = response.findRecursive(args); Boolean result = null; if (objectItem != null && objectItem instanceof Boolean) { result = (Boolean) objectItem; } return result; }
class class_name[name] begin[{] method[getBoolean, return_type[type[Boolean]], modifier[final private], parameter[response, args]] begin[{] local_variable[type[Object], objectItem] local_variable[type[Boolean], result] if[binary_operation[binary_operation[member[.objectItem], !=, literal[null]], &&, binary_operation[member[.objectItem], instanceof, type[Boolean]]]] begin[{] assign[member[.result], Cast(expression=MemberReference(member=objectItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[private] Keyword[final] identifier[Boolean] identifier[getBoolean] operator[SEP] identifier[NamedList] operator[<] identifier[Object] operator[>] identifier[response] , identifier[String] operator[...] identifier[args] operator[SEP] { identifier[Object] identifier[objectItem] operator[=] identifier[response] operator[SEP] identifier[findRecursive] operator[SEP] identifier[args] operator[SEP] operator[SEP] identifier[Boolean] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[objectItem] operator[!=] Other[null] operator[&&] identifier[objectItem] Keyword[instanceof] identifier[Boolean] operator[SEP] { identifier[result] operator[=] operator[SEP] identifier[Boolean] operator[SEP] identifier[objectItem] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
private Observable<Boolean> upsertTempMessage(ChatMessage message) { return persistenceController.updateStoreWithNewMessage(message, noConversationListener) .doOnError(t -> log.e("Error saving temp message " + t.getLocalizedMessage())) .onErrorReturn(t -> false); }
class class_name[name] begin[{] method[upsertTempMessage, return_type[type[Observable]], modifier[private], parameter[message]] begin[{] return[call[persistenceController.updateStoreWithNewMessage, parameter[member[.message], member[.noConversationListener]]]] end[}] END[}]
Keyword[private] identifier[Observable] operator[<] identifier[Boolean] operator[>] identifier[upsertTempMessage] operator[SEP] identifier[ChatMessage] identifier[message] operator[SEP] { Keyword[return] identifier[persistenceController] operator[SEP] identifier[updateStoreWithNewMessage] operator[SEP] identifier[message] , identifier[noConversationListener] operator[SEP] operator[SEP] identifier[doOnError] operator[SEP] identifier[t] operator[->] identifier[log] operator[SEP] identifier[e] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getLocalizedMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[onErrorReturn] operator[SEP] identifier[t] operator[->] literal[boolean] operator[SEP] operator[SEP] }
public static File writeUCI(TrainingCorpus corpus, Lexicon lexicon, boolean b, String vector_location, Map<Integer, Integer> attributeMapping) throws IOException { File vectorFile = new File(vector_location); PrintWriter out = null; out = new PrintWriter(new FileWriter(vectorFile)); // dump the content of the lexicon file int attributeNum = lexicon.getAttributesNum(); // get an iterator on the Corpus // and retrieve the documents one by one Iterator<Document> docIterator = corpus.iterator(); while (docIterator.hasNext()) { Document doc = docIterator.next(); int label = doc.getLabel(); // get a vector from the document // need a metric (e.g. relative frequency / binary) // and a lexicon // the vector is represented as a string directly Vector vector = null; if (attributeMapping == null) vector = doc.getFeatureVector(lexicon); else vector = doc.getFeatureVector(lexicon, attributeMapping); StringBuffer buffer = new StringBuffer(); buffer.append(lexicon.getLabel(label)); int[] indices = vector.getIndices(); double[] values = vector.getValues(); double[] denseVector = new double[attributeNum]; for (int i = 0; i < indices.length; i++) { int currentIndex = indices[i]; if (indices[i] > attributeNum) continue; denseVector[currentIndex] = values[i]; } for (int i = 0; i < denseVector.length; i++) { buffer.append(",").append(denseVector[i]); } buffer.append("\n"); out.print(buffer.toString()); } out.close(); return vectorFile; }
class class_name[name] begin[{] method[writeUCI, return_type[type[File]], modifier[public static], parameter[corpus, lexicon, b, vector_location, attributeMapping]] begin[{] local_variable[type[File], vectorFile] local_variable[type[PrintWriter], out] assign[member[.out], ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=vectorFile, 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=FileWriter, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PrintWriter, sub_type=None))] local_variable[type[int], attributeNum] local_variable[type[Iterator], docIterator] while[call[docIterator.hasNext, parameter[]]] begin[{] local_variable[type[Document], doc] local_variable[type[int], label] local_variable[type[Vector], vector] if[binary_operation[member[.attributeMapping], ==, literal[null]]] begin[{] assign[member[.vector], call[doc.getFeatureVector, parameter[member[.lexicon]]]] else begin[{] assign[member[.vector], call[doc.getFeatureVector, parameter[member[.lexicon], member[.attributeMapping]]]] end[}] local_variable[type[StringBuffer], buffer] call[buffer.append, parameter[call[lexicon.getLabel, parameter[member[.label]]]]] local_variable[type[int], indices] local_variable[type[double], values] local_variable[type[double], denseVector] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=currentIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=indices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=attributeNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=denseVector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=currentIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=indices, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[MethodInvocation(arguments=[MemberReference(member=denseVector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=denseVector, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[buffer.append, parameter[literal["\n"]]] call[out.print, parameter[call[buffer.toString, parameter[]]]] end[}] call[out.close, parameter[]] return[member[.vectorFile]] end[}] END[}]
Keyword[public] Keyword[static] identifier[File] identifier[writeUCI] operator[SEP] identifier[TrainingCorpus] identifier[corpus] , identifier[Lexicon] identifier[lexicon] , Keyword[boolean] identifier[b] , identifier[String] identifier[vector_location] , identifier[Map] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[attributeMapping] operator[SEP] Keyword[throws] identifier[IOException] { identifier[File] identifier[vectorFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[vector_location] operator[SEP] operator[SEP] identifier[PrintWriter] identifier[out] operator[=] Other[null] operator[SEP] identifier[out] operator[=] Keyword[new] identifier[PrintWriter] operator[SEP] Keyword[new] identifier[FileWriter] operator[SEP] identifier[vectorFile] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[attributeNum] operator[=] identifier[lexicon] operator[SEP] identifier[getAttributesNum] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[Document] operator[>] identifier[docIterator] operator[=] identifier[corpus] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[docIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Document] identifier[doc] operator[=] identifier[docIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[label] operator[=] identifier[doc] operator[SEP] identifier[getLabel] operator[SEP] operator[SEP] operator[SEP] identifier[Vector] identifier[vector] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[attributeMapping] operator[==] Other[null] operator[SEP] identifier[vector] operator[=] identifier[doc] operator[SEP] identifier[getFeatureVector] operator[SEP] identifier[lexicon] operator[SEP] operator[SEP] Keyword[else] identifier[vector] operator[=] identifier[doc] operator[SEP] identifier[getFeatureVector] operator[SEP] identifier[lexicon] , identifier[attributeMapping] operator[SEP] operator[SEP] identifier[StringBuffer] identifier[buffer] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[lexicon] operator[SEP] identifier[getLabel] operator[SEP] identifier[label] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[indices] operator[=] identifier[vector] operator[SEP] identifier[getIndices] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[values] operator[=] identifier[vector] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[denseVector] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[attributeNum] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[indices] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[currentIndex] operator[=] identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[indices] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[attributeNum] operator[SEP] Keyword[continue] operator[SEP] identifier[denseVector] operator[SEP] identifier[currentIndex] operator[SEP] operator[=] identifier[values] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[denseVector] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[denseVector] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[vectorFile] operator[SEP] }
public EvaluationContextImpl newEvaluationContext(ClassLoader cl, Collection<FEELEventListener> listeners, Map<String, Object> inputVariables) { FEELEventListenersManager eventsManager = getEventsManager(listeners); EvaluationContextImpl ctx = new EvaluationContextImpl(cl, eventsManager, inputVariables.size()); if (customFrame.isPresent()) { ExecutionFrameImpl globalFrame = (ExecutionFrameImpl) ctx.pop(); ExecutionFrameImpl interveawedFrame = customFrame.get(); interveawedFrame.setParentFrame(ctx.peek()); globalFrame.setParentFrame(interveawedFrame); ctx.push(interveawedFrame); ctx.push(globalFrame); } ctx.setValues(inputVariables); return ctx; }
class class_name[name] begin[{] method[newEvaluationContext, return_type[type[EvaluationContextImpl]], modifier[public], parameter[cl, listeners, inputVariables]] begin[{] local_variable[type[FEELEventListenersManager], eventsManager] local_variable[type[EvaluationContextImpl], ctx] if[call[customFrame.isPresent, parameter[]]] begin[{] local_variable[type[ExecutionFrameImpl], globalFrame] local_variable[type[ExecutionFrameImpl], interveawedFrame] call[interveawedFrame.setParentFrame, parameter[call[ctx.peek, parameter[]]]] call[globalFrame.setParentFrame, parameter[member[.interveawedFrame]]] call[ctx.push, parameter[member[.interveawedFrame]]] call[ctx.push, parameter[member[.globalFrame]]] else begin[{] None end[}] call[ctx.setValues, parameter[member[.inputVariables]]] return[member[.ctx]] end[}] END[}]
Keyword[public] identifier[EvaluationContextImpl] identifier[newEvaluationContext] operator[SEP] identifier[ClassLoader] identifier[cl] , identifier[Collection] operator[<] identifier[FEELEventListener] operator[>] identifier[listeners] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[inputVariables] operator[SEP] { identifier[FEELEventListenersManager] identifier[eventsManager] operator[=] identifier[getEventsManager] operator[SEP] identifier[listeners] operator[SEP] operator[SEP] identifier[EvaluationContextImpl] identifier[ctx] operator[=] Keyword[new] identifier[EvaluationContextImpl] operator[SEP] identifier[cl] , identifier[eventsManager] , identifier[inputVariables] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[customFrame] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { identifier[ExecutionFrameImpl] identifier[globalFrame] operator[=] operator[SEP] identifier[ExecutionFrameImpl] operator[SEP] identifier[ctx] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] identifier[ExecutionFrameImpl] identifier[interveawedFrame] operator[=] identifier[customFrame] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[interveawedFrame] operator[SEP] identifier[setParentFrame] operator[SEP] identifier[ctx] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[globalFrame] operator[SEP] identifier[setParentFrame] operator[SEP] identifier[interveawedFrame] operator[SEP] operator[SEP] identifier[ctx] operator[SEP] identifier[push] operator[SEP] identifier[interveawedFrame] operator[SEP] operator[SEP] identifier[ctx] operator[SEP] identifier[push] operator[SEP] identifier[globalFrame] operator[SEP] operator[SEP] } identifier[ctx] operator[SEP] identifier[setValues] operator[SEP] identifier[inputVariables] operator[SEP] operator[SEP] Keyword[return] identifier[ctx] operator[SEP] }
public static List<ExternalGraphic> externalGraphicsFromGraphic( Graphic graphic ) { List<ExternalGraphic> gList = new ArrayList<ExternalGraphic>(); for( GraphicalSymbol gs : graphic.graphicalSymbols() ) { if ((gs != null) && (gs instanceof ExternalGraphic)) { ExternalGraphic externalGraphic = (ExternalGraphic) gs; gList.add(externalGraphic); } } return gList; }
class class_name[name] begin[{] method[externalGraphicsFromGraphic, return_type[type[List]], modifier[public static], parameter[graphic]] begin[{] local_variable[type[List], gList] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=gs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=gs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ExternalGraphic, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=gs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ExternalGraphic, sub_type=None)), name=externalGraphic)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExternalGraphic, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=externalGraphic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=gList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=graphicalSymbols, postfix_operators=[], prefix_operators=[], qualifier=graphic, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=gs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GraphicalSymbol, sub_type=None))), label=None) return[member[.gList]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[ExternalGraphic] operator[>] identifier[externalGraphicsFromGraphic] operator[SEP] identifier[Graphic] identifier[graphic] operator[SEP] { identifier[List] operator[<] identifier[ExternalGraphic] operator[>] identifier[gList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ExternalGraphic] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[GraphicalSymbol] identifier[gs] operator[:] identifier[graphic] operator[SEP] identifier[graphicalSymbols] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[gs] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[gs] Keyword[instanceof] identifier[ExternalGraphic] operator[SEP] operator[SEP] { identifier[ExternalGraphic] identifier[externalGraphic] operator[=] operator[SEP] identifier[ExternalGraphic] operator[SEP] identifier[gs] operator[SEP] identifier[gList] operator[SEP] identifier[add] operator[SEP] identifier[externalGraphic] operator[SEP] operator[SEP] } } Keyword[return] identifier[gList] operator[SEP] }
public void validateInjectionPointForDeploymentProblems(InjectionPoint ij, Bean<?> bean, BeanManagerImpl beanManager) { if (ij.isDelegate()) { return; // do not validate delegate injection points as these are special } Set<Bean<?>> resolvedBeans = beanManager.getBeanResolver().resolve(beanManager.getBeans(ij)); if (!isInjectionPointSatisfied(ij, resolvedBeans, beanManager)) { throw ValidatorLogger.LOG.injectionPointHasUnsatisfiedDependencies( ij, Formats.formatAnnotations(ij.getQualifiers()), Formats.formatInjectionPointType(ij.getType()), Formats.formatAsStackTraceElement(ij), InjectionPoints.getUnsatisfiedDependenciesAdditionalInfo(ij, beanManager)); } if (resolvedBeans.size() > 1) { throw ValidatorLogger.LOG.injectionPointHasAmbiguousDependencies( ij, Formats.formatAnnotations(ij.getQualifiers()), Formats.formatInjectionPointType(ij.getType()), Formats.formatAsStackTraceElement(ij), WeldCollections.toMultiRowString(resolvedBeans)); } // Account for the case this is disabled decorator if (!resolvedBeans.isEmpty()) { Bean<?> resolvedBean = (Bean<?>) resolvedBeans.iterator().next(); if (beanManager.isNormalScope(resolvedBean.getScope())) { UnproxyableResolutionException ue = Proxies.getUnproxyableTypeException(ij.getType(), resolvedBean, beanManager.getServices(), false); if (ue != null) { throw ValidatorLogger.LOG.injectionPointHasNonProxyableDependencies(ij, Formats.formatAsStackTraceElement(ij), ue); } } if (bean != null && Beans.isPassivatingScope(bean, beanManager)) { validateInjectionPointPassivationCapable(ij, resolvedBean, beanManager); } } for (PlugableValidator validator : plugableValidators) { validator.validateInjectionPointForDeploymentProblems(ij, bean, beanManager); } if (resolvedInjectionPoints != null) { // Store result to identify unused beans resolvedInjectionPoints.put(resolvedBeans.iterator().next(), Boolean.TRUE); } }
class class_name[name] begin[{] method[validateInjectionPointForDeploymentProblems, return_type[void], modifier[public], parameter[ij, bean, beanManager]] begin[{] if[call[ij.isDelegate, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Set], resolvedBeans] if[call[.isInjectionPointSatisfied, parameter[member[.ij], member[.resolvedBeans], member[.beanManager]]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getQualifiers, postfix_operators=[], prefix_operators=[], qualifier=ij, selectors=[], type_arguments=None)], member=formatAnnotations, postfix_operators=[], prefix_operators=[], qualifier=Formats, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=ij, selectors=[], type_arguments=None)], member=formatInjectionPointType, postfix_operators=[], prefix_operators=[], qualifier=Formats, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=formatAsStackTraceElement, postfix_operators=[], prefix_operators=[], qualifier=Formats, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=beanManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUnsatisfiedDependenciesAdditionalInfo, postfix_operators=[], prefix_operators=[], qualifier=InjectionPoints, selectors=[], type_arguments=None)], member=injectionPointHasUnsatisfiedDependencies, postfix_operators=[], prefix_operators=[], qualifier=ValidatorLogger.LOG, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] if[binary_operation[call[resolvedBeans.size, parameter[]], >, literal[1]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getQualifiers, postfix_operators=[], prefix_operators=[], qualifier=ij, selectors=[], type_arguments=None)], member=formatAnnotations, postfix_operators=[], prefix_operators=[], qualifier=Formats, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=ij, selectors=[], type_arguments=None)], member=formatInjectionPointType, postfix_operators=[], prefix_operators=[], qualifier=Formats, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=formatAsStackTraceElement, postfix_operators=[], prefix_operators=[], qualifier=Formats, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=resolvedBeans, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toMultiRowString, postfix_operators=[], prefix_operators=[], qualifier=WeldCollections, selectors=[], type_arguments=None)], member=injectionPointHasAmbiguousDependencies, postfix_operators=[], prefix_operators=[], qualifier=ValidatorLogger.LOG, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] if[call[resolvedBeans.isEmpty, parameter[]]] begin[{] local_variable[type[Bean], resolvedBean] if[call[beanManager.isNormalScope, parameter[call[resolvedBean.getScope, parameter[]]]]] begin[{] local_variable[type[UnproxyableResolutionException], ue] if[binary_operation[member[.ue], !=, literal[null]]] begin[{] ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=formatAsStackTraceElement, postfix_operators=[], prefix_operators=[], qualifier=Formats, selectors=[], type_arguments=None), MemberReference(member=ue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=injectionPointHasNonProxyableDependencies, postfix_operators=[], prefix_operators=[], qualifier=ValidatorLogger.LOG, selectors=[], type_arguments=None), label=None) else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[.bean], !=, literal[null]], &&, call[Beans.isPassivatingScope, parameter[member[.bean], member[.beanManager]]]]] begin[{] call[.validateInjectionPointPassivationCapable, parameter[member[.ij], member[.resolvedBean], member[.beanManager]]] else begin[{] None end[}] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ij, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=beanManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validateInjectionPointForDeploymentProblems, postfix_operators=[], prefix_operators=[], qualifier=validator, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=plugableValidators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=validator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PlugableValidator, sub_type=None))), label=None) if[binary_operation[member[.resolvedInjectionPoints], !=, literal[null]]] begin[{] call[resolvedInjectionPoints.put, parameter[call[resolvedBeans.iterator, parameter[]], member[Boolean.TRUE]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[validateInjectionPointForDeploymentProblems] operator[SEP] identifier[InjectionPoint] identifier[ij] , identifier[Bean] operator[<] operator[?] operator[>] identifier[bean] , identifier[BeanManagerImpl] identifier[beanManager] operator[SEP] { Keyword[if] operator[SEP] identifier[ij] operator[SEP] identifier[isDelegate] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[Set] operator[<] identifier[Bean] operator[<] operator[?] operator[>] operator[>] identifier[resolvedBeans] operator[=] identifier[beanManager] operator[SEP] identifier[getBeanResolver] operator[SEP] operator[SEP] operator[SEP] identifier[resolve] operator[SEP] identifier[beanManager] operator[SEP] identifier[getBeans] operator[SEP] identifier[ij] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isInjectionPointSatisfied] operator[SEP] identifier[ij] , identifier[resolvedBeans] , identifier[beanManager] operator[SEP] operator[SEP] { Keyword[throw] identifier[ValidatorLogger] operator[SEP] identifier[LOG] operator[SEP] identifier[injectionPointHasUnsatisfiedDependencies] operator[SEP] identifier[ij] , identifier[Formats] operator[SEP] identifier[formatAnnotations] operator[SEP] identifier[ij] operator[SEP] identifier[getQualifiers] operator[SEP] operator[SEP] operator[SEP] , identifier[Formats] operator[SEP] identifier[formatInjectionPointType] operator[SEP] identifier[ij] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] , identifier[Formats] operator[SEP] identifier[formatAsStackTraceElement] operator[SEP] identifier[ij] operator[SEP] , identifier[InjectionPoints] operator[SEP] identifier[getUnsatisfiedDependenciesAdditionalInfo] operator[SEP] identifier[ij] , identifier[beanManager] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[resolvedBeans] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { Keyword[throw] identifier[ValidatorLogger] operator[SEP] identifier[LOG] operator[SEP] identifier[injectionPointHasAmbiguousDependencies] operator[SEP] identifier[ij] , identifier[Formats] operator[SEP] identifier[formatAnnotations] operator[SEP] identifier[ij] operator[SEP] identifier[getQualifiers] operator[SEP] operator[SEP] operator[SEP] , identifier[Formats] operator[SEP] identifier[formatInjectionPointType] operator[SEP] identifier[ij] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] , identifier[Formats] operator[SEP] identifier[formatAsStackTraceElement] operator[SEP] identifier[ij] operator[SEP] , identifier[WeldCollections] operator[SEP] identifier[toMultiRowString] operator[SEP] identifier[resolvedBeans] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[resolvedBeans] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Bean] operator[<] operator[?] operator[>] identifier[resolvedBean] operator[=] operator[SEP] identifier[Bean] operator[<] operator[?] operator[>] operator[SEP] identifier[resolvedBeans] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[beanManager] operator[SEP] identifier[isNormalScope] operator[SEP] identifier[resolvedBean] operator[SEP] identifier[getScope] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[UnproxyableResolutionException] identifier[ue] operator[=] identifier[Proxies] operator[SEP] identifier[getUnproxyableTypeException] operator[SEP] identifier[ij] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[resolvedBean] , identifier[beanManager] operator[SEP] identifier[getServices] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ue] operator[!=] Other[null] operator[SEP] { Keyword[throw] identifier[ValidatorLogger] operator[SEP] identifier[LOG] operator[SEP] identifier[injectionPointHasNonProxyableDependencies] operator[SEP] identifier[ij] , identifier[Formats] operator[SEP] identifier[formatAsStackTraceElement] operator[SEP] identifier[ij] operator[SEP] , identifier[ue] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[bean] operator[!=] Other[null] operator[&&] identifier[Beans] operator[SEP] identifier[isPassivatingScope] operator[SEP] identifier[bean] , identifier[beanManager] operator[SEP] operator[SEP] { identifier[validateInjectionPointPassivationCapable] operator[SEP] identifier[ij] , identifier[resolvedBean] , identifier[beanManager] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[PlugableValidator] identifier[validator] operator[:] identifier[plugableValidators] operator[SEP] { identifier[validator] operator[SEP] identifier[validateInjectionPointForDeploymentProblems] operator[SEP] identifier[ij] , identifier[bean] , identifier[beanManager] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[resolvedInjectionPoints] operator[!=] Other[null] operator[SEP] { identifier[resolvedInjectionPoints] operator[SEP] identifier[put] operator[SEP] identifier[resolvedBeans] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] , identifier[Boolean] operator[SEP] identifier[TRUE] operator[SEP] operator[SEP] } }
@Override public Planar<T> createNew(int imgWidth, int imgHeight) { return new Planar<>(type, imgWidth, imgHeight, bands.length); }
class class_name[name] begin[{] method[createNew, return_type[type[Planar]], modifier[public], parameter[imgWidth, imgHeight]] begin[{] return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=imgWidth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=imgHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=bands, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Planar, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Planar] operator[<] identifier[T] operator[>] identifier[createNew] operator[SEP] Keyword[int] identifier[imgWidth] , Keyword[int] identifier[imgHeight] operator[SEP] { Keyword[return] Keyword[new] identifier[Planar] operator[<] operator[>] operator[SEP] identifier[type] , identifier[imgWidth] , identifier[imgHeight] , identifier[bands] operator[SEP] identifier[length] operator[SEP] operator[SEP] }
@Override public FSDataOutputStream create(Path f, FsPermission permission, boolean overwrite, int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { throw new IOException("Create not supported for EmoFileSystem: " + f); }
class class_name[name] begin[{] method[create, return_type[type[FSDataOutputStream]], modifier[public], parameter[f, permission, overwrite, bufferSize, replication, blockSize, progress]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Create not supported for EmoFileSystem: "), operandr=MemberReference(member=f, 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) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[FSDataOutputStream] identifier[create] operator[SEP] identifier[Path] identifier[f] , identifier[FsPermission] identifier[permission] , Keyword[boolean] identifier[overwrite] , Keyword[int] identifier[bufferSize] , Keyword[short] identifier[replication] , Keyword[long] identifier[blockSize] , identifier[Progressable] identifier[progress] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[f] operator[SEP] operator[SEP] }
public static <T extends Comparable<? super T>> void sort(T[] arr, int[] brr) { sort(arr, brr, arr.length); }
class class_name[name] begin[{] method[sort, return_type[void], modifier[public static], parameter[arr, brr]] begin[{] call[.sort, parameter[member[.arr], member[.brr], member[arr.length]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Comparable] operator[<] operator[?] Keyword[super] identifier[T] operator[>] operator[>] Keyword[void] identifier[sort] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[arr] , Keyword[int] operator[SEP] operator[SEP] identifier[brr] operator[SEP] { identifier[sort] operator[SEP] identifier[arr] , identifier[brr] , identifier[arr] operator[SEP] identifier[length] operator[SEP] operator[SEP] }
public static double elementMaxMagnitude2( ZMatrixD1 a ) { final int size = a.getDataLength(); double max = 0; for( int i = 0; i < size; ) { double real = a.data[i++]; double imaginary = a.data[i++]; double m = real*real + imaginary*imaginary; if( m > max ) { max = m; } } return max; }
class class_name[name] begin[{] method[elementMaxMagnitude2, return_type[type[double]], modifier[public static], parameter[a]] begin[{] local_variable[type[int], size] local_variable[type[double], max] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), name=real)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), name=imaginary)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=real, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=real, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=imaginary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=imaginary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), name=m)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=max, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=m, 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=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=None), label=None) return[member[.max]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[elementMaxMagnitude2] operator[SEP] identifier[ZMatrixD1] identifier[a] operator[SEP] { Keyword[final] Keyword[int] identifier[size] operator[=] identifier[a] operator[SEP] identifier[getDataLength] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[max] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] operator[SEP] { Keyword[double] identifier[real] operator[=] identifier[a] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[++] operator[SEP] operator[SEP] Keyword[double] identifier[imaginary] operator[=] identifier[a] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[++] operator[SEP] operator[SEP] Keyword[double] identifier[m] operator[=] identifier[real] operator[*] identifier[real] operator[+] identifier[imaginary] operator[*] identifier[imaginary] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[>] identifier[max] operator[SEP] { identifier[max] operator[=] identifier[m] operator[SEP] } } Keyword[return] identifier[max] operator[SEP] }
@Override public void enlist() throws ResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, hexId() + ":enlist()"); } }
class class_name[name] begin[{] method[enlist, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[call[.hexId, parameter[]], +, literal[":enlist()"]]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[enlist] operator[SEP] operator[SEP] Keyword[throws] identifier[ResourceException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[hexId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY: return getProbability(); case BpsimPackage.BINOMIAL_DISTRIBUTION_TYPE__TRIALS: return getTrials(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY, postfix_operators=[], prefix_operators=[], qualifier=BpsimPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getProbability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=BINOMIAL_DISTRIBUTION_TYPE__TRIALS, postfix_operators=[], prefix_operators=[], qualifier=BpsimPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getTrials, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[BpsimPackage] operator[SEP] identifier[BINOMIAL_DISTRIBUTION_TYPE__PROBABILITY] operator[:] Keyword[return] identifier[getProbability] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[BpsimPackage] operator[SEP] identifier[BINOMIAL_DISTRIBUTION_TYPE__TRIALS] operator[:] Keyword[return] identifier[getTrials] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
public JavaWriter emitImports(Class<?>... types) throws IOException { List<String> classNames = new ArrayList<String>(types.length); for (Class<?> classToImport : types) { classNames.add(classToImport.getName()); } return emitImports(classNames); }
class class_name[name] begin[{] method[emitImports, return_type[type[JavaWriter]], modifier[public], parameter[types]] begin[{] local_variable[type[List], classNames] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=classToImport, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=classNames, selectors=[], 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=classToImport)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) return[call[.emitImports, parameter[member[.classNames]]]] end[}] END[}]
Keyword[public] identifier[JavaWriter] identifier[emitImports] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[types] operator[SEP] Keyword[throws] identifier[IOException] { identifier[List] operator[<] identifier[String] operator[>] identifier[classNames] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[types] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[classToImport] operator[:] identifier[types] operator[SEP] { identifier[classNames] operator[SEP] identifier[add] operator[SEP] identifier[classToImport] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[emitImports] operator[SEP] identifier[classNames] operator[SEP] operator[SEP] }
public void marshall(HyperParameterTuningJobObjective hyperParameterTuningJobObjective, ProtocolMarshaller protocolMarshaller) { if (hyperParameterTuningJobObjective == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(hyperParameterTuningJobObjective.getType(), TYPE_BINDING); protocolMarshaller.marshall(hyperParameterTuningJobObjective.getMetricName(), METRICNAME_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[hyperParameterTuningJobObjective, protocolMarshaller]] begin[{] if[binary_operation[member[.hyperParameterTuningJobObjective], ==, 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=getType, postfix_operators=[], prefix_operators=[], qualifier=hyperParameterTuningJobObjective, 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), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMetricName, postfix_operators=[], prefix_operators=[], qualifier=hyperParameterTuningJobObjective, selectors=[], type_arguments=None), MemberReference(member=METRICNAME_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[HyperParameterTuningJobObjective] identifier[hyperParameterTuningJobObjective] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[hyperParameterTuningJobObjective] 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[hyperParameterTuningJobObjective] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[TYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[hyperParameterTuningJobObjective] operator[SEP] identifier[getMetricName] operator[SEP] operator[SEP] , identifier[METRICNAME_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static Stream<MutableLongTuple> stream( Order order, LongTuple min, LongTuple max) { if (order == null) { return null; } Utils.checkForEqualSize(min, max); MutableLongTuple localMin = LongTuples.copy(min); MutableLongTuple localMax = LongTuples.copy(max); LongTupleRangeSpliterator spliterator = new LongTupleRangeSpliterator( 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[MutableLongTuple], localMin] local_variable[type[MutableLongTuple], localMax] local_variable[type[LongTupleRangeSpliterator], spliterator] return[call[StreamSupport.stream, parameter[member[.spliterator], literal[false]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Stream] operator[<] identifier[MutableLongTuple] operator[>] identifier[stream] operator[SEP] identifier[Order] identifier[order] , identifier[LongTuple] identifier[min] , identifier[LongTuple] 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[MutableLongTuple] identifier[localMin] operator[=] identifier[LongTuples] operator[SEP] identifier[copy] operator[SEP] identifier[min] operator[SEP] operator[SEP] identifier[MutableLongTuple] identifier[localMax] operator[=] identifier[LongTuples] operator[SEP] identifier[copy] operator[SEP] identifier[max] operator[SEP] operator[SEP] identifier[LongTupleRangeSpliterator] identifier[spliterator] operator[=] Keyword[new] identifier[LongTupleRangeSpliterator] 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] }
@SuppressWarnings("serial") public void join(final Conference conference) { join(conference, Direction.DUPLEX); try { Thread.sleep(800); mg.getPlayer().play(URI.create(url), null, null); } catch (Exception e) { logger.error("Error", e); } }
class class_name[name] begin[{] method[join, return_type[void], modifier[public], parameter[conference]] begin[{] call[.join, parameter[member[.conference], member[Direction.DUPLEX]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=800)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getPlayer, postfix_operators=[], prefix_operators=[], qualifier=mg, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=URI, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=play, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[void] identifier[join] operator[SEP] Keyword[final] identifier[Conference] identifier[conference] operator[SEP] { identifier[join] operator[SEP] identifier[conference] , identifier[Direction] operator[SEP] identifier[DUPLEX] operator[SEP] operator[SEP] Keyword[try] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] Other[800] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[getPlayer] operator[SEP] operator[SEP] operator[SEP] identifier[play] operator[SEP] identifier[URI] operator[SEP] identifier[create] operator[SEP] identifier[url] operator[SEP] , Other[null] , Other[null] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public ArrayList<OvhWhoisObfuscatorFieldsEnum> serviceName_owo_GET(String serviceName, OvhWhoisObfuscatorFieldsEnum field) throws IOException { String qPath = "/domain/{serviceName}/owo"; StringBuilder sb = path(qPath, serviceName); query(sb, "field", field); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t7); }
class class_name[name] begin[{] method[serviceName_owo_GET, return_type[type[ArrayList]], modifier[public], parameter[serviceName, field]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] call[.query, parameter[member[.sb], literal["field"], member[.field]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], member[.t7]]]] end[}] END[}]
Keyword[public] identifier[ArrayList] operator[<] identifier[OvhWhoisObfuscatorFieldsEnum] operator[>] identifier[serviceName_owo_GET] operator[SEP] identifier[String] identifier[serviceName] , identifier[OvhWhoisObfuscatorFieldsEnum] identifier[field] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[field] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[t7] operator[SEP] operator[SEP] }
public void marshall(DescribeDRTAccessRequest describeDRTAccessRequest, ProtocolMarshaller protocolMarshaller) { if (describeDRTAccessRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { } 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[describeDRTAccessRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.describeDRTAccessRequest], ==, 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=[], 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[DescribeDRTAccessRequest] identifier[describeDRTAccessRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[describeDRTAccessRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { } 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 String describe(Session session) { StringBuffer sb; String temp; Index index; Index primaryIndex; int[] primaryKey; boolean hidden; boolean fullScan; sb = new StringBuffer(); index = rangeIndex; primaryIndex = rangeTable.getPrimaryIndex(); primaryKey = rangeTable.getPrimaryKey(); hidden = false; fullScan = (indexCondition == null && indexEndCondition == null); if (index == null) { index = primaryIndex; } if (index == primaryIndex && primaryKey.length == 0) { hidden = true; fullScan = true; } sb.append(super.toString()).append('\n'); sb.append("table=[").append(rangeTable.getName().name).append("]\n"); if (tableAlias != null) { sb.append("alias=[").append(tableAlias.name).append("]\n"); } sb.append("access=[").append(fullScan ? "FULL SCAN" : "INDEX PRED").append("]\n"); sb.append("index=["); sb.append(index == null ? "NONE" : index.getName() == null ? "UNNAMED" : index.getName() .name); sb.append(hidden ? "[HIDDEN]]\n" : "]\n"); temp = "INNER"; if (isLeftJoin) { temp = "LEFT OUTER"; if (isRightJoin) { temp = "FULL"; } } else if (isRightJoin) { temp = "RIGHT OUTER"; } sb.append("joinType=[").append(temp).append("]\n"); temp = indexCondition == null ? "null" : indexCondition.describe(session); if (findFirstExpressions != null) { StringBuffer sbt = new StringBuffer(); for (int i = 0; i < multiColumnCount; i++) { sbt.append(findFirstExpressions[i].describe(session)); } temp = sbt.toString(); } sb.append("eStart=[").append(temp).append("]\n"); temp = indexEndCondition == null ? "null" : indexEndCondition.describe(session); sb.append("eEnd=[").append(temp).append("]\n"); temp = nonIndexJoinCondition == null ? "null" : nonIndexJoinCondition.describe( session); sb.append("eAnd=[").append(temp).append("]"); return sb.toString(); }
class class_name[name] begin[{] method[describe, return_type[type[String]], modifier[public], parameter[session]] begin[{] local_variable[type[StringBuffer], sb] local_variable[type[String], temp] local_variable[type[Index], index] local_variable[type[Index], primaryIndex] local_variable[type[int], primaryKey] local_variable[type[boolean], hidden] local_variable[type[boolean], fullScan] assign[member[.sb], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuffer, sub_type=None))] assign[member[.index], member[.rangeIndex]] assign[member[.primaryIndex], call[rangeTable.getPrimaryIndex, parameter[]]] assign[member[.primaryKey], call[rangeTable.getPrimaryKey, parameter[]]] assign[member[.hidden], literal[false]] assign[member[.fullScan], binary_operation[binary_operation[member[.indexCondition], ==, literal[null]], &&, binary_operation[member[.indexEndCondition], ==, literal[null]]]] if[binary_operation[member[.index], ==, literal[null]]] begin[{] assign[member[.index], member[.primaryIndex]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.index], ==, member[.primaryIndex]], &&, binary_operation[member[primaryKey.length], ==, literal[0]]]] begin[{] assign[member[.hidden], literal[true]] assign[member[.fullScan], literal[true]] else begin[{] None end[}] call[sb.append, parameter[SuperMethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]] call[sb.append, parameter[literal["table=["]]] if[binary_operation[member[.tableAlias], !=, literal[null]]] begin[{] call[sb.append, parameter[literal["alias=["]]] else begin[{] None end[}] call[sb.append, parameter[literal["access=["]]] call[sb.append, parameter[literal["index=["]]] call[sb.append, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=index, selectors=[MemberReference(member=name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UNNAMED")), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NONE"))]] call[sb.append, parameter[TernaryExpression(condition=MemberReference(member=hidden, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]\n"), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[HIDDEN]]\n"))]] assign[member[.temp], literal["INNER"]] if[member[.isLeftJoin]] begin[{] assign[member[.temp], literal["LEFT OUTER"]] if[member[.isRightJoin]] begin[{] assign[member[.temp], literal["FULL"]] else begin[{] None end[}] else begin[{] if[member[.isRightJoin]] begin[{] assign[member[.temp], literal["RIGHT OUTER"]] else begin[{] None end[}] end[}] call[sb.append, parameter[literal["joinType=["]]] assign[member[.temp], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=indexCondition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=describe, postfix_operators=[], prefix_operators=[], qualifier=indexCondition, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null"))] if[binary_operation[member[.findFirstExpressions], !=, literal[null]]] begin[{] local_variable[type[StringBuffer], sbt] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=findFirstExpressions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=describe, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sbt, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=multiColumnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.temp], call[sbt.toString, parameter[]]] else begin[{] None end[}] call[sb.append, parameter[literal["eStart=["]]] assign[member[.temp], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=indexEndCondition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=describe, postfix_operators=[], prefix_operators=[], qualifier=indexEndCondition, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null"))] call[sb.append, parameter[literal["eEnd=["]]] assign[member[.temp], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=nonIndexJoinCondition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=describe, postfix_operators=[], prefix_operators=[], qualifier=nonIndexJoinCondition, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null"))] call[sb.append, parameter[literal["eAnd=["]]] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[describe] operator[SEP] identifier[Session] identifier[session] operator[SEP] { identifier[StringBuffer] identifier[sb] operator[SEP] identifier[String] identifier[temp] operator[SEP] identifier[Index] identifier[index] operator[SEP] identifier[Index] identifier[primaryIndex] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[primaryKey] operator[SEP] Keyword[boolean] identifier[hidden] operator[SEP] Keyword[boolean] identifier[fullScan] operator[SEP] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[=] identifier[rangeIndex] operator[SEP] identifier[primaryIndex] operator[=] identifier[rangeTable] operator[SEP] identifier[getPrimaryIndex] operator[SEP] operator[SEP] operator[SEP] identifier[primaryKey] operator[=] identifier[rangeTable] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] operator[SEP] identifier[hidden] operator[=] literal[boolean] operator[SEP] identifier[fullScan] operator[=] operator[SEP] identifier[indexCondition] operator[==] Other[null] operator[&&] identifier[indexEndCondition] operator[==] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] Other[null] operator[SEP] { identifier[index] operator[=] identifier[primaryIndex] operator[SEP] } Keyword[if] operator[SEP] identifier[index] operator[==] identifier[primaryIndex] operator[&&] identifier[primaryKey] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[hidden] operator[=] literal[boolean] operator[SEP] identifier[fullScan] operator[=] literal[boolean] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] Keyword[super] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[rangeTable] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tableAlias] operator[!=] Other[null] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[tableAlias] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[fullScan] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[index] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[index] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[index] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[hidden] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] identifier[temp] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[isLeftJoin] operator[SEP] { identifier[temp] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[isRightJoin] operator[SEP] { identifier[temp] operator[=] literal[String] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[isRightJoin] operator[SEP] { identifier[temp] operator[=] literal[String] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[temp] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[temp] operator[=] identifier[indexCondition] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[indexCondition] operator[SEP] identifier[describe] operator[SEP] identifier[session] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[findFirstExpressions] operator[!=] Other[null] operator[SEP] { identifier[StringBuffer] identifier[sbt] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[multiColumnCount] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[sbt] operator[SEP] identifier[append] operator[SEP] identifier[findFirstExpressions] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[describe] operator[SEP] identifier[session] operator[SEP] operator[SEP] operator[SEP] } identifier[temp] operator[=] identifier[sbt] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[temp] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[temp] operator[=] identifier[indexEndCondition] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[indexEndCondition] operator[SEP] identifier[describe] operator[SEP] identifier[session] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[temp] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[temp] operator[=] identifier[nonIndexJoinCondition] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[nonIndexJoinCondition] operator[SEP] identifier[describe] operator[SEP] identifier[session] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[temp] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static void getXMLCMCLockType(LockType[] lockType, Method[] ejbMethods, Session sessionBean) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "getXMLCMCLockType: " + sessionBean.getEjbClassName() + " methods = " + Arrays.toString(ejbMethods)); //F743-7027.1 // Create an array of ints that will hold the highest priority // style of <lock> stanza configured for each method. The priority // from lowest to highest is as follows: // // 1 - style one is the case where method name is "*" which indicates // a lock type value configured for all methods of the singleton SB. // 2 - style two is the case where method name is specified, but not the // method parameters. This must override any style 1 configuration. // 3 - style three is the case where both method name and parameters are specified. // This style is required by spec to override any style 1 or 2 configured for the bean. int numberOfEjbMethods = ejbMethods.length; //F743-7027CodRev int[] highestStyleOnMethod = new int[numberOfEjbMethods]; //F743-7027CodRev // Get the list of WCCM ConcurrentMethod objects configured for this // singleton session bean and its enterprise bean name. There is one ConcurrentMethod // object created for each <lock> stanza that exists in DD. String enterpriseBeanName = sessionBean.getName(); //F00743.9717 List<ConcurrentMethod> cmcMethodList = sessionBean.getConcurrentMethods(); // For each of WCCM ConcurrentMethod objects, determine which EJB methods this // ConcurrentMethod object applies to and set the lock type in the lockType array // passed to this method by the caller. int numberOfCmcMethods = cmcMethodList.size(); //F743-7027CodRev for (int i = 0; i < numberOfCmcMethods; i++) //F743-7027CodRev { // Get the WCCM ConcurrentLockType, NamedMethod, and MethodParams objects // from the WCCM ConcurrentMethod object being processed in this iteration. //F00743.9717 ConcurrentMethod cmcMethod = cmcMethodList.get(i); int cmcLockType = cmcMethod.getLockTypeValue(); // Process lock type if DD provided one for this ConcurrentMethod object. if (cmcLockType != ConcurrentMethod.LOCK_TYPE_UNSPECIFIED) { NamedMethod namedMethod = cmcMethod.getMethod(); List<String> parms = namedMethod.getMethodParamList(); // Map the ConcurrentLockType object to the corresponding javax.ejb.LockType value. // Assumption here is WCCM parser error occurs and application does not install // if invalid value was coded (something other than Read or Write). LockType methodLockType = null; //F00743.9717 if (cmcLockType == ConcurrentMethod.LOCK_TYPE_READ) { methodLockType = LockType.READ; } else if (cmcLockType == ConcurrentMethod.LOCK_TYPE_WRITE) { methodLockType = LockType.WRITE; } // Now determine whether ConcurrentMethod is a style 1, 2, or 3 configuration // and update lockType array with method lock type as appropriate. String cmcMethodName = namedMethod.getMethodName().trim(); if (isTraceOn && tc.isDebugEnabled()) //F743-7027.1 { Tr.debug(tc, cmcMethodName + " LockType = " + methodLockType); //F743-7027.1 } if (cmcMethodName.equals("*")) { // style type 1 -- update all entries in lockType array that was not // previously set by either a style 2 or 3 configuration. // The EJB spec is silent on whether more than one style 1 can be specified // for the same singleton session bean. Our assumption is the last style 1 is used. for (int j = 0; j < numberOfEjbMethods; ++j) //F743-7027CodRev { Method m = ejbMethods[j]; if (highestStyleOnMethod[j] <= 1) { if (isTraceOn && tc.isDebugEnabled()) trace(m, enterpriseBeanName, "Style 1 - replacing " + lockType[j] + " lock type with " + methodLockType); lockType[j] = methodLockType; highestStyleOnMethod[j] = 1; } } } else if (parms == null) { // style type 2 -- update all entries in lockType array for a // method with matching method name that was not previously // set by a style 3 configuration. // The EJB spec is silent on whether more than one style 2 can be specified // for the same method. Our assumption is the last style 2 is used. for (int j = 0; j < numberOfEjbMethods; ++j) //F743-7027CodRev { if (highestStyleOnMethod[j] <= 2) { Method m = ejbMethods[j]; String methodName = m.getName(); //F743-7027.1 if (cmcMethodName.equals(methodName)) //F743-7027.1 { if (isTraceOn && tc.isDebugEnabled()) trace(m, enterpriseBeanName, "Style 2 - replacing " + lockType[j] + " lock type with " + methodLockType); lockType[j] = methodLockType; highestStyleOnMethod[j] = 2; } } } } else { // style type 3 -- update only the lockType array entry with a // matching method signature. // The EJB spec is silent on whether more than one style 3 can be specified // for the same method signature. Our assumption is the last style 3 is used. Method style3Method = DDUtil.findMethod(namedMethod, ejbMethods); if (style3Method != null) //F743-7027.1 { for (int j = 0; j < numberOfEjbMethods; ++j) //F743-7027CodRev { Method m = ejbMethods[j]; if (style3Method.equals(m)) { if (isTraceOn && tc.isDebugEnabled()) trace(m, enterpriseBeanName, "Style 3 - replacing " + lockType[j] + " lock type with " + methodLockType); lockType[j] = methodLockType; highestStyleOnMethod[j] = 3; // break out of for loop since there can only be 1 EJB method that // matches the signature. break; } } } } } } // end for if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "getXMLCMCLockType: " + sessionBean.getEjbClassName(), Arrays.toString(lockType)); //F743-7027.1 }
class class_name[name] begin[{] method[getXMLCMCLockType, return_type[void], modifier[public static], parameter[lockType, ejbMethods, sessionBean]] begin[{] local_variable[type[boolean], isTraceOn] if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], binary_operation[binary_operation[binary_operation[literal["getXMLCMCLockType: "], +, call[sessionBean.getEjbClassName, parameter[]]], +, literal[" methods = "]], +, call[Arrays.toString, parameter[member[.ejbMethods]]]]]] else begin[{] None end[}] local_variable[type[int], numberOfEjbMethods] local_variable[type[int], highestStyleOnMethod] local_variable[type[String], enterpriseBeanName] local_variable[type[List], cmcMethodList] local_variable[type[int], numberOfCmcMethods] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=cmcMethodList, selectors=[], type_arguments=None), name=cmcMethod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConcurrentMethod, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLockTypeValue, postfix_operators=[], prefix_operators=[], qualifier=cmcMethod, selectors=[], type_arguments=None), name=cmcLockType)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cmcLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LOCK_TYPE_UNSPECIFIED, postfix_operators=[], prefix_operators=[], qualifier=ConcurrentMethod, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=cmcMethod, selectors=[], type_arguments=None), name=namedMethod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NamedMethod, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMethodParamList, postfix_operators=[], prefix_operators=[], qualifier=namedMethod, selectors=[], type_arguments=None), name=parms)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=methodLockType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LockType, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cmcLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LOCK_TYPE_READ, postfix_operators=[], prefix_operators=[], qualifier=ConcurrentMethod, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cmcLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LOCK_TYPE_WRITE, postfix_operators=[], prefix_operators=[], qualifier=ConcurrentMethod, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=methodLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=WRITE, postfix_operators=[], prefix_operators=[], qualifier=LockType, selectors=[])), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=methodLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=READ, postfix_operators=[], prefix_operators=[], qualifier=LockType, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMethodName, postfix_operators=[], prefix_operators=[], qualifier=namedMethod, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=cmcMethodName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cmcMethodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" LockType = "), operator=+), operandr=MemberReference(member=methodLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=cmcMethodName, selectors=[], type_arguments=None), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=namedMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ejbMethods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findMethod, postfix_operators=[], prefix_operators=[], qualifier=DDUtil, selectors=[], type_arguments=None), name=style3Method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=style3Method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=ejbMethods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=style3Method, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enterpriseBeanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Style 3 - replacing "), operandr=MemberReference(member=lockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" lock type with "), operator=+), operandr=MemberReference(member=methodLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=methodLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=highestStyleOnMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberOfEjbMethods, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=highestStyleOnMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=ejbMethods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), name=methodName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=cmcMethodName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enterpriseBeanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Style 2 - replacing "), operandr=MemberReference(member=lockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" lock type with "), operator=+), operandr=MemberReference(member=methodLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=methodLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=highestStyleOnMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberOfEjbMethods, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=ejbMethods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=highestStyleOnMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enterpriseBeanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Style 1 - replacing "), operandr=MemberReference(member=lockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" lock type with "), operator=+), operandr=MemberReference(member=methodLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=methodLockType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=highestStyleOnMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberOfEjbMethods, 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=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, 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=numberOfCmcMethods, 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) if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], binary_operation[literal["getXMLCMCLockType: "], +, call[sessionBean.getEjbClassName, parameter[]]], call[Arrays.toString, parameter[member[.lockType]]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[getXMLCMCLockType] operator[SEP] identifier[LockType] operator[SEP] operator[SEP] identifier[lockType] , identifier[Method] operator[SEP] operator[SEP] identifier[ejbMethods] , identifier[Session] identifier[sessionBean] operator[SEP] { Keyword[final] Keyword[boolean] identifier[isTraceOn] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[sessionBean] operator[SEP] identifier[getEjbClassName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[ejbMethods] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numberOfEjbMethods] operator[=] identifier[ejbMethods] operator[SEP] identifier[length] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[highestStyleOnMethod] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[numberOfEjbMethods] operator[SEP] operator[SEP] identifier[String] identifier[enterpriseBeanName] operator[=] identifier[sessionBean] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[ConcurrentMethod] operator[>] identifier[cmcMethodList] operator[=] identifier[sessionBean] operator[SEP] identifier[getConcurrentMethods] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[numberOfCmcMethods] operator[=] identifier[cmcMethodList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numberOfCmcMethods] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[ConcurrentMethod] identifier[cmcMethod] operator[=] identifier[cmcMethodList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[cmcLockType] operator[=] identifier[cmcMethod] operator[SEP] identifier[getLockTypeValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmcLockType] operator[!=] identifier[ConcurrentMethod] operator[SEP] identifier[LOCK_TYPE_UNSPECIFIED] operator[SEP] { identifier[NamedMethod] identifier[namedMethod] operator[=] identifier[cmcMethod] operator[SEP] identifier[getMethod] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[parms] operator[=] identifier[namedMethod] operator[SEP] identifier[getMethodParamList] operator[SEP] operator[SEP] operator[SEP] identifier[LockType] identifier[methodLockType] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[cmcLockType] operator[==] identifier[ConcurrentMethod] operator[SEP] identifier[LOCK_TYPE_READ] operator[SEP] { identifier[methodLockType] operator[=] identifier[LockType] operator[SEP] identifier[READ] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[cmcLockType] operator[==] identifier[ConcurrentMethod] operator[SEP] identifier[LOCK_TYPE_WRITE] operator[SEP] { identifier[methodLockType] operator[=] identifier[LockType] operator[SEP] identifier[WRITE] operator[SEP] } identifier[String] identifier[cmcMethodName] operator[=] identifier[namedMethod] operator[SEP] identifier[getMethodName] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[cmcMethodName] operator[+] literal[String] operator[+] identifier[methodLockType] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[cmcMethodName] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[numberOfEjbMethods] operator[SEP] operator[++] identifier[j] operator[SEP] { identifier[Method] identifier[m] operator[=] identifier[ejbMethods] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[highestStyleOnMethod] operator[SEP] identifier[j] operator[SEP] operator[<=] Other[1] operator[SEP] { Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[m] , identifier[enterpriseBeanName] , literal[String] operator[+] identifier[lockType] operator[SEP] identifier[j] operator[SEP] operator[+] literal[String] operator[+] identifier[methodLockType] operator[SEP] operator[SEP] identifier[lockType] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[methodLockType] operator[SEP] identifier[highestStyleOnMethod] operator[SEP] identifier[j] operator[SEP] operator[=] Other[1] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[parms] operator[==] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[numberOfEjbMethods] operator[SEP] operator[++] identifier[j] operator[SEP] { Keyword[if] operator[SEP] identifier[highestStyleOnMethod] operator[SEP] identifier[j] operator[SEP] operator[<=] Other[2] operator[SEP] { identifier[Method] identifier[m] operator[=] identifier[ejbMethods] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[String] identifier[methodName] operator[=] identifier[m] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmcMethodName] operator[SEP] identifier[equals] operator[SEP] identifier[methodName] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[m] , identifier[enterpriseBeanName] , literal[String] operator[+] identifier[lockType] operator[SEP] identifier[j] operator[SEP] operator[+] literal[String] operator[+] identifier[methodLockType] operator[SEP] operator[SEP] identifier[lockType] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[methodLockType] operator[SEP] identifier[highestStyleOnMethod] operator[SEP] identifier[j] operator[SEP] operator[=] Other[2] operator[SEP] } } } } Keyword[else] { identifier[Method] identifier[style3Method] operator[=] identifier[DDUtil] operator[SEP] identifier[findMethod] operator[SEP] identifier[namedMethod] , identifier[ejbMethods] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[style3Method] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[numberOfEjbMethods] operator[SEP] operator[++] identifier[j] operator[SEP] { identifier[Method] identifier[m] operator[=] identifier[ejbMethods] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[style3Method] operator[SEP] identifier[equals] operator[SEP] identifier[m] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[m] , identifier[enterpriseBeanName] , literal[String] operator[+] identifier[lockType] operator[SEP] identifier[j] operator[SEP] operator[+] literal[String] operator[+] identifier[methodLockType] operator[SEP] operator[SEP] identifier[lockType] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[methodLockType] operator[SEP] identifier[highestStyleOnMethod] operator[SEP] identifier[j] operator[SEP] operator[=] Other[3] operator[SEP] Keyword[break] operator[SEP] } } } } } } Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[sessionBean] operator[SEP] identifier[getEjbClassName] operator[SEP] operator[SEP] , identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[lockType] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isRestSSLAuthenticationEnabled(Configuration sslConfig) { checkNotNull(sslConfig, "sslConfig"); return isRestSSLEnabled(sslConfig) && sslConfig.getBoolean(SecurityOptions.SSL_REST_AUTHENTICATION_ENABLED); }
class class_name[name] begin[{] method[isRestSSLAuthenticationEnabled, return_type[type[boolean]], modifier[public static], parameter[sslConfig]] begin[{] call[.checkNotNull, parameter[member[.sslConfig], literal["sslConfig"]]] return[binary_operation[call[.isRestSSLEnabled, parameter[member[.sslConfig]]], &&, call[sslConfig.getBoolean, parameter[member[SecurityOptions.SSL_REST_AUTHENTICATION_ENABLED]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isRestSSLAuthenticationEnabled] operator[SEP] identifier[Configuration] identifier[sslConfig] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[sslConfig] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[isRestSSLEnabled] operator[SEP] identifier[sslConfig] operator[SEP] operator[&&] identifier[sslConfig] operator[SEP] identifier[getBoolean] operator[SEP] identifier[SecurityOptions] operator[SEP] identifier[SSL_REST_AUTHENTICATION_ENABLED] operator[SEP] operator[SEP] }
public ApiResponse<ApiSuccessResponse> setAgentStateReadyWithHttpInfo(ReadyData readyData) throws ApiException { com.squareup.okhttp.Call call = setAgentStateReadyValidateBeforeCall(readyData, null, null); Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
class class_name[name] begin[{] method[setAgentStateReadyWithHttpInfo, return_type[type[ApiResponse]], modifier[public], parameter[readyData]] 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[ApiSuccessResponse] operator[>] identifier[setAgentStateReadyWithHttpInfo] operator[SEP] identifier[ReadyData] identifier[readyData] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[setAgentStateReadyValidateBeforeCall] operator[SEP] identifier[readyData] , Other[null] , Other[null] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[ApiSuccessResponse] 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 Slice wrappedLongArray(long[] array, int offset, int length) { if (length == 0) { return EMPTY_SLICE; } return new Slice(array, offset, length); }
class class_name[name] begin[{] method[wrappedLongArray, return_type[type[Slice]], modifier[public static], parameter[array, offset, length]] begin[{] if[binary_operation[member[.length], ==, literal[0]]] begin[{] return[member[.EMPTY_SLICE]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, 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=Slice, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Slice] identifier[wrappedLongArray] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[array] , Keyword[int] identifier[offset] , Keyword[int] identifier[length] operator[SEP] { Keyword[if] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[EMPTY_SLICE] operator[SEP] } Keyword[return] Keyword[new] identifier[Slice] operator[SEP] identifier[array] , identifier[offset] , identifier[length] operator[SEP] operator[SEP] }
public int count(Pair<T> obj) { long index = getIndex(obj); int count = counts.get(index); count++; counts.put(index, count); sum++; return count; }
class class_name[name] begin[{] method[count, return_type[type[int]], modifier[public], parameter[obj]] begin[{] local_variable[type[long], index] local_variable[type[int], count] member[.count] call[counts.put, parameter[member[.index], member[.count]]] member[.sum] return[member[.count]] end[}] END[}]
Keyword[public] Keyword[int] identifier[count] operator[SEP] identifier[Pair] operator[<] identifier[T] operator[>] identifier[obj] operator[SEP] { Keyword[long] identifier[index] operator[=] identifier[getIndex] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[int] identifier[count] operator[=] identifier[counts] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[count] operator[++] operator[SEP] identifier[counts] operator[SEP] identifier[put] operator[SEP] identifier[index] , identifier[count] operator[SEP] operator[SEP] identifier[sum] operator[++] operator[SEP] Keyword[return] identifier[count] operator[SEP] }
public void setTraceIds(java.util.Collection<String> traceIds) { if (traceIds == null) { this.traceIds = null; return; } this.traceIds = new java.util.ArrayList<String>(traceIds); }
class class_name[name] begin[{] method[setTraceIds, return_type[void], modifier[public], parameter[traceIds]] begin[{] if[binary_operation[member[.traceIds], ==, literal[null]]] begin[{] assign[THIS[member[None.traceIds]], literal[null]] return[None] else begin[{] None end[}] assign[THIS[member[None.traceIds]], ClassCreator(arguments=[MemberReference(member=traceIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setTraceIds] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[traceIds] operator[SEP] { Keyword[if] operator[SEP] identifier[traceIds] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[traceIds] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[traceIds] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[traceIds] operator[SEP] operator[SEP] }
public List<ImpersonationToken> getImpersonationTokens(Object userIdOrUsername, ImpersonationState state) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm() .withParam("state", state) .withParam(PER_PAGE_PARAM, getDefaultPerPage()); Response response = get(Response.Status.OK, formData.asMap(), "users", getUserIdOrUsername(userIdOrUsername), "impersonation_tokens"); return (response.readEntity(new GenericType<List<ImpersonationToken>>() {})); }
class class_name[name] begin[{] method[getImpersonationTokens, return_type[type[List]], modifier[public], parameter[userIdOrUsername, state]] begin[{] local_variable[type[GitLabApiForm], formData] local_variable[type[Response], response] return[call[response.readEntity, parameter[ClassCreator(arguments=[], body=[], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ImpersonationToken, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=GenericType, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[ImpersonationToken] operator[>] identifier[getImpersonationTokens] operator[SEP] identifier[Object] identifier[userIdOrUsername] , identifier[ImpersonationState] identifier[state] operator[SEP] Keyword[throws] identifier[GitLabApiException] { identifier[GitLabApiForm] identifier[formData] operator[=] Keyword[new] identifier[GitLabApiForm] operator[SEP] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] literal[String] , identifier[state] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] identifier[PER_PAGE_PARAM] , identifier[getDefaultPerPage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Response] identifier[response] operator[=] identifier[get] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[OK] , identifier[formData] operator[SEP] identifier[asMap] operator[SEP] operator[SEP] , literal[String] , identifier[getUserIdOrUsername] operator[SEP] identifier[userIdOrUsername] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[response] operator[SEP] identifier[readEntity] operator[SEP] Keyword[new] identifier[GenericType] operator[<] identifier[List] operator[<] identifier[ImpersonationToken] operator[>] operator[>] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] operator[SEP] }
public UnspentTransactionOutput build(String txHash, int height, String scriptBytesHex, int index, long value) throws Exception { byte[] utxoScriptBytes = ByteUtil.fromHex(scriptBytesHex); ScriptOutput script = ScriptOutput.fromScriptBytes(utxoScriptBytes); OutPoint outPoint = OutPoint.fromString(txHash + ":" + index); return new UnspentTransactionOutput(outPoint, height, value, script); }
class class_name[name] begin[{] method[build, return_type[type[UnspentTransactionOutput]], modifier[public], parameter[txHash, height, scriptBytesHex, index, value]] begin[{] local_variable[type[byte], utxoScriptBytes] local_variable[type[ScriptOutput], script] local_variable[type[OutPoint], outPoint] return[ClassCreator(arguments=[MemberReference(member=outPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=script, 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=UnspentTransactionOutput, sub_type=None))] end[}] END[}]
Keyword[public] identifier[UnspentTransactionOutput] identifier[build] operator[SEP] identifier[String] identifier[txHash] , Keyword[int] identifier[height] , identifier[String] identifier[scriptBytesHex] , Keyword[int] identifier[index] , Keyword[long] identifier[value] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[byte] operator[SEP] operator[SEP] identifier[utxoScriptBytes] operator[=] identifier[ByteUtil] operator[SEP] identifier[fromHex] operator[SEP] identifier[scriptBytesHex] operator[SEP] operator[SEP] identifier[ScriptOutput] identifier[script] operator[=] identifier[ScriptOutput] operator[SEP] identifier[fromScriptBytes] operator[SEP] identifier[utxoScriptBytes] operator[SEP] operator[SEP] identifier[OutPoint] identifier[outPoint] operator[=] identifier[OutPoint] operator[SEP] identifier[fromString] operator[SEP] identifier[txHash] operator[+] literal[String] operator[+] identifier[index] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[UnspentTransactionOutput] operator[SEP] identifier[outPoint] , identifier[height] , identifier[value] , identifier[script] operator[SEP] operator[SEP] }
public static void closeQuietly(Closeable closeable) { try { if (closeable != null) { closeable.close(); } } catch (IOException e) { LOGGER.log(Level.FINE, e.getMessage(), e); } }
class class_name[name] begin[{] method[closeQuietly, return_type[void], modifier[public static], parameter[closeable]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=closeable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=closeable, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[closeQuietly] operator[SEP] identifier[Closeable] identifier[closeable] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[closeable] operator[!=] Other[null] operator[SEP] { identifier[closeable] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private void updateInstructionList(InstructionModel model) { RouteProgress routeProgress = model.retrieveProgress(); boolean isListShowing = instructionListLayout.getVisibility() == VISIBLE; rvInstructions.stopScroll(); instructionListAdapter.updateBannerListWith(routeProgress, isListShowing); }
class class_name[name] begin[{] method[updateInstructionList, return_type[void], modifier[private], parameter[model]] begin[{] local_variable[type[RouteProgress], routeProgress] local_variable[type[boolean], isListShowing] call[rvInstructions.stopScroll, parameter[]] call[instructionListAdapter.updateBannerListWith, parameter[member[.routeProgress], member[.isListShowing]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[updateInstructionList] operator[SEP] identifier[InstructionModel] identifier[model] operator[SEP] { identifier[RouteProgress] identifier[routeProgress] operator[=] identifier[model] operator[SEP] identifier[retrieveProgress] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isListShowing] operator[=] identifier[instructionListLayout] operator[SEP] identifier[getVisibility] operator[SEP] operator[SEP] operator[==] identifier[VISIBLE] operator[SEP] identifier[rvInstructions] operator[SEP] identifier[stopScroll] operator[SEP] operator[SEP] operator[SEP] identifier[instructionListAdapter] operator[SEP] identifier[updateBannerListWith] operator[SEP] identifier[routeProgress] , identifier[isListShowing] operator[SEP] operator[SEP] }