code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static String relativize(final String path, final File parentDir, final boolean removeInitialFileSep) { // Check sanity Validate.notNull(path, "path"); Validate.notNull(parentDir, "parentDir"); final String basedirPath = FileSystemUtilities.getCanonicalPath(parentDir); String toReturn = path; // Compare case insensitive if (path.toLowerCase().startsWith(basedirPath.toLowerCase())) { toReturn = path.substring(basedirPath.length()); } // Handle whitespace in the argument. return removeInitialFileSep && toReturn.startsWith(File.separator) ? toReturn.substring(File.separator.length()) : toReturn; }
class class_name[name] begin[{] method[relativize, return_type[type[String]], modifier[public static], parameter[path, parentDir, removeInitialFileSep]] begin[{] call[Validate.notNull, parameter[member[.path], literal["path"]]] call[Validate.notNull, parameter[member[.parentDir], literal["parentDir"]]] local_variable[type[String], basedirPath] local_variable[type[String], toReturn] if[call[path.toLowerCase, parameter[]]] begin[{] assign[member[.toReturn], call[path.substring, parameter[call[basedirPath.length, parameter[]]]]] else begin[{] None end[}] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=removeInitialFileSep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=File, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=toReturn, selectors=[], type_arguments=None), operator=&&), if_false=MemberReference(member=toReturn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=File.separator, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=toReturn, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[relativize] operator[SEP] Keyword[final] identifier[String] identifier[path] , Keyword[final] identifier[File] identifier[parentDir] , Keyword[final] Keyword[boolean] identifier[removeInitialFileSep] operator[SEP] { identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[path] , literal[String] operator[SEP] operator[SEP] identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[parentDir] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[basedirPath] operator[=] identifier[FileSystemUtilities] operator[SEP] identifier[getCanonicalPath] operator[SEP] identifier[parentDir] operator[SEP] operator[SEP] identifier[String] identifier[toReturn] operator[=] identifier[path] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[basedirPath] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[toReturn] operator[=] identifier[path] operator[SEP] identifier[substring] operator[SEP] identifier[basedirPath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[removeInitialFileSep] operator[&&] identifier[toReturn] operator[SEP] identifier[startsWith] operator[SEP] identifier[File] operator[SEP] identifier[separator] operator[SEP] operator[?] identifier[toReturn] operator[SEP] identifier[substring] operator[SEP] identifier[File] operator[SEP] identifier[separator] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[toReturn] operator[SEP] }
public static String from(int state) { switch (state) { case Bundle.ACTIVE: return ACTIVE; case Bundle.INSTALLED: return INSTALLED; case Bundle.RESOLVED: return RESOLVED; case Bundle.STARTING: return STARTING; case Bundle.STOPPING: return STOPPING; case Bundle.UNINSTALLED: return UNINSTALLED; default: return "UNKNOWN (" + Integer.toString(state) + ")"; } }
class class_name[name] begin[{] method[from, return_type[type[String]], modifier[public static], parameter[state]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=ACTIVE, postfix_operators=[], prefix_operators=[], qualifier=Bundle, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=ACTIVE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=INSTALLED, postfix_operators=[], prefix_operators=[], qualifier=Bundle, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=INSTALLED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=RESOLVED, postfix_operators=[], prefix_operators=[], qualifier=Bundle, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=RESOLVED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=STARTING, postfix_operators=[], prefix_operators=[], qualifier=Bundle, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=STARTING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=STOPPING, postfix_operators=[], prefix_operators=[], qualifier=Bundle, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=STOPPING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=[MemberReference(member=UNINSTALLED, postfix_operators=[], prefix_operators=[], qualifier=Bundle, selectors=[])], statements=[ReturnStatement(expression=MemberReference(member=UNINSTALLED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UNKNOWN ("), operandr=MethodInvocation(arguments=[MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+), label=None)])], expression=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[from] operator[SEP] Keyword[int] identifier[state] operator[SEP] { Keyword[switch] operator[SEP] identifier[state] operator[SEP] { Keyword[case] identifier[Bundle] operator[SEP] identifier[ACTIVE] operator[:] Keyword[return] identifier[ACTIVE] operator[SEP] Keyword[case] identifier[Bundle] operator[SEP] identifier[INSTALLED] operator[:] Keyword[return] identifier[INSTALLED] operator[SEP] Keyword[case] identifier[Bundle] operator[SEP] identifier[RESOLVED] operator[:] Keyword[return] identifier[RESOLVED] operator[SEP] Keyword[case] identifier[Bundle] operator[SEP] identifier[STARTING] operator[:] Keyword[return] identifier[STARTING] operator[SEP] Keyword[case] identifier[Bundle] operator[SEP] identifier[STOPPING] operator[:] Keyword[return] identifier[STOPPING] operator[SEP] Keyword[case] identifier[Bundle] operator[SEP] identifier[UNINSTALLED] operator[:] Keyword[return] identifier[UNINSTALLED] operator[SEP] Keyword[default] operator[:] Keyword[return] literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[state] operator[SEP] operator[+] literal[String] operator[SEP] } }
public Range addMember(Resource first, Resource... rest) throws IllegalArgumentException { if (this.members == null) { this.members = new ArrayList<>(); } List<Resource> membersToAdd = Lists.asList(first, rest); membersToAdd.forEach(this::checkMember); this.members.addAll(membersToAdd); return this; }
class class_name[name] begin[{] method[addMember, return_type[type[Range]], modifier[public], parameter[first, rest]] begin[{] if[binary_operation[THIS[member[None.members]], ==, literal[null]]] begin[{] assign[THIS[member[None.members]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] local_variable[type[List], membersToAdd] call[membersToAdd.forEach, parameter[MethodReference(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), method=MemberReference(member=checkMember, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]] THIS[member[None.members]call[None.addAll, parameter[member[.membersToAdd]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Range] identifier[addMember] operator[SEP] identifier[Resource] identifier[first] , identifier[Resource] operator[...] identifier[rest] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[members] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[members] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[Resource] operator[>] identifier[membersToAdd] operator[=] identifier[Lists] operator[SEP] identifier[asList] operator[SEP] identifier[first] , identifier[rest] operator[SEP] operator[SEP] identifier[membersToAdd] operator[SEP] identifier[forEach] operator[SEP] Keyword[this] operator[::] identifier[checkMember] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[members] operator[SEP] identifier[addAll] operator[SEP] identifier[membersToAdd] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
protected SubscriptionMessage generateGenericSubscriptionMessage() { SubscriptionMessage subMessage = new SubscriptionMessage(); subMessage.setRules(this.rules); subMessage.setMessageType(SubscriptionMessage.SUBSCRIPTION_MESSAGE_ID); return subMessage; }
class class_name[name] begin[{] method[generateGenericSubscriptionMessage, return_type[type[SubscriptionMessage]], modifier[protected], parameter[]] begin[{] local_variable[type[SubscriptionMessage], subMessage] call[subMessage.setRules, parameter[THIS[member[None.rules]]]] call[subMessage.setMessageType, parameter[member[SubscriptionMessage.SUBSCRIPTION_MESSAGE_ID]]] return[member[.subMessage]] end[}] END[}]
Keyword[protected] identifier[SubscriptionMessage] identifier[generateGenericSubscriptionMessage] operator[SEP] operator[SEP] { identifier[SubscriptionMessage] identifier[subMessage] operator[=] Keyword[new] identifier[SubscriptionMessage] operator[SEP] operator[SEP] operator[SEP] identifier[subMessage] operator[SEP] identifier[setRules] operator[SEP] Keyword[this] operator[SEP] identifier[rules] operator[SEP] operator[SEP] identifier[subMessage] operator[SEP] identifier[setMessageType] operator[SEP] identifier[SubscriptionMessage] operator[SEP] identifier[SUBSCRIPTION_MESSAGE_ID] operator[SEP] operator[SEP] Keyword[return] identifier[subMessage] operator[SEP] }
private void loadAllParts() throws IOException { // Get first boundary String line = _in.readLine(); if (!line.equals(_boundary)) { log.warn(line); throw new IOException("Missing initial multi part boundary"); } // Read each part while (!_lastPart) { // Read Part headers Part part = new Part(); String content_disposition=null; while ((line=_in.readLine())!=null) { // If blank line, end of part headers if (line.length()==0) break; if(log.isDebugEnabled())log.debug("LINE="+line); // place part header key and value in map int c = line.indexOf(':',0); if (c>0) { String key = line.substring(0,c).trim().toLowerCase(); String value = line.substring(c+1,line.length()).trim(); String ev = (String) part._headers.get(key); part._headers.put(key,(ev!=null)?(ev+';'+value):value); if(log.isDebugEnabled())log.debug(key+": "+value); if (key.equals("content-disposition")) content_disposition=value; } } // Extract content-disposition boolean form_data=false; if (content_disposition==null) { throw new IOException("Missing content-disposition"); } StringTokenizer tok = new StringTokenizer(content_disposition,";"); while (tok.hasMoreTokens()) { String t = tok.nextToken().trim(); String tl = t.toLowerCase(); if (t.startsWith("form-data")) form_data=true; else if (tl.startsWith("name=")) part._name=value(t); else if (tl.startsWith("filename=")) part._filename=value(t); } // Check disposition if (!form_data) { log.warn("Non form-data part in multipart/form-data"); continue; } if (part._name==null || part._name.length()==0) { log.warn("Part with no name in multipart/form-data"); continue; } if(log.isDebugEnabled())log.debug("name="+part._name); if(log.isDebugEnabled())log.debug("filename="+part._filename); _partMap.add(part._name,part); part._data=readBytes(); } }
class class_name[name] begin[{] method[loadAllParts, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[String], line] if[call[line.equals, parameter[member[._boundary]]]] begin[{] call[log.warn, parameter[member[.line]]] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing initial multi part boundary")], 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[}] while[member[._lastPart]] begin[{] local_variable[type[Part], part] local_variable[type[String], content_disposition] while[binary_operation[assign[member[.line], call[_in.readLine, parameter[]]], !=, literal[null]]] begin[{] if[binary_operation[call[line.length, parameter[]], ==, literal[0]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[binary_operation[literal["LINE="], +, member[.line]]]] else begin[{] None end[}] local_variable[type[int], c] if[binary_operation[member[.c], >, literal[0]]] begin[{] local_variable[type[String], key] local_variable[type[String], value] local_variable[type[String], ev] call[part._headers.put, parameter[member[.key], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=ev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=';'), operator=+), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[binary_operation[binary_operation[member[.key], +, literal[": "]], +, member[.value]]]] else begin[{] None end[}] if[call[key.equals, parameter[literal["content-disposition"]]]] begin[{] assign[member[.content_disposition], member[.value]] else begin[{] None end[}] else begin[{] None end[}] end[}] local_variable[type[boolean], form_data] if[binary_operation[member[.content_disposition], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing content-disposition")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[StringTokenizer], tok] while[call[tok.hasMoreTokens, parameter[]]] begin[{] local_variable[type[String], t] local_variable[type[String], tl] if[call[t.startsWith, parameter[literal["form-data"]]]] begin[{] assign[member[.form_data], literal[true]] else begin[{] if[call[tl.startsWith, parameter[literal["name="]]]] begin[{] assign[member[part._name], call[.value, parameter[member[.t]]]] else begin[{] if[call[tl.startsWith, parameter[literal["filename="]]]] begin[{] assign[member[part._filename], call[.value, parameter[member[.t]]]] else begin[{] None end[}] end[}] end[}] end[}] if[member[.form_data]] begin[{] call[log.warn, parameter[literal["Non form-data part in multipart/form-data"]]] ContinueStatement(goto=None, label=None) else begin[{] None end[}] if[binary_operation[binary_operation[member[part._name], ==, literal[null]], ||, binary_operation[call[part._name.length, parameter[]], ==, literal[0]]]] begin[{] call[log.warn, parameter[literal["Part with no name in multipart/form-data"]]] ContinueStatement(goto=None, label=None) else begin[{] None end[}] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[binary_operation[literal["name="], +, member[part._name]]]] else begin[{] None end[}] if[call[log.isDebugEnabled, parameter[]]] begin[{] call[log.debug, parameter[binary_operation[literal["filename="], +, member[part._filename]]]] else begin[{] None end[}] call[_partMap.add, parameter[member[part._name], member[.part]]] assign[member[part._data], call[.readBytes, parameter[]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[loadAllParts] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[line] operator[=] identifier[_in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[line] operator[SEP] identifier[equals] operator[SEP] identifier[_boundary] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] identifier[line] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] operator[!] identifier[_lastPart] operator[SEP] { identifier[Part] identifier[part] operator[=] Keyword[new] identifier[Part] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[content_disposition] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[_in] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[break] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[line] operator[SEP] operator[SEP] Keyword[int] identifier[c] operator[=] identifier[line] operator[SEP] identifier[indexOf] operator[SEP] literal[String] , Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[>] Other[0] operator[SEP] { identifier[String] identifier[key] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[c] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] identifier[c] operator[+] Other[1] , identifier[line] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[ev] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[part] operator[SEP] identifier[_headers] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[part] operator[SEP] identifier[_headers] operator[SEP] identifier[put] operator[SEP] identifier[key] , operator[SEP] identifier[ev] operator[!=] Other[null] operator[SEP] operator[?] operator[SEP] identifier[ev] operator[+] literal[String] operator[+] identifier[value] operator[SEP] operator[:] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] identifier[key] operator[+] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[content_disposition] operator[=] identifier[value] operator[SEP] } } Keyword[boolean] identifier[form_data] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[content_disposition] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[StringTokenizer] identifier[tok] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[content_disposition] , literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[tok] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[t] operator[=] identifier[tok] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[tl] operator[=] identifier[t] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[t] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[form_data] operator[=] literal[boolean] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[tl] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[part] operator[SEP] identifier[_name] operator[=] identifier[value] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[tl] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[part] operator[SEP] identifier[_filename] operator[=] identifier[value] operator[SEP] identifier[t] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[form_data] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[part] operator[SEP] identifier[_name] operator[==] Other[null] operator[||] identifier[part] operator[SEP] identifier[_name] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[part] operator[SEP] identifier[_name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[part] operator[SEP] identifier[_filename] operator[SEP] operator[SEP] identifier[_partMap] operator[SEP] identifier[add] operator[SEP] identifier[part] operator[SEP] identifier[_name] , identifier[part] operator[SEP] operator[SEP] identifier[part] operator[SEP] identifier[_data] operator[=] identifier[readBytes] operator[SEP] operator[SEP] operator[SEP] } }
public boolean unpackBoolean() throws IOException { byte b = readByte(); if (b == Code.FALSE) { return false; } else if (b == Code.TRUE) { return true; } throw unexpected("boolean", b); }
class class_name[name] begin[{] method[unpackBoolean, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[byte], b] if[binary_operation[member[.b], ==, member[Code.FALSE]]] begin[{] return[literal[false]] else begin[{] if[binary_operation[member[.b], ==, member[Code.TRUE]]] begin[{] return[literal[true]] else begin[{] None end[}] end[}] ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="boolean"), MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unexpected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[public] Keyword[boolean] identifier[unpackBoolean] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[byte] identifier[b] operator[=] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[==] identifier[Code] operator[SEP] identifier[FALSE] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[b] operator[==] identifier[Code] operator[SEP] identifier[TRUE] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[throw] identifier[unexpected] operator[SEP] literal[String] , identifier[b] operator[SEP] operator[SEP] }
private Action buildAction(String path) { Action action = (Action) ActionContext.getContext().getContextMap().get("dispatch_action"); if (null == action) { action = new Action(); String newPath = path; if (path.startsWith("?")) { newPath = getServletPath(ServletActionContext.getRequest()) + path; } action.path(newPath); } else { if (null != action.getClazz()) { Action newAction = actionBuilder.build(action.getClazz()); action.name(newAction.getName()).namespace(newAction.getNamespace()); } if (isBlank(action.getName())) { action.path(getServletPath(ServletActionContext.getRequest())); } } return action; }
class class_name[name] begin[{] method[buildAction, return_type[type[Action]], modifier[private], parameter[path]] begin[{] local_variable[type[Action], action] if[binary_operation[literal[null], ==, member[.action]]] begin[{] assign[member[.action], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Action, sub_type=None))] local_variable[type[String], newPath] if[call[path.startsWith, parameter[literal["?"]]]] begin[{] assign[member[.newPath], binary_operation[call[.getServletPath, parameter[call[ServletActionContext.getRequest, parameter[]]]], +, member[.path]]] else begin[{] None end[}] call[action.path, parameter[member[.newPath]]] else begin[{] if[binary_operation[literal[null], !=, call[action.getClazz, parameter[]]]] begin[{] local_variable[type[Action], newAction] call[action.name, parameter[call[newAction.getName, parameter[]]]] else begin[{] None end[}] if[call[.isBlank, parameter[call[action.getName, parameter[]]]]] begin[{] call[action.path, parameter[call[.getServletPath, parameter[call[ServletActionContext.getRequest, parameter[]]]]]] else begin[{] None end[}] end[}] return[member[.action]] end[}] END[}]
Keyword[private] identifier[Action] identifier[buildAction] operator[SEP] identifier[String] identifier[path] operator[SEP] { identifier[Action] identifier[action] operator[=] operator[SEP] identifier[Action] operator[SEP] identifier[ActionContext] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getContextMap] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[action] operator[SEP] { identifier[action] operator[=] Keyword[new] identifier[Action] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[newPath] operator[=] identifier[path] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[newPath] operator[=] identifier[getServletPath] operator[SEP] identifier[ServletActionContext] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] operator[+] identifier[path] operator[SEP] } identifier[action] operator[SEP] identifier[path] operator[SEP] identifier[newPath] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] Other[null] operator[!=] identifier[action] operator[SEP] identifier[getClazz] operator[SEP] operator[SEP] operator[SEP] { identifier[Action] identifier[newAction] operator[=] identifier[actionBuilder] operator[SEP] identifier[build] operator[SEP] identifier[action] operator[SEP] identifier[getClazz] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[action] operator[SEP] identifier[name] operator[SEP] identifier[newAction] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[namespace] operator[SEP] identifier[newAction] operator[SEP] identifier[getNamespace] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isBlank] operator[SEP] identifier[action] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[action] operator[SEP] identifier[path] operator[SEP] identifier[getServletPath] operator[SEP] identifier[ServletActionContext] operator[SEP] identifier[getRequest] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[action] operator[SEP] }
private List<JoinableResourceBundle> getBundlesFromName(List<String> names, List<JoinableResourceBundle> bundles) { List<JoinableResourceBundle> resultBundles = new ArrayList<>(); for (String name : names) { for (JoinableResourceBundle bundle : bundles) { if (bundle.getName().equals(name)) { resultBundles.add(bundle); } } } return resultBundles; }
class class_name[name] begin[{] method[getBundlesFromName, return_type[type[List]], modifier[private], parameter[names, bundles]] begin[{] local_variable[type[List], resultBundles] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=bundle, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bundle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=resultBundles, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=bundles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=bundle)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JoinableResourceBundle, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.resultBundles]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[JoinableResourceBundle] operator[>] identifier[getBundlesFromName] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[names] , identifier[List] operator[<] identifier[JoinableResourceBundle] operator[>] identifier[bundles] operator[SEP] { identifier[List] operator[<] identifier[JoinableResourceBundle] operator[>] identifier[resultBundles] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] identifier[names] operator[SEP] { Keyword[for] operator[SEP] identifier[JoinableResourceBundle] identifier[bundle] operator[:] identifier[bundles] operator[SEP] { Keyword[if] operator[SEP] identifier[bundle] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] { identifier[resultBundles] operator[SEP] identifier[add] operator[SEP] identifier[bundle] operator[SEP] operator[SEP] } } } Keyword[return] identifier[resultBundles] operator[SEP] }
private DocletTag findParamDocByNameOrIndex(String name, int paramIndex, List<DocletTag> tags) { for (DocletTag tag : tags) { if (name.equals(tag.getParameters().get(0))) { return tag; } } if (paramIndex < tags.size()) { return tags.get(paramIndex); } return null; }
class class_name[name] begin[{] method[findParamDocByNameOrIndex, return_type[type[DocletTag]], modifier[private], parameter[name, paramIndex, tags]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=tag, 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=equals, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=tags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tag)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DocletTag, sub_type=None))), label=None) if[binary_operation[member[.paramIndex], <, call[tags.size, parameter[]]]] begin[{] return[call[tags.get, parameter[member[.paramIndex]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] identifier[DocletTag] identifier[findParamDocByNameOrIndex] operator[SEP] identifier[String] identifier[name] , Keyword[int] identifier[paramIndex] , identifier[List] operator[<] identifier[DocletTag] operator[>] identifier[tags] operator[SEP] { Keyword[for] operator[SEP] identifier[DocletTag] identifier[tag] operator[:] identifier[tags] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[tag] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[tag] operator[SEP] } } Keyword[if] operator[SEP] identifier[paramIndex] operator[<] identifier[tags] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[tags] operator[SEP] identifier[get] operator[SEP] identifier[paramIndex] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case FULL_CLASS_NAME: return is_set_full_class_name(); case ARGS_LIST: return is_set_args_list(); } throw new IllegalStateException(); }
class class_name[name] begin[{] method[isSet, return_type[type[boolean]], modifier[public], parameter[field]] begin[{] if[binary_operation[member[.field], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=['FULL_CLASS_NAME'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=is_set_full_class_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['ARGS_LIST'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=is_set_args_list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[boolean] identifier[isSet] operator[SEP] identifier[_Fields] identifier[field] operator[SEP] { Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[field] operator[SEP] { Keyword[case] identifier[FULL_CLASS_NAME] operator[:] Keyword[return] identifier[is_set_full_class_name] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[ARGS_LIST] operator[:] Keyword[return] identifier[is_set_args_list] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP] }
public void marshall(CreateJobRequest createJobRequest, ProtocolMarshaller protocolMarshaller) { if (createJobRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createJobRequest.getPipelineId(), PIPELINEID_BINDING); protocolMarshaller.marshall(createJobRequest.getInput(), INPUT_BINDING); protocolMarshaller.marshall(createJobRequest.getInputs(), INPUTS_BINDING); protocolMarshaller.marshall(createJobRequest.getOutput(), OUTPUT_BINDING); protocolMarshaller.marshall(createJobRequest.getOutputs(), OUTPUTS_BINDING); protocolMarshaller.marshall(createJobRequest.getOutputKeyPrefix(), OUTPUTKEYPREFIX_BINDING); protocolMarshaller.marshall(createJobRequest.getPlaylists(), PLAYLISTS_BINDING); protocolMarshaller.marshall(createJobRequest.getUserMetadata(), USERMETADATA_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[createJobRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.createJobRequest], ==, 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=getPipelineId, postfix_operators=[], prefix_operators=[], qualifier=createJobRequest, selectors=[], type_arguments=None), MemberReference(member=PIPELINEID_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=getInput, postfix_operators=[], prefix_operators=[], qualifier=createJobRequest, selectors=[], type_arguments=None), MemberReference(member=INPUT_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=getInputs, postfix_operators=[], prefix_operators=[], qualifier=createJobRequest, selectors=[], type_arguments=None), MemberReference(member=INPUTS_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=getOutput, postfix_operators=[], prefix_operators=[], qualifier=createJobRequest, selectors=[], type_arguments=None), MemberReference(member=OUTPUT_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=getOutputs, postfix_operators=[], prefix_operators=[], qualifier=createJobRequest, selectors=[], type_arguments=None), MemberReference(member=OUTPUTS_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=getOutputKeyPrefix, postfix_operators=[], prefix_operators=[], qualifier=createJobRequest, selectors=[], type_arguments=None), MemberReference(member=OUTPUTKEYPREFIX_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=getPlaylists, postfix_operators=[], prefix_operators=[], qualifier=createJobRequest, selectors=[], type_arguments=None), MemberReference(member=PLAYLISTS_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=getUserMetadata, postfix_operators=[], prefix_operators=[], qualifier=createJobRequest, selectors=[], type_arguments=None), MemberReference(member=USERMETADATA_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[CreateJobRequest] identifier[createJobRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createJobRequest] 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[createJobRequest] operator[SEP] identifier[getPipelineId] operator[SEP] operator[SEP] , identifier[PIPELINEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createJobRequest] operator[SEP] identifier[getInput] operator[SEP] operator[SEP] , identifier[INPUT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createJobRequest] operator[SEP] identifier[getInputs] operator[SEP] operator[SEP] , identifier[INPUTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createJobRequest] operator[SEP] identifier[getOutput] operator[SEP] operator[SEP] , identifier[OUTPUT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createJobRequest] operator[SEP] identifier[getOutputs] operator[SEP] operator[SEP] , identifier[OUTPUTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createJobRequest] operator[SEP] identifier[getOutputKeyPrefix] operator[SEP] operator[SEP] , identifier[OUTPUTKEYPREFIX_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createJobRequest] operator[SEP] identifier[getPlaylists] operator[SEP] operator[SEP] , identifier[PLAYLISTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createJobRequest] operator[SEP] identifier[getUserMetadata] operator[SEP] operator[SEP] , identifier[USERMETADATA_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private List<String> convertObjectToListOfStringValues(Object value) { if (value != null) { List<String> valueList = new ArrayList<>(); if (value instanceof Collection) { Collection valueCollection = (Collection) value; for (Object val : valueCollection) { if (val == null) { valueList.add(null); } else { valueList.add(val.toString()); } } } else if (value instanceof Object[]) { Object[] valueArray = (Object[]) value; for (Object val : valueArray) { if (val == null) { valueList.add(null); } else { valueList.add(val.toString()); } } } else { valueList.add(value.toString()); } return valueList; } else { return null; } }
class class_name[name] begin[{] method[convertObjectToListOfStringValues, return_type[type[List]], modifier[private], parameter[value]] begin[{] if[binary_operation[member[.value], !=, literal[null]]] begin[{] local_variable[type[List], valueList] if[binary_operation[member[.value], instanceof, type[Collection]]] begin[{] local_variable[type[Collection], valueCollection] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=val, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=valueList, 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=null)], member=add, postfix_operators=[], prefix_operators=[], qualifier=valueList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=valueCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) else begin[{] if[binary_operation[member[.value], instanceof, type[Object]]] begin[{] local_variable[type[Object], valueArray] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=val, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=valueList, 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=null)], member=add, postfix_operators=[], prefix_operators=[], qualifier=valueList, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=valueArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=val)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) else begin[{] call[valueList.add, parameter[call[value.toString, parameter[]]]] end[}] end[}] return[member[.valueList]] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[String] operator[>] identifier[convertObjectToListOfStringValues] operator[SEP] identifier[Object] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[valueList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Collection] operator[SEP] { identifier[Collection] identifier[valueCollection] operator[=] operator[SEP] identifier[Collection] operator[SEP] identifier[value] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[val] operator[:] identifier[valueCollection] operator[SEP] { Keyword[if] operator[SEP] identifier[val] operator[==] Other[null] operator[SEP] { identifier[valueList] operator[SEP] identifier[add] operator[SEP] Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[valueList] operator[SEP] identifier[add] operator[SEP] identifier[val] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Object] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] operator[SEP] operator[SEP] identifier[valueArray] operator[=] operator[SEP] identifier[Object] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[val] operator[:] identifier[valueArray] operator[SEP] { Keyword[if] operator[SEP] identifier[val] operator[==] Other[null] operator[SEP] { identifier[valueList] operator[SEP] identifier[add] operator[SEP] Other[null] operator[SEP] operator[SEP] } Keyword[else] { identifier[valueList] operator[SEP] identifier[add] operator[SEP] identifier[val] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[valueList] operator[SEP] identifier[add] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[valueList] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
public static void dispose() { if (xml2containerMap != null) { for (SpringContainer container : xml2containerMap.values()) { container.dispose(); } xml2containerMap.clear(); } }
class class_name[name] begin[{] method[dispose, return_type[void], modifier[public static], parameter[]] begin[{] if[binary_operation[member[.xml2containerMap], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=dispose, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=xml2containerMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=container)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SpringContainer, sub_type=None))), label=None) call[xml2containerMap.clear, parameter[]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[dispose] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[xml2containerMap] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[SpringContainer] identifier[container] operator[:] identifier[xml2containerMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { identifier[container] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP] } identifier[xml2containerMap] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } }
public OtpMsg receiveMsg() throws OtpErlangExit { final OtpMsg m = (OtpMsg) queue.get(); switch (m.type()) { case OtpMsg.exitTag: case OtpMsg.exit2Tag: try { final OtpErlangObject o = m.getMsg(); throw new OtpErlangExit(o, m.getSenderPid()); } catch (final OtpErlangDecodeException e) { throw new OtpErlangExit("unknown", m.getSenderPid()); } default: return m; } }
class class_name[name] begin[{] method[receiveMsg, return_type[type[OtpMsg]], modifier[public], parameter[]] begin[{] local_variable[type[OtpMsg], m] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=exitTag, postfix_operators=[], prefix_operators=[], qualifier=OtpMsg, selectors=[]), MemberReference(member=exit2Tag, postfix_operators=[], prefix_operators=[], qualifier=OtpMsg, selectors=[])], statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMsg, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), name=o)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=OtpErlangObject, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getSenderPid, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OtpErlangExit, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unknown"), MethodInvocation(arguments=[], member=getSenderPid, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OtpErlangExit, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['OtpErlangDecodeException']))], finally_block=None, label=None, resources=None)]), SwitchStatementCase(case=[], statements=[ReturnStatement(expression=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[public] identifier[OtpMsg] identifier[receiveMsg] operator[SEP] operator[SEP] Keyword[throws] identifier[OtpErlangExit] { Keyword[final] identifier[OtpMsg] identifier[m] operator[=] operator[SEP] identifier[OtpMsg] operator[SEP] identifier[queue] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[m] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[OtpMsg] operator[SEP] identifier[exitTag] operator[:] Keyword[case] identifier[OtpMsg] operator[SEP] identifier[exit2Tag] operator[:] Keyword[try] { Keyword[final] identifier[OtpErlangObject] identifier[o] operator[=] identifier[m] operator[SEP] identifier[getMsg] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[OtpErlangExit] operator[SEP] identifier[o] , identifier[m] operator[SEP] identifier[getSenderPid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[OtpErlangDecodeException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[OtpErlangExit] operator[SEP] literal[String] , identifier[m] operator[SEP] identifier[getSenderPid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[default] operator[:] Keyword[return] identifier[m] operator[SEP] } }
public ValidationPlanResult append(Collection<ValidationResult> results) { if (results == null) { return this; } for (ValidationResult message : results) { addResult(message); } return this; }
class class_name[name] begin[{] method[append, return_type[type[ValidationPlanResult]], modifier[public], parameter[results]] begin[{] if[binary_operation[member[.results], ==, literal[null]]] begin[{] return[THIS[]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=message)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ValidationResult, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ValidationPlanResult] identifier[append] operator[SEP] identifier[Collection] operator[<] identifier[ValidationResult] operator[>] identifier[results] operator[SEP] { Keyword[if] operator[SEP] identifier[results] operator[==] Other[null] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } Keyword[for] operator[SEP] identifier[ValidationResult] identifier[message] operator[:] identifier[results] operator[SEP] { identifier[addResult] operator[SEP] identifier[message] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public ResourceBundle mergeWithGlobal(ResourceBundle resourceBundle) { if (globalResourceBundle == null) { if (resourceBundle == null) { return EMPTY_RESOURCE_BUNDLE; } else { return new ResourceBundleWrapper(resourceBundle); } } else { if (resourceBundle == null) { return new ResourceBundleWrapper(globalResourceBundle); } else { return merge(resourceBundle, globalResourceBundle); } } }
class class_name[name] begin[{] method[mergeWithGlobal, return_type[type[ResourceBundle]], modifier[public], parameter[resourceBundle]] begin[{] if[binary_operation[member[.globalResourceBundle], ==, literal[null]]] begin[{] if[binary_operation[member[.resourceBundle], ==, literal[null]]] begin[{] return[member[.EMPTY_RESOURCE_BUNDLE]] else begin[{] return[ClassCreator(arguments=[MemberReference(member=resourceBundle, 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=ResourceBundleWrapper, sub_type=None))] end[}] else begin[{] if[binary_operation[member[.resourceBundle], ==, literal[null]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=globalResourceBundle, 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=ResourceBundleWrapper, sub_type=None))] else begin[{] return[call[.merge, parameter[member[.resourceBundle], member[.globalResourceBundle]]]] end[}] end[}] end[}] END[}]
Keyword[public] identifier[ResourceBundle] identifier[mergeWithGlobal] operator[SEP] identifier[ResourceBundle] identifier[resourceBundle] operator[SEP] { Keyword[if] operator[SEP] identifier[globalResourceBundle] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceBundle] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[EMPTY_RESOURCE_BUNDLE] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[ResourceBundleWrapper] operator[SEP] identifier[resourceBundle] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[resourceBundle] operator[==] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[ResourceBundleWrapper] operator[SEP] identifier[globalResourceBundle] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[merge] operator[SEP] identifier[resourceBundle] , identifier[globalResourceBundle] operator[SEP] operator[SEP] } } }
public void error(String format, Object arg) { formatAndLog(Log.ERROR, format, arg); }
class class_name[name] begin[{] method[error, return_type[void], modifier[public], parameter[format, arg]] begin[{] call[.formatAndLog, parameter[member[Log.ERROR], member[.format], member[.arg]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[error] operator[SEP] identifier[String] identifier[format] , identifier[Object] identifier[arg] operator[SEP] { identifier[formatAndLog] operator[SEP] identifier[Log] operator[SEP] identifier[ERROR] , identifier[format] , identifier[arg] operator[SEP] operator[SEP] }
public void bind() { if (serviceObject != null) { return; } final Context context = contextRef.get(); if (context == null) { return; } // TODO make it configurable final Intent intent = new Intent(context, GoroService.class); intent.setAction(getInterfaceClass().getName()); if (DEBUG_CALLS) { Log.v(TAG, "Attempt to bind to service " + this + "/" + context, new RuntimeException()); } // start manually, so that it will be stopped manually context.startService(intent); final boolean bindResult = context.bindService(intent, this, 0); if (DEBUG) { Log.v(TAG, "Binded to service: " + bindResult + ", " + context + ", interface: " + getInterfaceClass()); } }
class class_name[name] begin[{] method[bind, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.serviceObject], !=, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Context], context] if[binary_operation[member[.context], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Intent], intent] call[intent.setAction, parameter[call[.getInterfaceClass, parameter[]]]] if[member[.DEBUG_CALLS]] begin[{] call[Log.v, parameter[member[.TAG], binary_operation[binary_operation[binary_operation[literal["Attempt to bind to service "], +, THIS[]], +, literal["/"]], +, member[.context]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None))]] else begin[{] None end[}] call[context.startService, parameter[member[.intent]]] local_variable[type[boolean], bindResult] if[member[.DEBUG]] begin[{] call[Log.v, parameter[member[.TAG], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Binded to service: "], +, member[.bindResult]], +, literal[", "]], +, member[.context]], +, literal[", interface: "]], +, call[.getInterfaceClass, parameter[]]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[bind] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[serviceObject] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[final] identifier[Context] identifier[context] operator[=] identifier[contextRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[final] identifier[Intent] identifier[intent] operator[=] Keyword[new] identifier[Intent] operator[SEP] identifier[context] , identifier[GoroService] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[intent] operator[SEP] identifier[setAction] operator[SEP] identifier[getInterfaceClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DEBUG_CALLS] operator[SEP] { identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[TAG] , literal[String] operator[+] Keyword[this] operator[+] literal[String] operator[+] identifier[context] , Keyword[new] identifier[RuntimeException] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[context] operator[SEP] identifier[startService] operator[SEP] identifier[intent] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[bindResult] operator[=] identifier[context] operator[SEP] identifier[bindService] operator[SEP] identifier[intent] , Keyword[this] , Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] { identifier[Log] operator[SEP] identifier[v] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[bindResult] operator[+] literal[String] operator[+] identifier[context] operator[+] literal[String] operator[+] identifier[getInterfaceClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public static <T extends TypeDefinition> ElementMatcher.Junction<T> isVariable(String symbol) { return isVariable(named(symbol)); }
class class_name[name] begin[{] method[isVariable, return_type[type[ElementMatcher]], modifier[public static], parameter[symbol]] begin[{] return[call[.isVariable, parameter[call[.named, parameter[member[.symbol]]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[TypeDefinition] operator[>] identifier[ElementMatcher] operator[SEP] identifier[Junction] operator[<] identifier[T] operator[>] identifier[isVariable] operator[SEP] identifier[String] identifier[symbol] operator[SEP] { Keyword[return] identifier[isVariable] operator[SEP] identifier[named] operator[SEP] identifier[symbol] operator[SEP] operator[SEP] operator[SEP] }
private void addSubSlide(final Node defaultSubSlide) { this.subSlides.add(model().getStepPosition(), defaultSubSlide); this.slideContent.getChildren().add(defaultSubSlide); StackPane.setAlignment(defaultSubSlide, Pos.CENTER); }
class class_name[name] begin[{] method[addSubSlide, return_type[void], modifier[private], parameter[defaultSubSlide]] begin[{] THIS[member[None.subSlides]call[None.add, parameter[call[.model, parameter[]], member[.defaultSubSlide]]]] THIS[member[None.slideContent]call[None.getChildren, parameter[]]call[None.add, parameter[member[.defaultSubSlide]]]] call[StackPane.setAlignment, parameter[member[.defaultSubSlide], member[Pos.CENTER]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addSubSlide] operator[SEP] Keyword[final] identifier[Node] identifier[defaultSubSlide] operator[SEP] { Keyword[this] operator[SEP] identifier[subSlides] operator[SEP] identifier[add] operator[SEP] identifier[model] operator[SEP] operator[SEP] operator[SEP] identifier[getStepPosition] operator[SEP] operator[SEP] , identifier[defaultSubSlide] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[slideContent] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[defaultSubSlide] operator[SEP] operator[SEP] identifier[StackPane] operator[SEP] identifier[setAlignment] operator[SEP] identifier[defaultSubSlide] , identifier[Pos] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] }
protected int deleteChildren(final TicketGrantingTicket ticket) { val count = new AtomicInteger(0); val services = ticket.getServices(); if (services != null && !services.isEmpty()) { services.keySet().forEach(ticketId -> { if (deleteSingleTicket(ticketId)) { LOGGER.debug("Removed ticket [{}]", ticketId); count.incrementAndGet(); } else { LOGGER.debug("Unable to remove ticket [{}]", ticketId); } }); } return count.intValue(); }
class class_name[name] begin[{] method[deleteChildren, return_type[type[int]], modifier[protected], parameter[ticket]] begin[{] local_variable[type[val], count] local_variable[type[val], services] if[binary_operation[binary_operation[member[.services], !=, literal[null]], &&, call[services.isEmpty, parameter[]]]] begin[{] call[services.keySet, parameter[]] else begin[{] None end[}] return[call[count.intValue, parameter[]]] end[}] END[}]
Keyword[protected] Keyword[int] identifier[deleteChildren] operator[SEP] Keyword[final] identifier[TicketGrantingTicket] identifier[ticket] operator[SEP] { identifier[val] identifier[count] operator[=] Keyword[new] identifier[AtomicInteger] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[val] identifier[services] operator[=] identifier[ticket] operator[SEP] identifier[getServices] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[services] operator[!=] Other[null] operator[&&] operator[!] identifier[services] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[services] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[ticketId] operator[->] { Keyword[if] operator[SEP] identifier[deleteSingleTicket] operator[SEP] identifier[ticketId] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[ticketId] operator[SEP] operator[SEP] identifier[count] operator[SEP] identifier[incrementAndGet] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[ticketId] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } Keyword[return] identifier[count] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] }
public static void showDialog(BufferedImage img) { ImageIcon icon = new ImageIcon(); icon.setImage(img); JOptionPane.showMessageDialog(null, icon); }
class class_name[name] begin[{] method[showDialog, return_type[void], modifier[public static], parameter[img]] begin[{] local_variable[type[ImageIcon], icon] call[icon.setImage, parameter[member[.img]]] call[JOptionPane.showMessageDialog, parameter[literal[null], member[.icon]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[showDialog] operator[SEP] identifier[BufferedImage] identifier[img] operator[SEP] { identifier[ImageIcon] identifier[icon] operator[=] Keyword[new] identifier[ImageIcon] operator[SEP] operator[SEP] operator[SEP] identifier[icon] operator[SEP] identifier[setImage] operator[SEP] identifier[img] operator[SEP] operator[SEP] identifier[JOptionPane] operator[SEP] identifier[showMessageDialog] operator[SEP] Other[null] , identifier[icon] operator[SEP] operator[SEP] }
public HiltItemStack setName(String name) { createItemMeta(); ItemMeta itemMeta = getItemMeta(); itemMeta.setDisplayName(name != null ? name.replace("\\s+", " ") : null); setItemMeta(itemMeta); return this; }
class class_name[name] begin[{] method[setName, return_type[type[HiltItemStack]], modifier[public], parameter[name]] begin[{] call[.createItemMeta, parameter[]] local_variable[type[ItemMeta], itemMeta] call[itemMeta.setDisplayName, parameter[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\s+"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None))]] call[.setItemMeta, parameter[member[.itemMeta]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[HiltItemStack] identifier[setName] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[createItemMeta] operator[SEP] operator[SEP] operator[SEP] identifier[ItemMeta] identifier[itemMeta] operator[=] identifier[getItemMeta] operator[SEP] operator[SEP] operator[SEP] identifier[itemMeta] operator[SEP] identifier[setDisplayName] operator[SEP] identifier[name] operator[!=] Other[null] operator[?] identifier[name] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[:] Other[null] operator[SEP] operator[SEP] identifier[setItemMeta] operator[SEP] identifier[itemMeta] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private boolean mapProperty(JSONObject root, JSONObject node, String key, String... mapping) throws JSONException { boolean deleteProperty = false; for (String value : mapping) { Matcher matcher = MAPPED_PATTERN.matcher(value); if (matcher.matches()) { // this is a mapped property, we will delete it if the mapped destination // property doesn't exist deleteProperty = true; String path = matcher.group(2); // unwrap quoted property paths path = StringUtils.removeStart(StringUtils.stripEnd(path, "\'"), "\'"); if (root.has(cleanup(path))) { // replace property by mapped value in the original tree Object originalValue = root.get(cleanup(path)); node.put(cleanup(key), originalValue); // negate boolean properties if negation character has been set String negate = matcher.group(1); if ("!".equals(negate) && (originalValue instanceof Boolean)) { node.put(cleanup(key), !((Boolean)originalValue)); } // the mapping was successful deleteProperty = false; break; } else { String defaultValue = matcher.group(4); if (defaultValue != null) { node.put(cleanup(key), defaultValue); deleteProperty = false; break; } } } } if (deleteProperty) { // mapped destination does not exist, we don't include the property in replacement tree node.remove(key); return false; } return true; }
class class_name[name] begin[{] method[mapProperty, return_type[type[boolean]], modifier[private], parameter[root, node, key, mapping]] begin[{] local_variable[type[boolean], deleteProperty] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=MAPPED_PATTERN, selectors=[], type_arguments=None), name=matcher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Matcher, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=matches, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=deleteProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=group, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\'")], member=stripEnd, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\'")], member=removeStart, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cleanup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=has, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], member=group, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), name=defaultValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cleanup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=deleteProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cleanup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=root, selectors=[], type_arguments=None), name=originalValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cleanup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=originalValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=group, postfix_operators=[], prefix_operators=[], qualifier=matcher, selectors=[], type_arguments=None), name=negate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=negate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="!"), operandr=BinaryOperation(operandl=MemberReference(member=originalValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None), operator=instanceof), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cleanup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MemberReference(member=originalValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=deleteProperty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=mapping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) if[member[.deleteProperty]] begin[{] call[node.remove, parameter[member[.key]]] return[literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[mapProperty] operator[SEP] identifier[JSONObject] identifier[root] , identifier[JSONObject] identifier[node] , identifier[String] identifier[key] , identifier[String] operator[...] identifier[mapping] operator[SEP] Keyword[throws] identifier[JSONException] { Keyword[boolean] identifier[deleteProperty] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[value] operator[:] identifier[mapping] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[MAPPED_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { identifier[deleteProperty] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[path] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[StringUtils] operator[SEP] identifier[removeStart] operator[SEP] identifier[StringUtils] operator[SEP] identifier[stripEnd] operator[SEP] identifier[path] , literal[String] operator[SEP] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[root] operator[SEP] identifier[has] operator[SEP] identifier[cleanup] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] { identifier[Object] identifier[originalValue] operator[=] identifier[root] operator[SEP] identifier[get] operator[SEP] identifier[cleanup] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[put] operator[SEP] identifier[cleanup] operator[SEP] identifier[key] operator[SEP] , identifier[originalValue] operator[SEP] operator[SEP] identifier[String] identifier[negate] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[negate] operator[SEP] operator[&&] operator[SEP] identifier[originalValue] Keyword[instanceof] identifier[Boolean] operator[SEP] operator[SEP] { identifier[node] operator[SEP] identifier[put] operator[SEP] identifier[cleanup] operator[SEP] identifier[key] operator[SEP] , operator[!] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] identifier[originalValue] operator[SEP] operator[SEP] operator[SEP] } identifier[deleteProperty] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } Keyword[else] { identifier[String] identifier[defaultValue] operator[=] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[defaultValue] operator[!=] Other[null] operator[SEP] { identifier[node] operator[SEP] identifier[put] operator[SEP] identifier[cleanup] operator[SEP] identifier[key] operator[SEP] , identifier[defaultValue] operator[SEP] operator[SEP] identifier[deleteProperty] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } } } Keyword[if] operator[SEP] identifier[deleteProperty] operator[SEP] { identifier[node] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private void handleDeclaration(char c) throws XMLStreamException { String keyw = null; /* We need to ensure that PEs do not span declaration boundaries * (similar to element nesting wrt. GE expansion for xml content). * This VC is defined in xml 1.0, section 2.8 as * "VC: Proper Declaration/PE Nesting" */ /* We have binary depths within DTDs, for now: since the declaration * just started, we should now have 1 as the depth: */ mCurrDepth = 1; try { do { // dummy loop, for break if (c == 'A') { // ATTLIST? keyw = checkDTDKeyword("TTLIST"); if (keyw == null) { mCurrDeclaration = "ATTLIST"; handleAttlistDecl(); break; } keyw = "A" + keyw; } else if (c == 'E') { // ENTITY, ELEMENT? c = dtdNextFromCurr(); if (c == 'N') { keyw = checkDTDKeyword("TITY"); if (keyw == null) { mCurrDeclaration = "ENTITY"; handleEntityDecl(false); break; } keyw = "EN" + keyw; } else if (c == 'L') { keyw = checkDTDKeyword("EMENT"); if (keyw == null) { mCurrDeclaration = "ELEMENT"; handleElementDecl(); break; } keyw = "EL" + keyw; } else { keyw = readDTDKeyword("E"+c); } } else if (c == 'N') { // NOTATION? keyw = checkDTDKeyword("OTATION"); if (keyw == null) { mCurrDeclaration = "NOTATION"; handleNotationDecl(); break; } keyw = "N" + keyw; } else if (c == 'T' && mCfgSupportDTDPP) { // (dtd++ only) TARGETNS? keyw = checkDTDKeyword("ARGETNS"); if (keyw == null) { mCurrDeclaration = "TARGETNS"; handleTargetNsDecl(); break; } keyw = "T" + keyw; } else { keyw = readDTDKeyword(String.valueOf(c)); } // If we got this far, we got a problem... _reportBadDirective(keyw); } while (false); /* Ok: now, the current input can not have been started * within the scope... so: */ if (mInput.getScopeId() > 0) { handleGreedyEntityProblem(mInput); } } finally { // Either way, declaration has ended now... mCurrDepth = 0; mCurrDeclaration = null; } }
class class_name[name] begin[{] method[handleDeclaration, return_type[void], modifier[private], parameter[c]] begin[{] local_variable[type[String], keyw] assign[member[.mCurrDepth], literal[1]] TryStatement(block=[DoStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='E'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='N'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='T'), operator===), operandr=MemberReference(member=mCfgSupportDTDPP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=readDTDKeyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ARGETNS")], member=checkDTDKeyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=keyw, 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=mCurrDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TARGETNS")), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=handleTargetNsDecl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="T"), operandr=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="OTATION")], member=checkDTDKeyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=keyw, 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=mCurrDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NOTATION")), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=handleNotationDecl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="N"), operandr=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=dtdNextFromCurr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='N'), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='L'), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="E"), operandr=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=readDTDKeyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="EMENT")], member=checkDTDKeyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=keyw, 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=mCurrDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ELEMENT")), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=handleElementDecl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="EL"), operandr=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TITY")], member=checkDTDKeyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=keyw, 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=mCurrDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ENTITY")), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=handleEntityDecl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="EN"), operandr=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="TTLIST")], member=checkDTDKeyword, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=keyw, 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=mCurrDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ATTLIST")), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=handleAttlistDecl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A"), operandr=MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keyw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=_reportBadDirective, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getScopeId, postfix_operators=[], prefix_operators=[], qualifier=mInput, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mInput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleGreedyEntityProblem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mCurrDepth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mCurrDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[handleDeclaration] operator[SEP] Keyword[char] identifier[c] operator[SEP] Keyword[throws] identifier[XMLStreamException] { identifier[String] identifier[keyw] operator[=] Other[null] operator[SEP] identifier[mCurrDepth] operator[=] Other[1] operator[SEP] Keyword[try] { Keyword[do] { Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[keyw] operator[=] identifier[checkDTDKeyword] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keyw] operator[==] Other[null] operator[SEP] { identifier[mCurrDeclaration] operator[=] literal[String] operator[SEP] identifier[handleAttlistDecl] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[keyw] operator[=] literal[String] operator[+] identifier[keyw] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[c] operator[=] identifier[dtdNextFromCurr] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[keyw] operator[=] identifier[checkDTDKeyword] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keyw] operator[==] Other[null] operator[SEP] { identifier[mCurrDeclaration] operator[=] literal[String] operator[SEP] identifier[handleEntityDecl] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[keyw] operator[=] literal[String] operator[+] identifier[keyw] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[keyw] operator[=] identifier[checkDTDKeyword] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keyw] operator[==] Other[null] operator[SEP] { identifier[mCurrDeclaration] operator[=] literal[String] operator[SEP] identifier[handleElementDecl] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[keyw] operator[=] literal[String] operator[+] identifier[keyw] operator[SEP] } Keyword[else] { identifier[keyw] operator[=] identifier[readDTDKeyword] operator[SEP] literal[String] operator[+] identifier[c] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[keyw] operator[=] identifier[checkDTDKeyword] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keyw] operator[==] Other[null] operator[SEP] { identifier[mCurrDeclaration] operator[=] literal[String] operator[SEP] identifier[handleNotationDecl] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[keyw] operator[=] literal[String] operator[+] identifier[keyw] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[&&] identifier[mCfgSupportDTDPP] operator[SEP] { identifier[keyw] operator[=] identifier[checkDTDKeyword] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keyw] operator[==] Other[null] operator[SEP] { identifier[mCurrDeclaration] operator[=] literal[String] operator[SEP] identifier[handleTargetNsDecl] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[keyw] operator[=] literal[String] operator[+] identifier[keyw] operator[SEP] } Keyword[else] { identifier[keyw] operator[=] identifier[readDTDKeyword] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] } identifier[_reportBadDirective] operator[SEP] identifier[keyw] operator[SEP] operator[SEP] } Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mInput] operator[SEP] identifier[getScopeId] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[handleGreedyEntityProblem] operator[SEP] identifier[mInput] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[mCurrDepth] operator[=] Other[0] operator[SEP] identifier[mCurrDeclaration] operator[=] Other[null] operator[SEP] } }
@SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case TypesPackage.JVM_ANNOTATION_TARGET__ANNOTATIONS: getAnnotations().clear(); getAnnotations().addAll((Collection<? extends JvmAnnotationReference>)newValue); return; } super.eSet(featureID, newValue); }
class class_name[name] begin[{] method[eSet, return_type[void], modifier[public], parameter[featureID, newValue]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=JVM_ANNOTATION_TARGET__ANNOTATIONS, postfix_operators=[], prefix_operators=[], qualifier=TypesPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=clear, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=getAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=JvmAnnotationReference, sub_type=None))], dimensions=[], name=Collection, sub_type=None))], member=addAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eSet] operator[SEP] Keyword[int] identifier[featureID] , identifier[Object] identifier[newValue] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[TypesPackage] operator[SEP] identifier[JVM_ANNOTATION_TARGET__ANNOTATIONS] operator[:] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[getAnnotations] operator[SEP] operator[SEP] operator[SEP] identifier[addAll] operator[SEP] operator[SEP] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[JvmAnnotationReference] operator[>] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[eSet] operator[SEP] identifier[featureID] , identifier[newValue] operator[SEP] operator[SEP] }
@SuppressWarnings("deprecation") public BUILDER setAllowedValues(String ... allowedValues) { assert allowedValues!= null; this.allowedValues = new ModelNode[allowedValues.length]; for (int i = 0; i < allowedValues.length; i++) { this.allowedValues[i] = new ModelNode(allowedValues[i]); } return (BUILDER) this; }
class class_name[name] begin[{] method[setAllowedValues, return_type[type[BUILDER]], modifier[public], parameter[allowedValues]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=allowedValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) assign[THIS[member[None.allowedValues]], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=allowedValues, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModelNode, sub_type=None))] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=allowedValues, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=allowedValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=ModelNode, sub_type=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=allowedValues, 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[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BUILDER, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[BUILDER] identifier[setAllowedValues] operator[SEP] identifier[String] operator[...] identifier[allowedValues] operator[SEP] { Keyword[assert] identifier[allowedValues] operator[!=] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[allowedValues] operator[=] Keyword[new] identifier[ModelNode] operator[SEP] identifier[allowedValues] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[allowedValues] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[this] operator[SEP] identifier[allowedValues] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[ModelNode] operator[SEP] identifier[allowedValues] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[BUILDER] operator[SEP] Keyword[this] operator[SEP] }
private void calculateIntersectPoints() { intersectPoints.clear(); /** order intersect points clockwise **/ //left edge if (center.x - menuBounds.left < expandedRadius) { int dy = (int) Math.sqrt(Math.pow(expandedRadius, 2) - Math.pow(center.x - menuBounds.left, 2)); if (center.y - dy > menuBounds.top) { intersectPoints.add(new Point(menuBounds.left, center.y - dy)); } if (center.y + dy < menuBounds.bottom) { intersectPoints.add(new Point(menuBounds.left, center.y + dy)); } } //top edge if (center.y - menuBounds.top < expandedRadius) { int dx = (int) Math.sqrt(Math.pow(expandedRadius, 2) - Math.pow(center.y - menuBounds.top, 2)); if (center.x + dx < menuBounds.right) { intersectPoints.add(new Point(center.x + dx, menuBounds.top)); } if (center.x - dx > menuBounds.left) { intersectPoints.add(new Point(center.x - dx, menuBounds.top)); } } //right edge if (menuBounds.right - center.x < expandedRadius) { int dy = (int) Math.sqrt(Math.pow(expandedRadius, 2) - Math.pow(menuBounds.right - center.x, 2)); if (center.y - dy > menuBounds.top) { intersectPoints.add(new Point(menuBounds.right, center.y - dy)); } if (center.y + dy < menuBounds.bottom) { intersectPoints.add(new Point(menuBounds.right, center.y + dy)); } } //bottom edge if (menuBounds.bottom - center.y < expandedRadius) { int dx = (int) Math.sqrt(Math.pow(expandedRadius, 2) - Math.pow(menuBounds.bottom - center.y, 2)); if (center.x + dx < menuBounds.right) { intersectPoints.add(new Point(center.x + dx, menuBounds.bottom)); } if (center.x - dx > menuBounds.left) { intersectPoints.add(new Point(center.x - dx, menuBounds.bottom)); } } //find the maximum arc in menuBounds int size = intersectPoints.size(); if (size == 0) { fromAngle = 0; toAngle = 360; return; } int indexA = size - 1; double maxAngle = arcAngle(center, intersectPoints.get(0), intersectPoints.get(indexA), menuBounds, expandedRadius); for (int i = 0; i < size - 1; i++) { Point a = intersectPoints.get(i); Point b = intersectPoints.get(i + 1); double angle = arcAngle(center, a, b, menuBounds, expandedRadius); Point midnormalPoint = findMidnormalPoint(center, a, b, menuBounds, expandedRadius); //if the arc(a->midnormalPoint->b) is in menuBounds and the angle is bigger, select it int pointerIndex = i; int endIndex = indexA + 1; if (!isClockwise(center, a, midnormalPoint)) { int tmpIndex = pointerIndex; pointerIndex = endIndex; endIndex = tmpIndex; } if (pointerIndex == intersectPoints.size() - 1) { pointerIndex = 0; } else { pointerIndex++; } if (pointerIndex == endIndex && angle > maxAngle) { indexA = i; maxAngle = angle; } } Point a = intersectPoints.get(indexA); Point b = intersectPoints.get(indexA + 1 >= size ? 0 : indexA + 1); Point midnormalPoint = findMidnormalPoint(center, a, b, menuBounds, expandedRadius); Point x = new Point(menuBounds.right, center.y); if (!isClockwise(center, a, midnormalPoint)) { Point tmp = a; a = b; b = tmp; } fromAngle = pointAngleOnCircle(center, a, x); toAngle = pointAngleOnCircle(center, b, x); toAngle = toAngle <= fromAngle ? 360 + toAngle : toAngle; }
class class_name[name] begin[{] method[calculateIntersectPoints, return_type[void], modifier[private], parameter[]] begin[{] call[intersectPoints.clear, parameter[]] if[binary_operation[binary_operation[member[center.x], -, member[menuBounds.left]], <, member[.expandedRadius]]] begin[{] local_variable[type[int], dy] if[binary_operation[binary_operation[member[center.y], -, member[.dy]], >, member[menuBounds.top]]] begin[{] call[intersectPoints.add, parameter[ClassCreator(arguments=[MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=menuBounds, selectors=[]), BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=center, selectors=[]), operandr=MemberReference(member=dy, 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=Point, sub_type=None))]] else begin[{] None end[}] if[binary_operation[binary_operation[member[center.y], +, member[.dy]], <, member[menuBounds.bottom]]] begin[{] call[intersectPoints.add, parameter[ClassCreator(arguments=[MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=menuBounds, selectors=[]), BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=center, selectors=[]), operandr=MemberReference(member=dy, 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=Point, sub_type=None))]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[center.y], -, member[menuBounds.top]], <, member[.expandedRadius]]] begin[{] local_variable[type[int], dx] if[binary_operation[binary_operation[member[center.x], +, member[.dx]], <, member[menuBounds.right]]] begin[{] call[intersectPoints.add, parameter[ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=center, selectors=[]), operandr=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=top, postfix_operators=[], prefix_operators=[], qualifier=menuBounds, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Point, sub_type=None))]] else begin[{] None end[}] if[binary_operation[binary_operation[member[center.x], -, member[.dx]], >, member[menuBounds.left]]] begin[{] call[intersectPoints.add, parameter[ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=center, selectors=[]), operandr=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), MemberReference(member=top, postfix_operators=[], prefix_operators=[], qualifier=menuBounds, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Point, sub_type=None))]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[menuBounds.right], -, member[center.x]], <, member[.expandedRadius]]] begin[{] local_variable[type[int], dy] if[binary_operation[binary_operation[member[center.y], -, member[.dy]], >, member[menuBounds.top]]] begin[{] call[intersectPoints.add, parameter[ClassCreator(arguments=[MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=menuBounds, selectors=[]), BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=center, selectors=[]), operandr=MemberReference(member=dy, 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=Point, sub_type=None))]] else begin[{] None end[}] if[binary_operation[binary_operation[member[center.y], +, member[.dy]], <, member[menuBounds.bottom]]] begin[{] call[intersectPoints.add, parameter[ClassCreator(arguments=[MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=menuBounds, selectors=[]), BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=center, selectors=[]), operandr=MemberReference(member=dy, 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=Point, sub_type=None))]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[menuBounds.bottom], -, member[center.y]], <, member[.expandedRadius]]] begin[{] local_variable[type[int], dx] if[binary_operation[binary_operation[member[center.x], +, member[.dx]], <, member[menuBounds.right]]] begin[{] call[intersectPoints.add, parameter[ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=center, selectors=[]), operandr=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=bottom, postfix_operators=[], prefix_operators=[], qualifier=menuBounds, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Point, sub_type=None))]] else begin[{] None end[}] if[binary_operation[binary_operation[member[center.x], -, member[.dx]], >, member[menuBounds.left]]] begin[{] call[intersectPoints.add, parameter[ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=center, selectors=[]), operandr=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), MemberReference(member=bottom, postfix_operators=[], prefix_operators=[], qualifier=menuBounds, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Point, sub_type=None))]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[int], size] if[binary_operation[member[.size], ==, literal[0]]] begin[{] assign[member[.fromAngle], literal[0]] assign[member[.toAngle], literal[360]] return[None] else begin[{] None end[}] local_variable[type[int], indexA] local_variable[type[double], maxAngle] 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=intersectPoints, selectors=[], type_arguments=None), name=a)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Point, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=intersectPoints, selectors=[], type_arguments=None), name=b)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Point, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=center, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=menuBounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=expandedRadius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arcAngle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=angle)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=center, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=menuBounds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=expandedRadius, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findMidnormalPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=midnormalPoint)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Point, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=pointerIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=indexA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=endIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=center, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=midnormalPoint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isClockwise, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=pointerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=tmpIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pointerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tmpIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pointerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=intersectPoints, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=pointerIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=pointerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pointerIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=endIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=angle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxAngle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=indexA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxAngle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=angle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[Point], a] local_variable[type[Point], b] local_variable[type[Point], midnormalPoint] local_variable[type[Point], x] if[call[.isClockwise, parameter[member[.center], member[.a], member[.midnormalPoint]]]] begin[{] local_variable[type[Point], tmp] assign[member[.a], member[.b]] assign[member[.b], member[.tmp]] else begin[{] None end[}] assign[member[.fromAngle], call[.pointAngleOnCircle, parameter[member[.center], member[.a], member[.x]]]] assign[member[.toAngle], call[.pointAngleOnCircle, parameter[member[.center], member[.b], member[.x]]]] assign[member[.toAngle], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=toAngle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=fromAngle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), if_false=MemberReference(member=toAngle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=360), operandr=MemberReference(member=toAngle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))] end[}] END[}]
Keyword[private] Keyword[void] identifier[calculateIntersectPoints] operator[SEP] operator[SEP] { identifier[intersectPoints] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[center] operator[SEP] identifier[x] operator[-] identifier[menuBounds] operator[SEP] identifier[left] operator[<] identifier[expandedRadius] operator[SEP] { Keyword[int] identifier[dy] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[expandedRadius] , Other[2] operator[SEP] operator[-] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[center] operator[SEP] identifier[x] operator[-] identifier[menuBounds] operator[SEP] identifier[left] , Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[center] operator[SEP] identifier[y] operator[-] identifier[dy] operator[>] identifier[menuBounds] operator[SEP] identifier[top] operator[SEP] { identifier[intersectPoints] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Point] operator[SEP] identifier[menuBounds] operator[SEP] identifier[left] , identifier[center] operator[SEP] identifier[y] operator[-] identifier[dy] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[center] operator[SEP] identifier[y] operator[+] identifier[dy] operator[<] identifier[menuBounds] operator[SEP] identifier[bottom] operator[SEP] { identifier[intersectPoints] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Point] operator[SEP] identifier[menuBounds] operator[SEP] identifier[left] , identifier[center] operator[SEP] identifier[y] operator[+] identifier[dy] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[center] operator[SEP] identifier[y] operator[-] identifier[menuBounds] operator[SEP] identifier[top] operator[<] identifier[expandedRadius] operator[SEP] { Keyword[int] identifier[dx] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[expandedRadius] , Other[2] operator[SEP] operator[-] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[center] operator[SEP] identifier[y] operator[-] identifier[menuBounds] operator[SEP] identifier[top] , Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[center] operator[SEP] identifier[x] operator[+] identifier[dx] operator[<] identifier[menuBounds] operator[SEP] identifier[right] operator[SEP] { identifier[intersectPoints] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Point] operator[SEP] identifier[center] operator[SEP] identifier[x] operator[+] identifier[dx] , identifier[menuBounds] operator[SEP] identifier[top] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[center] operator[SEP] identifier[x] operator[-] identifier[dx] operator[>] identifier[menuBounds] operator[SEP] identifier[left] operator[SEP] { identifier[intersectPoints] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Point] operator[SEP] identifier[center] operator[SEP] identifier[x] operator[-] identifier[dx] , identifier[menuBounds] operator[SEP] identifier[top] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[menuBounds] operator[SEP] identifier[right] operator[-] identifier[center] operator[SEP] identifier[x] operator[<] identifier[expandedRadius] operator[SEP] { Keyword[int] identifier[dy] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[expandedRadius] , Other[2] operator[SEP] operator[-] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[menuBounds] operator[SEP] identifier[right] operator[-] identifier[center] operator[SEP] identifier[x] , Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[center] operator[SEP] identifier[y] operator[-] identifier[dy] operator[>] identifier[menuBounds] operator[SEP] identifier[top] operator[SEP] { identifier[intersectPoints] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Point] operator[SEP] identifier[menuBounds] operator[SEP] identifier[right] , identifier[center] operator[SEP] identifier[y] operator[-] identifier[dy] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[center] operator[SEP] identifier[y] operator[+] identifier[dy] operator[<] identifier[menuBounds] operator[SEP] identifier[bottom] operator[SEP] { identifier[intersectPoints] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Point] operator[SEP] identifier[menuBounds] operator[SEP] identifier[right] , identifier[center] operator[SEP] identifier[y] operator[+] identifier[dy] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[menuBounds] operator[SEP] identifier[bottom] operator[-] identifier[center] operator[SEP] identifier[y] operator[<] identifier[expandedRadius] operator[SEP] { Keyword[int] identifier[dx] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[expandedRadius] , Other[2] operator[SEP] operator[-] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[menuBounds] operator[SEP] identifier[bottom] operator[-] identifier[center] operator[SEP] identifier[y] , Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[center] operator[SEP] identifier[x] operator[+] identifier[dx] operator[<] identifier[menuBounds] operator[SEP] identifier[right] operator[SEP] { identifier[intersectPoints] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Point] operator[SEP] identifier[center] operator[SEP] identifier[x] operator[+] identifier[dx] , identifier[menuBounds] operator[SEP] identifier[bottom] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[center] operator[SEP] identifier[x] operator[-] identifier[dx] operator[>] identifier[menuBounds] operator[SEP] identifier[left] operator[SEP] { identifier[intersectPoints] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Point] operator[SEP] identifier[center] operator[SEP] identifier[x] operator[-] identifier[dx] , identifier[menuBounds] operator[SEP] identifier[bottom] operator[SEP] operator[SEP] operator[SEP] } } Keyword[int] identifier[size] operator[=] identifier[intersectPoints] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[==] Other[0] operator[SEP] { identifier[fromAngle] operator[=] Other[0] operator[SEP] identifier[toAngle] operator[=] Other[360] operator[SEP] Keyword[return] operator[SEP] } Keyword[int] identifier[indexA] operator[=] identifier[size] operator[-] Other[1] operator[SEP] Keyword[double] identifier[maxAngle] operator[=] identifier[arcAngle] operator[SEP] identifier[center] , identifier[intersectPoints] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] , identifier[intersectPoints] operator[SEP] identifier[get] operator[SEP] identifier[indexA] operator[SEP] , identifier[menuBounds] , identifier[expandedRadius] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Point] identifier[a] operator[=] identifier[intersectPoints] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[Point] identifier[b] operator[=] identifier[intersectPoints] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[double] identifier[angle] operator[=] identifier[arcAngle] operator[SEP] identifier[center] , identifier[a] , identifier[b] , identifier[menuBounds] , identifier[expandedRadius] operator[SEP] operator[SEP] identifier[Point] identifier[midnormalPoint] operator[=] identifier[findMidnormalPoint] operator[SEP] identifier[center] , identifier[a] , identifier[b] , identifier[menuBounds] , identifier[expandedRadius] operator[SEP] operator[SEP] Keyword[int] identifier[pointerIndex] operator[=] identifier[i] operator[SEP] Keyword[int] identifier[endIndex] operator[=] identifier[indexA] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isClockwise] operator[SEP] identifier[center] , identifier[a] , identifier[midnormalPoint] operator[SEP] operator[SEP] { Keyword[int] identifier[tmpIndex] operator[=] identifier[pointerIndex] operator[SEP] identifier[pointerIndex] operator[=] identifier[endIndex] operator[SEP] identifier[endIndex] operator[=] identifier[tmpIndex] operator[SEP] } Keyword[if] operator[SEP] identifier[pointerIndex] operator[==] identifier[intersectPoints] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] { identifier[pointerIndex] operator[=] Other[0] operator[SEP] } Keyword[else] { identifier[pointerIndex] operator[++] operator[SEP] } Keyword[if] operator[SEP] identifier[pointerIndex] operator[==] identifier[endIndex] operator[&&] identifier[angle] operator[>] identifier[maxAngle] operator[SEP] { identifier[indexA] operator[=] identifier[i] operator[SEP] identifier[maxAngle] operator[=] identifier[angle] operator[SEP] } } identifier[Point] identifier[a] operator[=] identifier[intersectPoints] operator[SEP] identifier[get] operator[SEP] identifier[indexA] operator[SEP] operator[SEP] identifier[Point] identifier[b] operator[=] identifier[intersectPoints] operator[SEP] identifier[get] operator[SEP] identifier[indexA] operator[+] Other[1] operator[>=] identifier[size] operator[?] Other[0] operator[:] identifier[indexA] operator[+] Other[1] operator[SEP] operator[SEP] identifier[Point] identifier[midnormalPoint] operator[=] identifier[findMidnormalPoint] operator[SEP] identifier[center] , identifier[a] , identifier[b] , identifier[menuBounds] , identifier[expandedRadius] operator[SEP] operator[SEP] identifier[Point] identifier[x] operator[=] Keyword[new] identifier[Point] operator[SEP] identifier[menuBounds] operator[SEP] identifier[right] , identifier[center] operator[SEP] identifier[y] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isClockwise] operator[SEP] identifier[center] , identifier[a] , identifier[midnormalPoint] operator[SEP] operator[SEP] { identifier[Point] identifier[tmp] operator[=] identifier[a] operator[SEP] identifier[a] operator[=] identifier[b] operator[SEP] identifier[b] operator[=] identifier[tmp] operator[SEP] } identifier[fromAngle] operator[=] identifier[pointAngleOnCircle] operator[SEP] identifier[center] , identifier[a] , identifier[x] operator[SEP] operator[SEP] identifier[toAngle] operator[=] identifier[pointAngleOnCircle] operator[SEP] identifier[center] , identifier[b] , identifier[x] operator[SEP] operator[SEP] identifier[toAngle] operator[=] identifier[toAngle] operator[<=] identifier[fromAngle] operator[?] Other[360] operator[+] identifier[toAngle] operator[:] identifier[toAngle] operator[SEP] }
public java.util.Map<String, String> getEncryptionContext() { if (encryptionContext == null) { encryptionContext = new com.ibm.cloud.objectstorage.internal.SdkInternalMap<String, String>(); } return encryptionContext; }
class class_name[name] begin[{] method[getEncryptionContext, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.encryptionContext], ==, literal[null]]] begin[{] assign[member[.encryptionContext], 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=ibm, sub_type=ReferenceType(arguments=None, dimensions=None, name=cloud, sub_type=ReferenceType(arguments=None, dimensions=None, name=objectstorage, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalMap, sub_type=None)))))))] else begin[{] None end[}] return[member[.encryptionContext]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[getEncryptionContext] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[encryptionContext] operator[==] Other[null] operator[SEP] { identifier[encryptionContext] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[cloud] operator[SEP] identifier[objectstorage] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[encryptionContext] operator[SEP] }
public int getTrackNumberNumeric() { String number = getTrackNumber(); if(number == null) return -1; try { return Integer.parseInt(number); } catch(NumberFormatException e) { return -1; } }
class class_name[name] begin[{] method[getTrackNumberNumeric, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[String], number] if[binary_operation[member[.number], ==, literal[null]]] begin[{] return[literal[1]] else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=number, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=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) end[}] END[}]
Keyword[public] Keyword[int] identifier[getTrackNumberNumeric] operator[SEP] operator[SEP] { identifier[String] identifier[number] operator[=] identifier[getTrackNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[number] operator[==] Other[null] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] Keyword[try] { Keyword[return] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[number] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } }
protected void notifyUpdate(String key, Map<String, Object> value) { if (value.size() == 1) { Map.Entry<String, Object> entry = value.entrySet().iterator().next(); notifyUpdate(entry.getKey(), entry.getValue()); return; } for (ISharedObjectListener listener : listeners) { listener.onSharedObjectUpdate(this, key, value); } }
class class_name[name] begin[{] method[notifyUpdate, return_type[void], modifier[protected], parameter[key, value]] begin[{] if[binary_operation[call[value.size, parameter[]], ==, literal[1]]] begin[{] local_variable[type[Map], entry] call[.notifyUpdate, parameter[call[entry.getKey, parameter[]], call[entry.getValue, parameter[]]]] return[None] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onSharedObjectUpdate, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=listeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ISharedObjectListener, sub_type=None))), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[notifyUpdate] operator[SEP] identifier[String] identifier[key] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[entry] operator[=] identifier[value] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[notifyUpdate] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[for] operator[SEP] identifier[ISharedObjectListener] identifier[listener] operator[:] identifier[listeners] operator[SEP] { identifier[listener] operator[SEP] identifier[onSharedObjectUpdate] operator[SEP] Keyword[this] , identifier[key] , identifier[value] operator[SEP] operator[SEP] } }
public static void touch(Resource res) throws IOException { if (res.exists()) { res.setLastModified(System.currentTimeMillis()); } else { res.createFile(true); } }
class class_name[name] begin[{] method[touch, return_type[void], modifier[public static], parameter[res]] begin[{] if[call[res.exists, parameter[]]] begin[{] call[res.setLastModified, parameter[call[System.currentTimeMillis, parameter[]]]] else begin[{] call[res.createFile, parameter[literal[true]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[touch] operator[SEP] identifier[Resource] identifier[res] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[res] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[res] operator[SEP] identifier[setLastModified] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[res] operator[SEP] identifier[createFile] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } }
final int getFieldId() { int id; if (_field_name_type == null) { throw new IllegalStateException("the field has not be set"); } switch (_field_name_type) { case STRING: try { id = add_symbol(_field_name); } catch (IOException e) { throw new IonException(e); } // TODO cache the sid? break; case INT: id = _field_name_sid; break; default: throw new IllegalStateException("the field has not be set"); } return id; }
class class_name[name] begin[{] method[getFieldId, return_type[type[int]], modifier[final], parameter[]] begin[{] local_variable[type[int], id] if[binary_operation[member[._field_name_type], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="the field has not be set")], 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[}] SwitchStatement(cases=[SwitchStatementCase(case=['STRING'], statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=_field_name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add_symbol, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IonException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['INT'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=_field_name_sid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="the field has not be set")], 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)])], expression=MemberReference(member=_field_name_type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[member[.id]] end[}] END[}]
Keyword[final] Keyword[int] identifier[getFieldId] operator[SEP] operator[SEP] { Keyword[int] identifier[id] operator[SEP] Keyword[if] operator[SEP] identifier[_field_name_type] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[switch] operator[SEP] identifier[_field_name_type] operator[SEP] { Keyword[case] identifier[STRING] operator[:] Keyword[try] { identifier[id] operator[=] identifier[add_symbol] operator[SEP] identifier[_field_name] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IonException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] Keyword[case] identifier[INT] operator[:] identifier[id] operator[=] identifier[_field_name_sid] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[id] operator[SEP] }
public static CPTaxCategory remove(long CPTaxCategoryId) throws com.liferay.commerce.product.exception.NoSuchCPTaxCategoryException { return getPersistence().remove(CPTaxCategoryId); }
class class_name[name] begin[{] method[remove, return_type[type[CPTaxCategory]], modifier[public static], parameter[CPTaxCategoryId]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CPTaxCategory] identifier[remove] operator[SEP] Keyword[long] identifier[CPTaxCategoryId] operator[SEP] Keyword[throws] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[product] operator[SEP] identifier[exception] operator[SEP] identifier[NoSuchCPTaxCategoryException] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[CPTaxCategoryId] operator[SEP] operator[SEP] }
public static boolean isAlreadyRegisteredIn(ObjectMapper mapper) { Assert.notNull(mapper, "ObjectMapper must not be null!"); return LinkMixin.class.equals(mapper.findMixInClassFor(Link.class)); }
class class_name[name] begin[{] method[isAlreadyRegisteredIn, return_type[type[boolean]], modifier[public static], parameter[mapper]] begin[{] call[Assert.notNull, parameter[member[.mapper], literal["ObjectMapper must not be null!"]]] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Link, sub_type=None))], member=findMixInClassFor, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=LinkMixin, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isAlreadyRegisteredIn] operator[SEP] identifier[ObjectMapper] identifier[mapper] operator[SEP] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[mapper] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[LinkMixin] operator[SEP] Keyword[class] operator[SEP] identifier[equals] operator[SEP] identifier[mapper] operator[SEP] identifier[findMixInClassFor] operator[SEP] identifier[Link] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] }
public void addDatastream(Datastream datastream, boolean addNewVersion) throws ServerException { assertNotInvalidated(); assertNotPendingRemoval(); // use this call to handle versionable m_obj.addDatastreamVersion(datastream, addNewVersion); }
class class_name[name] begin[{] method[addDatastream, return_type[void], modifier[public], parameter[datastream, addNewVersion]] begin[{] call[.assertNotInvalidated, parameter[]] call[.assertNotPendingRemoval, parameter[]] call[m_obj.addDatastreamVersion, parameter[member[.datastream], member[.addNewVersion]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addDatastream] operator[SEP] identifier[Datastream] identifier[datastream] , Keyword[boolean] identifier[addNewVersion] operator[SEP] Keyword[throws] identifier[ServerException] { identifier[assertNotInvalidated] operator[SEP] operator[SEP] operator[SEP] identifier[assertNotPendingRemoval] operator[SEP] operator[SEP] operator[SEP] identifier[m_obj] operator[SEP] identifier[addDatastreamVersion] operator[SEP] identifier[datastream] , identifier[addNewVersion] operator[SEP] operator[SEP] }
public List<String> preview(int limit, boolean noHeaderLine) { E.illegalArgumentIf(limit < 1, "limit must be positive integer"); return fetch(noHeaderLine ? 1 : 0, limit); }
class class_name[name] begin[{] method[preview, return_type[type[List]], modifier[public], parameter[limit, noHeaderLine]] begin[{] call[E.illegalArgumentIf, parameter[binary_operation[member[.limit], <, literal[1]], literal["limit must be positive integer"]]] return[call[.fetch, parameter[TernaryExpression(condition=MemberReference(member=noHeaderLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), member[.limit]]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[preview] operator[SEP] Keyword[int] identifier[limit] , Keyword[boolean] identifier[noHeaderLine] operator[SEP] { identifier[E] operator[SEP] identifier[illegalArgumentIf] operator[SEP] identifier[limit] operator[<] Other[1] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[fetch] operator[SEP] identifier[noHeaderLine] operator[?] Other[1] operator[:] Other[0] , identifier[limit] operator[SEP] operator[SEP] }
public FaceDetail withEmotions(Emotion... emotions) { if (this.emotions == null) { setEmotions(new java.util.ArrayList<Emotion>(emotions.length)); } for (Emotion ele : emotions) { this.emotions.add(ele); } return this; }
class class_name[name] begin[{] method[withEmotions, return_type[type[FaceDetail]], modifier[public], parameter[emotions]] begin[{] if[binary_operation[THIS[member[None.emotions]], ==, literal[null]]] begin[{] call[.setEmotions, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=emotions, 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=Emotion, 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=emotions, 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=emotions, 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=Emotion, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[FaceDetail] identifier[withEmotions] operator[SEP] identifier[Emotion] operator[...] identifier[emotions] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[emotions] operator[==] Other[null] operator[SEP] { identifier[setEmotions] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[Emotion] operator[>] operator[SEP] identifier[emotions] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Emotion] identifier[ele] operator[:] identifier[emotions] operator[SEP] { Keyword[this] operator[SEP] identifier[emotions] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public Map<String, Boolean> getNamesOfConfigurationSources() { final Map<String, Boolean> result = new LinkedHashMap<String, Boolean>(); for (ConfigurationSource configurationSource : configurationSources) { result.put(configurationSource.getName(), configurationSource.isSavingPossible()); } return result; }
class class_name[name] begin[{] method[getNamesOfConfigurationSources, return_type[type[Map]], modifier[public], parameter[]] begin[{] local_variable[type[Map], result] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=configurationSource, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=isSavingPossible, postfix_operators=[], prefix_operators=[], qualifier=configurationSource, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=configurationSources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=configurationSource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConfigurationSource, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Boolean] operator[>] identifier[getNamesOfConfigurationSources] operator[SEP] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Boolean] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[Boolean] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ConfigurationSource] identifier[configurationSource] operator[:] identifier[configurationSources] operator[SEP] { identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[configurationSource] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[configurationSource] operator[SEP] identifier[isSavingPossible] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public T text(CharSequence text, boolean goneIfEmpty) { if (goneIfEmpty && (text == null || text.length() == 0)) { return gone(); } else { return text(text); } }
class class_name[name] begin[{] method[text, return_type[type[T]], modifier[public], parameter[text, goneIfEmpty]] begin[{] if[binary_operation[member[.goneIfEmpty], &&, binary_operation[binary_operation[member[.text], ==, literal[null]], ||, binary_operation[call[text.length, parameter[]], ==, literal[0]]]]] begin[{] return[call[.gone, parameter[]]] else begin[{] return[call[.text, parameter[member[.text]]]] end[}] end[}] END[}]
Keyword[public] identifier[T] identifier[text] operator[SEP] identifier[CharSequence] identifier[text] , Keyword[boolean] identifier[goneIfEmpty] operator[SEP] { Keyword[if] operator[SEP] identifier[goneIfEmpty] operator[&&] operator[SEP] identifier[text] operator[==] Other[null] operator[||] identifier[text] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] { Keyword[return] identifier[gone] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[text] operator[SEP] identifier[text] operator[SEP] operator[SEP] } }
public Alias getAlias(String aliasName) { Alias result = null; for (Alias item : getAliasesList()) { if (item.getName().equals(aliasName)) { result = item; } } return result; }
class class_name[name] begin[{] method[getAlias, return_type[type[Alias]], modifier[public], parameter[aliasName]] begin[{] local_variable[type[Alias], result] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[MethodInvocation(arguments=[MemberReference(member=aliasName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getAliasesList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Alias, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[Alias] identifier[getAlias] operator[SEP] identifier[String] identifier[aliasName] operator[SEP] { identifier[Alias] identifier[result] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[Alias] identifier[item] operator[:] identifier[getAliasesList] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[aliasName] operator[SEP] operator[SEP] { identifier[result] operator[=] identifier[item] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
private void optimize(NavPath path) { int pt = 0; while (pt < path.length()-2) { float sx = path.getX(pt); float sy = path.getY(pt); float nx = path.getX(pt+2); float ny = path.getY(pt+2); if (isClear(sx,sy,nx,ny,0.1f)) { path.remove(pt+1); } else { pt++; } } }
class class_name[name] begin[{] method[optimize, return_type[void], modifier[private], parameter[path]] begin[{] local_variable[type[int], pt] while[binary_operation[member[.pt], <, binary_operation[call[path.length, parameter[]], -, literal[2]]]] begin[{] local_variable[type[float], sx] local_variable[type[float], sy] local_variable[type[float], nx] local_variable[type[float], ny] if[call[.isClear, parameter[member[.sx], member[.sy], member[.nx], member[.ny], literal[0.1f]]]] begin[{] call[path.remove, parameter[binary_operation[member[.pt], +, literal[1]]]] else begin[{] member[.pt] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[optimize] operator[SEP] identifier[NavPath] identifier[path] operator[SEP] { Keyword[int] identifier[pt] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[pt] operator[<] identifier[path] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[2] operator[SEP] { Keyword[float] identifier[sx] operator[=] identifier[path] operator[SEP] identifier[getX] operator[SEP] identifier[pt] operator[SEP] operator[SEP] Keyword[float] identifier[sy] operator[=] identifier[path] operator[SEP] identifier[getY] operator[SEP] identifier[pt] operator[SEP] operator[SEP] Keyword[float] identifier[nx] operator[=] identifier[path] operator[SEP] identifier[getX] operator[SEP] identifier[pt] operator[+] Other[2] operator[SEP] operator[SEP] Keyword[float] identifier[ny] operator[=] identifier[path] operator[SEP] identifier[getY] operator[SEP] identifier[pt] operator[+] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isClear] operator[SEP] identifier[sx] , identifier[sy] , identifier[nx] , identifier[ny] , literal[Float] operator[SEP] operator[SEP] { identifier[path] operator[SEP] identifier[remove] operator[SEP] identifier[pt] operator[+] Other[1] operator[SEP] operator[SEP] } Keyword[else] { identifier[pt] operator[++] operator[SEP] } } }
public AddressBuilderPath setDecoded(CharSequence name, Object... values) { parent.setDecoded(name, values); return this; }
class class_name[name] begin[{] method[setDecoded, return_type[type[AddressBuilderPath]], modifier[public], parameter[name, values]] begin[{] call[parent.setDecoded, parameter[member[.name], member[.values]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[AddressBuilderPath] identifier[setDecoded] operator[SEP] identifier[CharSequence] identifier[name] , identifier[Object] operator[...] identifier[values] operator[SEP] { identifier[parent] operator[SEP] identifier[setDecoded] operator[SEP] identifier[name] , identifier[values] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public String getXAExceptionContents(XAException xae) { StringBuilder xsb = new StringBuilder(350); try { Class<?> c = WSManagedConnectionFactoryImpl.priv.loadClass(mcf.jdbcDriverLoader, "oracle.jdbc.xa.OracleXAException"); if (c.isInstance(xae)) { int xaerror = (Integer) c.getMethod("getXAError").invoke(xae); int oraerr = (Integer) c.getMethod("getOracleError").invoke(xae); Method getXAErrorMessage = c.getMethod("getXAErrorMessage", int.class); String EOLN = AdapterUtil.EOLN; xsb.append(EOLN).append("The XA Error is : ").append(xaerror).append(EOLN); xsb.append("The XA Error message is : ").append(getXAErrorMessage.invoke(null, xaerror)).append(EOLN); xsb.append("The Oracle Error code is : ").append(oraerr).append(EOLN); xsb.append("The Oracle Error message is: ").append(getXAErrorMessage.invoke(null, oraerr)).append(EOLN); } } catch (Exception x) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getXAExceptionContents", x); } if (xae.getCause() != null) xsb.append("The cause is : ").append(xae.getCause()); return xsb.toString(); }
class class_name[name] begin[{] method[getXAExceptionContents, return_type[type[String]], modifier[public], parameter[xae]] begin[{] local_variable[type[StringBuilder], xsb] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=jdbcDriverLoader, postfix_operators=[], prefix_operators=[], qualifier=mcf, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="oracle.jdbc.xa.OracleXAException")], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=WSManagedConnectionFactoryImpl.priv, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=xae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInstance, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getXAError")], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[MemberReference(member=xae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=xaerror)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getOracleError")], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[MemberReference(member=xae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), name=oraerr)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getXAErrorMessage"), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int))], member=getMethod, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), name=getXAErrorMessage)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=EOLN, postfix_operators=[], prefix_operators=[], qualifier=AdapterUtil, selectors=[]), name=EOLN)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=EOLN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=xsb, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The XA Error is : ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=xaerror, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=EOLN, 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), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The XA Error message is : ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=xsb, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=xaerror, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=getXAErrorMessage, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=EOLN, 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), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The Oracle Error code is : ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=xsb, selectors=[MethodInvocation(arguments=[MemberReference(member=oraerr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=EOLN, 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), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The Oracle Error message is: ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=xsb, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=oraerr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=getXAErrorMessage, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=EOLN, 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)]))], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getXAExceptionContents"), MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=x, types=['Exception']))], finally_block=None, label=None, resources=None) if[binary_operation[call[xae.getCause, parameter[]], !=, literal[null]]] begin[{] call[xsb.append, parameter[literal["The cause is : "]]] else begin[{] None end[}] return[call[xsb.toString, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getXAExceptionContents] operator[SEP] identifier[XAException] identifier[xae] operator[SEP] { identifier[StringBuilder] identifier[xsb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[350] operator[SEP] operator[SEP] Keyword[try] { identifier[Class] operator[<] operator[?] operator[>] identifier[c] operator[=] identifier[WSManagedConnectionFactoryImpl] operator[SEP] identifier[priv] operator[SEP] identifier[loadClass] operator[SEP] identifier[mcf] operator[SEP] identifier[jdbcDriverLoader] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[SEP] identifier[isInstance] operator[SEP] identifier[xae] operator[SEP] operator[SEP] { Keyword[int] identifier[xaerror] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[c] operator[SEP] identifier[getMethod] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] identifier[xae] operator[SEP] operator[SEP] Keyword[int] identifier[oraerr] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[c] operator[SEP] identifier[getMethod] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] identifier[xae] operator[SEP] operator[SEP] identifier[Method] identifier[getXAErrorMessage] operator[=] identifier[c] operator[SEP] identifier[getMethod] operator[SEP] literal[String] , Keyword[int] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[String] identifier[EOLN] operator[=] identifier[AdapterUtil] operator[SEP] identifier[EOLN] operator[SEP] identifier[xsb] operator[SEP] identifier[append] operator[SEP] identifier[EOLN] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[xaerror] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[EOLN] operator[SEP] operator[SEP] identifier[xsb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getXAErrorMessage] operator[SEP] identifier[invoke] operator[SEP] Other[null] , identifier[xaerror] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[EOLN] operator[SEP] operator[SEP] identifier[xsb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[oraerr] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[EOLN] operator[SEP] operator[SEP] identifier[xsb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getXAErrorMessage] operator[SEP] identifier[invoke] operator[SEP] Other[null] , identifier[oraerr] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[EOLN] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[x] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[x] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[xae] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[xsb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[xae] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[xsb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private IndexedContainer getContainerForType(WidgetType type, boolean realOnly, String ou) throws CmsException { IndexedContainer res = null; List<FontIcon> icon = new ArrayList<FontIcon>(); if (!OpenCms.getRoleManager().hasRole(m_cms, CmsRole.ACCOUNT_MANAGER)) { List<CmsGroup> groups = OpenCms.getOrgUnitManager().getGroups( m_cms, m_cms.getRequestContext().getOuFqn(), false); return CmsVaadinUtils.getPrincipalContainer( A_CmsUI.getCmsObject(), groups, ID_CAPTION, ID_DESC, ID_ICON, ID_OU, OpenCmsTheme.ICON_GROUP, icon); } if (type.equals(WidgetType.groupwidget) | type.equals(WidgetType.principalwidget)) { List<CmsGroup> groups = OpenCms.getRoleManager().getManageableGroups(m_cms, ou, false); if (!realOnly) { groups.add( 0, new CmsGroup( CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID, null, CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_LABEL_ALLOTHERS_0), CmsVaadinUtils.getMessageText( org.opencms.workplace.commons.Messages.GUI_DESCRIPTION_ALLOTHERS_0), 0)); icon.add(new CmsCssIcon(OpenCmsTheme.ICON_PRINCIPAL_ALL)); if (OpenCms.getRoleManager().hasRole(m_cms, CmsRole.VFS_MANAGER)) { groups.add( 0, new CmsGroup( CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID, null, CmsVaadinUtils.getMessageText( org.opencms.workplace.commons.Messages.GUI_LABEL_OVERWRITEALL_0), CmsVaadinUtils.getMessageText( org.opencms.workplace.commons.Messages.GUI_DESCRIPTION_OVERWRITEALL_0), 0)); icon.add(0, new CmsCssIcon(OpenCmsTheme.ICON_PRINCIPAL_OVERWRITE)); } } res = CmsVaadinUtils.getPrincipalContainer( A_CmsUI.getCmsObject(), groups, ID_CAPTION, ID_DESC, ID_ICON, ID_OU, OpenCmsTheme.ICON_GROUP, icon); } if (type.equals(WidgetType.userwidget)) { List<CmsUser> users = OpenCms.getRoleManager().getManageableUsers(m_cms, ou, false, true); if (!realOnly) { CmsUser user = new CmsUser( CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID, CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_LABEL_ALLOTHERS_0), "", "", "", "", 0, 0, 0, null); user.setDescription( CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_DESCRIPTION_ALLOTHERS_0)); users.add(0, user); icon.add(new CmsCssIcon(OpenCmsTheme.ICON_PRINCIPAL_ALL)); if (OpenCms.getRoleManager().hasRole(m_cms, CmsRole.VFS_MANAGER)) { user = new CmsUser( CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID, CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_LABEL_OVERWRITEALL_0), "", "", "", "", 0, 0, 0, null); user.setDescription( CmsVaadinUtils.getMessageText( org.opencms.workplace.commons.Messages.GUI_DESCRIPTION_OVERWRITEALL_0)); users.add(0, user); icon.add(0, new CmsCssIcon(OpenCmsTheme.ICON_PRINCIPAL_OVERWRITE)); } } res = CmsVaadinUtils.getPrincipalContainer( A_CmsUI.getCmsObject(), users, ID_CAPTION, ID_DESC, ID_ICON, ID_OU, OpenCmsTheme.ICON_USER, icon); } return res; }
class class_name[name] begin[{] method[getContainerForType, return_type[type[IndexedContainer]], modifier[private], parameter[type, realOnly, ou]] begin[{] local_variable[type[IndexedContainer], res] local_variable[type[List], icon] if[call[OpenCms.getRoleManager, parameter[]]] begin[{] local_variable[type[List], groups] return[call[CmsVaadinUtils.getPrincipalContainer, parameter[call[A_CmsUI.getCmsObject, parameter[]], member[.groups], member[.ID_CAPTION], member[.ID_DESC], member[.ID_ICON], member[.ID_OU], member[OpenCmsTheme.ICON_GROUP], member[.icon]]]] else begin[{] None end[}] if[binary_operation[call[type.equals, parameter[member[WidgetType.groupwidget]]], |, call[type.equals, parameter[member[WidgetType.principalwidget]]]]] begin[{] local_variable[type[List], groups] if[member[.realOnly]] begin[{] call[groups.add, parameter[literal[0], ClassCreator(arguments=[MemberReference(member=PRINCIPAL_ALL_OTHERS_ID, postfix_operators=[], prefix_operators=[], qualifier=CmsAccessControlEntry, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[MemberReference(member=GUI_LABEL_ALLOTHERS_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.workplace.commons.Messages, selectors=[])], member=getMessageText, postfix_operators=[], prefix_operators=[], qualifier=CmsVaadinUtils, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=GUI_DESCRIPTION_ALLOTHERS_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.workplace.commons.Messages, selectors=[])], member=getMessageText, postfix_operators=[], prefix_operators=[], qualifier=CmsVaadinUtils, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsGroup, sub_type=None))]] call[icon.add, parameter[ClassCreator(arguments=[MemberReference(member=ICON_PRINCIPAL_ALL, postfix_operators=[], prefix_operators=[], qualifier=OpenCmsTheme, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsCssIcon, sub_type=None))]] if[call[OpenCms.getRoleManager, parameter[]]] begin[{] call[groups.add, parameter[literal[0], ClassCreator(arguments=[MemberReference(member=PRINCIPAL_OVERWRITE_ALL_ID, postfix_operators=[], prefix_operators=[], qualifier=CmsAccessControlEntry, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MethodInvocation(arguments=[MemberReference(member=GUI_LABEL_OVERWRITEALL_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.workplace.commons.Messages, selectors=[])], member=getMessageText, postfix_operators=[], prefix_operators=[], qualifier=CmsVaadinUtils, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=GUI_DESCRIPTION_OVERWRITEALL_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.workplace.commons.Messages, selectors=[])], member=getMessageText, postfix_operators=[], prefix_operators=[], qualifier=CmsVaadinUtils, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsGroup, sub_type=None))]] call[icon.add, parameter[literal[0], ClassCreator(arguments=[MemberReference(member=ICON_PRINCIPAL_OVERWRITE, postfix_operators=[], prefix_operators=[], qualifier=OpenCmsTheme, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsCssIcon, sub_type=None))]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.res], call[CmsVaadinUtils.getPrincipalContainer, parameter[call[A_CmsUI.getCmsObject, parameter[]], member[.groups], member[.ID_CAPTION], member[.ID_DESC], member[.ID_ICON], member[.ID_OU], member[OpenCmsTheme.ICON_GROUP], member[.icon]]]] else begin[{] None end[}] if[call[type.equals, parameter[member[WidgetType.userwidget]]]] begin[{] local_variable[type[List], users] if[member[.realOnly]] begin[{] local_variable[type[CmsUser], user] call[user.setDescription, parameter[call[CmsVaadinUtils.getMessageText, parameter[member[org.opencms.workplace.commons.Messages.GUI_DESCRIPTION_ALLOTHERS_0]]]]] call[users.add, parameter[literal[0], member[.user]]] call[icon.add, parameter[ClassCreator(arguments=[MemberReference(member=ICON_PRINCIPAL_ALL, postfix_operators=[], prefix_operators=[], qualifier=OpenCmsTheme, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsCssIcon, sub_type=None))]] if[call[OpenCms.getRoleManager, parameter[]]] begin[{] assign[member[.user], ClassCreator(arguments=[MemberReference(member=PRINCIPAL_OVERWRITE_ALL_ID, postfix_operators=[], prefix_operators=[], qualifier=CmsAccessControlEntry, selectors=[]), MethodInvocation(arguments=[MemberReference(member=GUI_LABEL_OVERWRITEALL_0, postfix_operators=[], prefix_operators=[], qualifier=org.opencms.workplace.commons.Messages, selectors=[])], member=getMessageText, postfix_operators=[], prefix_operators=[], qualifier=CmsVaadinUtils, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsUser, sub_type=None))] call[user.setDescription, parameter[call[CmsVaadinUtils.getMessageText, parameter[member[org.opencms.workplace.commons.Messages.GUI_DESCRIPTION_OVERWRITEALL_0]]]]] call[users.add, parameter[literal[0], member[.user]]] call[icon.add, parameter[literal[0], ClassCreator(arguments=[MemberReference(member=ICON_PRINCIPAL_OVERWRITE, postfix_operators=[], prefix_operators=[], qualifier=OpenCmsTheme, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsCssIcon, sub_type=None))]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.res], call[CmsVaadinUtils.getPrincipalContainer, parameter[call[A_CmsUI.getCmsObject, parameter[]], member[.users], member[.ID_CAPTION], member[.ID_DESC], member[.ID_ICON], member[.ID_OU], member[OpenCmsTheme.ICON_USER], member[.icon]]]] else begin[{] None end[}] return[member[.res]] end[}] END[}]
Keyword[private] identifier[IndexedContainer] identifier[getContainerForType] operator[SEP] identifier[WidgetType] identifier[type] , Keyword[boolean] identifier[realOnly] , identifier[String] identifier[ou] operator[SEP] Keyword[throws] identifier[CmsException] { identifier[IndexedContainer] identifier[res] operator[=] Other[null] operator[SEP] identifier[List] operator[<] identifier[FontIcon] operator[>] identifier[icon] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[FontIcon] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[OpenCms] operator[SEP] identifier[getRoleManager] operator[SEP] operator[SEP] operator[SEP] identifier[hasRole] operator[SEP] identifier[m_cms] , identifier[CmsRole] operator[SEP] identifier[ACCOUNT_MANAGER] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[CmsGroup] operator[>] identifier[groups] operator[=] identifier[OpenCms] operator[SEP] identifier[getOrgUnitManager] operator[SEP] operator[SEP] operator[SEP] identifier[getGroups] operator[SEP] identifier[m_cms] , identifier[m_cms] operator[SEP] identifier[getRequestContext] operator[SEP] operator[SEP] operator[SEP] identifier[getOuFqn] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[CmsVaadinUtils] operator[SEP] identifier[getPrincipalContainer] operator[SEP] identifier[A_CmsUI] operator[SEP] identifier[getCmsObject] operator[SEP] operator[SEP] , identifier[groups] , identifier[ID_CAPTION] , identifier[ID_DESC] , identifier[ID_ICON] , identifier[ID_OU] , identifier[OpenCmsTheme] operator[SEP] identifier[ICON_GROUP] , identifier[icon] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[WidgetType] operator[SEP] identifier[groupwidget] operator[SEP] operator[|] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[WidgetType] operator[SEP] identifier[principalwidget] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[CmsGroup] operator[>] identifier[groups] operator[=] identifier[OpenCms] operator[SEP] identifier[getRoleManager] operator[SEP] operator[SEP] operator[SEP] identifier[getManageableGroups] operator[SEP] identifier[m_cms] , identifier[ou] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[realOnly] operator[SEP] { identifier[groups] operator[SEP] identifier[add] operator[SEP] Other[0] , Keyword[new] identifier[CmsGroup] operator[SEP] identifier[CmsAccessControlEntry] operator[SEP] identifier[PRINCIPAL_ALL_OTHERS_ID] , Other[null] , identifier[CmsVaadinUtils] operator[SEP] identifier[getMessageText] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[workplace] operator[SEP] identifier[commons] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LABEL_ALLOTHERS_0] operator[SEP] , identifier[CmsVaadinUtils] operator[SEP] identifier[getMessageText] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[workplace] operator[SEP] identifier[commons] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_DESCRIPTION_ALLOTHERS_0] operator[SEP] , Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[icon] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsCssIcon] operator[SEP] identifier[OpenCmsTheme] operator[SEP] identifier[ICON_PRINCIPAL_ALL] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getRoleManager] operator[SEP] operator[SEP] operator[SEP] identifier[hasRole] operator[SEP] identifier[m_cms] , identifier[CmsRole] operator[SEP] identifier[VFS_MANAGER] operator[SEP] operator[SEP] { identifier[groups] operator[SEP] identifier[add] operator[SEP] Other[0] , Keyword[new] identifier[CmsGroup] operator[SEP] identifier[CmsAccessControlEntry] operator[SEP] identifier[PRINCIPAL_OVERWRITE_ALL_ID] , Other[null] , identifier[CmsVaadinUtils] operator[SEP] identifier[getMessageText] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[workplace] operator[SEP] identifier[commons] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LABEL_OVERWRITEALL_0] operator[SEP] , identifier[CmsVaadinUtils] operator[SEP] identifier[getMessageText] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[workplace] operator[SEP] identifier[commons] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_DESCRIPTION_OVERWRITEALL_0] operator[SEP] , Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[icon] operator[SEP] identifier[add] operator[SEP] Other[0] , Keyword[new] identifier[CmsCssIcon] operator[SEP] identifier[OpenCmsTheme] operator[SEP] identifier[ICON_PRINCIPAL_OVERWRITE] operator[SEP] operator[SEP] operator[SEP] } } identifier[res] operator[=] identifier[CmsVaadinUtils] operator[SEP] identifier[getPrincipalContainer] operator[SEP] identifier[A_CmsUI] operator[SEP] identifier[getCmsObject] operator[SEP] operator[SEP] , identifier[groups] , identifier[ID_CAPTION] , identifier[ID_DESC] , identifier[ID_ICON] , identifier[ID_OU] , identifier[OpenCmsTheme] operator[SEP] identifier[ICON_GROUP] , identifier[icon] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[equals] operator[SEP] identifier[WidgetType] operator[SEP] identifier[userwidget] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[CmsUser] operator[>] identifier[users] operator[=] identifier[OpenCms] operator[SEP] identifier[getRoleManager] operator[SEP] operator[SEP] operator[SEP] identifier[getManageableUsers] operator[SEP] identifier[m_cms] , identifier[ou] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[realOnly] operator[SEP] { identifier[CmsUser] identifier[user] operator[=] Keyword[new] identifier[CmsUser] operator[SEP] identifier[CmsAccessControlEntry] operator[SEP] identifier[PRINCIPAL_ALL_OTHERS_ID] , identifier[CmsVaadinUtils] operator[SEP] identifier[getMessageText] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[workplace] operator[SEP] identifier[commons] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LABEL_ALLOTHERS_0] operator[SEP] , literal[String] , literal[String] , literal[String] , literal[String] , Other[0] , Other[0] , Other[0] , Other[null] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setDescription] operator[SEP] identifier[CmsVaadinUtils] operator[SEP] identifier[getMessageText] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[workplace] operator[SEP] identifier[commons] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_DESCRIPTION_ALLOTHERS_0] operator[SEP] operator[SEP] operator[SEP] identifier[users] operator[SEP] identifier[add] operator[SEP] Other[0] , identifier[user] operator[SEP] operator[SEP] identifier[icon] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsCssIcon] operator[SEP] identifier[OpenCmsTheme] operator[SEP] identifier[ICON_PRINCIPAL_ALL] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[OpenCms] operator[SEP] identifier[getRoleManager] operator[SEP] operator[SEP] operator[SEP] identifier[hasRole] operator[SEP] identifier[m_cms] , identifier[CmsRole] operator[SEP] identifier[VFS_MANAGER] operator[SEP] operator[SEP] { identifier[user] operator[=] Keyword[new] identifier[CmsUser] operator[SEP] identifier[CmsAccessControlEntry] operator[SEP] identifier[PRINCIPAL_OVERWRITE_ALL_ID] , identifier[CmsVaadinUtils] operator[SEP] identifier[getMessageText] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[workplace] operator[SEP] identifier[commons] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_LABEL_OVERWRITEALL_0] operator[SEP] , literal[String] , literal[String] , literal[String] , literal[String] , Other[0] , Other[0] , Other[0] , Other[null] operator[SEP] operator[SEP] identifier[user] operator[SEP] identifier[setDescription] operator[SEP] identifier[CmsVaadinUtils] operator[SEP] identifier[getMessageText] operator[SEP] identifier[org] operator[SEP] identifier[opencms] operator[SEP] identifier[workplace] operator[SEP] identifier[commons] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_DESCRIPTION_OVERWRITEALL_0] operator[SEP] operator[SEP] operator[SEP] identifier[users] operator[SEP] identifier[add] operator[SEP] Other[0] , identifier[user] operator[SEP] operator[SEP] identifier[icon] operator[SEP] identifier[add] operator[SEP] Other[0] , Keyword[new] identifier[CmsCssIcon] operator[SEP] identifier[OpenCmsTheme] operator[SEP] identifier[ICON_PRINCIPAL_OVERWRITE] operator[SEP] operator[SEP] operator[SEP] } } identifier[res] operator[=] identifier[CmsVaadinUtils] operator[SEP] identifier[getPrincipalContainer] operator[SEP] identifier[A_CmsUI] operator[SEP] identifier[getCmsObject] operator[SEP] operator[SEP] , identifier[users] , identifier[ID_CAPTION] , identifier[ID_DESC] , identifier[ID_ICON] , identifier[ID_OU] , identifier[OpenCmsTheme] operator[SEP] identifier[ICON_USER] , identifier[icon] operator[SEP] operator[SEP] } Keyword[return] identifier[res] operator[SEP] }
public static final Object getImpl(Object obj) { InvocationHandler handler; return Proxy.isProxyClass(obj.getClass()) && (handler = Proxy.getInvocationHandler(obj)) instanceof WSJdbcTracer ? ((WSJdbcTracer) handler).impl : obj; }
class class_name[name] begin[{] method[getImpl, return_type[type[Object]], modifier[final public static], parameter[obj]] begin[{] local_variable[type[InvocationHandler], handler] return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None)], member=isProxyClass, postfix_operators=[], prefix_operators=[], qualifier=Proxy, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInvocationHandler, postfix_operators=[], prefix_operators=[], qualifier=Proxy, selectors=[], type_arguments=None)), operandr=ReferenceType(arguments=None, dimensions=[], name=WSJdbcTracer, sub_type=None), operator=instanceof), operator=&&), if_false=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Cast(expression=MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=WSJdbcTracer, sub_type=None)))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] identifier[Object] identifier[getImpl] operator[SEP] identifier[Object] identifier[obj] operator[SEP] { identifier[InvocationHandler] identifier[handler] operator[SEP] Keyword[return] identifier[Proxy] operator[SEP] identifier[isProxyClass] operator[SEP] identifier[obj] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[handler] operator[=] identifier[Proxy] operator[SEP] identifier[getInvocationHandler] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[instanceof] identifier[WSJdbcTracer] operator[?] operator[SEP] operator[SEP] identifier[WSJdbcTracer] operator[SEP] identifier[handler] operator[SEP] operator[SEP] identifier[impl] operator[:] identifier[obj] operator[SEP] }
public boolean matches(Labels runtimeLabels) { if ((runtimeLabels == null) || runtimeLabels.isEmpty()) { return true; } if (this.labels.isEmpty()) { return true; } for (String expression : this.labels) { if (matches(expression, runtimeLabels)) { return true; } } return false; }
class class_name[name] begin[{] method[matches, return_type[type[boolean]], modifier[public], parameter[runtimeLabels]] begin[{] if[binary_operation[binary_operation[member[.runtimeLabels], ==, literal[null]], ||, call[runtimeLabels.isEmpty, parameter[]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[THIS[member[None.labels]call[None.isEmpty, parameter[]]]] begin[{] return[literal[true]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=expression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=runtimeLabels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=[], prefix_operators=[], qualifier=, 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=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=labels, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=expression)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[matches] operator[SEP] identifier[Labels] identifier[runtimeLabels] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[runtimeLabels] operator[==] Other[null] operator[SEP] operator[||] identifier[runtimeLabels] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[labels] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[expression] operator[:] Keyword[this] operator[SEP] identifier[labels] operator[SEP] { Keyword[if] operator[SEP] identifier[matches] operator[SEP] identifier[expression] , identifier[runtimeLabels] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
static GeometricParity geometric(IAtomContainer mol, int l, int r, int l1, int l2, int r1, int r2) { // we need all points for 2D as they may be skewed, i.e. // // \ // C=C // |\ // C H Point2d l2d = mol.getAtom(l).getPoint2d(); Point2d r2d = mol.getAtom(r).getPoint2d(); Point2d l12d = mol.getAtom(l1).getPoint2d(); Point2d l22d = mol.getAtom(l2).getPoint2d(); Point2d r12d = mol.getAtom(r1).getPoint2d(); Point2d r22d = mol.getAtom(r2).getPoint2d(); if (l2d != null && r2d != null && l12d != null && l22d != null && r12d != null && r22d != null) { return new DoubleBond2DParity(l2d, r2d, l12d, l22d, r12d, r22d); } // we only need the first point, we presume the 3D angles are all correct Point3d l3d = mol.getAtom(l).getPoint3d(); Point3d r3d = mol.getAtom(r).getPoint3d(); Point3d l13d = mol.getAtom(l1).getPoint3d(); Point3d r13d = mol.getAtom(r1).getPoint3d(); if (l3d != null && r3d != null && l13d != null && r13d != null) return new DoubleBond3DParity(l3d, r3d, l13d, r13d); return null; }
class class_name[name] begin[{] method[geometric, return_type[type[GeometricParity]], modifier[static], parameter[mol, l, r, l1, l2, r1, r2]] begin[{] local_variable[type[Point2d], l2d] local_variable[type[Point2d], r2d] local_variable[type[Point2d], l12d] local_variable[type[Point2d], l22d] local_variable[type[Point2d], r12d] local_variable[type[Point2d], r22d] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.l2d], !=, literal[null]], &&, binary_operation[member[.r2d], !=, literal[null]]], &&, binary_operation[member[.l12d], !=, literal[null]]], &&, binary_operation[member[.l22d], !=, literal[null]]], &&, binary_operation[member[.r12d], !=, literal[null]]], &&, binary_operation[member[.r22d], !=, literal[null]]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=l2d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r2d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=l12d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=l22d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r12d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r22d, 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=DoubleBond2DParity, sub_type=None))] else begin[{] None end[}] local_variable[type[Point3d], l3d] local_variable[type[Point3d], r3d] local_variable[type[Point3d], l13d] local_variable[type[Point3d], r13d] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.l3d], !=, literal[null]], &&, binary_operation[member[.r3d], !=, literal[null]]], &&, binary_operation[member[.l13d], !=, literal[null]]], &&, binary_operation[member[.r13d], !=, literal[null]]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=l3d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r3d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=l13d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r13d, 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=DoubleBond3DParity, sub_type=None))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[static] identifier[GeometricParity] identifier[geometric] operator[SEP] identifier[IAtomContainer] identifier[mol] , Keyword[int] identifier[l] , Keyword[int] identifier[r] , Keyword[int] identifier[l1] , Keyword[int] identifier[l2] , Keyword[int] identifier[r1] , Keyword[int] identifier[r2] operator[SEP] { identifier[Point2d] identifier[l2d] operator[=] identifier[mol] operator[SEP] identifier[getAtom] operator[SEP] identifier[l] operator[SEP] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[SEP] identifier[Point2d] identifier[r2d] operator[=] identifier[mol] operator[SEP] identifier[getAtom] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[SEP] identifier[Point2d] identifier[l12d] operator[=] identifier[mol] operator[SEP] identifier[getAtom] operator[SEP] identifier[l1] operator[SEP] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[SEP] identifier[Point2d] identifier[l22d] operator[=] identifier[mol] operator[SEP] identifier[getAtom] operator[SEP] identifier[l2] operator[SEP] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[SEP] identifier[Point2d] identifier[r12d] operator[=] identifier[mol] operator[SEP] identifier[getAtom] operator[SEP] identifier[r1] operator[SEP] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[SEP] identifier[Point2d] identifier[r22d] operator[=] identifier[mol] operator[SEP] identifier[getAtom] operator[SEP] identifier[r2] operator[SEP] operator[SEP] identifier[getPoint2d] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l2d] operator[!=] Other[null] operator[&&] identifier[r2d] operator[!=] Other[null] operator[&&] identifier[l12d] operator[!=] Other[null] operator[&&] identifier[l22d] operator[!=] Other[null] operator[&&] identifier[r12d] operator[!=] Other[null] operator[&&] identifier[r22d] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[DoubleBond2DParity] operator[SEP] identifier[l2d] , identifier[r2d] , identifier[l12d] , identifier[l22d] , identifier[r12d] , identifier[r22d] operator[SEP] operator[SEP] } identifier[Point3d] identifier[l3d] operator[=] identifier[mol] operator[SEP] identifier[getAtom] operator[SEP] identifier[l] operator[SEP] operator[SEP] identifier[getPoint3d] operator[SEP] operator[SEP] operator[SEP] identifier[Point3d] identifier[r3d] operator[=] identifier[mol] operator[SEP] identifier[getAtom] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[getPoint3d] operator[SEP] operator[SEP] operator[SEP] identifier[Point3d] identifier[l13d] operator[=] identifier[mol] operator[SEP] identifier[getAtom] operator[SEP] identifier[l1] operator[SEP] operator[SEP] identifier[getPoint3d] operator[SEP] operator[SEP] operator[SEP] identifier[Point3d] identifier[r13d] operator[=] identifier[mol] operator[SEP] identifier[getAtom] operator[SEP] identifier[r1] operator[SEP] operator[SEP] identifier[getPoint3d] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l3d] operator[!=] Other[null] operator[&&] identifier[r3d] operator[!=] Other[null] operator[&&] identifier[l13d] operator[!=] Other[null] operator[&&] identifier[r13d] operator[!=] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[DoubleBond3DParity] operator[SEP] identifier[l3d] , identifier[r3d] , identifier[l13d] , identifier[r13d] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
public static void copyDirectory( File source, File target ) throws IOException { Utils.createDirectory( target ); for( File sourceFile : listAllFiles( source, false )) { String path = computeFileRelativeLocation( source, sourceFile ); File targetFile = new File( target, path ); Utils.createDirectory( targetFile.getParentFile()); copyStream( sourceFile, targetFile ); } }
class class_name[name] begin[{] method[copyDirectory, return_type[void], modifier[public static], parameter[source, target]] begin[{] call[Utils.createDirectory, parameter[member[.target]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sourceFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=computeFileRelativeLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=targetFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParentFile, postfix_operators=[], prefix_operators=[], qualifier=targetFile, selectors=[], type_arguments=None)], member=createDirectory, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sourceFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=targetFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=listAllFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sourceFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[copyDirectory] operator[SEP] identifier[File] identifier[source] , identifier[File] identifier[target] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Utils] operator[SEP] identifier[createDirectory] operator[SEP] identifier[target] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[File] identifier[sourceFile] operator[:] identifier[listAllFiles] operator[SEP] identifier[source] , literal[boolean] operator[SEP] operator[SEP] { identifier[String] identifier[path] operator[=] identifier[computeFileRelativeLocation] operator[SEP] identifier[source] , identifier[sourceFile] operator[SEP] operator[SEP] identifier[File] identifier[targetFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[target] , identifier[path] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[createDirectory] operator[SEP] identifier[targetFile] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[copyStream] operator[SEP] identifier[sourceFile] , identifier[targetFile] operator[SEP] operator[SEP] } }
@Override public void setValue(Pin pin, Number value) { super.setValue(pin, value.doubleValue()); }
class class_name[name] begin[{] method[setValue, return_type[void], modifier[public], parameter[pin, value]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=pin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setValue] operator[SEP] identifier[Pin] identifier[pin] , identifier[Number] identifier[value] operator[SEP] { Keyword[super] operator[SEP] identifier[setValue] operator[SEP] identifier[pin] , identifier[value] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static OPTICSPlot plotForClusterOrder(ClusterOrder co, VisualizerContext context) { // Check for an existing plot // ArrayList<OPTICSPlot<D>> plots = ResultUtil.filterResults(co, // OPTICSPlot.class); // if (plots.size() > 0) { // return plots.get(0); // } final StylingPolicy policy = context.getStylingPolicy(); OPTICSPlot opticsplot = new OPTICSPlot(co, policy); // co.addChildResult(opticsplot); return opticsplot; }
class class_name[name] begin[{] method[plotForClusterOrder, return_type[type[OPTICSPlot]], modifier[public static], parameter[co, context]] begin[{] local_variable[type[StylingPolicy], policy] local_variable[type[OPTICSPlot], opticsplot] return[member[.opticsplot]] end[}] END[}]
Keyword[public] Keyword[static] identifier[OPTICSPlot] identifier[plotForClusterOrder] operator[SEP] identifier[ClusterOrder] identifier[co] , identifier[VisualizerContext] identifier[context] operator[SEP] { Keyword[final] identifier[StylingPolicy] identifier[policy] operator[=] identifier[context] operator[SEP] identifier[getStylingPolicy] operator[SEP] operator[SEP] operator[SEP] identifier[OPTICSPlot] identifier[opticsplot] operator[=] Keyword[new] identifier[OPTICSPlot] operator[SEP] identifier[co] , identifier[policy] operator[SEP] operator[SEP] Keyword[return] identifier[opticsplot] operator[SEP] }
public static <E> Set<E> intersection(Set<E> s1, Set<E> s2) { Set<E> s = new HashSet<E>(); s.addAll(s1); s.retainAll(s2); return s; }
class class_name[name] begin[{] method[intersection, return_type[type[Set]], modifier[public static], parameter[s1, s2]] begin[{] local_variable[type[Set], s] call[s.addAll, parameter[member[.s1]]] call[s.retainAll, parameter[member[.s2]]] return[member[.s]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[Set] operator[<] identifier[E] operator[>] identifier[intersection] operator[SEP] identifier[Set] operator[<] identifier[E] operator[>] identifier[s1] , identifier[Set] operator[<] identifier[E] operator[>] identifier[s2] operator[SEP] { identifier[Set] operator[<] identifier[E] operator[>] identifier[s] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[E] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[addAll] operator[SEP] identifier[s1] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[retainAll] operator[SEP] identifier[s2] operator[SEP] operator[SEP] Keyword[return] identifier[s] operator[SEP] }
public final ChannelAddress newChannelAddress(URI location, Map<String, Object> options) { String locationSchemeName = location.getScheme(); String schemeName = getSchemeName(); if (locationSchemeName == null || !locationSchemeName.equals(schemeName)) { throw new ChannelException(String.format("Location scheme %s does not match expected scheme %s", location, schemeName)); } // make the port explicit int locationPort = location.getPort(); if (locationPort == -1) { int newLocationPort = getSchemePort(); if (newLocationPort != -1) { try { String locationUserInfo = location.getUserInfo(); String locationHost = location.getHost(); String locationPath = location.getPath(); String locationQuery = location.getQuery(); String locationFragment = location.getFragment(); location = new URI(locationSchemeName, locationUserInfo, locationHost, newLocationPort, locationPath, locationQuery, locationFragment); } catch (URISyntaxException e) { throw new ChannelException(e); } } } URI transportURI = (URI) options.remove("transport"); if (transportURI == null) { LocationFactory transportFactory = getTransportFactory(); if (transportFactory != null) { transportURI = transportFactory.createURI(location); } } ChannelAddress transport = null; if (transportURI != null) { transport = channelAddressFactory.newChannelAddress(transportURI, options); } return newChannelAddress0(location, transport, options); }
class class_name[name] begin[{] method[newChannelAddress, return_type[type[ChannelAddress]], modifier[final public], parameter[location, options]] begin[{] local_variable[type[String], locationSchemeName] local_variable[type[String], schemeName] if[binary_operation[binary_operation[member[.locationSchemeName], ==, literal[null]], ||, call[locationSchemeName.equals, parameter[member[.schemeName]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Location scheme %s does not match expected scheme %s"), MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=schemeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChannelException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], locationPort] if[binary_operation[member[.locationPort], ==, literal[1]]] begin[{] local_variable[type[int], newLocationPort] if[binary_operation[member[.newLocationPort], !=, literal[1]]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getUserInfo, postfix_operators=[], prefix_operators=[], qualifier=location, selectors=[], type_arguments=None), name=locationUserInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getHost, postfix_operators=[], prefix_operators=[], qualifier=location, selectors=[], type_arguments=None), name=locationHost)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=location, selectors=[], type_arguments=None), name=locationPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getQuery, postfix_operators=[], prefix_operators=[], qualifier=location, selectors=[], type_arguments=None), name=locationQuery)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFragment, postfix_operators=[], prefix_operators=[], qualifier=location, selectors=[], type_arguments=None), name=locationFragment)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=location, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=locationSchemeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locationUserInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locationHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newLocationPort, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locationPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locationQuery, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locationFragment, 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=URI, 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=ChannelException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] else begin[{] None end[}] local_variable[type[URI], transportURI] if[binary_operation[member[.transportURI], ==, literal[null]]] begin[{] local_variable[type[LocationFactory], transportFactory] if[binary_operation[member[.transportFactory], !=, literal[null]]] begin[{] assign[member[.transportURI], call[transportFactory.createURI, parameter[member[.location]]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[ChannelAddress], transport] if[binary_operation[member[.transportURI], !=, literal[null]]] begin[{] assign[member[.transport], call[channelAddressFactory.newChannelAddress, parameter[member[.transportURI], member[.options]]]] else begin[{] None end[}] return[call[.newChannelAddress0, parameter[member[.location], member[.transport], member[.options]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[ChannelAddress] identifier[newChannelAddress] operator[SEP] identifier[URI] identifier[location] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[options] operator[SEP] { identifier[String] identifier[locationSchemeName] operator[=] identifier[location] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[schemeName] operator[=] identifier[getSchemeName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[locationSchemeName] operator[==] Other[null] operator[||] operator[!] identifier[locationSchemeName] operator[SEP] identifier[equals] operator[SEP] identifier[schemeName] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ChannelException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[location] , identifier[schemeName] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[locationPort] operator[=] identifier[location] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[locationPort] operator[==] operator[-] Other[1] operator[SEP] { Keyword[int] identifier[newLocationPort] operator[=] identifier[getSchemePort] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[newLocationPort] operator[!=] operator[-] Other[1] operator[SEP] { Keyword[try] { identifier[String] identifier[locationUserInfo] operator[=] identifier[location] operator[SEP] identifier[getUserInfo] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[locationHost] operator[=] identifier[location] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[locationPath] operator[=] identifier[location] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[locationQuery] operator[=] identifier[location] operator[SEP] identifier[getQuery] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[locationFragment] operator[=] identifier[location] operator[SEP] identifier[getFragment] operator[SEP] operator[SEP] operator[SEP] identifier[location] operator[=] Keyword[new] identifier[URI] operator[SEP] identifier[locationSchemeName] , identifier[locationUserInfo] , identifier[locationHost] , identifier[newLocationPort] , identifier[locationPath] , identifier[locationQuery] , identifier[locationFragment] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ChannelException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } } } identifier[URI] identifier[transportURI] operator[=] operator[SEP] identifier[URI] operator[SEP] identifier[options] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transportURI] operator[==] Other[null] operator[SEP] { identifier[LocationFactory] identifier[transportFactory] operator[=] identifier[getTransportFactory] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transportFactory] operator[!=] Other[null] operator[SEP] { identifier[transportURI] operator[=] identifier[transportFactory] operator[SEP] identifier[createURI] operator[SEP] identifier[location] operator[SEP] operator[SEP] } } identifier[ChannelAddress] identifier[transport] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[transportURI] operator[!=] Other[null] operator[SEP] { identifier[transport] operator[=] identifier[channelAddressFactory] operator[SEP] identifier[newChannelAddress] operator[SEP] identifier[transportURI] , identifier[options] operator[SEP] operator[SEP] } Keyword[return] identifier[newChannelAddress0] operator[SEP] identifier[location] , identifier[transport] , identifier[options] operator[SEP] operator[SEP] }
public static CommerceTierPriceEntry fetchByC_LtM_Last( long commercePriceEntryId, int minQuantity, OrderByComparator<CommerceTierPriceEntry> orderByComparator) { return getPersistence() .fetchByC_LtM_Last(commercePriceEntryId, minQuantity, orderByComparator); }
class class_name[name] begin[{] method[fetchByC_LtM_Last, return_type[type[CommerceTierPriceEntry]], modifier[public static], parameter[commercePriceEntryId, minQuantity, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommerceTierPriceEntry] identifier[fetchByC_LtM_Last] operator[SEP] Keyword[long] identifier[commercePriceEntryId] , Keyword[int] identifier[minQuantity] , identifier[OrderByComparator] operator[<] identifier[CommerceTierPriceEntry] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByC_LtM_Last] operator[SEP] identifier[commercePriceEntryId] , identifier[minQuantity] , identifier[orderByComparator] operator[SEP] operator[SEP] }
private File generate(String pattern, int generation, int unique) throws IOException { File file = null; String word = ""; int ix = 0; boolean sawg = false; boolean sawu = false; while (ix < pattern.length()) { char ch = pattern.charAt(ix); ix++; char ch2 = 0; if (ix < pattern.length()) { ch2 = Character.toLowerCase(pattern.charAt(ix)); } if (ch == '/') { if (file == null) { file = new File(word); } else { file = new File(file, word); } word = ""; continue; } else if (ch == '%') { if (ch2 == 't') { String tmpDir = System.getProperty("java.io.tmpdir"); if (tmpDir == null) { tmpDir = System.getProperty("user.home"); } file = new File(tmpDir); ix++; word = ""; continue; } else if (ch2 == 'h') { file = new File(System.getProperty("user.home")); // Android-changed: Don't make a special exemption for setuid programs. // // if (isSetUID()) { // // Ok, we are in a set UID program. For safety's sake // // we disallow attempts to open files relative to %h. // throw new IOException("can't use %h in set UID program"); // } ix++; word = ""; continue; } else if (ch2 == 'g') { word = word + generation; sawg = true; ix++; continue; } else if (ch2 == 'u') { word = word + unique; sawu = true; ix++; continue; } else if (ch2 == '%') { word = word + "%"; ix++; continue; } } word = word + ch; } if (count > 1 && !sawg) { word = word + "." + generation; } if (unique > 0 && !sawu) { word = word + "." + unique; } if (word.length() > 0) { if (file == null) { file = new File(word); } else { file = new File(file, word); } } return file; }
class class_name[name] begin[{] method[generate, return_type[type[File]], modifier[private], parameter[pattern, generation, unique]] begin[{] local_variable[type[File], file] local_variable[type[String], word] local_variable[type[int], ix] local_variable[type[boolean], sawg] local_variable[type[boolean], sawu] while[binary_operation[member[.ix], <, call[pattern.length, parameter[]]]] begin[{] local_variable[type[char], ch] member[.ix] local_variable[type[char], ch2] if[binary_operation[member[.ix], <, call[pattern.length, parameter[]]]] begin[{] assign[member[.ch2], call[Character.toLowerCase, parameter[call[pattern.charAt, parameter[member[.ix]]]]]] else begin[{] None end[}] if[binary_operation[member[.ch], ==, literal['/']]] begin[{] if[binary_operation[member[.file], ==, literal[null]]] begin[{] assign[member[.file], ClassCreator(arguments=[MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] else begin[{] assign[member[.file], ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] end[}] assign[member[.word], literal[""]] ContinueStatement(goto=None, label=None) else begin[{] if[binary_operation[member[.ch], ==, literal['%']]] begin[{] if[binary_operation[member[.ch2], ==, literal['t']]] begin[{] local_variable[type[String], tmpDir] if[binary_operation[member[.tmpDir], ==, literal[null]]] begin[{] assign[member[.tmpDir], call[System.getProperty, parameter[literal["user.home"]]]] else begin[{] None end[}] assign[member[.file], ClassCreator(arguments=[MemberReference(member=tmpDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] member[.ix] assign[member[.word], literal[""]] ContinueStatement(goto=None, label=None) else begin[{] if[binary_operation[member[.ch2], ==, literal['h']]] begin[{] assign[member[.file], ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user.home")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] member[.ix] assign[member[.word], literal[""]] ContinueStatement(goto=None, label=None) else begin[{] if[binary_operation[member[.ch2], ==, literal['g']]] begin[{] assign[member[.word], binary_operation[member[.word], +, member[.generation]]] assign[member[.sawg], literal[true]] member[.ix] ContinueStatement(goto=None, label=None) else begin[{] if[binary_operation[member[.ch2], ==, literal['u']]] begin[{] assign[member[.word], binary_operation[member[.word], +, member[.unique]]] assign[member[.sawu], literal[true]] member[.ix] ContinueStatement(goto=None, label=None) else begin[{] if[binary_operation[member[.ch2], ==, literal['%']]] begin[{] assign[member[.word], binary_operation[member[.word], +, literal["%"]]] member[.ix] ContinueStatement(goto=None, label=None) else begin[{] None end[}] end[}] end[}] end[}] end[}] else begin[{] None end[}] end[}] assign[member[.word], binary_operation[member[.word], +, member[.ch]]] end[}] if[binary_operation[binary_operation[member[.count], >, literal[1]], &&, member[.sawg]]] begin[{] assign[member[.word], binary_operation[binary_operation[member[.word], +, literal["."]], +, member[.generation]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.unique], >, literal[0]], &&, member[.sawu]]] begin[{] assign[member[.word], binary_operation[binary_operation[member[.word], +, literal["."]], +, member[.unique]]] else begin[{] None end[}] if[binary_operation[call[word.length, parameter[]], >, literal[0]]] begin[{] if[binary_operation[member[.file], ==, literal[null]]] begin[{] assign[member[.file], ClassCreator(arguments=[MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] else begin[{] assign[member[.file], ClassCreator(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=word, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] end[}] else begin[{] None end[}] return[member[.file]] end[}] END[}]
Keyword[private] identifier[File] identifier[generate] operator[SEP] identifier[String] identifier[pattern] , Keyword[int] identifier[generation] , Keyword[int] identifier[unique] operator[SEP] Keyword[throws] identifier[IOException] { identifier[File] identifier[file] operator[=] Other[null] operator[SEP] identifier[String] identifier[word] operator[=] literal[String] operator[SEP] Keyword[int] identifier[ix] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[sawg] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[sawu] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] identifier[ix] operator[<] identifier[pattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[char] identifier[ch] operator[=] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[ix] operator[SEP] operator[SEP] identifier[ix] operator[++] operator[SEP] Keyword[char] identifier[ch2] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[ix] operator[<] identifier[pattern] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[ch2] operator[=] identifier[Character] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[pattern] operator[SEP] identifier[charAt] operator[SEP] identifier[ix] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[file] operator[==] Other[null] operator[SEP] { identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[word] operator[SEP] operator[SEP] } Keyword[else] { identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[file] , identifier[word] operator[SEP] operator[SEP] } identifier[word] operator[=] literal[String] operator[SEP] Keyword[continue] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[ch2] operator[==] literal[String] operator[SEP] { identifier[String] identifier[tmpDir] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmpDir] operator[==] Other[null] operator[SEP] { identifier[tmpDir] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[tmpDir] operator[SEP] operator[SEP] identifier[ix] operator[++] operator[SEP] identifier[word] operator[=] literal[String] operator[SEP] Keyword[continue] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ch2] operator[==] literal[String] operator[SEP] { identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[ix] operator[++] operator[SEP] identifier[word] operator[=] literal[String] operator[SEP] Keyword[continue] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ch2] operator[==] literal[String] operator[SEP] { identifier[word] operator[=] identifier[word] operator[+] identifier[generation] operator[SEP] identifier[sawg] operator[=] literal[boolean] operator[SEP] identifier[ix] operator[++] operator[SEP] Keyword[continue] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ch2] operator[==] literal[String] operator[SEP] { identifier[word] operator[=] identifier[word] operator[+] identifier[unique] operator[SEP] identifier[sawu] operator[=] literal[boolean] operator[SEP] identifier[ix] operator[++] operator[SEP] Keyword[continue] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ch2] operator[==] literal[String] operator[SEP] { identifier[word] operator[=] identifier[word] operator[+] literal[String] operator[SEP] identifier[ix] operator[++] operator[SEP] Keyword[continue] operator[SEP] } } identifier[word] operator[=] identifier[word] operator[+] identifier[ch] operator[SEP] } Keyword[if] operator[SEP] identifier[count] operator[>] Other[1] operator[&&] operator[!] identifier[sawg] operator[SEP] { identifier[word] operator[=] identifier[word] operator[+] literal[String] operator[+] identifier[generation] operator[SEP] } Keyword[if] operator[SEP] identifier[unique] operator[>] Other[0] operator[&&] operator[!] identifier[sawu] operator[SEP] { identifier[word] operator[=] identifier[word] operator[+] literal[String] operator[+] identifier[unique] operator[SEP] } Keyword[if] operator[SEP] identifier[word] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[file] operator[==] Other[null] operator[SEP] { identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[word] operator[SEP] operator[SEP] } Keyword[else] { identifier[file] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[file] , identifier[word] operator[SEP] operator[SEP] } } Keyword[return] identifier[file] operator[SEP] }
private int[] getColumnList(OrderedHashSet set, Table table) { if (set == null) { return null; } return table.getColumnIndexes(set); }
class class_name[name] begin[{] method[getColumnList, return_type[type[int]], modifier[private], parameter[set, table]] begin[{] if[binary_operation[member[.set], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[table.getColumnIndexes, parameter[member[.set]]]] end[}] END[}]
Keyword[private] Keyword[int] operator[SEP] operator[SEP] identifier[getColumnList] operator[SEP] identifier[OrderedHashSet] identifier[set] , identifier[Table] identifier[table] operator[SEP] { Keyword[if] operator[SEP] identifier[set] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[table] operator[SEP] identifier[getColumnIndexes] operator[SEP] identifier[set] operator[SEP] operator[SEP] }
public static ResponseStatusDetails convert(final ByteBuf input) { if (input.readableBytes() <= 0) { return null; } try { byte[] inputBytes = new byte[input.readableBytes()]; input.readBytes(inputBytes); HashMap<String,HashMap<String, String>> result = DefaultObjectMapper.readValue(inputBytes, JACKSON_TYPEREF); HashMap<String, String> errorMap = result.get("error"); if (errorMap == null) { LOGGER.warn("Exception while converting ResponseStatusDetails (no error json object), ignoring."); return null; } return new ResponseStatusDetails(errorMap.get("ref"), errorMap.get("context")); } catch (Exception ex) { LOGGER.warn("Exception while converting ResponseStatusDetails, ignoring.", ex); return null; } }
class class_name[name] begin[{] method[convert, return_type[type[ResponseStatusDetails]], modifier[public static], parameter[input]] begin[{] if[binary_operation[call[input.readableBytes, parameter[]], <=, literal[0]]] begin[{] return[literal[null]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=readableBytes, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=inputBytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=inputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readBytes, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=inputBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=JACKSON_TYPEREF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readValue, postfix_operators=[], prefix_operators=[], qualifier=DefaultObjectMapper, selectors=[], type_arguments=None), name=result)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=HashMap, sub_type=None))], dimensions=[], name=HashMap, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error")], member=get, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), name=errorMap)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=HashMap, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=errorMap, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception while converting ResponseStatusDetails (no error json object), ignoring.")], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ref")], member=get, postfix_operators=[], prefix_operators=[], qualifier=errorMap, selectors=[], type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="context")], member=get, postfix_operators=[], prefix_operators=[], qualifier=errorMap, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ResponseStatusDetails, sub_type=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception while converting ResponseStatusDetails, ignoring."), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[ResponseStatusDetails] identifier[convert] operator[SEP] Keyword[final] identifier[ByteBuf] identifier[input] operator[SEP] { Keyword[if] operator[SEP] identifier[input] operator[SEP] identifier[readableBytes] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[try] { Keyword[byte] operator[SEP] operator[SEP] identifier[inputBytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[input] operator[SEP] identifier[readableBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[input] operator[SEP] identifier[readBytes] operator[SEP] identifier[inputBytes] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[>] identifier[result] operator[=] identifier[DefaultObjectMapper] operator[SEP] identifier[readValue] operator[SEP] identifier[inputBytes] , identifier[JACKSON_TYPEREF] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] identifier[errorMap] operator[=] identifier[result] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[errorMap] operator[==] Other[null] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[return] Keyword[new] identifier[ResponseStatusDetails] operator[SEP] identifier[errorMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] , identifier[errorMap] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public boolean open(boolean async, DelayCalculator delayCalculator) { if (open.compareAndSet(false, true)) { assert lock != null; notificator = Executors.newSingleThreadExecutor(new NotificationThreadFactory()); // lock webcam for other Java (only) processes lock.lock(); // open webcam device WebcamOpenTask task = new WebcamOpenTask(driver, device); try { task.open(); } catch (InterruptedException e) { lock.unlock(); open.set(false); LOG.debug("Thread has been interrupted in the middle of webcam opening process!", e); return false; } catch (WebcamException e) { lock.unlock(); open.set(false); LOG.debug("Webcam exception when opening", e); throw e; } LOG.debug("Webcam is now open {}", getName()); // install shutdown hook try { Runtime.getRuntime().addShutdownHook(hook = new WebcamShutdownHook(this)); } catch (IllegalStateException e) { LOG.debug("Shutdown in progress, do not open device"); LOG.trace(e.getMessage(), e); close(); return false; } // setup non-blocking configuration if (asynchronous = async) { if (updater == null) { updater = new WebcamUpdater(this, delayCalculator); } updater.start(); } // notify listeners WebcamEvent we = new WebcamEvent(WebcamEventType.OPEN, this); Iterator<WebcamListener> wli = listeners.iterator(); WebcamListener l = null; while (wli.hasNext()) { l = wli.next(); try { l.webcamOpen(we); } catch (Exception e) { LOG.error(String.format("Notify webcam open, exception when calling listener %s", l.getClass()), e); } } } else { LOG.debug("Webcam is already open {}", getName()); } return true; }
class class_name[name] begin[{] method[open, return_type[type[boolean]], modifier[public], parameter[async, delayCalculator]] begin[{] if[call[open.compareAndSet, parameter[literal[false], literal[true]]]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=lock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None) assign[member[.notificator], call[Executors.newSingleThreadExecutor, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NotificationThreadFactory, sub_type=None))]]] call[lock.lock, parameter[]] local_variable[type[WebcamOpenTask], task] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=open, postfix_operators=[], prefix_operators=[], qualifier=task, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=set, postfix_operators=[], prefix_operators=[], qualifier=open, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Thread has been interrupted in the middle of webcam opening process!"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=set, postfix_operators=[], prefix_operators=[], qualifier=open, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Webcam exception when opening"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['WebcamException']))], finally_block=None, label=None, resources=None) call[LOG.debug, parameter[literal["Webcam is now open {}"], call[.getName, parameter[]]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getRuntime, postfix_operators=[], prefix_operators=[], qualifier=Runtime, selectors=[MethodInvocation(arguments=[Assignment(expressionl=MemberReference(member=hook, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WebcamShutdownHook, sub_type=None)))], member=addShutdownHook, 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="Shutdown in progress, do not open device")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalStateException']))], finally_block=None, label=None, resources=None) if[assign[member[.asynchronous], member[.async]]] begin[{] if[binary_operation[member[.updater], ==, literal[null]]] begin[{] assign[member[.updater], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=delayCalculator, 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=WebcamUpdater, sub_type=None))] else begin[{] None end[}] call[updater.start, parameter[]] else begin[{] None end[}] local_variable[type[WebcamEvent], we] local_variable[type[Iterator], wli] local_variable[type[WebcamListener], l] while[call[wli.hasNext, parameter[]]] begin[{] assign[member[.l], call[wli.next, parameter[]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=we, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=webcamOpen, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Notify webcam open, exception when calling listener %s"), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] else begin[{] call[LOG.debug, parameter[literal["Webcam is already open {}"], call[.getName, parameter[]]]] end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[open] operator[SEP] Keyword[boolean] identifier[async] , identifier[DelayCalculator] identifier[delayCalculator] operator[SEP] { Keyword[if] operator[SEP] identifier[open] operator[SEP] identifier[compareAndSet] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] { Keyword[assert] identifier[lock] operator[!=] Other[null] operator[SEP] identifier[notificator] operator[=] identifier[Executors] operator[SEP] identifier[newSingleThreadExecutor] operator[SEP] Keyword[new] identifier[NotificationThreadFactory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] identifier[WebcamOpenTask] identifier[task] operator[=] Keyword[new] identifier[WebcamOpenTask] operator[SEP] identifier[driver] , identifier[device] operator[SEP] operator[SEP] Keyword[try] { identifier[task] operator[SEP] identifier[open] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] identifier[open] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[WebcamException] identifier[e] operator[SEP] { identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] identifier[open] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Runtime] operator[SEP] identifier[getRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[addShutdownHook] operator[SEP] identifier[hook] operator[=] Keyword[new] identifier[WebcamShutdownHook] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalStateException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[trace] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[asynchronous] operator[=] identifier[async] operator[SEP] { Keyword[if] operator[SEP] identifier[updater] operator[==] Other[null] operator[SEP] { identifier[updater] operator[=] Keyword[new] identifier[WebcamUpdater] operator[SEP] Keyword[this] , identifier[delayCalculator] operator[SEP] operator[SEP] } identifier[updater] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] } identifier[WebcamEvent] identifier[we] operator[=] Keyword[new] identifier[WebcamEvent] operator[SEP] identifier[WebcamEventType] operator[SEP] identifier[OPEN] , Keyword[this] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[WebcamListener] operator[>] identifier[wli] operator[=] identifier[listeners] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[WebcamListener] identifier[l] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[wli] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[l] operator[=] identifier[wli] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[l] operator[SEP] identifier[webcamOpen] operator[SEP] identifier[we] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[l] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@Override public Object findByInterface(String application, String interfaceName) throws EJBException, RemoteException { return ejbLinkResolver.findByInterface(application, interfaceName); }
class class_name[name] begin[{] method[findByInterface, return_type[type[Object]], modifier[public], parameter[application, interfaceName]] begin[{] return[call[ejbLinkResolver.findByInterface, parameter[member[.application], member[.interfaceName]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[findByInterface] operator[SEP] identifier[String] identifier[application] , identifier[String] identifier[interfaceName] operator[SEP] Keyword[throws] identifier[EJBException] , identifier[RemoteException] { Keyword[return] identifier[ejbLinkResolver] operator[SEP] identifier[findByInterface] operator[SEP] identifier[application] , identifier[interfaceName] operator[SEP] operator[SEP] }
public void windowUpdateRatio(float ratio) { assert ctx == null || ctx.executor().inEventLoop(); checkValidRatio(ratio); windowUpdateRatio = ratio; }
class class_name[name] begin[{] method[windowUpdateRatio, return_type[void], modifier[public], parameter[ratio]] begin[{] AssertStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=executor, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[MethodInvocation(arguments=[], member=inEventLoop, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), label=None, value=None) call[.checkValidRatio, parameter[member[.ratio]]] assign[member[.windowUpdateRatio], member[.ratio]] end[}] END[}]
Keyword[public] Keyword[void] identifier[windowUpdateRatio] operator[SEP] Keyword[float] identifier[ratio] operator[SEP] { Keyword[assert] identifier[ctx] operator[==] Other[null] operator[||] identifier[ctx] operator[SEP] identifier[executor] operator[SEP] operator[SEP] operator[SEP] identifier[inEventLoop] operator[SEP] operator[SEP] operator[SEP] identifier[checkValidRatio] operator[SEP] identifier[ratio] operator[SEP] operator[SEP] identifier[windowUpdateRatio] operator[=] identifier[ratio] operator[SEP] }
private Expr parseRangeExpression(EnclosingScope scope, boolean terminated) { int start = index; Expr lhs = parseAdditiveExpression(scope, true); match(DotDot); Expr rhs = parseAdditiveExpression(scope, true); Expr range = new Expr.ArrayRange(Type.Void, lhs, rhs); return annotateSourceLocation(range, start); }
class class_name[name] begin[{] method[parseRangeExpression, return_type[type[Expr]], modifier[private], parameter[scope, terminated]] begin[{] local_variable[type[int], start] local_variable[type[Expr], lhs] call[.match, parameter[member[.DotDot]]] local_variable[type[Expr], rhs] local_variable[type[Expr], range] return[call[.annotateSourceLocation, parameter[member[.range], member[.start]]]] end[}] END[}]
Keyword[private] identifier[Expr] identifier[parseRangeExpression] operator[SEP] identifier[EnclosingScope] identifier[scope] , Keyword[boolean] identifier[terminated] operator[SEP] { Keyword[int] identifier[start] operator[=] identifier[index] operator[SEP] identifier[Expr] identifier[lhs] operator[=] identifier[parseAdditiveExpression] operator[SEP] identifier[scope] , literal[boolean] operator[SEP] operator[SEP] identifier[match] operator[SEP] identifier[DotDot] operator[SEP] operator[SEP] identifier[Expr] identifier[rhs] operator[=] identifier[parseAdditiveExpression] operator[SEP] identifier[scope] , literal[boolean] operator[SEP] operator[SEP] identifier[Expr] identifier[range] operator[=] Keyword[new] identifier[Expr] operator[SEP] identifier[ArrayRange] operator[SEP] identifier[Type] operator[SEP] identifier[Void] , identifier[lhs] , identifier[rhs] operator[SEP] operator[SEP] Keyword[return] identifier[annotateSourceLocation] operator[SEP] identifier[range] , identifier[start] operator[SEP] operator[SEP] }
public void marshall(TagResourceRequest tagResourceRequest, ProtocolMarshaller protocolMarshaller) { if (tagResourceRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(tagResourceRequest.getArn(), ARN_BINDING); protocolMarshaller.marshall(tagResourceRequest.getTags(), TAGS_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[tagResourceRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.tagResourceRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getArn, postfix_operators=[], prefix_operators=[], qualifier=tagResourceRequest, selectors=[], type_arguments=None), MemberReference(member=ARN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTags, postfix_operators=[], prefix_operators=[], qualifier=tagResourceRequest, selectors=[], type_arguments=None), MemberReference(member=TAGS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], 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[TagResourceRequest] identifier[tagResourceRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[tagResourceRequest] 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[tagResourceRequest] operator[SEP] identifier[getArn] operator[SEP] operator[SEP] , identifier[ARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[tagResourceRequest] operator[SEP] identifier[getTags] operator[SEP] operator[SEP] , identifier[TAGS_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 MsmsPipelineAnalysis parse(Path path) throws FileParsingException { try { XMLStreamReader xsr = JaxbUtils.createXmlStreamReader(path, false); MsmsPipelineAnalysis msmsPipelineAnalysis = JaxbUtils .unmarshal(MsmsPipelineAnalysis.class, xsr); return msmsPipelineAnalysis; } catch (JAXBException e) { throw new FileParsingException( String .format("JAXB parsing of PepXML file failed (%s)", path.toAbsolutePath().toString()), e); } }
class class_name[name] begin[{] method[parse, return_type[type[MsmsPipelineAnalysis]], modifier[public static], parameter[path]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=createXmlStreamReader, postfix_operators=[], prefix_operators=[], qualifier=JaxbUtils, selectors=[], type_arguments=None), name=xsr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=XMLStreamReader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MsmsPipelineAnalysis, sub_type=None)), MemberReference(member=xsr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmarshal, postfix_operators=[], prefix_operators=[], qualifier=JaxbUtils, selectors=[], type_arguments=None), name=msmsPipelineAnalysis)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MsmsPipelineAnalysis, sub_type=None)), ReturnStatement(expression=MemberReference(member=msmsPipelineAnalysis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="JAXB parsing of PepXML file failed (%s)"), MethodInvocation(arguments=[], member=toAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, 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=FileParsingException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JAXBException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[MsmsPipelineAnalysis] identifier[parse] operator[SEP] identifier[Path] identifier[path] operator[SEP] Keyword[throws] identifier[FileParsingException] { Keyword[try] { identifier[XMLStreamReader] identifier[xsr] operator[=] identifier[JaxbUtils] operator[SEP] identifier[createXmlStreamReader] operator[SEP] identifier[path] , literal[boolean] operator[SEP] operator[SEP] identifier[MsmsPipelineAnalysis] identifier[msmsPipelineAnalysis] operator[=] identifier[JaxbUtils] operator[SEP] identifier[unmarshal] operator[SEP] identifier[MsmsPipelineAnalysis] operator[SEP] Keyword[class] , identifier[xsr] operator[SEP] operator[SEP] Keyword[return] identifier[msmsPipelineAnalysis] operator[SEP] } Keyword[catch] operator[SEP] identifier[JAXBException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[FileParsingException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[path] operator[SEP] identifier[toAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static Class<?>[] primitivesToWrappers(final Class<?>... classes) { if (classes == null) { return null; } if (classes.length == 0) { return classes; } final Class<?>[] convertedClasses = new Class[classes.length]; for (int i = 0; i < classes.length; i++) { convertedClasses[i] = primitiveToWrapper(classes[i]); } return convertedClasses; }
class class_name[name] begin[{] method[primitivesToWrappers, return_type[type[Class]], modifier[public static], parameter[classes]] begin[{] if[binary_operation[member[.classes], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[member[classes.length], ==, literal[0]]] begin[{] return[member[.classes]] else begin[{] None end[}] local_variable[type[Class], convertedClasses] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=convertedClasses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=classes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=primitiveToWrapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=classes, 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[.convertedClasses]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[primitivesToWrappers] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[classes] operator[SEP] { Keyword[if] operator[SEP] identifier[classes] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[classes] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[classes] operator[SEP] } Keyword[final] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[convertedClasses] operator[=] Keyword[new] identifier[Class] operator[SEP] identifier[classes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[classes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[convertedClasses] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[primitiveToWrapper] operator[SEP] identifier[classes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[convertedClasses] operator[SEP] }
public OvhCredential currentCredential_GET() throws IOException { String qPath = "/auth/currentCredential"; StringBuilder sb = path(qPath); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhCredential.class); }
class class_name[name] begin[{] method[currentCredential_GET, return_type[type[OvhCredential]], modifier[public], parameter[]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhCredential, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhCredential] identifier[currentCredential_GET] operator[SEP] 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] 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[OvhCredential] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
public void setLinkWithSitesTreeSelection(boolean enabled) { linkWithSitesTreeButton.setSelected(enabled); if (enabled) { extension.setShowJustInScope(false); final JTree sitesTree = view.getSiteTreePanel().getTreeSite(); final TreePath selectionPath = sitesTree.getSelectionPath(); getTreeAlert().setModel(getLinkWithSitesTreeModel()); if (selectionPath != null) { recreateLinkWithSitesTreeModel((SiteNode) selectionPath.getLastPathComponent()); } sitesTree.addTreeSelectionListener(getLinkWithSitesTreeSelectionListener()); } else { extension.setMainTreeModel(); ((AlertNode) getLinkWithSitesTreeModel().getRoot()).removeAllChildren(); view.getSiteTreePanel().getTreeSite().removeTreeSelectionListener(getLinkWithSitesTreeSelectionListener()); } }
class class_name[name] begin[{] method[setLinkWithSitesTreeSelection, return_type[void], modifier[public], parameter[enabled]] begin[{] call[linkWithSitesTreeButton.setSelected, parameter[member[.enabled]]] if[member[.enabled]] begin[{] call[extension.setShowJustInScope, parameter[literal[false]]] local_variable[type[JTree], sitesTree] local_variable[type[TreePath], selectionPath] call[.getTreeAlert, parameter[]] if[binary_operation[member[.selectionPath], !=, literal[null]]] begin[{] call[.recreateLinkWithSitesTreeModel, parameter[Cast(expression=MethodInvocation(arguments=[], member=getLastPathComponent, postfix_operators=[], prefix_operators=[], qualifier=selectionPath, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SiteNode, sub_type=None))]] else begin[{] None end[}] call[sitesTree.addTreeSelectionListener, parameter[call[.getLinkWithSitesTreeSelectionListener, parameter[]]]] else begin[{] call[extension.setMainTreeModel, parameter[]] Cast(expression=MethodInvocation(arguments=[], member=getLinkWithSitesTreeModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getRoot, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AlertNode, sub_type=None)) call[view.getSiteTreePanel, parameter[]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setLinkWithSitesTreeSelection] operator[SEP] Keyword[boolean] identifier[enabled] operator[SEP] { identifier[linkWithSitesTreeButton] operator[SEP] identifier[setSelected] operator[SEP] identifier[enabled] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[enabled] operator[SEP] { identifier[extension] operator[SEP] identifier[setShowJustInScope] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[final] identifier[JTree] identifier[sitesTree] operator[=] identifier[view] operator[SEP] identifier[getSiteTreePanel] operator[SEP] operator[SEP] operator[SEP] identifier[getTreeSite] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[TreePath] identifier[selectionPath] operator[=] identifier[sitesTree] operator[SEP] identifier[getSelectionPath] operator[SEP] operator[SEP] operator[SEP] identifier[getTreeAlert] operator[SEP] operator[SEP] operator[SEP] identifier[setModel] operator[SEP] identifier[getLinkWithSitesTreeModel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[selectionPath] operator[!=] Other[null] operator[SEP] { identifier[recreateLinkWithSitesTreeModel] operator[SEP] operator[SEP] identifier[SiteNode] operator[SEP] identifier[selectionPath] operator[SEP] identifier[getLastPathComponent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[sitesTree] operator[SEP] identifier[addTreeSelectionListener] operator[SEP] identifier[getLinkWithSitesTreeSelectionListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[extension] operator[SEP] identifier[setMainTreeModel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[AlertNode] operator[SEP] identifier[getLinkWithSitesTreeModel] operator[SEP] operator[SEP] operator[SEP] identifier[getRoot] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[removeAllChildren] operator[SEP] operator[SEP] operator[SEP] identifier[view] operator[SEP] identifier[getSiteTreePanel] operator[SEP] operator[SEP] operator[SEP] identifier[getTreeSite] operator[SEP] operator[SEP] operator[SEP] identifier[removeTreeSelectionListener] operator[SEP] identifier[getLinkWithSitesTreeSelectionListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public Config setTopicConfigs(Map<String, TopicConfig> topicConfigs) { this.topicConfigs.clear(); this.topicConfigs.putAll(topicConfigs); for (final Entry<String, TopicConfig> entry : this.topicConfigs.entrySet()) { entry.getValue().setName(entry.getKey()); } return this; }
class class_name[name] begin[{] method[setTopicConfigs, return_type[type[Config]], modifier[public], parameter[topicConfigs]] begin[{] THIS[member[None.topicConfigs]call[None.clear, parameter[]]] THIS[member[None.topicConfigs]call[None.putAll, parameter[member[.topicConfigs]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=setName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=topicConfigs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=TopicConfig, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[Config] identifier[setTopicConfigs] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[TopicConfig] operator[>] identifier[topicConfigs] operator[SEP] { Keyword[this] operator[SEP] identifier[topicConfigs] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[topicConfigs] operator[SEP] identifier[putAll] operator[SEP] identifier[topicConfigs] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Entry] operator[<] identifier[String] , identifier[TopicConfig] operator[>] identifier[entry] operator[:] Keyword[this] operator[SEP] identifier[topicConfigs] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[setName] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public <B, C> DecomposableMatchBuilder2<T, B, C> decomposeFirst( DecomposableMatchBuilder2<A, B, C> first) { Objects.requireNonNull(first); Map<Integer, DecomposableMatchBuilder> buildersByIndex = Maps.treeMapOf(extractedIndex, first); List<Matcher<Object>> matchers = getChildMatchers(buildersByIndex); Tuple2<Integer, Integer> newIndexes = Tuple2.of( extractedIndex + first.extractedIndexes.first(), extractedIndex + first.extractedIndexes.second()); NestedFieldExtractor<T> nestedFieldExtractor = getNestedFieldExtractor(buildersByIndex); return new DecomposableMatchBuilder2<>(matchers, newIndexes, nestedFieldExtractor); }
class class_name[name] begin[{] method[decomposeFirst, return_type[type[DecomposableMatchBuilder2]], modifier[public], parameter[first]] begin[{] call[Objects.requireNonNull, parameter[member[.first]]] local_variable[type[Map], buildersByIndex] local_variable[type[List], matchers] local_variable[type[Tuple2], newIndexes] local_variable[type[NestedFieldExtractor], nestedFieldExtractor] return[ClassCreator(arguments=[MemberReference(member=matchers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newIndexes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nestedFieldExtractor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=DecomposableMatchBuilder2, sub_type=None))] end[}] END[}]
Keyword[public] operator[<] identifier[B] , identifier[C] operator[>] identifier[DecomposableMatchBuilder2] operator[<] identifier[T] , identifier[B] , identifier[C] operator[>] identifier[decomposeFirst] operator[SEP] identifier[DecomposableMatchBuilder2] operator[<] identifier[A] , identifier[B] , identifier[C] operator[>] identifier[first] operator[SEP] { identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[first] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[DecomposableMatchBuilder] operator[>] identifier[buildersByIndex] operator[=] identifier[Maps] operator[SEP] identifier[treeMapOf] operator[SEP] identifier[extractedIndex] , identifier[first] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Matcher] operator[<] identifier[Object] operator[>] operator[>] identifier[matchers] operator[=] identifier[getChildMatchers] operator[SEP] identifier[buildersByIndex] operator[SEP] operator[SEP] identifier[Tuple2] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[newIndexes] operator[=] identifier[Tuple2] operator[SEP] identifier[of] operator[SEP] identifier[extractedIndex] operator[+] identifier[first] operator[SEP] identifier[extractedIndexes] operator[SEP] identifier[first] operator[SEP] operator[SEP] , identifier[extractedIndex] operator[+] identifier[first] operator[SEP] identifier[extractedIndexes] operator[SEP] identifier[second] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[NestedFieldExtractor] operator[<] identifier[T] operator[>] identifier[nestedFieldExtractor] operator[=] identifier[getNestedFieldExtractor] operator[SEP] identifier[buildersByIndex] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[DecomposableMatchBuilder2] operator[<] operator[>] operator[SEP] identifier[matchers] , identifier[newIndexes] , identifier[nestedFieldExtractor] operator[SEP] operator[SEP] }
@Override public boolean isExtension() { if (isExtension == null) { if (archive.getType() == ArchiveType.ON_DEMAND_LIB) { isExtension = false; } else { Set<String> extensionClazz = archive.getExtensionClasses(); isExtension = extensionClazz.isEmpty() ? false : true; } } return isExtension; }
class class_name[name] begin[{] method[isExtension, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.isExtension], ==, literal[null]]] begin[{] if[binary_operation[call[archive.getType, parameter[]], ==, member[ArchiveType.ON_DEMAND_LIB]]] begin[{] assign[member[.isExtension], literal[false]] else begin[{] local_variable[type[Set], extensionClazz] assign[member[.isExtension], TernaryExpression(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=extensionClazz, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false))] end[}] else begin[{] None end[}] return[member[.isExtension]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isExtension] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isExtension] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[archive] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[ArchiveType] operator[SEP] identifier[ON_DEMAND_LIB] operator[SEP] { identifier[isExtension] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[Set] operator[<] identifier[String] operator[>] identifier[extensionClazz] operator[=] identifier[archive] operator[SEP] identifier[getExtensionClasses] operator[SEP] operator[SEP] operator[SEP] identifier[isExtension] operator[=] identifier[extensionClazz] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[?] literal[boolean] operator[:] literal[boolean] operator[SEP] } } Keyword[return] identifier[isExtension] operator[SEP] }
public Method findBestMethodWithSignature( String methodName, Class<?>... argumentsClasses ) throws NoSuchMethodException, SecurityException { return findBestMethodWithSignature(methodName, true, argumentsClasses); }
class class_name[name] begin[{] method[findBestMethodWithSignature, return_type[type[Method]], modifier[public], parameter[methodName, argumentsClasses]] begin[{] return[call[.findBestMethodWithSignature, parameter[member[.methodName], literal[true], member[.argumentsClasses]]]] end[}] END[}]
Keyword[public] identifier[Method] identifier[findBestMethodWithSignature] operator[SEP] identifier[String] identifier[methodName] , identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[argumentsClasses] operator[SEP] Keyword[throws] identifier[NoSuchMethodException] , identifier[SecurityException] { Keyword[return] identifier[findBestMethodWithSignature] operator[SEP] identifier[methodName] , literal[boolean] , identifier[argumentsClasses] operator[SEP] operator[SEP] }
public static String getText(URL url) throws IOException { return getText(url, CharsetToolkit.getDefaultSystemCharset().name()); }
class class_name[name] begin[{] method[getText, return_type[type[String]], modifier[public static], parameter[url]] begin[{] return[call[.getText, parameter[member[.url], call[CharsetToolkit.getDefaultSystemCharset, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getText] operator[SEP] identifier[URL] identifier[url] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[getText] operator[SEP] identifier[url] , identifier[CharsetToolkit] operator[SEP] identifier[getDefaultSystemCharset] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public PreparedStatement prepareStatement(final String _sql, final String[] _strings) throws SQLException { return getConnection().prepareStatement(_sql, _strings); }
class class_name[name] begin[{] method[prepareStatement, return_type[type[PreparedStatement]], modifier[public], parameter[_sql, _strings]] begin[{] return[call[.getConnection, parameter[]]] end[}] END[}]
Keyword[public] identifier[PreparedStatement] identifier[prepareStatement] operator[SEP] Keyword[final] identifier[String] identifier[_sql] , Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[_strings] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[return] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[_sql] , identifier[_strings] operator[SEP] operator[SEP] }
protected void execute(StoreOperation storeOperation, MavenProject rootModule, Set<MavenProject> executedModules) throws MojoExecutionException, MojoFailureException { synchronized (cachingStoreProvider) { Store store = getStore(rootModule); if (isResetStoreBeforeExecution() && executedModules.isEmpty()) { store.reset(); } try { storeOperation.run(rootModule, store); } finally { releaseStore(store); } } }
class class_name[name] begin[{] method[execute, return_type[void], modifier[protected], parameter[storeOperation, rootModule, executedModules]] begin[{] SYNCHRONIZED[member[.cachingStoreProvider]] BEGIN[{] local_variable[type[Store], store] if[binary_operation[call[.isResetStoreBeforeExecution, parameter[]], &&, call[executedModules.isEmpty, parameter[]]]] begin[{] call[store.reset, parameter[]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rootModule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=store, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=run, postfix_operators=[], prefix_operators=[], qualifier=storeOperation, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=store, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=releaseStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) END[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[execute] operator[SEP] identifier[StoreOperation] identifier[storeOperation] , identifier[MavenProject] identifier[rootModule] , identifier[Set] operator[<] identifier[MavenProject] operator[>] identifier[executedModules] operator[SEP] Keyword[throws] identifier[MojoExecutionException] , identifier[MojoFailureException] { Keyword[synchronized] operator[SEP] identifier[cachingStoreProvider] operator[SEP] { identifier[Store] identifier[store] operator[=] identifier[getStore] operator[SEP] identifier[rootModule] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isResetStoreBeforeExecution] operator[SEP] operator[SEP] operator[&&] identifier[executedModules] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[store] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[storeOperation] operator[SEP] identifier[run] operator[SEP] identifier[rootModule] , identifier[store] operator[SEP] operator[SEP] } Keyword[finally] { identifier[releaseStore] operator[SEP] identifier[store] operator[SEP] operator[SEP] } } }
public static BankCardMagneticTrack from(final String rawTrackData) { final Track1FormatB track1 = Track1FormatB.from(rawTrackData); final Track2 track2 = Track2.from(rawTrackData); final Track3 track3 = Track3.from(rawTrackData); return new BankCardMagneticTrack(rawTrackData, track1, track2, track3); }
class class_name[name] begin[{] method[from, return_type[type[BankCardMagneticTrack]], modifier[public static], parameter[rawTrackData]] begin[{] local_variable[type[Track1FormatB], track1] local_variable[type[Track2], track2] local_variable[type[Track3], track3] return[ClassCreator(arguments=[MemberReference(member=rawTrackData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=track1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=track2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=track3, 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=BankCardMagneticTrack, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[BankCardMagneticTrack] identifier[from] operator[SEP] Keyword[final] identifier[String] identifier[rawTrackData] operator[SEP] { Keyword[final] identifier[Track1FormatB] identifier[track1] operator[=] identifier[Track1FormatB] operator[SEP] identifier[from] operator[SEP] identifier[rawTrackData] operator[SEP] operator[SEP] Keyword[final] identifier[Track2] identifier[track2] operator[=] identifier[Track2] operator[SEP] identifier[from] operator[SEP] identifier[rawTrackData] operator[SEP] operator[SEP] Keyword[final] identifier[Track3] identifier[track3] operator[=] identifier[Track3] operator[SEP] identifier[from] operator[SEP] identifier[rawTrackData] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[BankCardMagneticTrack] operator[SEP] identifier[rawTrackData] , identifier[track1] , identifier[track2] , identifier[track3] operator[SEP] operator[SEP] }
@Override public GlobalsModel addGlobal(GlobalModel global) { addChildModel(global); _globals.add(global); return this; }
class class_name[name] begin[{] method[addGlobal, return_type[type[GlobalsModel]], modifier[public], parameter[global]] begin[{] call[.addChildModel, parameter[member[.global]]] call[_globals.add, parameter[member[.global]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[GlobalsModel] identifier[addGlobal] operator[SEP] identifier[GlobalModel] identifier[global] operator[SEP] { identifier[addChildModel] operator[SEP] identifier[global] operator[SEP] operator[SEP] identifier[_globals] operator[SEP] identifier[add] operator[SEP] identifier[global] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public Enumeration<URL> getResources(String name) throws IOException { List<Enumeration<URL>> enumerations = new ArrayList<Enumeration<URL>>(parents.size() + 1); for (ClassLoader parent : parents) { enumerations.add(parent.getResources(name)); } enumerations.add(super.getResources(name)); return new CompoundEnumeration(enumerations); }
class class_name[name] begin[{] method[getResources, return_type[type[Enumeration]], modifier[public], parameter[name]] begin[{] local_variable[type[List], enumerations] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResources, postfix_operators=[], prefix_operators=[], qualifier=parent, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=enumerations, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=parents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=parent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ClassLoader, sub_type=None))), label=None) call[enumerations.add, parameter[SuperMethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResources, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]] return[ClassCreator(arguments=[MemberReference(member=enumerations, 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=CompoundEnumeration, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Enumeration] operator[<] identifier[URL] operator[>] identifier[getResources] operator[SEP] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[IOException] { identifier[List] operator[<] identifier[Enumeration] operator[<] identifier[URL] operator[>] operator[>] identifier[enumerations] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Enumeration] operator[<] identifier[URL] operator[>] operator[>] operator[SEP] identifier[parents] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ClassLoader] identifier[parent] operator[:] identifier[parents] operator[SEP] { identifier[enumerations] operator[SEP] identifier[add] operator[SEP] identifier[parent] operator[SEP] identifier[getResources] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] } identifier[enumerations] operator[SEP] identifier[add] operator[SEP] Keyword[super] operator[SEP] identifier[getResources] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CompoundEnumeration] operator[SEP] identifier[enumerations] operator[SEP] operator[SEP] }
@Override public BoundingBox getBoundingBox(Projection projection) { Contents contents = geometryColumns.getContents(); BoundingBox boundingBox = contents.getBoundingBox(projection); return boundingBox; }
class class_name[name] begin[{] method[getBoundingBox, return_type[type[BoundingBox]], modifier[public], parameter[projection]] begin[{] local_variable[type[Contents], contents] local_variable[type[BoundingBox], boundingBox] return[member[.boundingBox]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[BoundingBox] identifier[getBoundingBox] operator[SEP] identifier[Projection] identifier[projection] operator[SEP] { identifier[Contents] identifier[contents] operator[=] identifier[geometryColumns] operator[SEP] identifier[getContents] operator[SEP] operator[SEP] operator[SEP] identifier[BoundingBox] identifier[boundingBox] operator[=] identifier[contents] operator[SEP] identifier[getBoundingBox] operator[SEP] identifier[projection] operator[SEP] operator[SEP] Keyword[return] identifier[boundingBox] operator[SEP] }
public GenerationFileHandler rotate(String storeSuffix, String activeSuffix) throws IOException { return rotate(storeSuffix, activeSuffix, false); }
class class_name[name] begin[{] method[rotate, return_type[type[GenerationFileHandler]], modifier[public], parameter[storeSuffix, activeSuffix]] begin[{] return[call[.rotate, parameter[member[.storeSuffix], member[.activeSuffix], literal[false]]]] end[}] END[}]
Keyword[public] identifier[GenerationFileHandler] identifier[rotate] operator[SEP] identifier[String] identifier[storeSuffix] , identifier[String] identifier[activeSuffix] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[rotate] operator[SEP] identifier[storeSuffix] , identifier[activeSuffix] , literal[boolean] operator[SEP] operator[SEP] }
public static SecretKey deserializeSecretKey(byte[] keyData, String algorithm) { LOGGER.trace("deserialize secret key from data using algorithm \"{}\"", algorithm); return new SecretKeySpec(keyData, algorithm); }
class class_name[name] begin[{] method[deserializeSecretKey, return_type[type[SecretKey]], modifier[public static], parameter[keyData, algorithm]] begin[{] call[LOGGER.trace, parameter[literal["deserialize secret key from data using algorithm \"{}\""], member[.algorithm]]] return[ClassCreator(arguments=[MemberReference(member=keyData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=algorithm, 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=SecretKeySpec, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[SecretKey] identifier[deserializeSecretKey] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[keyData] , identifier[String] identifier[algorithm] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[algorithm] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[SecretKeySpec] operator[SEP] identifier[keyData] , identifier[algorithm] operator[SEP] operator[SEP] }
public void add(CharRange cond) { if (set.isEmpty()) { set.add(cond); } else { List<CharRange> remlist = new ArrayList<CharRange>(); List<CharRange> addlist = new ArrayList<CharRange>(); boolean is = false; for (CharRange r : set) { if (r.intersect(cond)) { remlist.add(r); addlist.addAll(CharRange.removeOverlap(cond, r)); is = true; } } if (!is) { set.add(cond); } set.removeAll(remlist); set.addAll(addlist); } }
class class_name[name] begin[{] method[add, return_type[void], modifier[public], parameter[cond]] begin[{] if[call[set.isEmpty, parameter[]]] begin[{] call[set.add, parameter[member[.cond]]] else begin[{] local_variable[type[List], remlist] local_variable[type[List], addlist] local_variable[type[boolean], is] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=cond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=intersect, postfix_operators=[], prefix_operators=[], qualifier=r, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=remlist, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=cond, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeOverlap, postfix_operators=[], prefix_operators=[], qualifier=CharRange, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=addlist, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=r)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CharRange, sub_type=None))), label=None) if[member[.is]] begin[{] call[set.add, parameter[member[.cond]]] else begin[{] None end[}] call[set.removeAll, parameter[member[.remlist]]] call[set.addAll, parameter[member[.addlist]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[CharRange] identifier[cond] operator[SEP] { Keyword[if] operator[SEP] identifier[set] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[set] operator[SEP] identifier[add] operator[SEP] identifier[cond] operator[SEP] operator[SEP] } Keyword[else] { identifier[List] operator[<] identifier[CharRange] operator[>] identifier[remlist] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CharRange] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[CharRange] operator[>] identifier[addlist] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CharRange] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[is] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[CharRange] identifier[r] operator[:] identifier[set] operator[SEP] { Keyword[if] operator[SEP] identifier[r] operator[SEP] identifier[intersect] operator[SEP] identifier[cond] operator[SEP] operator[SEP] { identifier[remlist] operator[SEP] identifier[add] operator[SEP] identifier[r] operator[SEP] operator[SEP] identifier[addlist] operator[SEP] identifier[addAll] operator[SEP] identifier[CharRange] operator[SEP] identifier[removeOverlap] operator[SEP] identifier[cond] , identifier[r] operator[SEP] operator[SEP] operator[SEP] identifier[is] operator[=] literal[boolean] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[is] operator[SEP] { identifier[set] operator[SEP] identifier[add] operator[SEP] identifier[cond] operator[SEP] operator[SEP] } identifier[set] operator[SEP] identifier[removeAll] operator[SEP] identifier[remlist] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[addAll] operator[SEP] identifier[addlist] operator[SEP] operator[SEP] } }
public void updateExpiration( final MemcachedBackupSession session ) throws InterruptedException { if ( _log.isDebugEnabled() ) { _log.debug( "Updating expiration time for session " + session.getId() ); } if ( !_memcachedNodesManager.getSessionIdFormat().isValid( session.getId() ) ) { return; } session.setExpirationUpdateRunning( true ); session.setLastBackupTime( System.currentTimeMillis() ); try { final ConcurrentMap<String, Object> attributes = session.getAttributesFiltered(); final byte[] attributesData = _transcoderService.serializeAttributes( session, attributes ); final byte[] data = _transcoderService.serialize( session, attributesData ); createBackupSessionTask( session, true ).doBackupSession( session, data, attributesData ); } finally { session.setExpirationUpdateRunning( false ); } }
class class_name[name] begin[{] method[updateExpiration, return_type[void], modifier[public], parameter[session]] begin[{] if[call[_log.isDebugEnabled, parameter[]]] begin[{] call[_log.debug, parameter[binary_operation[literal["Updating expiration time for session "], +, call[session.getId, parameter[]]]]] else begin[{] None end[}] if[call[_memcachedNodesManager.getSessionIdFormat, parameter[]]] begin[{] return[None] else begin[{] None end[}] call[session.setExpirationUpdateRunning, parameter[literal[true]]] call[session.setLastBackupTime, parameter[call[System.currentTimeMillis, parameter[]]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAttributesFiltered, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), name=attributes)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=ConcurrentMap, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serializeAttributes, postfix_operators=[], prefix_operators=[], qualifier=_transcoderService, selectors=[], type_arguments=None), name=attributesData)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributesData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=serialize, postfix_operators=[], prefix_operators=[], qualifier=_transcoderService, selectors=[], type_arguments=None), name=data)], modifiers={'final'}, type=BasicType(dimensions=[None], name=byte)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=createBackupSessionTask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=attributesData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doBackupSession, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=setExpirationUpdateRunning, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[updateExpiration] operator[SEP] Keyword[final] identifier[MemcachedBackupSession] identifier[session] operator[SEP] Keyword[throws] identifier[InterruptedException] { Keyword[if] operator[SEP] identifier[_log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[_log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[session] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[_memcachedNodesManager] operator[SEP] identifier[getSessionIdFormat] operator[SEP] operator[SEP] operator[SEP] identifier[isValid] operator[SEP] identifier[session] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[session] operator[SEP] identifier[setExpirationUpdateRunning] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[setLastBackupTime] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[ConcurrentMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[attributes] operator[=] identifier[session] operator[SEP] identifier[getAttributesFiltered] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[attributesData] operator[=] identifier[_transcoderService] operator[SEP] identifier[serializeAttributes] operator[SEP] identifier[session] , identifier[attributes] operator[SEP] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[_transcoderService] operator[SEP] identifier[serialize] operator[SEP] identifier[session] , identifier[attributesData] operator[SEP] operator[SEP] identifier[createBackupSessionTask] operator[SEP] identifier[session] , literal[boolean] operator[SEP] operator[SEP] identifier[doBackupSession] operator[SEP] identifier[session] , identifier[data] , identifier[attributesData] operator[SEP] operator[SEP] } Keyword[finally] { identifier[session] operator[SEP] identifier[setExpirationUpdateRunning] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } }
protected final QB generateQuery(final Map<String, List<Object>> query) { QB queryBuilder = null; if (this.queryAttributeMapping != null) { for (final Map.Entry<String, Set<String>> queryAttrEntry : this.queryAttributeMapping.entrySet()) { final String queryAttr = queryAttrEntry.getKey(); final List<Object> queryValues = query.get(queryAttr); if (queryValues != null) { final Set<String> dataAttributes = queryAttrEntry.getValue(); if (dataAttributes == null) { queryBuilder = this.appendCanonicalizedAttributeToQuery(queryBuilder, queryAttr, null, queryValues); } else { for (final String dataAttribute : dataAttributes) { queryBuilder = this.appendCanonicalizedAttributeToQuery(queryBuilder, queryAttr, dataAttribute, queryValues); } } } else if (this.requireAllQueryAttributes) { this.logger.debug("Query " + query + " does not contain all nessesary attributes as specified by queryAttributeMapping " + this.queryAttributeMapping + ", null will be returned for the queryBuilder"); return null; } } } else if (this.useAllQueryAttributes) { for (final Map.Entry<String, List<Object>> queryAttrEntry : query.entrySet()) { final String queryKey = queryAttrEntry.getKey(); final List<Object> queryValues = queryAttrEntry.getValue(); queryBuilder = this.appendCanonicalizedAttributeToQuery(queryBuilder, queryKey, queryKey, queryValues); } } if (this.logger.isDebugEnabled()) { this.logger.debug("Generated query builder '" + queryBuilder + "' from query Map " + query + "."); } return queryBuilder; }
class class_name[name] begin[{] method[generateQuery, return_type[type[QB]], modifier[final protected], parameter[query]] begin[{] local_variable[type[QB], queryBuilder] if[binary_operation[THIS[member[None.queryAttributeMapping]], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=queryAttrEntry, selectors=[], type_arguments=None), name=queryAttr)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=queryAttr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), name=queryValues)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=queryValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=requireAllQueryAttributes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=logger, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Query "), operandr=MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" does not contain all nessesary attributes as specified by queryAttributeMapping "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=queryAttributeMapping, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", null will be returned for the queryBuilder"), operator=+)], member=debug, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=queryAttrEntry, selectors=[], type_arguments=None), name=dataAttributes)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dataAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=queryBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=queryBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryAttr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendCanonicalizedAttributeToQuery, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=dataAttributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dataAttribute)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=queryBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=queryBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryAttr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=queryValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendCanonicalizedAttributeToQuery, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]))]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=queryAttributeMapping, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=queryAttrEntry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) else begin[{] if[THIS[member[None.useAllQueryAttributes]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=queryAttrEntry, selectors=[], type_arguments=None), name=queryKey)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=queryAttrEntry, selectors=[], type_arguments=None), name=queryValues)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=queryBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=queryBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=queryValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendCanonicalizedAttributeToQuery, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=queryAttrEntry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) else begin[{] None end[}] end[}] if[THIS[member[None.logger]call[None.isDebugEnabled, parameter[]]]] begin[{] THIS[member[None.logger]call[None.debug, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Generated query builder '"], +, member[.queryBuilder]], +, literal["' from query Map "]], +, member[.query]], +, literal["."]]]]] else begin[{] None end[}] return[member[.queryBuilder]] end[}] END[}]
Keyword[protected] Keyword[final] identifier[QB] identifier[generateQuery] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[Object] operator[>] operator[>] identifier[query] operator[SEP] { identifier[QB] identifier[queryBuilder] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[queryAttributeMapping] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[queryAttrEntry] operator[:] Keyword[this] operator[SEP] identifier[queryAttributeMapping] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[queryAttr] operator[=] identifier[queryAttrEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Object] operator[>] identifier[queryValues] operator[=] identifier[query] operator[SEP] identifier[get] operator[SEP] identifier[queryAttr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[queryValues] operator[!=] Other[null] operator[SEP] { Keyword[final] identifier[Set] operator[<] identifier[String] operator[>] identifier[dataAttributes] operator[=] identifier[queryAttrEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dataAttributes] operator[==] Other[null] operator[SEP] { identifier[queryBuilder] operator[=] Keyword[this] operator[SEP] identifier[appendCanonicalizedAttributeToQuery] operator[SEP] identifier[queryBuilder] , identifier[queryAttr] , Other[null] , identifier[queryValues] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[dataAttribute] operator[:] identifier[dataAttributes] operator[SEP] { identifier[queryBuilder] operator[=] Keyword[this] operator[SEP] identifier[appendCanonicalizedAttributeToQuery] operator[SEP] identifier[queryBuilder] , identifier[queryAttr] , identifier[dataAttribute] , identifier[queryValues] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[requireAllQueryAttributes] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[query] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[queryAttributeMapping] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[useAllQueryAttributes] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[List] operator[<] identifier[Object] operator[>] operator[>] identifier[queryAttrEntry] operator[:] identifier[query] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[queryKey] operator[=] identifier[queryAttrEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[Object] operator[>] identifier[queryValues] operator[=] identifier[queryAttrEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[queryBuilder] operator[=] Keyword[this] operator[SEP] identifier[appendCanonicalizedAttributeToQuery] operator[SEP] identifier[queryBuilder] , identifier[queryKey] , identifier[queryKey] , identifier[queryValues] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[queryBuilder] operator[+] literal[String] operator[+] identifier[query] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[queryBuilder] operator[SEP] }
public XYSeries addSeries(String seriesName, int[] xData, int[] yData, int[] errorBars) { return addSeries( seriesName, Utils.getDoubleArrayFromIntArray(xData), Utils.getDoubleArrayFromIntArray(yData), Utils.getDoubleArrayFromIntArray(errorBars), DataType.Number); }
class class_name[name] begin[{] method[addSeries, return_type[type[XYSeries]], modifier[public], parameter[seriesName, xData, yData, errorBars]] begin[{] return[call[.addSeries, parameter[member[.seriesName], call[Utils.getDoubleArrayFromIntArray, parameter[member[.xData]]], call[Utils.getDoubleArrayFromIntArray, parameter[member[.yData]]], call[Utils.getDoubleArrayFromIntArray, parameter[member[.errorBars]]], member[DataType.Number]]]] end[}] END[}]
Keyword[public] identifier[XYSeries] identifier[addSeries] operator[SEP] identifier[String] identifier[seriesName] , Keyword[int] operator[SEP] operator[SEP] identifier[xData] , Keyword[int] operator[SEP] operator[SEP] identifier[yData] , Keyword[int] operator[SEP] operator[SEP] identifier[errorBars] operator[SEP] { Keyword[return] identifier[addSeries] operator[SEP] identifier[seriesName] , identifier[Utils] operator[SEP] identifier[getDoubleArrayFromIntArray] operator[SEP] identifier[xData] operator[SEP] , identifier[Utils] operator[SEP] identifier[getDoubleArrayFromIntArray] operator[SEP] identifier[yData] operator[SEP] , identifier[Utils] operator[SEP] identifier[getDoubleArrayFromIntArray] operator[SEP] identifier[errorBars] operator[SEP] , identifier[DataType] operator[SEP] identifier[Number] operator[SEP] operator[SEP] }
public static Conference createConference(final Map<String, Object> params) throws Exception { return createConference(BandwidthClient.getInstance(), params); }
class class_name[name] begin[{] method[createConference, return_type[type[Conference]], modifier[public static], parameter[params]] begin[{] return[call[.createConference, parameter[call[BandwidthClient.getInstance, parameter[]], member[.params]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Conference] identifier[createConference] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[params] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[return] identifier[createConference] operator[SEP] identifier[BandwidthClient] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] , identifier[params] operator[SEP] operator[SEP] }
public static List<String> getElements(File file, String charset) { List<String> list = new ArrayList<>(); try (BufferedReader br = new BufferedReader( new InputStreamReader(java.nio.file.Files.newInputStream(file.toPath()), charset))) { StringBuilder sb = new StringBuilder(4096); String line; int cnt = 0; final Pattern whitespacesOnly = Pattern.compile("^\\s*$"); while ((line = br.readLine()) != null) { if (cnt > (TOP_COUNT)) { if (whitespacesOnly.matcher(line).matches()) { list.add(sb.toString()); sb.setLength(0); } else { sb.append(line); sb.append('\n'); } } ++cnt; } if (sb.length() > 0) { list.add(sb.toString()); } } catch (IOException e) { String msg = new StringBuilder(512).append("Cannot feed the data into sonar, details: '") .append(e) .append("'").toString(); LOG.error(msg); } return list; }
class class_name[name] begin[{] method[getElements, return_type[type[List]], modifier[public static], parameter[file, charset]] begin[{] local_variable[type[List], list] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4096)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=line)], 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=0), name=cnt)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="^\\s*$")], member=compile, postfix_operators=[], prefix_operators=[], qualifier=Pattern, selectors=[], type_arguments=None), name=whitespacesOnly)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Pattern, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cnt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=TOP_COUNT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matcher, postfix_operators=[], prefix_operators=[], qualifier=whitespacesOnly, selectors=[MethodInvocation(arguments=[], member=matches, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, 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='\n')], 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=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=setLength, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=MemberReference(member=cnt, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=br, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=512)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot feed the data into sonar, details: '")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=br, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None), value=ClassCreator(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toPath, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)], member=newInputStream, postfix_operators=[], prefix_operators=[], qualifier=java.nio.file.Files, selectors=[], type_arguments=None), MemberReference(member=charset, 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=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)))]) return[member[.list]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[getElements] operator[SEP] identifier[File] identifier[file] , identifier[String] identifier[charset] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[BufferedReader] identifier[br] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[java] operator[SEP] identifier[nio] operator[SEP] identifier[file] operator[SEP] identifier[Files] operator[SEP] identifier[newInputStream] operator[SEP] identifier[file] operator[SEP] identifier[toPath] operator[SEP] operator[SEP] operator[SEP] , identifier[charset] operator[SEP] operator[SEP] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[4096] operator[SEP] operator[SEP] identifier[String] identifier[line] operator[SEP] Keyword[int] identifier[cnt] operator[=] Other[0] operator[SEP] Keyword[final] identifier[Pattern] identifier[whitespacesOnly] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[br] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[cnt] operator[>] operator[SEP] identifier[TOP_COUNT] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[whitespacesOnly] operator[SEP] identifier[matcher] operator[SEP] identifier[line] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[setLength] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[else] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } } operator[++] identifier[cnt] operator[SEP] } Keyword[if] operator[SEP] identifier[sb] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[String] identifier[msg] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] Other[512] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } Keyword[return] identifier[list] operator[SEP] }
@Override public int getLogSummaryExpiry(String originalAppenderName) { return CONFIGURATION.getIntProperty( "netflix.blitz4j." + originalAppenderName + ".discardEntryExpireSeconds", Integer.valueOf(this.getPropertyValue("netflix.blitz4j." + originalAppenderName + ".discardEntryExpireSeconds", "60"))).get(); }
class class_name[name] begin[{] method[getLogSummaryExpiry, return_type[type[int]], modifier[public], parameter[originalAppenderName]] begin[{] return[call[CONFIGURATION.getIntProperty, parameter[binary_operation[binary_operation[literal["netflix.blitz4j."], +, member[.originalAppenderName]], +, literal[".discardEntryExpireSeconds"]], call[Integer.valueOf, parameter[THIS[call[None.getPropertyValue, parameter[binary_operation[binary_operation[literal["netflix.blitz4j."], +, member[.originalAppenderName]], +, literal[".discardEntryExpireSeconds"]], literal["60"]]]]]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[getLogSummaryExpiry] operator[SEP] identifier[String] identifier[originalAppenderName] operator[SEP] { Keyword[return] identifier[CONFIGURATION] operator[SEP] identifier[getIntProperty] operator[SEP] literal[String] operator[+] identifier[originalAppenderName] operator[+] literal[String] , identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] Keyword[this] operator[SEP] identifier[getPropertyValue] operator[SEP] literal[String] operator[+] identifier[originalAppenderName] operator[+] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] }
protected synchronized Thread start(boolean forceRestart) { if (!forceRestart && isFixingActive()) { fixThread.interrupt(); } if (forceRestart || !isFixingActive()) { fixThread = new FixThread(); fixThread.start(); } return fixThread; }
class class_name[name] begin[{] method[start, return_type[type[Thread]], modifier[synchronized protected], parameter[forceRestart]] begin[{] if[binary_operation[member[.forceRestart], &&, call[.isFixingActive, parameter[]]]] begin[{] call[fixThread.interrupt, parameter[]] else begin[{] None end[}] if[binary_operation[member[.forceRestart], ||, call[.isFixingActive, parameter[]]]] begin[{] assign[member[.fixThread], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FixThread, sub_type=None))] call[fixThread.start, parameter[]] else begin[{] None end[}] return[member[.fixThread]] end[}] END[}]
Keyword[protected] Keyword[synchronized] identifier[Thread] identifier[start] operator[SEP] Keyword[boolean] identifier[forceRestart] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[forceRestart] operator[&&] identifier[isFixingActive] operator[SEP] operator[SEP] operator[SEP] { identifier[fixThread] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[forceRestart] operator[||] operator[!] identifier[isFixingActive] operator[SEP] operator[SEP] operator[SEP] { identifier[fixThread] operator[=] Keyword[new] identifier[FixThread] operator[SEP] operator[SEP] operator[SEP] identifier[fixThread] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[fixThread] operator[SEP] }
public void sendMessage(Message message) throws NotConnectedException, InterruptedException { message.setTo(room); message.setType(Message.Type.groupchat); connection.sendStanza(message); }
class class_name[name] begin[{] method[sendMessage, return_type[void], modifier[public], parameter[message]] begin[{] call[message.setTo, parameter[member[.room]]] call[message.setType, parameter[member[Message.Type.groupchat]]] call[connection.sendStanza, parameter[member[.message]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[sendMessage] operator[SEP] identifier[Message] identifier[message] operator[SEP] Keyword[throws] identifier[NotConnectedException] , identifier[InterruptedException] { identifier[message] operator[SEP] identifier[setTo] operator[SEP] identifier[room] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[setType] operator[SEP] identifier[Message] operator[SEP] identifier[Type] operator[SEP] identifier[groupchat] operator[SEP] operator[SEP] identifier[connection] operator[SEP] identifier[sendStanza] operator[SEP] identifier[message] operator[SEP] operator[SEP] }
private void jButtonDelStreamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDelStreamActionPerformed this.streamModel.removeRow(this.jTableStreams.getSelectedRow()); }
class class_name[name] begin[{] method[jButtonDelStreamActionPerformed, return_type[void], modifier[private], parameter[evt]] begin[{] THIS[member[None.streamModel]call[None.removeRow, parameter[THIS[member[None.jTableStreams]call[None.getSelectedRow, parameter[]]]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[jButtonDelStreamActionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] { Keyword[this] operator[SEP] identifier[streamModel] operator[SEP] identifier[removeRow] operator[SEP] Keyword[this] operator[SEP] identifier[jTableStreams] operator[SEP] identifier[getSelectedRow] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static boolean isValidXMLName(String s) { // Catch the empty string or null. if (s == null || "".equals(s)) { return false; } // Since the string isn't empty, check that the first character is a // valid starting character. if (!isXMLNameStart(s.codePointAt(0))) { return false; } // Loop through the string by UNICODE codepoints. This is NOT equivalent // to looping through the characters because some UNICODE codepoints can // occupy more than one character. int length = s.length(); int index = 1; while (index < length) { int codePoint = s.codePointAt(index); if (!isXMLNamePart(codePoint)) { return false; } index += Character.charCount(codePoint); } // Names that begin with "xml" with letters in any case are reserved by // the XML specification. if (s.toLowerCase().startsWith("xml")) { return false; } // If we get here then all of the characters have been checked and are // valid. Unfortunately the usual case takes the longest to verify. return true; }
class class_name[name] begin[{] method[isValidXMLName, return_type[type[boolean]], modifier[public static], parameter[s]] begin[{] if[binary_operation[binary_operation[member[.s], ==, literal[null]], ||, literal[""]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[.isXMLNameStart, parameter[call[s.codePointAt, parameter[literal[0]]]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[int], length] local_variable[type[int], index] while[binary_operation[member[.index], <, member[.length]]] begin[{] local_variable[type[int], codePoint] if[call[.isXMLNamePart, parameter[member[.codePoint]]]] begin[{] return[literal[false]] else begin[{] None end[}] assign[member[.index], call[Character.charCount, parameter[member[.codePoint]]]] end[}] if[call[s.toLowerCase, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isValidXMLName] operator[SEP] identifier[String] identifier[s] operator[SEP] { Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[s] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isXMLNameStart] operator[SEP] identifier[s] operator[SEP] identifier[codePointAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[int] identifier[length] operator[=] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[1] operator[SEP] Keyword[while] operator[SEP] identifier[index] operator[<] identifier[length] operator[SEP] { Keyword[int] identifier[codePoint] operator[=] identifier[s] operator[SEP] identifier[codePointAt] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isXMLNamePart] operator[SEP] identifier[codePoint] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[index] operator[+=] identifier[Character] operator[SEP] identifier[charCount] operator[SEP] identifier[codePoint] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public Optional<EdgeLabel> getOutEdgeLabel(String edgeLabelName) { EdgeLabel edgeLabel = getOutEdgeLabels().get(this.schema.getName() + "." + edgeLabelName); if (edgeLabel != null) { return Optional.of(edgeLabel); } return Optional.empty(); }
class class_name[name] begin[{] method[getOutEdgeLabel, return_type[type[Optional]], modifier[public], parameter[edgeLabelName]] begin[{] local_variable[type[EdgeLabel], edgeLabel] if[binary_operation[member[.edgeLabel], !=, literal[null]]] begin[{] return[call[Optional.of, parameter[member[.edgeLabel]]]] else begin[{] None end[}] return[call[Optional.empty, parameter[]]] end[}] END[}]
Keyword[public] identifier[Optional] operator[<] identifier[EdgeLabel] operator[>] identifier[getOutEdgeLabel] operator[SEP] identifier[String] identifier[edgeLabelName] operator[SEP] { identifier[EdgeLabel] identifier[edgeLabel] operator[=] identifier[getOutEdgeLabels] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] identifier[schema] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[edgeLabelName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[edgeLabel] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[of] operator[SEP] identifier[edgeLabel] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] }
private void buildDependencyTree() throws DependencyTreeBuilderException { if ( rootNode == null ) { rootNode = dependencyTreeBuilder.buildDependencyTree( project, localRepository, artifactFactory, artifactMetadataSource, null, artifactCollector ); } }
class class_name[name] begin[{] method[buildDependencyTree, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[member[.rootNode], ==, literal[null]]] begin[{] assign[member[.rootNode], call[dependencyTreeBuilder.buildDependencyTree, parameter[member[.project], member[.localRepository], member[.artifactFactory], member[.artifactMetadataSource], literal[null], member[.artifactCollector]]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[buildDependencyTree] operator[SEP] operator[SEP] Keyword[throws] identifier[DependencyTreeBuilderException] { Keyword[if] operator[SEP] identifier[rootNode] operator[==] Other[null] operator[SEP] { identifier[rootNode] operator[=] identifier[dependencyTreeBuilder] operator[SEP] identifier[buildDependencyTree] operator[SEP] identifier[project] , identifier[localRepository] , identifier[artifactFactory] , identifier[artifactMetadataSource] , Other[null] , identifier[artifactCollector] operator[SEP] operator[SEP] } }
public void applyServiceAccount(ServiceAccount serviceAccount, String sourceName) throws Exception { String namespace = getNamespace(); String id = getName(serviceAccount); Objects.requireNonNull(id, "No name for " + serviceAccount + " " + sourceName); if (isServicesOnlyMode()) { log.debug("Only processing Services right now so ignoring ServiceAccount: " + id); return; } ServiceAccount old = kubernetesClient.serviceAccounts().inNamespace(namespace).withName(id).get(); if (isRunning(old)) { if (UserConfigurationCompare.configEqual(serviceAccount, old)) { log.info("ServiceAccount has not changed so not doing anything"); } else { if (isRecreateMode()) { kubernetesClient.serviceAccounts().inNamespace(namespace).withName(id).delete(); doCreateServiceAccount(serviceAccount, namespace, sourceName); } else { log.info("Updating a ServiceAccount from " + sourceName); try { Object answer = kubernetesClient.serviceAccounts().inNamespace(namespace).withName(id).replace(serviceAccount); logGeneratedEntity("Updated ServiceAccount: ", namespace, serviceAccount, answer); } catch (Exception e) { onApplyError("Failed to update ServiceAccount from " + sourceName + ". " + e + ". " + serviceAccount, e); } } } } else { if (!isAllowCreate()) { log.warn("Creation disabled so not creating a ServiceAccount from " + sourceName + " namespace " + namespace + " name " + getName(serviceAccount)); } else { doCreateServiceAccount(serviceAccount, namespace, sourceName); } } }
class class_name[name] begin[{] method[applyServiceAccount, return_type[void], modifier[public], parameter[serviceAccount, sourceName]] begin[{] local_variable[type[String], namespace] local_variable[type[String], id] call[Objects.requireNonNull, parameter[member[.id], binary_operation[binary_operation[binary_operation[literal["No name for "], +, member[.serviceAccount]], +, literal[" "]], +, member[.sourceName]]]] if[call[.isServicesOnlyMode, parameter[]]] begin[{] call[log.debug, parameter[binary_operation[literal["Only processing Services right now so ignoring ServiceAccount: "], +, member[.id]]]] return[None] else begin[{] None end[}] local_variable[type[ServiceAccount], old] if[call[.isRunning, parameter[member[.old]]]] begin[{] if[call[UserConfigurationCompare.configEqual, parameter[member[.serviceAccount], member[.old]]]] begin[{] call[log.info, parameter[literal["ServiceAccount has not changed so not doing anything"]]] else begin[{] if[call[.isRecreateMode, parameter[]]] begin[{] call[kubernetesClient.serviceAccounts, parameter[]] call[.doCreateServiceAccount, parameter[member[.serviceAccount], member[.namespace], member[.sourceName]]] else begin[{] call[log.info, parameter[binary_operation[literal["Updating a ServiceAccount from "], +, member[.sourceName]]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=serviceAccounts, postfix_operators=[], prefix_operators=[], qualifier=kubernetesClient, selectors=[MethodInvocation(arguments=[MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=inNamespace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=serviceAccount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=replace, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=answer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Updated ServiceAccount: "), MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=serviceAccount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=answer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logGeneratedEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to update ServiceAccount from "), operandr=MemberReference(member=sourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". "), operator=+), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". "), operator=+), operandr=MemberReference(member=serviceAccount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onApplyError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] end[}] else begin[{] if[call[.isAllowCreate, parameter[]]] begin[{] call[log.warn, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Creation disabled so not creating a ServiceAccount from "], +, member[.sourceName]], +, literal[" namespace "]], +, member[.namespace]], +, literal[" name "]], +, call[.getName, parameter[member[.serviceAccount]]]]]] else begin[{] call[.doCreateServiceAccount, parameter[member[.serviceAccount], member[.namespace], member[.sourceName]]] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[applyServiceAccount] operator[SEP] identifier[ServiceAccount] identifier[serviceAccount] , identifier[String] identifier[sourceName] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[namespace] operator[=] identifier[getNamespace] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[id] operator[=] identifier[getName] operator[SEP] identifier[serviceAccount] operator[SEP] operator[SEP] identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[id] , literal[String] operator[+] identifier[serviceAccount] operator[+] literal[String] operator[+] identifier[sourceName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isServicesOnlyMode] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[id] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[ServiceAccount] identifier[old] operator[=] identifier[kubernetesClient] operator[SEP] identifier[serviceAccounts] operator[SEP] operator[SEP] operator[SEP] identifier[inNamespace] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] identifier[withName] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isRunning] operator[SEP] identifier[old] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[UserConfigurationCompare] operator[SEP] identifier[configEqual] operator[SEP] identifier[serviceAccount] , identifier[old] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[isRecreateMode] operator[SEP] operator[SEP] operator[SEP] { identifier[kubernetesClient] operator[SEP] identifier[serviceAccounts] operator[SEP] operator[SEP] operator[SEP] identifier[inNamespace] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] identifier[withName] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] identifier[doCreateServiceAccount] operator[SEP] identifier[serviceAccount] , identifier[namespace] , identifier[sourceName] operator[SEP] operator[SEP] } Keyword[else] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[sourceName] operator[SEP] operator[SEP] Keyword[try] { identifier[Object] identifier[answer] operator[=] identifier[kubernetesClient] operator[SEP] identifier[serviceAccounts] operator[SEP] operator[SEP] operator[SEP] identifier[inNamespace] operator[SEP] identifier[namespace] operator[SEP] operator[SEP] identifier[withName] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[replace] operator[SEP] identifier[serviceAccount] operator[SEP] operator[SEP] identifier[logGeneratedEntity] operator[SEP] literal[String] , identifier[namespace] , identifier[serviceAccount] , identifier[answer] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[onApplyError] operator[SEP] literal[String] operator[+] identifier[sourceName] operator[+] literal[String] operator[+] identifier[e] operator[+] literal[String] operator[+] identifier[serviceAccount] , identifier[e] operator[SEP] operator[SEP] } } } } Keyword[else] { Keyword[if] operator[SEP] operator[!] identifier[isAllowCreate] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[sourceName] operator[+] literal[String] operator[+] identifier[namespace] operator[+] literal[String] operator[+] identifier[getName] operator[SEP] identifier[serviceAccount] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[doCreateServiceAccount] operator[SEP] identifier[serviceAccount] , identifier[namespace] , identifier[sourceName] operator[SEP] operator[SEP] } } }
public static CommerceWarehouse fetchByG_C_First(long groupId, long commerceCountryId, OrderByComparator<CommerceWarehouse> orderByComparator) { return getPersistence() .fetchByG_C_First(groupId, commerceCountryId, orderByComparator); }
class class_name[name] begin[{] method[fetchByG_C_First, return_type[type[CommerceWarehouse]], modifier[public static], parameter[groupId, commerceCountryId, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CommerceWarehouse] identifier[fetchByG_C_First] operator[SEP] Keyword[long] identifier[groupId] , Keyword[long] identifier[commerceCountryId] , identifier[OrderByComparator] operator[<] identifier[CommerceWarehouse] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByG_C_First] operator[SEP] identifier[groupId] , identifier[commerceCountryId] , identifier[orderByComparator] operator[SEP] operator[SEP] }
@CheckReturnValue public RestAction<List<Message>> retrieveFuture(int amount) { if (amount > 100 || amount < 1) throw new IllegalArgumentException("Message retrieval limit is between 1 and 100 messages. No more, no less. Limit provided: " + amount); if (history.isEmpty()) throw new IllegalStateException("No messages have been retrieved yet, so there is no message to act as a marker to retrieve more recent messages based on."); Route.CompiledRoute route = Route.Messages.GET_MESSAGE_HISTORY.compile(channel.getId()).withQueryParams("limit", Integer.toString(amount), "after", String.valueOf(history.firstKey())); return new RestAction<List<Message>>(getJDA(), route) { @Override protected void handleResponse(Response response, Request<List<Message>> request) { if (!response.isOk()) { request.onFailure(response); return; } EntityBuilder builder = api.get().getEntityBuilder(); LinkedList<Message> msgs = new LinkedList<>(); JSONArray historyJson = response.getArray(); for (int i = 0; i < historyJson.length(); i++) msgs.add(builder.createMessage(historyJson.getJSONObject(i))); for (Iterator<Message> it = msgs.descendingIterator(); it.hasNext();) { Message m = it.next(); history.put(0, m.getIdLong(), m); } request.onSuccess(msgs); } }; }
class class_name[name] begin[{] method[retrieveFuture, return_type[type[RestAction]], modifier[public], parameter[amount]] begin[{] if[binary_operation[binary_operation[member[.amount], >, literal[100]], ||, binary_operation[member[.amount], <, literal[1]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Message retrieval limit is between 1 and 100 messages. No more, no less. Limit provided: "), operandr=MemberReference(member=amount, 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=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[call[history.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No messages have been retrieved yet, so there is no message to act as a marker to retrieve more recent messages based on.")], 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[}] local_variable[type[Route], route] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getJDA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=route, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=MethodInvocation(arguments=[], member=isOk, postfix_operators=[], prefix_operators=['!'], qualifier=response, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onFailure, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=api, selectors=[MethodInvocation(arguments=[], member=getEntityBuilder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=builder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EntityBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=LinkedList, sub_type=None)), name=msgs)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Message, sub_type=None))], dimensions=[], name=LinkedList, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getArray, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), name=historyJson)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSONArray, sub_type=None)), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJSONObject, postfix_operators=[], prefix_operators=[], qualifier=historyJson, selectors=[], type_arguments=None)], member=createMessage, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=msgs, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=historyJson, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Message, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[], member=getIdLong, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=history, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=descendingIterator, postfix_operators=[], prefix_operators=[], qualifier=msgs, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Message, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onSuccess, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'protected'}, name=handleResponse, parameters=[FormalParameter(annotations=[], modifiers=set(), name=response, type=ReferenceType(arguments=None, dimensions=[], name=Response, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=request, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Message, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=[], name=Request, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Message, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=RestAction, sub_type=None))] end[}] END[}]
annotation[@] identifier[CheckReturnValue] Keyword[public] identifier[RestAction] operator[<] identifier[List] operator[<] identifier[Message] operator[>] operator[>] identifier[retrieveFuture] operator[SEP] Keyword[int] identifier[amount] operator[SEP] { Keyword[if] operator[SEP] identifier[amount] operator[>] Other[100] operator[||] identifier[amount] operator[<] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[amount] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[history] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Route] operator[SEP] identifier[CompiledRoute] identifier[route] operator[=] identifier[Route] operator[SEP] identifier[Messages] operator[SEP] identifier[GET_MESSAGE_HISTORY] operator[SEP] identifier[compile] operator[SEP] identifier[channel] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[withQueryParams] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[amount] operator[SEP] , literal[String] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[history] operator[SEP] identifier[firstKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[RestAction] operator[<] identifier[List] operator[<] identifier[Message] operator[>] operator[>] operator[SEP] identifier[getJDA] operator[SEP] operator[SEP] , identifier[route] operator[SEP] { annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[handleResponse] operator[SEP] identifier[Response] identifier[response] , identifier[Request] operator[<] identifier[List] operator[<] identifier[Message] operator[>] operator[>] identifier[request] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[response] operator[SEP] identifier[isOk] operator[SEP] operator[SEP] operator[SEP] { identifier[request] operator[SEP] identifier[onFailure] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[EntityBuilder] identifier[builder] operator[=] identifier[api] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getEntityBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[LinkedList] operator[<] identifier[Message] operator[>] identifier[msgs] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[JSONArray] identifier[historyJson] operator[=] identifier[response] operator[SEP] identifier[getArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[historyJson] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[msgs] operator[SEP] identifier[add] operator[SEP] identifier[builder] operator[SEP] identifier[createMessage] operator[SEP] identifier[historyJson] operator[SEP] identifier[getJSONObject] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[Message] operator[>] identifier[it] operator[=] identifier[msgs] operator[SEP] identifier[descendingIterator] operator[SEP] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Message] identifier[m] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[history] operator[SEP] identifier[put] operator[SEP] Other[0] , identifier[m] operator[SEP] identifier[getIdLong] operator[SEP] operator[SEP] , identifier[m] operator[SEP] operator[SEP] } identifier[request] operator[SEP] identifier[onSuccess] operator[SEP] identifier[msgs] operator[SEP] operator[SEP] } } operator[SEP] }
@SuppressWarnings("unchecked") public static Object getMBean(final Class c, final String name) throws Throwable { final MBeanServer server = getMbeanServer(); // return MBeanProxyExt.create(c, name, server); return JMX.newMBeanProxy(server, new ObjectName(name), c); }
class class_name[name] begin[{] method[getMBean, return_type[type[Object]], modifier[public static], parameter[c, name]] begin[{] local_variable[type[MBeanServer], server] return[call[JMX.newMBeanProxy, parameter[member[.server], ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ObjectName, sub_type=None)), member[.c]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[Object] identifier[getMBean] operator[SEP] Keyword[final] identifier[Class] identifier[c] , Keyword[final] identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[Throwable] { Keyword[final] identifier[MBeanServer] identifier[server] operator[=] identifier[getMbeanServer] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[JMX] operator[SEP] identifier[newMBeanProxy] operator[SEP] identifier[server] , Keyword[new] identifier[ObjectName] operator[SEP] identifier[name] operator[SEP] , identifier[c] operator[SEP] operator[SEP] }
public JobScheduleTerminateHeaders withLastModified(DateTime lastModified) { if (lastModified == null) { this.lastModified = null; } else { this.lastModified = new DateTimeRfc1123(lastModified); } return this; }
class class_name[name] begin[{] method[withLastModified, return_type[type[JobScheduleTerminateHeaders]], modifier[public], parameter[lastModified]] begin[{] if[binary_operation[member[.lastModified], ==, literal[null]]] begin[{] assign[THIS[member[None.lastModified]], literal[null]] else begin[{] assign[THIS[member[None.lastModified]], ClassCreator(arguments=[MemberReference(member=lastModified, 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=DateTimeRfc1123, sub_type=None))] end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[JobScheduleTerminateHeaders] identifier[withLastModified] operator[SEP] identifier[DateTime] identifier[lastModified] operator[SEP] { Keyword[if] operator[SEP] identifier[lastModified] operator[==] Other[null] operator[SEP] { Keyword[this] operator[SEP] identifier[lastModified] operator[=] Other[null] operator[SEP] } Keyword[else] { Keyword[this] operator[SEP] identifier[lastModified] operator[=] Keyword[new] identifier[DateTimeRfc1123] operator[SEP] identifier[lastModified] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public String computeSignature(String requestMethod, String targetUrl, Map<String, String> params) { return computeSignature(requestMethod, targetUrl, params, consumerSecret, tokenSecret); }
class class_name[name] begin[{] method[computeSignature, return_type[type[String]], modifier[public], parameter[requestMethod, targetUrl, params]] begin[{] return[call[.computeSignature, parameter[member[.requestMethod], member[.targetUrl], member[.params], member[.consumerSecret], member[.tokenSecret]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[computeSignature] operator[SEP] identifier[String] identifier[requestMethod] , identifier[String] identifier[targetUrl] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[SEP] { Keyword[return] identifier[computeSignature] operator[SEP] identifier[requestMethod] , identifier[targetUrl] , identifier[params] , identifier[consumerSecret] , identifier[tokenSecret] operator[SEP] operator[SEP] }
private static String getFreeVariable(Expression2 expression, int index, Scope scope) { Expression2 sub = expression.getSubexpression(index); if (sub.isConstant()) { String constant = sub.getConstant(); if (!constant.equals(LAMBDA) && !scope.isBound(constant)) { return sub.getConstant(); } } return null; }
class class_name[name] begin[{] method[getFreeVariable, return_type[type[String]], modifier[private static], parameter[expression, index, scope]] begin[{] local_variable[type[Expression2], sub] if[call[sub.isConstant, parameter[]]] begin[{] local_variable[type[String], constant] if[binary_operation[call[constant.equals, parameter[member[.LAMBDA]]], &&, call[scope.isBound, parameter[member[.constant]]]]] begin[{] return[call[sub.getConstant, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[getFreeVariable] operator[SEP] identifier[Expression2] identifier[expression] , Keyword[int] identifier[index] , identifier[Scope] identifier[scope] operator[SEP] { identifier[Expression2] identifier[sub] operator[=] identifier[expression] operator[SEP] identifier[getSubexpression] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sub] operator[SEP] identifier[isConstant] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[constant] operator[=] identifier[sub] operator[SEP] identifier[getConstant] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[constant] operator[SEP] identifier[equals] operator[SEP] identifier[LAMBDA] operator[SEP] operator[&&] operator[!] identifier[scope] operator[SEP] identifier[isBound] operator[SEP] identifier[constant] operator[SEP] operator[SEP] { Keyword[return] identifier[sub] operator[SEP] identifier[getConstant] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
static void replaceEntry(PollArrayWrapper source, int sindex, PollArrayWrapper target, int tindex) { target.putDescriptor(tindex, source.getDescriptor(sindex)); target.putEventOps(tindex, source.getEventOps(sindex)); target.putReventOps(tindex, source.getReventOps(sindex)); }
class class_name[name] begin[{] method[replaceEntry, return_type[void], modifier[static], parameter[source, sindex, target, tindex]] begin[{] call[target.putDescriptor, parameter[member[.tindex], call[source.getDescriptor, parameter[member[.sindex]]]]] call[target.putEventOps, parameter[member[.tindex], call[source.getEventOps, parameter[member[.sindex]]]]] call[target.putReventOps, parameter[member[.tindex], call[source.getReventOps, parameter[member[.sindex]]]]] end[}] END[}]
Keyword[static] Keyword[void] identifier[replaceEntry] operator[SEP] identifier[PollArrayWrapper] identifier[source] , Keyword[int] identifier[sindex] , identifier[PollArrayWrapper] identifier[target] , Keyword[int] identifier[tindex] operator[SEP] { identifier[target] operator[SEP] identifier[putDescriptor] operator[SEP] identifier[tindex] , identifier[source] operator[SEP] identifier[getDescriptor] operator[SEP] identifier[sindex] operator[SEP] operator[SEP] operator[SEP] identifier[target] operator[SEP] identifier[putEventOps] operator[SEP] identifier[tindex] , identifier[source] operator[SEP] identifier[getEventOps] operator[SEP] identifier[sindex] operator[SEP] operator[SEP] operator[SEP] identifier[target] operator[SEP] identifier[putReventOps] operator[SEP] identifier[tindex] , identifier[source] operator[SEP] identifier[getReventOps] operator[SEP] identifier[sindex] operator[SEP] operator[SEP] operator[SEP] }