code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
private static int partition(final long[] arr, final int lo, final int hi) { int i = lo, j = hi + 1; //left and right scan indices final long v = arr[lo]; //partitioning item value while (true) { //Scan right, scan left, check for scan complete, and exchange while (arr[ ++i] < v) { if (i == hi) { break; } } while (v < arr[ --j]) { if (j == lo) { break; } } if (i >= j) { break; } final long x = arr[i]; arr[i] = arr[j]; arr[j] = x; } //put v=arr[j] into position with a[lo .. j-1] <= a[j] <= a[j+1 .. hi] final long x = arr[lo]; arr[lo] = arr[j]; arr[j] = x; return j; }
class class_name[name] begin[{] method[partition, return_type[type[int]], modifier[private static], parameter[arr, lo, hi]] begin[{] local_variable[type[int], i] local_variable[type[long], v] while[literal[true]] begin[{] while[binary_operation[member[.arr], <, member[.v]]] begin[{] if[binary_operation[member[.i], ==, member[.hi]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] end[}] while[binary_operation[member[.v], <, member[.arr]]] begin[{] if[binary_operation[member[.j], ==, member[.lo]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] end[}] if[binary_operation[member[.i], >=, member[.j]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[long], x] assign[member[.arr], member[.arr]] assign[member[.arr], member[.x]] end[}] local_variable[type[long], x] assign[member[.arr], member[.arr]] assign[member[.arr], member[.x]] return[member[.j]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[int] identifier[partition] operator[SEP] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[arr] , Keyword[final] Keyword[int] identifier[lo] , Keyword[final] Keyword[int] identifier[hi] operator[SEP] { Keyword[int] identifier[i] operator[=] identifier[lo] , identifier[j] operator[=] identifier[hi] operator[+] Other[1] operator[SEP] Keyword[final] Keyword[long] identifier[v] operator[=] identifier[arr] operator[SEP] identifier[lo] operator[SEP] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[while] operator[SEP] identifier[arr] operator[SEP] operator[++] identifier[i] operator[SEP] operator[<] identifier[v] operator[SEP] { Keyword[if] operator[SEP] identifier[i] operator[==] identifier[hi] operator[SEP] { Keyword[break] operator[SEP] } } Keyword[while] operator[SEP] identifier[v] operator[<] identifier[arr] operator[SEP] operator[--] identifier[j] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[j] operator[==] identifier[lo] operator[SEP] { Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[i] operator[>=] identifier[j] operator[SEP] { Keyword[break] operator[SEP] } Keyword[final] Keyword[long] identifier[x] operator[=] identifier[arr] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[arr] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[arr] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[arr] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[x] operator[SEP] } Keyword[final] Keyword[long] identifier[x] operator[=] identifier[arr] operator[SEP] identifier[lo] operator[SEP] operator[SEP] identifier[arr] operator[SEP] identifier[lo] operator[SEP] operator[=] identifier[arr] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[arr] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[x] operator[SEP] Keyword[return] identifier[j] operator[SEP] }
private PropertyRecord getPropertyRecord(PropertyIdValue property) { Integer id = getNumId(property.getId(), false); if (!this.propertyRecords.containsKey(id)) { PropertyRecord propertyRecord = new PropertyRecord(); this.propertyRecords.put(id, propertyRecord); return propertyRecord; } else { return this.propertyRecords.get(id); } }
class class_name[name] begin[{] method[getPropertyRecord, return_type[type[PropertyRecord]], modifier[private], parameter[property]] begin[{] local_variable[type[Integer], id] if[THIS[member[None.propertyRecords]call[None.containsKey, parameter[member[.id]]]]] begin[{] local_variable[type[PropertyRecord], propertyRecord] THIS[member[None.propertyRecords]call[None.put, parameter[member[.id], member[.propertyRecord]]]] return[member[.propertyRecord]] else begin[{] return[THIS[member[None.propertyRecords]call[None.get, parameter[member[.id]]]]] end[}] end[}] END[}]
Keyword[private] identifier[PropertyRecord] identifier[getPropertyRecord] operator[SEP] identifier[PropertyIdValue] identifier[property] operator[SEP] { identifier[Integer] identifier[id] operator[=] identifier[getNumId] operator[SEP] identifier[property] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[propertyRecords] operator[SEP] identifier[containsKey] operator[SEP] identifier[id] operator[SEP] operator[SEP] { identifier[PropertyRecord] identifier[propertyRecord] operator[=] Keyword[new] identifier[PropertyRecord] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[propertyRecords] operator[SEP] identifier[put] operator[SEP] identifier[id] , identifier[propertyRecord] operator[SEP] operator[SEP] Keyword[return] identifier[propertyRecord] operator[SEP] } Keyword[else] { Keyword[return] Keyword[this] operator[SEP] identifier[propertyRecords] operator[SEP] identifier[get] operator[SEP] identifier[id] operator[SEP] operator[SEP] } }
public String convertIfcShadingDeviceTypeEnumToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); }
class class_name[name] begin[{] method[convertIfcShadingDeviceTypeEnumToString, return_type[type[String]], modifier[public], parameter[eDataType, instanceValue]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=instanceValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=instanceValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[String] identifier[convertIfcShadingDeviceTypeEnumToString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[Object] identifier[instanceValue] operator[SEP] { Keyword[return] identifier[instanceValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[instanceValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void setProperties(Properties properties) { script = properties.getProperty("script", script); pageIntervalInMinutes = Integer.parseInt(properties.getProperty("page_interval_in_minutes", "" + pageIntervalInMinutes)); pageOffsetInMinutes = Integer.parseInt(properties.getProperty("page_offset_in_minutes", "" + pageOffsetInMinutes)); }
class class_name[name] begin[{] method[setProperties, return_type[void], modifier[public], parameter[properties]] begin[{] assign[member[.script], call[properties.getProperty, parameter[literal["script"], member[.script]]]] assign[member[.pageIntervalInMinutes], call[Integer.parseInt, parameter[call[properties.getProperty, parameter[literal["page_interval_in_minutes"], binary_operation[literal[""], +, member[.pageIntervalInMinutes]]]]]]] assign[member[.pageOffsetInMinutes], call[Integer.parseInt, parameter[call[properties.getProperty, parameter[literal["page_offset_in_minutes"], binary_operation[literal[""], +, member[.pageOffsetInMinutes]]]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setProperties] operator[SEP] identifier[Properties] identifier[properties] operator[SEP] { identifier[script] operator[=] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] literal[String] , identifier[script] operator[SEP] operator[SEP] identifier[pageIntervalInMinutes] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] literal[String] , literal[String] operator[+] identifier[pageIntervalInMinutes] operator[SEP] operator[SEP] operator[SEP] identifier[pageOffsetInMinutes] operator[=] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] identifier[properties] operator[SEP] identifier[getProperty] operator[SEP] literal[String] , literal[String] operator[+] identifier[pageOffsetInMinutes] operator[SEP] operator[SEP] operator[SEP] }
public Matrix getIplus() { Matrix Iplus = new Matrix(size, size); int i, j; for (i = 0; i < size; i++) for (j = 0; j < size; j++) Iplus.matrix[i][j] = 0d; for (i = 1; i < size; i++) Iplus.matrix[i - 1][i] = Math.sqrt(J * J + J - (J - i + 1) * (J - i + 1) + (J - i + 1)); return Iplus; }
class class_name[name] begin[{] method[getIplus, return_type[type[Matrix]], modifier[public], parameter[]] begin[{] local_variable[type[Matrix], Iplus] local_variable[type[int], i] ForStatement(body=ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=Iplus, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0d)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=matrix, postfix_operators=[], prefix_operators=[], qualifier=Iplus, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=J, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=J, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=J, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=J, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=J, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=*), operator=-), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=J, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator=+)], member=sqrt, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))], update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.Iplus]] end[}] END[}]
Keyword[public] identifier[Matrix] identifier[getIplus] operator[SEP] operator[SEP] { identifier[Matrix] identifier[Iplus] operator[=] Keyword[new] identifier[Matrix] operator[SEP] identifier[size] , identifier[size] operator[SEP] operator[SEP] Keyword[int] identifier[i] , identifier[j] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] Keyword[for] operator[SEP] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[size] operator[SEP] identifier[j] operator[++] operator[SEP] identifier[Iplus] operator[SEP] identifier[matrix] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[Iplus] operator[SEP] identifier[matrix] operator[SEP] identifier[i] operator[-] Other[1] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[J] operator[*] identifier[J] operator[+] identifier[J] operator[-] operator[SEP] identifier[J] operator[-] identifier[i] operator[+] Other[1] operator[SEP] operator[*] operator[SEP] identifier[J] operator[-] identifier[i] operator[+] Other[1] operator[SEP] operator[+] operator[SEP] identifier[J] operator[-] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Iplus] operator[SEP] }
@SuppressWarnings("rawtypes") private boolean hasGroups(final Annotation anno, final Class<?>... groups) { final Optional<Class[]> targetGroups = Utils.getAnnotationAttribute(anno, "groups", Class[].class); if(!targetGroups.isPresent()) { // groups属性を持たない場合 return false; } if(groups.length == 0) { if(targetGroups.get().length == 0) { // グループの指定がない場合は、デフォルトグループとして処理。 return true; } else { for(Class<?> targetGroup : targetGroups.get()) { if(targetGroup.equals(DefaultGroup.class)) { // デフォルトを直接指定している場合に、グループと一致。 return true; } } } } else { // グループの指定がある場合 for(Class<?> group : groups) { if(group.equals(DefaultGroup.class) && targetGroups.get().length == 0) { // フィールド側にグループの指定がない場合は、デフォルトグループとして処理する。 return true; } for(Class<?> targetGroup : targetGroups.get()) { // 一致するグループを持つか判定する。 if(targetGroup.equals(group)) { return true; } } } } return false; }
class class_name[name] begin[{] method[hasGroups, return_type[type[boolean]], modifier[private], parameter[anno, groups]] begin[{] local_variable[type[Optional], targetGroups] if[call[targetGroups.isPresent, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[member[groups.length], ==, literal[0]]] begin[{] if[binary_operation[call[targetGroups.get, parameter[]], ==, literal[0]]] begin[{] return[literal[true]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultGroup, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=targetGroup, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=targetGroups, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=targetGroup)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) end[}] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultGroup, sub_type=None))], member=equals, postfix_operators=[], prefix_operators=[], qualifier=group, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=targetGroups, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=targetGroup, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=targetGroups, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=targetGroup)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=groups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=group)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) end[}] return[literal[false]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[boolean] identifier[hasGroups] operator[SEP] Keyword[final] identifier[Annotation] identifier[anno] , Keyword[final] identifier[Class] operator[<] operator[?] operator[>] operator[...] identifier[groups] operator[SEP] { Keyword[final] identifier[Optional] operator[<] identifier[Class] operator[SEP] operator[SEP] operator[>] identifier[targetGroups] operator[=] identifier[Utils] operator[SEP] identifier[getAnnotationAttribute] operator[SEP] identifier[anno] , literal[String] , identifier[Class] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[targetGroups] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[groups] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[targetGroups] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[targetGroup] operator[:] identifier[targetGroups] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[targetGroup] operator[SEP] identifier[equals] operator[SEP] identifier[DefaultGroup] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } } Keyword[else] { Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[group] operator[:] identifier[groups] operator[SEP] { Keyword[if] operator[SEP] identifier[group] operator[SEP] identifier[equals] operator[SEP] identifier[DefaultGroup] operator[SEP] Keyword[class] operator[SEP] operator[&&] identifier[targetGroups] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[targetGroup] operator[:] identifier[targetGroups] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[targetGroup] operator[SEP] identifier[equals] operator[SEP] identifier[group] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } } Keyword[return] literal[boolean] operator[SEP] }
public float getVoltage() { // Range mapping from http://stackoverflow.com/a/7506169/254187 float inMin = 0; float inMax = 100; float outMin = (float) 2.0; float outMax = (float) 3.7; float x = this.percentage; return (x - inMin) * (outMax - outMin) / (inMax - inMin) + outMin; }
class class_name[name] begin[{] method[getVoltage, return_type[type[float]], modifier[public], parameter[]] begin[{] local_variable[type[float], inMin] local_variable[type[float], inMax] local_variable[type[float], outMin] local_variable[type[float], outMax] local_variable[type[float], x] return[binary_operation[binary_operation[binary_operation[binary_operation[member[.x], -, member[.inMin]], *, binary_operation[member[.outMax], -, member[.outMin]]], /, binary_operation[member[.inMax], -, member[.inMin]]], +, member[.outMin]]] end[}] END[}]
Keyword[public] Keyword[float] identifier[getVoltage] operator[SEP] operator[SEP] { Keyword[float] identifier[inMin] operator[=] Other[0] operator[SEP] Keyword[float] identifier[inMax] operator[=] Other[100] operator[SEP] Keyword[float] identifier[outMin] operator[=] operator[SEP] Keyword[float] operator[SEP] literal[Float] operator[SEP] Keyword[float] identifier[outMax] operator[=] operator[SEP] Keyword[float] operator[SEP] literal[Float] operator[SEP] Keyword[float] identifier[x] operator[=] Keyword[this] operator[SEP] identifier[percentage] operator[SEP] Keyword[return] operator[SEP] identifier[x] operator[-] identifier[inMin] operator[SEP] operator[*] operator[SEP] identifier[outMax] operator[-] identifier[outMin] operator[SEP] operator[/] operator[SEP] identifier[inMax] operator[-] identifier[inMin] operator[SEP] operator[+] identifier[outMin] operator[SEP] }
protected void logResponse(String logMessage, MessageContext messageContext, boolean incoming) throws TransformerException { if (messageContext.hasResponse()) { if (messageContext.getResponse() instanceof SoapMessage) { logSoapMessage(logMessage, (SoapMessage) messageContext.getResponse(), incoming); } else { logWebServiceMessage(logMessage, messageContext.getResponse(), incoming); } } }
class class_name[name] begin[{] method[logResponse, return_type[void], modifier[protected], parameter[logMessage, messageContext, incoming]] begin[{] if[call[messageContext.hasResponse, parameter[]]] begin[{] if[binary_operation[call[messageContext.getResponse, parameter[]], instanceof, type[SoapMessage]]] begin[{] call[.logSoapMessage, parameter[member[.logMessage], Cast(expression=MethodInvocation(arguments=[], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=messageContext, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SoapMessage, sub_type=None)), member[.incoming]]] else begin[{] call[.logWebServiceMessage, parameter[member[.logMessage], call[messageContext.getResponse, parameter[]], member[.incoming]]] end[}] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[logResponse] operator[SEP] identifier[String] identifier[logMessage] , identifier[MessageContext] identifier[messageContext] , Keyword[boolean] identifier[incoming] operator[SEP] Keyword[throws] identifier[TransformerException] { Keyword[if] operator[SEP] identifier[messageContext] operator[SEP] identifier[hasResponse] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[messageContext] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] Keyword[instanceof] identifier[SoapMessage] operator[SEP] { identifier[logSoapMessage] operator[SEP] identifier[logMessage] , operator[SEP] identifier[SoapMessage] operator[SEP] identifier[messageContext] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] , identifier[incoming] operator[SEP] operator[SEP] } Keyword[else] { identifier[logWebServiceMessage] operator[SEP] identifier[logMessage] , identifier[messageContext] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] , identifier[incoming] operator[SEP] operator[SEP] } } }
private static void initRepositoryDefinitions() throws JSONException { final JSONObject jsonObject = Repositories.getRepositoriesDescription(); if (null == jsonObject) { LOGGER.warn("Loads repository description [repository.json] failed"); return; } repositoryDefinitions = new ArrayList<>(); final JSONArray repositoritArray = jsonObject.getJSONArray(REPOSITORIES); JSONObject repositoryObject; JSONObject keyObject; for (int i = 0; i < repositoritArray.length(); i++) { repositoryObject = repositoritArray.getJSONObject(i); final RepositoryDefinition repositoryDefinition = new RepositoryDefinition(); repositoryDefinitions.add(repositoryDefinition); repositoryDefinition.setName(repositoryObject.getString(NAME)); repositoryDefinition.setDescription(repositoryObject.optString(DESCRIPTION)); final List<FieldDefinition> keys = new ArrayList<>(); repositoryDefinition.setKeys(keys); final JSONArray keysJsonArray = repositoryObject.getJSONArray(KEYS); FieldDefinition definition; for (int j = 0; j < keysJsonArray.length(); j++) { keyObject = keysJsonArray.getJSONObject(j); definition = fillFieldDefinitionData(keyObject); keys.add(definition); } repositoryDefinition.setCharset(repositoryObject.optString(CHARSET)); repositoryDefinition.setCollate(repositoryObject.optString(COLLATE)); } }
class class_name[name] begin[{] method[initRepositoryDefinitions, return_type[void], modifier[private static], parameter[]] begin[{] local_variable[type[JSONObject], jsonObject] if[binary_operation[literal[null], ==, member[.jsonObject]]] begin[{] call[LOGGER.warn, parameter[literal["Loads repository description [repository.json] failed"]]] return[None] else begin[{] None end[}] assign[member[.repositoryDefinitions], 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))] local_variable[type[JSONArray], repositoritArray] local_variable[type[JSONObject], repositoryObject] local_variable[type[JSONObject], keyObject] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=repositoryObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJSONObject, postfix_operators=[], prefix_operators=[], qualifier=repositoritArray, selectors=[], type_arguments=None)), label=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=None, dimensions=None, name=RepositoryDefinition, sub_type=None)), name=repositoryDefinition)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=RepositoryDefinition, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=repositoryDefinition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=repositoryDefinitions, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=repositoryObject, selectors=[], type_arguments=None)], member=setName, postfix_operators=[], prefix_operators=[], qualifier=repositoryDefinition, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=DESCRIPTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=optString, postfix_operators=[], prefix_operators=[], qualifier=repositoryObject, selectors=[], type_arguments=None)], member=setDescription, postfix_operators=[], prefix_operators=[], qualifier=repositoryDefinition, selectors=[], type_arguments=None), label=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=ArrayList, sub_type=None)), name=keys)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=FieldDefinition, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setKeys, postfix_operators=[], prefix_operators=[], qualifier=repositoryDefinition, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=KEYS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJSONArray, postfix_operators=[], prefix_operators=[], qualifier=repositoryObject, selectors=[], type_arguments=None), name=keysJsonArray)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=JSONArray, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=definition)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FieldDefinition, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keyObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJSONObject, postfix_operators=[], prefix_operators=[], qualifier=keysJsonArray, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=definition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=keyObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fillFieldDefinitionData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=definition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=keysJsonArray, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=CHARSET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=optString, postfix_operators=[], prefix_operators=[], qualifier=repositoryObject, selectors=[], type_arguments=None)], member=setCharset, postfix_operators=[], prefix_operators=[], qualifier=repositoryDefinition, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=COLLATE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=optString, postfix_operators=[], prefix_operators=[], qualifier=repositoryObject, selectors=[], type_arguments=None)], member=setCollate, postfix_operators=[], prefix_operators=[], qualifier=repositoryDefinition, 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=repositoritArray, 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) end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[initRepositoryDefinitions] operator[SEP] operator[SEP] Keyword[throws] identifier[JSONException] { Keyword[final] identifier[JSONObject] identifier[jsonObject] operator[=] identifier[Repositories] operator[SEP] identifier[getRepositoriesDescription] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[jsonObject] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[repositoryDefinitions] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[JSONArray] identifier[repositoritArray] operator[=] identifier[jsonObject] operator[SEP] identifier[getJSONArray] operator[SEP] identifier[REPOSITORIES] operator[SEP] operator[SEP] identifier[JSONObject] identifier[repositoryObject] operator[SEP] identifier[JSONObject] identifier[keyObject] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[repositoritArray] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[repositoryObject] operator[=] identifier[repositoritArray] operator[SEP] identifier[getJSONObject] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[final] identifier[RepositoryDefinition] identifier[repositoryDefinition] operator[=] Keyword[new] identifier[RepositoryDefinition] operator[SEP] operator[SEP] operator[SEP] identifier[repositoryDefinitions] operator[SEP] identifier[add] operator[SEP] identifier[repositoryDefinition] operator[SEP] operator[SEP] identifier[repositoryDefinition] operator[SEP] identifier[setName] operator[SEP] identifier[repositoryObject] operator[SEP] identifier[getString] operator[SEP] identifier[NAME] operator[SEP] operator[SEP] operator[SEP] identifier[repositoryDefinition] operator[SEP] identifier[setDescription] operator[SEP] identifier[repositoryObject] operator[SEP] identifier[optString] operator[SEP] identifier[DESCRIPTION] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[FieldDefinition] operator[>] identifier[keys] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[repositoryDefinition] operator[SEP] identifier[setKeys] operator[SEP] identifier[keys] operator[SEP] operator[SEP] Keyword[final] identifier[JSONArray] identifier[keysJsonArray] operator[=] identifier[repositoryObject] operator[SEP] identifier[getJSONArray] operator[SEP] identifier[KEYS] operator[SEP] operator[SEP] identifier[FieldDefinition] identifier[definition] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[keysJsonArray] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[keyObject] operator[=] identifier[keysJsonArray] operator[SEP] identifier[getJSONObject] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[definition] operator[=] identifier[fillFieldDefinitionData] operator[SEP] identifier[keyObject] operator[SEP] operator[SEP] identifier[keys] operator[SEP] identifier[add] operator[SEP] identifier[definition] operator[SEP] operator[SEP] } identifier[repositoryDefinition] operator[SEP] identifier[setCharset] operator[SEP] identifier[repositoryObject] operator[SEP] identifier[optString] operator[SEP] identifier[CHARSET] operator[SEP] operator[SEP] operator[SEP] identifier[repositoryDefinition] operator[SEP] identifier[setCollate] operator[SEP] identifier[repositoryObject] operator[SEP] identifier[optString] operator[SEP] identifier[COLLATE] operator[SEP] operator[SEP] operator[SEP] } }
public Map<Long, DelayStatInfo> listTimelineDelayStat(Long pipelineId, Date start, Date end) { Map<Long, DelayStatInfo> delayStatInfos = new LinkedHashMap<Long, DelayStatInfo>(); List<DelayStatDO> delayStatDOs = delayStatDao.listTimelineDelayStatsByPipelineId(pipelineId, start, end); int size = delayStatDOs.size(); int k = size - 1; for (Long i = start.getTime(); i <= end.getTime(); i += 60 * 1000) { DelayStatInfo delayStatInfo = new DelayStatInfo(); List<DelayStat> delayStats = new ArrayList<DelayStat>(); // 取出每个时间点i以内的数据,k是一个游标,每次遍历时前面已经取过了的数据就不用再遍历了 for (int j = k; j >= 0; --j) { if ((i - delayStatDOs.get(j).getGmtModified().getTime() <= 60 * 1000) && (i - delayStatDOs.get(j).getGmtModified().getTime() >= 0)) { delayStats.add(delayStatDOToModel(delayStatDOs.get(j))); k = j - 1; }// 如果不满足if条件,则后面的数据也不用再遍历 else { break; } } if (delayStats.size() > 0) { delayStatInfo.setItems(delayStats); delayStatInfos.put(i, delayStatInfo); } } return delayStatInfos; }
class class_name[name] begin[{] method[listTimelineDelayStat, return_type[type[Map]], modifier[public], parameter[pipelineId, start, end]] begin[{] local_variable[type[Map], delayStatInfos] local_variable[type[List], delayStatDOs] local_variable[type[int], size] local_variable[type[int], k] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DelayStatInfo, sub_type=None)), name=delayStatInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DelayStatInfo, 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DelayStat, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=delayStats)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DelayStat, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=delayStatDOs, selectors=[MethodInvocation(arguments=[], member=getGmtModified, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=-), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=*), operator=<=), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=delayStatDOs, selectors=[MethodInvocation(arguments=[], member=getGmtModified, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getTime, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operator=&&), else_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=delayStatDOs, selectors=[], type_arguments=None)], member=delayStatDOToModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=delayStats, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=delayStats, 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=delayStats, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setItems, postfix_operators=[], prefix_operators=[], qualifier=delayStatInfo, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=delayStatInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=delayStatInfos, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=end, selectors=[], type_arguments=None), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getTime, postfix_operators=[], prefix_operators=[], qualifier=start, selectors=[], type_arguments=None), name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=60), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=*))]), label=None) return[member[.delayStatInfos]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[Long] , identifier[DelayStatInfo] operator[>] identifier[listTimelineDelayStat] operator[SEP] identifier[Long] identifier[pipelineId] , identifier[Date] identifier[start] , identifier[Date] identifier[end] operator[SEP] { identifier[Map] operator[<] identifier[Long] , identifier[DelayStatInfo] operator[>] identifier[delayStatInfos] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[Long] , identifier[DelayStatInfo] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[DelayStatDO] operator[>] identifier[delayStatDOs] operator[=] identifier[delayStatDao] operator[SEP] identifier[listTimelineDelayStatsByPipelineId] operator[SEP] identifier[pipelineId] , identifier[start] , identifier[end] operator[SEP] operator[SEP] Keyword[int] identifier[size] operator[=] identifier[delayStatDOs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[k] operator[=] identifier[size] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] identifier[Long] identifier[i] operator[=] identifier[start] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[<=] identifier[end] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[+=] Other[60] operator[*] Other[1000] operator[SEP] { identifier[DelayStatInfo] identifier[delayStatInfo] operator[=] Keyword[new] identifier[DelayStatInfo] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[DelayStat] operator[>] identifier[delayStats] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[DelayStat] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[k] operator[SEP] identifier[j] operator[>=] Other[0] operator[SEP] operator[--] identifier[j] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[i] operator[-] identifier[delayStatDOs] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getGmtModified] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[<=] Other[60] operator[*] Other[1000] operator[SEP] operator[&&] operator[SEP] identifier[i] operator[-] identifier[delayStatDOs] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getGmtModified] operator[SEP] operator[SEP] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] operator[SEP] { identifier[delayStats] operator[SEP] identifier[add] operator[SEP] identifier[delayStatDOToModel] operator[SEP] identifier[delayStatDOs] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[k] operator[=] identifier[j] operator[-] Other[1] operator[SEP] } Keyword[else] { Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[delayStats] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[delayStatInfo] operator[SEP] identifier[setItems] operator[SEP] identifier[delayStats] operator[SEP] operator[SEP] identifier[delayStatInfos] operator[SEP] identifier[put] operator[SEP] identifier[i] , identifier[delayStatInfo] operator[SEP] operator[SEP] } } Keyword[return] identifier[delayStatInfos] operator[SEP] }
public double getFitness(Sudoku candidate, List<? extends Sudoku> population) { // We can assume that there are no duplicates in any rows because // the candidate factory and evolutionary operators that we use do // not permit rows to contain duplicates. int fitness = 0; // Check columns for duplicates. Set<Integer> values = new HashSet<Integer>(Sudoku.SIZE * 2); // Big enough to avoid re-hashing. for (int column = 0; column < Sudoku.SIZE; column++) { for (int row = 0; row < Sudoku.SIZE; row++) { values.add(candidate.getValue(row, column)); } fitness += (Sudoku.SIZE - values.size()); values.clear(); } // Check sub-grids for duplicates. for (int band = 0; band < Sudoku.SIZE; band += 3) { for (int stack = 0; stack < Sudoku.SIZE; stack += 3) { for (int row = band; row < band + 3; row++) { for (int column = stack; column < stack + 3; column++) { values.add(candidate.getValue(row, column)); } } fitness += (Sudoku.SIZE - values.size()); values.clear(); } } return fitness; }
class class_name[name] begin[{] method[getFitness, return_type[type[double]], modifier[public], parameter[candidate, population]] begin[{] local_variable[type[int], fitness] local_variable[type[Set], values] ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=candidate, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=Sudoku, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=row)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=row, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fitness, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=Sudoku, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), operator=-)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=Sudoku, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=column)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=column, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=candidate, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=column)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=column, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=band, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=band, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=row)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=row, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fitness, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=Sudoku, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), operator=-)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=Sudoku, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=stack)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=stack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=band, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=Sudoku, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=band)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=band, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), label=None) return[member[.fitness]] end[}] END[}]
Keyword[public] Keyword[double] identifier[getFitness] operator[SEP] identifier[Sudoku] identifier[candidate] , identifier[List] operator[<] operator[?] Keyword[extends] identifier[Sudoku] operator[>] identifier[population] operator[SEP] { Keyword[int] identifier[fitness] operator[=] Other[0] operator[SEP] identifier[Set] operator[<] identifier[Integer] operator[>] identifier[values] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Integer] operator[>] operator[SEP] identifier[Sudoku] operator[SEP] identifier[SIZE] operator[*] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[column] operator[=] Other[0] operator[SEP] identifier[column] operator[<] identifier[Sudoku] operator[SEP] identifier[SIZE] operator[SEP] identifier[column] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[row] operator[=] Other[0] operator[SEP] identifier[row] operator[<] identifier[Sudoku] operator[SEP] identifier[SIZE] operator[SEP] identifier[row] operator[++] operator[SEP] { identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[candidate] operator[SEP] identifier[getValue] operator[SEP] identifier[row] , identifier[column] operator[SEP] operator[SEP] operator[SEP] } identifier[fitness] operator[+=] operator[SEP] identifier[Sudoku] operator[SEP] identifier[SIZE] operator[-] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[band] operator[=] Other[0] operator[SEP] identifier[band] operator[<] identifier[Sudoku] operator[SEP] identifier[SIZE] operator[SEP] identifier[band] operator[+=] Other[3] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[stack] operator[=] Other[0] operator[SEP] identifier[stack] operator[<] identifier[Sudoku] operator[SEP] identifier[SIZE] operator[SEP] identifier[stack] operator[+=] Other[3] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[row] operator[=] identifier[band] operator[SEP] identifier[row] operator[<] identifier[band] operator[+] Other[3] operator[SEP] identifier[row] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[column] operator[=] identifier[stack] operator[SEP] identifier[column] operator[<] identifier[stack] operator[+] Other[3] operator[SEP] identifier[column] operator[++] operator[SEP] { identifier[values] operator[SEP] identifier[add] operator[SEP] identifier[candidate] operator[SEP] identifier[getValue] operator[SEP] identifier[row] , identifier[column] operator[SEP] operator[SEP] operator[SEP] } } identifier[fitness] operator[+=] operator[SEP] identifier[Sudoku] operator[SEP] identifier[SIZE] operator[-] identifier[values] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[fitness] operator[SEP] }
public void deployCron() throws MojoExecutionException { stager.stage(); try { deployMojo .getAppEngineFactory() .deployment() .deployCron( configBuilder.buildDeployProjectConfigurationConfiguration(appengineDirectory)); } catch (AppEngineException ex) { throw new MojoExecutionException("Failed to deploy", ex); } }
class class_name[name] begin[{] method[deployCron, return_type[void], modifier[public], parameter[]] begin[{] call[stager.stage, parameter[]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getAppEngineFactory, postfix_operators=[], prefix_operators=[], qualifier=deployMojo, selectors=[MethodInvocation(arguments=[], member=deployment, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=appengineDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildDeployProjectConfigurationConfiguration, postfix_operators=[], prefix_operators=[], qualifier=configBuilder, selectors=[], type_arguments=None)], member=deployCron, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to deploy"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MojoExecutionException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['AppEngineException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[deployCron] operator[SEP] operator[SEP] Keyword[throws] identifier[MojoExecutionException] { identifier[stager] operator[SEP] identifier[stage] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[deployMojo] operator[SEP] identifier[getAppEngineFactory] operator[SEP] operator[SEP] operator[SEP] identifier[deployment] operator[SEP] operator[SEP] operator[SEP] identifier[deployCron] operator[SEP] identifier[configBuilder] operator[SEP] identifier[buildDeployProjectConfigurationConfiguration] operator[SEP] identifier[appengineDirectory] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[AppEngineException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[MojoExecutionException] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP] } }
@Override public List<String> listKeys() { lock.lock(); try { List<String> keys = new ArrayList<>(this.items.size()); for (Map.Entry<String, ApiType> entry : this.items.entrySet()) { keys.add(entry.getKey()); } return keys; } finally { lock.unlock(); } }
class class_name[name] begin[{] method[listKeys, return_type[type[List]], modifier[public], parameter[]] begin[{] call[lock.lock, parameter[]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=items, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=keys)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=items, 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=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ApiType, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None), ReturnStatement(expression=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[listKeys] operator[SEP] operator[SEP] { identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[List] operator[<] identifier[String] operator[>] identifier[keys] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[items] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[ApiType] operator[>] identifier[entry] operator[:] Keyword[this] operator[SEP] identifier[items] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[keys] operator[SEP] identifier[add] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[keys] operator[SEP] } Keyword[finally] { identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public List<CellFiller> cell(final Symbol left, final Symbol right) { final List<CellFiller> cell = table.get(left, right); if (cell != null) { return cell; } else { return ImmutableList.of(); } }
class class_name[name] begin[{] method[cell, return_type[type[List]], modifier[public], parameter[left, right]] begin[{] local_variable[type[List], cell] if[binary_operation[member[.cell], !=, literal[null]]] begin[{] return[member[.cell]] else begin[{] return[call[ImmutableList.of, parameter[]]] end[}] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[CellFiller] operator[>] identifier[cell] operator[SEP] Keyword[final] identifier[Symbol] identifier[left] , Keyword[final] identifier[Symbol] identifier[right] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[CellFiller] operator[>] identifier[cell] operator[=] identifier[table] operator[SEP] identifier[get] operator[SEP] identifier[left] , identifier[right] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cell] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[cell] operator[SEP] } Keyword[else] { Keyword[return] identifier[ImmutableList] operator[SEP] identifier[of] operator[SEP] operator[SEP] operator[SEP] } }
public static HttpURLConnection setAcl(final URI uri, final QueueRequestOptions queueOptions, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { final UriQueryBuilder builder = new UriQueryBuilder(); builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.ACL); final HttpURLConnection request = BaseRequest.createURLConnection(uri, queueOptions, builder, opContext); request.setDoOutput(true); request.setRequestMethod(Constants.HTTP_PUT); return request; }
class class_name[name] begin[{] method[setAcl, return_type[type[HttpURLConnection]], modifier[public static], parameter[uri, queueOptions, opContext]] begin[{] local_variable[type[UriQueryBuilder], builder] call[builder.add, parameter[member[Constants.QueryConstants.COMPONENT], member[Constants.QueryConstants.ACL]]] local_variable[type[HttpURLConnection], request] call[request.setDoOutput, parameter[literal[true]]] call[request.setRequestMethod, parameter[member[Constants.HTTP_PUT]]] return[member[.request]] end[}] END[}]
Keyword[public] Keyword[static] identifier[HttpURLConnection] identifier[setAcl] operator[SEP] Keyword[final] identifier[URI] identifier[uri] , Keyword[final] identifier[QueueRequestOptions] identifier[queueOptions] , Keyword[final] identifier[OperationContext] identifier[opContext] operator[SEP] Keyword[throws] identifier[IOException] , identifier[URISyntaxException] , identifier[StorageException] { Keyword[final] identifier[UriQueryBuilder] identifier[builder] operator[=] Keyword[new] identifier[UriQueryBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[add] operator[SEP] identifier[Constants] operator[SEP] identifier[QueryConstants] operator[SEP] identifier[COMPONENT] , identifier[Constants] operator[SEP] identifier[QueryConstants] operator[SEP] identifier[ACL] operator[SEP] operator[SEP] Keyword[final] identifier[HttpURLConnection] identifier[request] operator[=] identifier[BaseRequest] operator[SEP] identifier[createURLConnection] operator[SEP] identifier[uri] , identifier[queueOptions] , identifier[builder] , identifier[opContext] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setDoOutput] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setRequestMethod] operator[SEP] identifier[Constants] operator[SEP] identifier[HTTP_PUT] operator[SEP] operator[SEP] Keyword[return] identifier[request] operator[SEP] }
public void execute(Runnable command, int blockingMode) throws InterruptedException, ThreadPoolQueueIsFullException, IllegalStateException { // D186668 execute(command, blockingMode, 0); }
class class_name[name] begin[{] method[execute, return_type[void], modifier[public], parameter[command, blockingMode]] begin[{] call[.execute, parameter[member[.command], member[.blockingMode], literal[0]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[Runnable] identifier[command] , Keyword[int] identifier[blockingMode] operator[SEP] Keyword[throws] identifier[InterruptedException] , identifier[ThreadPoolQueueIsFullException] , identifier[IllegalStateException] { identifier[execute] operator[SEP] identifier[command] , identifier[blockingMode] , Other[0] operator[SEP] operator[SEP] }
private void calcPage() { if (navigatepageNums != null && navigatepageNums.length > 0) { navigateFirstPage = navigatepageNums[0]; navigateLastPage = navigatepageNums[navigatepageNums.length - 1]; if (pageNum > 1) { prePage = pageNum - 1; } if (pageNum < pages) { nextPage = pageNum + 1; } } }
class class_name[name] begin[{] method[calcPage, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[binary_operation[member[.navigatepageNums], !=, literal[null]], &&, binary_operation[member[navigatepageNums.length], >, literal[0]]]] begin[{] assign[member[.navigateFirstPage], member[.navigatepageNums]] assign[member[.navigateLastPage], member[.navigatepageNums]] if[binary_operation[member[.pageNum], >, literal[1]]] begin[{] assign[member[.prePage], binary_operation[member[.pageNum], -, literal[1]]] else begin[{] None end[}] if[binary_operation[member[.pageNum], <, member[.pages]]] begin[{] assign[member[.nextPage], binary_operation[member[.pageNum], +, literal[1]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[calcPage] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[navigatepageNums] operator[!=] Other[null] operator[&&] identifier[navigatepageNums] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { identifier[navigateFirstPage] operator[=] identifier[navigatepageNums] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[navigateLastPage] operator[=] identifier[navigatepageNums] operator[SEP] identifier[navigatepageNums] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pageNum] operator[>] Other[1] operator[SEP] { identifier[prePage] operator[=] identifier[pageNum] operator[-] Other[1] operator[SEP] } Keyword[if] operator[SEP] identifier[pageNum] operator[<] identifier[pages] operator[SEP] { identifier[nextPage] operator[=] identifier[pageNum] operator[+] Other[1] operator[SEP] } } }
@Override public ZKData<String> getZKStringData(String path, Watcher watcher) throws InterruptedException, KeeperException { ZKData<byte[]> zkData = getZKByteData(path, watcher); return new ZKData<String>(toStringData(zkData.getData()), zkData.getStat()); }
class class_name[name] begin[{] method[getZKStringData, return_type[type[ZKData]], modifier[public], parameter[path, watcher]] begin[{] local_variable[type[ZKData], zkData] return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getData, postfix_operators=[], prefix_operators=[], qualifier=zkData, selectors=[], type_arguments=None)], member=toStringData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getStat, postfix_operators=[], prefix_operators=[], qualifier=zkData, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ZKData, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ZKData] operator[<] identifier[String] operator[>] identifier[getZKStringData] operator[SEP] identifier[String] identifier[path] , identifier[Watcher] identifier[watcher] operator[SEP] Keyword[throws] identifier[InterruptedException] , identifier[KeeperException] { identifier[ZKData] operator[<] Keyword[byte] operator[SEP] operator[SEP] operator[>] identifier[zkData] operator[=] identifier[getZKByteData] operator[SEP] identifier[path] , identifier[watcher] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ZKData] operator[<] identifier[String] operator[>] operator[SEP] identifier[toStringData] operator[SEP] identifier[zkData] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] , identifier[zkData] operator[SEP] identifier[getStat] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public String getScreenURL() { String strURL = super.getScreenURL(); if (this.getClass().getName().equals(BaseMenuScreen.class.getName())) { strURL = this.addURLParam(strURL, DBParams.RECORD, this.getMainRecord().getClass().getName()); strURL = this.addURLParam(strURL, DBParams.COMMAND, MenuConstants.MENUREC); } else strURL = this.addURLParam(strURL, DBParams.SCREEN, this.getClass().getName()); try { if (this.getMainRecord() != null) if ((this.getMainRecord().getEditMode() == Constants.EDIT_IN_PROGRESS) || (this.getMainRecord().getEditMode() == Constants.EDIT_CURRENT)) { String strBookmark = this.getMainRecord().getHandle(DBConstants.OBJECT_ID_HANDLE).toString(); strURL = this.addURLParam(strURL, DBConstants.STRING_OBJECT_ID_HANDLE, strBookmark); } } catch (DBException ex) { Debug.print(ex); ex.printStackTrace(); } return strURL; }
class class_name[name] begin[{] method[getScreenURL, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], strURL] if[THIS[call[None.getClass, parameter[]]call[None.getName, parameter[]]call[None.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BaseMenuScreen, sub_type=None))]]]] begin[{] assign[member[.strURL], THIS[call[None.addURLParam, parameter[member[.strURL], member[DBParams.RECORD], THIS[call[None.getMainRecord, parameter[]]call[None.getClass, parameter[]]call[None.getName, parameter[]]]]]]] assign[member[.strURL], THIS[call[None.addURLParam, parameter[member[.strURL], member[DBParams.COMMAND], member[MenuConstants.MENUREC]]]]] else begin[{] assign[member[.strURL], THIS[call[None.addURLParam, parameter[member[.strURL], member[DBParams.SCREEN], THIS[call[None.getClass, parameter[]]call[None.getName, parameter[]]]]]]] end[}] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getMainRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getMainRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getEditMode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MemberReference(member=EDIT_IN_PROGRESS, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator===), operandr=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getMainRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getEditMode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=MemberReference(member=EDIT_CURRENT, postfix_operators=[], prefix_operators=[], qualifier=Constants, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getMainRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=OBJECT_ID_HANDLE, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[])], member=getHandle, 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)]), name=strBookmark)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=strURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=strURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=STRING_OBJECT_ID_HANDLE, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[]), MemberReference(member=strBookmark, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addURLParam, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)])))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['DBException']))], finally_block=None, label=None, resources=None) return[member[.strURL]] end[}] END[}]
Keyword[public] identifier[String] identifier[getScreenURL] operator[SEP] operator[SEP] { identifier[String] identifier[strURL] operator[=] Keyword[super] operator[SEP] identifier[getScreenURL] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[BaseMenuScreen] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[strURL] operator[=] Keyword[this] operator[SEP] identifier[addURLParam] operator[SEP] identifier[strURL] , identifier[DBParams] operator[SEP] identifier[RECORD] , Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[strURL] operator[=] Keyword[this] operator[SEP] identifier[addURLParam] operator[SEP] identifier[strURL] , identifier[DBParams] operator[SEP] identifier[COMMAND] , identifier[MenuConstants] operator[SEP] identifier[MENUREC] operator[SEP] operator[SEP] } Keyword[else] identifier[strURL] operator[=] Keyword[this] operator[SEP] identifier[addURLParam] operator[SEP] identifier[strURL] , identifier[DBParams] operator[SEP] identifier[SCREEN] , Keyword[this] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getEditMode] operator[SEP] operator[SEP] operator[==] identifier[Constants] operator[SEP] identifier[EDIT_IN_PROGRESS] operator[SEP] operator[||] operator[SEP] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getEditMode] operator[SEP] operator[SEP] operator[==] identifier[Constants] operator[SEP] identifier[EDIT_CURRENT] operator[SEP] operator[SEP] { identifier[String] identifier[strBookmark] operator[=] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getHandle] operator[SEP] identifier[DBConstants] operator[SEP] identifier[OBJECT_ID_HANDLE] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[strURL] operator[=] Keyword[this] operator[SEP] identifier[addURLParam] operator[SEP] identifier[strURL] , identifier[DBConstants] operator[SEP] identifier[STRING_OBJECT_ID_HANDLE] , identifier[strBookmark] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[DBException] identifier[ex] operator[SEP] { identifier[Debug] operator[SEP] identifier[print] operator[SEP] identifier[ex] operator[SEP] operator[SEP] identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[strURL] operator[SEP] }
public static String name(Class<?> clazz, String... names) { // If we get a guice-enhanced class then we should go up one level to get the class name from the user's code if (clazz.getName().contains("$$EnhancerByGuice$$")) clazz = clazz.getSuperclass(); return MetricRegistry.name(clazz, names); }
class class_name[name] begin[{] method[name, return_type[type[String]], modifier[public static], parameter[clazz, names]] begin[{] if[call[clazz.getName, parameter[]]] begin[{] assign[member[.clazz], call[clazz.getSuperclass, parameter[]]] else begin[{] None end[}] return[call[MetricRegistry.name, parameter[member[.clazz], member[.names]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[name] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[String] operator[...] identifier[names] operator[SEP] { Keyword[if] operator[SEP] identifier[clazz] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[clazz] operator[=] identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[MetricRegistry] operator[SEP] identifier[name] operator[SEP] identifier[clazz] , identifier[names] operator[SEP] operator[SEP] }
@BetaApi public final Operation patchRegionInstanceGroupManager( String instanceGroupManager, InstanceGroupManager instanceGroupManagerResource, List<String> fieldMask) { PatchRegionInstanceGroupManagerHttpRequest request = PatchRegionInstanceGroupManagerHttpRequest.newBuilder() .setInstanceGroupManager(instanceGroupManager) .setInstanceGroupManagerResource(instanceGroupManagerResource) .addAllFieldMask(fieldMask) .build(); return patchRegionInstanceGroupManager(request); }
class class_name[name] begin[{] method[patchRegionInstanceGroupManager, return_type[type[Operation]], modifier[final public], parameter[instanceGroupManager, instanceGroupManagerResource, fieldMask]] begin[{] local_variable[type[PatchRegionInstanceGroupManagerHttpRequest], request] return[call[.patchRegionInstanceGroupManager, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Operation] identifier[patchRegionInstanceGroupManager] operator[SEP] identifier[String] identifier[instanceGroupManager] , identifier[InstanceGroupManager] identifier[instanceGroupManagerResource] , identifier[List] operator[<] identifier[String] operator[>] identifier[fieldMask] operator[SEP] { identifier[PatchRegionInstanceGroupManagerHttpRequest] identifier[request] operator[=] identifier[PatchRegionInstanceGroupManagerHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setInstanceGroupManager] operator[SEP] identifier[instanceGroupManager] operator[SEP] operator[SEP] identifier[setInstanceGroupManagerResource] operator[SEP] identifier[instanceGroupManagerResource] operator[SEP] operator[SEP] identifier[addAllFieldMask] operator[SEP] identifier[fieldMask] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[patchRegionInstanceGroupManager] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void writeInt(int pInt) throws IOException { file.write(pInt & 0xFF); file.write((pInt >>> 8) & 0xFF); file.write((pInt >>> 16) & 0xFF); file.write((pInt >>> 24) & 0xFF); }
class class_name[name] begin[{] method[writeInt, return_type[void], modifier[public], parameter[pInt]] begin[{] call[file.write, parameter[binary_operation[member[.pInt], &, literal[0xFF]]]] call[file.write, parameter[binary_operation[binary_operation[member[.pInt], >>>, literal[8]], &, literal[0xFF]]]] call[file.write, parameter[binary_operation[binary_operation[member[.pInt], >>>, literal[16]], &, literal[0xFF]]]] call[file.write, parameter[binary_operation[binary_operation[member[.pInt], >>>, literal[24]], &, literal[0xFF]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[writeInt] operator[SEP] Keyword[int] identifier[pInt] operator[SEP] Keyword[throws] identifier[IOException] { identifier[file] operator[SEP] identifier[write] operator[SEP] identifier[pInt] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[file] operator[SEP] identifier[write] operator[SEP] operator[SEP] identifier[pInt] operator[>] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[file] operator[SEP] identifier[write] operator[SEP] operator[SEP] identifier[pInt] operator[>] operator[>] operator[>] Other[16] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[file] operator[SEP] identifier[write] operator[SEP] operator[SEP] identifier[pInt] operator[>] operator[>] operator[>] Other[24] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] }
@Override protected List<? extends Object> getFieldValues() { return Arrays.asList(absolutePath(), fxmlName(), absoluteBundlePath(), bundleName()); }
class class_name[name] begin[{] method[getFieldValues, return_type[type[List]], modifier[protected], parameter[]] begin[{] return[call[Arrays.asList, parameter[call[.absolutePath, parameter[]], call[.fxmlName, parameter[]], call[.absoluteBundlePath, parameter[]], call[.bundleName, parameter[]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[List] operator[<] operator[?] Keyword[extends] identifier[Object] operator[>] identifier[getFieldValues] operator[SEP] operator[SEP] { Keyword[return] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[absolutePath] operator[SEP] operator[SEP] , identifier[fxmlName] operator[SEP] operator[SEP] , identifier[absoluteBundlePath] operator[SEP] operator[SEP] , identifier[bundleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public Neighbor<double[], E>[] knn(double[] q, int k, double recall, int T) { if (recall > 1 || recall < 0) { throw new IllegalArgumentException("Invalid recall: " + recall); } if (k < 1) { throw new IllegalArgumentException("Invalid k: " + k); } double alpha = 1 - Math.pow(1 - recall, 1.0 / hash.size()); int hit = 0; IntArrayList candidates = new IntArrayList(); for (int i = 0; i < hash.size(); i++) { IntArrayList buckets = model.get(i).getProbeSequence(q, alpha, T); for (int j = 0; j < buckets.size(); j++) { int bucket = buckets.get(j); ArrayList<HashEntry> bin = hash.get(i).table[bucket % H]; if (bin != null) { for (HashEntry e : bin) { if (e.bucket == bucket) { if (q != e.key || identicalExcluded) { candidates.add(e.index); } } } } } } int[] cand = candidates.toArray(); Arrays.sort(cand); Neighbor<double[], E> neighbor = new Neighbor<>(null, null, 0, Double.MAX_VALUE); @SuppressWarnings("unchecked") Neighbor<double[], E>[] neighbors = (Neighbor<double[], E>[]) java.lang.reflect.Array.newInstance(neighbor.getClass(), k); HeapSelect<Neighbor<double[], E>> heap = new HeapSelect<>(neighbors); for (int i = 0; i < k; i++) { heap.add(neighbor); } int prev = -1; for (int index : cand) { if (index == prev) { continue; } else { prev = index; } double[] key = keys.get(index); double dist = Math.distance(q, key); if (dist < heap.peek().distance) { heap.add(new Neighbor<>(key, data.get(index), index, dist)); hit++; } } heap.sort(); if (hit < k) { @SuppressWarnings("unchecked") Neighbor<double[], E>[] n2 = (Neighbor<double[], E>[]) java.lang.reflect.Array.newInstance(neighbor.getClass(), hit); int start = k - hit; for (int i = 0; i < hit; i++) { n2[i] = neighbors[i + start]; } neighbors = n2; } return neighbors; }
class class_name[name] begin[{] method[knn, return_type[type[Neighbor]], modifier[public], parameter[q, k, recall, T]] begin[{] if[binary_operation[binary_operation[member[.recall], >, literal[1]], ||, binary_operation[member[.recall], <, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid recall: "), operandr=MemberReference(member=recall, 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[binary_operation[member[.k], <, literal[1]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid k: "), operandr=MemberReference(member=k, 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[}] local_variable[type[double], alpha] local_variable[type[int], hit] local_variable[type[IntArrayList], candidates] 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=model, selectors=[MethodInvocation(arguments=[MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=alpha, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=T, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProbeSequence, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=buckets)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IntArrayList, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=buckets, selectors=[], type_arguments=None), name=bucket)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=hash, selectors=[MemberReference(member=table, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=H, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%))], type_arguments=None), name=bin)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=HashEntry, sub_type=None))], dimensions=[], name=ArrayList, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[]), operandr=MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[]), operator=!=), operandr=MemberReference(member=identicalExcluded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=candidates, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=bin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HashEntry, sub_type=None))), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=buckets, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=hash, 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) local_variable[type[int], cand] call[Arrays.sort, parameter[member[.cand]]] local_variable[type[Neighbor], neighbor] local_variable[type[Neighbor], neighbors] local_variable[type[HeapSelect], heap] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=neighbor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=heap, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[int], prev] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=BasicType(dimensions=[None], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=distance, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=dist)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=dist, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=peek, postfix_operators=[], prefix_operators=[], qualifier=heap, selectors=[MemberReference(member=distance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dist, 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=Neighbor, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=heap, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=hit, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=cand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None) call[heap.sort, parameter[]] if[binary_operation[member[.hit], <, member[.k]]] begin[{] local_variable[type[Neighbor], n2] local_variable[type[int], start] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=n2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=neighbors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=hit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.neighbors], member[.n2]] else begin[{] None end[}] return[member[.neighbors]] end[}] END[}]
Keyword[public] identifier[Neighbor] operator[<] Keyword[double] operator[SEP] operator[SEP] , identifier[E] operator[>] operator[SEP] operator[SEP] identifier[knn] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[q] , Keyword[int] identifier[k] , Keyword[double] identifier[recall] , Keyword[int] identifier[T] operator[SEP] { Keyword[if] operator[SEP] identifier[recall] operator[>] Other[1] operator[||] identifier[recall] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[recall] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[k] operator[<] Other[1] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[k] operator[SEP] operator[SEP] } Keyword[double] identifier[alpha] operator[=] Other[1] operator[-] identifier[Math] operator[SEP] identifier[pow] operator[SEP] Other[1] operator[-] identifier[recall] , literal[Float] operator[/] identifier[hash] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[hit] operator[=] Other[0] operator[SEP] identifier[IntArrayList] identifier[candidates] operator[=] Keyword[new] identifier[IntArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[hash] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[IntArrayList] identifier[buckets] operator[=] identifier[model] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getProbeSequence] operator[SEP] identifier[q] , identifier[alpha] , identifier[T] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[buckets] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { Keyword[int] identifier[bucket] operator[=] identifier[buckets] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[HashEntry] operator[>] identifier[bin] operator[=] identifier[hash] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[table] operator[SEP] identifier[bucket] operator[%] identifier[H] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bin] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[HashEntry] identifier[e] operator[:] identifier[bin] operator[SEP] { Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[bucket] operator[==] identifier[bucket] operator[SEP] { Keyword[if] operator[SEP] identifier[q] operator[!=] identifier[e] operator[SEP] identifier[key] operator[||] identifier[identicalExcluded] operator[SEP] { identifier[candidates] operator[SEP] identifier[add] operator[SEP] identifier[e] operator[SEP] identifier[index] operator[SEP] operator[SEP] } } } } } } Keyword[int] operator[SEP] operator[SEP] identifier[cand] operator[=] identifier[candidates] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[cand] operator[SEP] operator[SEP] identifier[Neighbor] operator[<] Keyword[double] operator[SEP] operator[SEP] , identifier[E] operator[>] identifier[neighbor] operator[=] Keyword[new] identifier[Neighbor] operator[<] operator[>] operator[SEP] Other[null] , Other[null] , Other[0] , identifier[Double] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Neighbor] operator[<] Keyword[double] operator[SEP] operator[SEP] , identifier[E] operator[>] operator[SEP] operator[SEP] identifier[neighbors] operator[=] operator[SEP] identifier[Neighbor] operator[<] Keyword[double] operator[SEP] operator[SEP] , identifier[E] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[reflect] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[neighbor] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[k] operator[SEP] operator[SEP] identifier[HeapSelect] operator[<] identifier[Neighbor] operator[<] Keyword[double] operator[SEP] operator[SEP] , identifier[E] operator[>] operator[>] identifier[heap] operator[=] Keyword[new] identifier[HeapSelect] operator[<] operator[>] operator[SEP] identifier[neighbors] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[k] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[heap] operator[SEP] identifier[add] operator[SEP] identifier[neighbor] operator[SEP] operator[SEP] } Keyword[int] identifier[prev] operator[=] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[:] identifier[cand] operator[SEP] { Keyword[if] operator[SEP] identifier[index] operator[==] identifier[prev] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[else] { identifier[prev] operator[=] identifier[index] operator[SEP] } Keyword[double] operator[SEP] operator[SEP] identifier[key] operator[=] identifier[keys] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[double] identifier[dist] operator[=] identifier[Math] operator[SEP] identifier[distance] operator[SEP] identifier[q] , identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dist] operator[<] identifier[heap] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[distance] operator[SEP] { identifier[heap] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Neighbor] operator[<] operator[>] operator[SEP] identifier[key] , identifier[data] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] , identifier[index] , identifier[dist] operator[SEP] operator[SEP] operator[SEP] identifier[hit] operator[++] operator[SEP] } } identifier[heap] operator[SEP] identifier[sort] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hit] operator[<] identifier[k] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Neighbor] operator[<] Keyword[double] operator[SEP] operator[SEP] , identifier[E] operator[>] operator[SEP] operator[SEP] identifier[n2] operator[=] operator[SEP] identifier[Neighbor] operator[<] Keyword[double] operator[SEP] operator[SEP] , identifier[E] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[reflect] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[neighbor] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[hit] operator[SEP] operator[SEP] Keyword[int] identifier[start] operator[=] identifier[k] operator[-] identifier[hit] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[hit] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[n2] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[neighbors] operator[SEP] identifier[i] operator[+] identifier[start] operator[SEP] operator[SEP] } identifier[neighbors] operator[=] identifier[n2] operator[SEP] } Keyword[return] identifier[neighbors] operator[SEP] }
public Observable<Page<BuildInner>> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<BuildInner>>, Page<BuildInner>>() { @Override public Page<BuildInner> call(ServiceResponse<Page<BuildInner>> response) { return response.body(); } }); }
class class_name[name] begin[{] method[listNextAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink]] begin[{] return[call[.listNextWithServiceResponseAsync, parameter[member[.nextPageLink]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[BuildInner] operator[>] operator[>] identifier[listNextAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[return] identifier[listNextWithServiceResponseAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[BuildInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[BuildInner] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[BuildInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[BuildInner] operator[>] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
private void processHyperlinkData(Resource resource, byte[] data) { if (data != null) { int offset = 12; String hyperlink; String address; String subaddress; offset += 12; hyperlink = MPPUtility.getUnicodeString(data, offset); offset += ((hyperlink.length() + 1) * 2); offset += 12; address = MPPUtility.getUnicodeString(data, offset); offset += ((address.length() + 1) * 2); offset += 12; subaddress = MPPUtility.getUnicodeString(data, offset); resource.setHyperlink(hyperlink); resource.setHyperlinkAddress(address); resource.setHyperlinkSubAddress(subaddress); } }
class class_name[name] begin[{] method[processHyperlinkData, return_type[void], modifier[private], parameter[resource, data]] begin[{] if[binary_operation[member[.data], !=, literal[null]]] begin[{] local_variable[type[int], offset] local_variable[type[String], hyperlink] local_variable[type[String], address] local_variable[type[String], subaddress] assign[member[.offset], literal[12]] assign[member[.hyperlink], call[MPPUtility.getUnicodeString, parameter[member[.data], member[.offset]]]] assign[member[.offset], binary_operation[binary_operation[call[hyperlink.length, parameter[]], +, literal[1]], *, literal[2]]] assign[member[.offset], literal[12]] assign[member[.address], call[MPPUtility.getUnicodeString, parameter[member[.data], member[.offset]]]] assign[member[.offset], binary_operation[binary_operation[call[address.length, parameter[]], +, literal[1]], *, literal[2]]] assign[member[.offset], literal[12]] assign[member[.subaddress], call[MPPUtility.getUnicodeString, parameter[member[.data], member[.offset]]]] call[resource.setHyperlink, parameter[member[.hyperlink]]] call[resource.setHyperlinkAddress, parameter[member[.address]]] call[resource.setHyperlinkSubAddress, parameter[member[.subaddress]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[processHyperlinkData] operator[SEP] identifier[Resource] identifier[resource] , Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[SEP] { Keyword[if] operator[SEP] identifier[data] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[offset] operator[=] Other[12] operator[SEP] identifier[String] identifier[hyperlink] operator[SEP] identifier[String] identifier[address] operator[SEP] identifier[String] identifier[subaddress] operator[SEP] identifier[offset] operator[+=] Other[12] operator[SEP] identifier[hyperlink] operator[=] identifier[MPPUtility] operator[SEP] identifier[getUnicodeString] operator[SEP] identifier[data] , identifier[offset] operator[SEP] operator[SEP] identifier[offset] operator[+=] operator[SEP] operator[SEP] identifier[hyperlink] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[*] Other[2] operator[SEP] operator[SEP] identifier[offset] operator[+=] Other[12] operator[SEP] identifier[address] operator[=] identifier[MPPUtility] operator[SEP] identifier[getUnicodeString] operator[SEP] identifier[data] , identifier[offset] operator[SEP] operator[SEP] identifier[offset] operator[+=] operator[SEP] operator[SEP] identifier[address] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[*] Other[2] operator[SEP] operator[SEP] identifier[offset] operator[+=] Other[12] operator[SEP] identifier[subaddress] operator[=] identifier[MPPUtility] operator[SEP] identifier[getUnicodeString] operator[SEP] identifier[data] , identifier[offset] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setHyperlink] operator[SEP] identifier[hyperlink] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setHyperlinkAddress] operator[SEP] identifier[address] operator[SEP] operator[SEP] identifier[resource] operator[SEP] identifier[setHyperlinkSubAddress] operator[SEP] identifier[subaddress] operator[SEP] operator[SEP] } }
protected void createBinaryBundle(HttpServlet servlet, BinaryResourcesHandler binaryRsHandler, String destDirPath, ServletConfig servletConfig, boolean keepUrlMapping) throws IOException, ServletException { Map<String, String> bundleImgMap = binaryRsHandler.getBinaryPathMap(); Iterator<String> bundleIterator = bundleImgMap.values().iterator(); MockServletResponse response = new MockServletResponse(); MockServletRequest request = new MockServletRequest( JAWR_BUNDLE_PROCESSOR_CONTEXT_PATH); String jawrServletMapping = servletConfig .getInitParameter(JawrConstant.SERVLET_MAPPING_PROPERTY_NAME); if (jawrServletMapping == null) { jawrServletMapping = ""; } String servletMapping = servletConfig .getInitParameter(JawrConstant.SPRING_SERVLET_MAPPING_PROPERTY_NAME); if (servletMapping == null) { servletMapping = jawrServletMapping; } // For the list of bundle defines, create the file associated while (bundleIterator.hasNext()) { String path = (String) bundleIterator.next(); String binaryFinalPath = null; if (keepUrlMapping) { binaryFinalPath = path; } else { binaryFinalPath = getImageFinalPath(path, binaryRsHandler.getConfig()); } File destFile = new File(destDirPath, binaryFinalPath); Map<String, String> variantMap = new HashMap<String, String>(); setRequestUrl(request, variantMap , path, binaryRsHandler.getConfig()); // Update the bundle mapping path = PathNormalizer.concatWebPath( PathNormalizer.asDirPath(jawrServletMapping), path); createBundleFile(servlet, response, request, path, destFile, servletMapping); } }
class class_name[name] begin[{] method[createBinaryBundle, return_type[void], modifier[protected], parameter[servlet, binaryRsHandler, destDirPath, servletConfig, keepUrlMapping]] begin[{] local_variable[type[Map], bundleImgMap] local_variable[type[Iterator], bundleIterator] local_variable[type[MockServletResponse], response] local_variable[type[MockServletRequest], request] local_variable[type[String], jawrServletMapping] if[binary_operation[member[.jawrServletMapping], ==, literal[null]]] begin[{] assign[member[.jawrServletMapping], literal[""]] else begin[{] None end[}] local_variable[type[String], servletMapping] if[binary_operation[member[.servletMapping], ==, literal[null]]] begin[{] assign[member[.servletMapping], member[.jawrServletMapping]] else begin[{] None end[}] while[call[bundleIterator.hasNext, parameter[]]] begin[{] local_variable[type[String], path] local_variable[type[String], binaryFinalPath] if[member[.keepUrlMapping]] begin[{] assign[member[.binaryFinalPath], member[.path]] else begin[{] assign[member[.binaryFinalPath], call[.getImageFinalPath, parameter[member[.path], call[binaryRsHandler.getConfig, parameter[]]]]] end[}] local_variable[type[File], destFile] local_variable[type[Map], variantMap] call[.setRequestUrl, parameter[member[.request], member[.variantMap], member[.path], call[binaryRsHandler.getConfig, parameter[]]]] assign[member[.path], call[PathNormalizer.concatWebPath, parameter[call[PathNormalizer.asDirPath, parameter[member[.jawrServletMapping]]], member[.path]]]] call[.createBundleFile, parameter[member[.servlet], member[.response], member[.request], member[.path], member[.destFile], member[.servletMapping]]] end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[createBinaryBundle] operator[SEP] identifier[HttpServlet] identifier[servlet] , identifier[BinaryResourcesHandler] identifier[binaryRsHandler] , identifier[String] identifier[destDirPath] , identifier[ServletConfig] identifier[servletConfig] , Keyword[boolean] identifier[keepUrlMapping] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[bundleImgMap] operator[=] identifier[binaryRsHandler] operator[SEP] identifier[getBinaryPathMap] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[bundleIterator] operator[=] identifier[bundleImgMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[MockServletResponse] identifier[response] operator[=] Keyword[new] identifier[MockServletResponse] operator[SEP] operator[SEP] operator[SEP] identifier[MockServletRequest] identifier[request] operator[=] Keyword[new] identifier[MockServletRequest] operator[SEP] identifier[JAWR_BUNDLE_PROCESSOR_CONTEXT_PATH] operator[SEP] operator[SEP] identifier[String] identifier[jawrServletMapping] operator[=] identifier[servletConfig] operator[SEP] identifier[getInitParameter] operator[SEP] identifier[JawrConstant] operator[SEP] identifier[SERVLET_MAPPING_PROPERTY_NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jawrServletMapping] operator[==] Other[null] operator[SEP] { identifier[jawrServletMapping] operator[=] literal[String] operator[SEP] } identifier[String] identifier[servletMapping] operator[=] identifier[servletConfig] operator[SEP] identifier[getInitParameter] operator[SEP] identifier[JawrConstant] operator[SEP] identifier[SPRING_SERVLET_MAPPING_PROPERTY_NAME] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[servletMapping] operator[==] Other[null] operator[SEP] { identifier[servletMapping] operator[=] identifier[jawrServletMapping] operator[SEP] } Keyword[while] operator[SEP] identifier[bundleIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[path] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[bundleIterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[binaryFinalPath] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[keepUrlMapping] operator[SEP] { identifier[binaryFinalPath] operator[=] identifier[path] operator[SEP] } Keyword[else] { identifier[binaryFinalPath] operator[=] identifier[getImageFinalPath] operator[SEP] identifier[path] , identifier[binaryRsHandler] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[File] identifier[destFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[destDirPath] , identifier[binaryFinalPath] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[variantMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[setRequestUrl] operator[SEP] identifier[request] , identifier[variantMap] , identifier[path] , identifier[binaryRsHandler] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[PathNormalizer] operator[SEP] identifier[concatWebPath] operator[SEP] identifier[PathNormalizer] operator[SEP] identifier[asDirPath] operator[SEP] identifier[jawrServletMapping] operator[SEP] , identifier[path] operator[SEP] operator[SEP] identifier[createBundleFile] operator[SEP] identifier[servlet] , identifier[response] , identifier[request] , identifier[path] , identifier[destFile] , identifier[servletMapping] operator[SEP] operator[SEP] } }
public static int mix(int a, int b, int c) { a = a - b; a = a - c; a = a ^ (c >>> 13); b = b - c; b = b - a; b = b ^ (a << 8); c = c - a; c = c - b; c = c ^ (b >>> 13); a = a - b; a = a - c; a = a ^ (c >>> 12); b = b - c; b = b - a; b = b ^ (a << 16); c = c - a; c = c - b; c = c ^ (b >>> 5); a = a - b; a = a - c; a = a ^ (c >>> 3); b = b - c; b = b - a; b = b ^ (a << 10); c = c - a; c = c - b; c = c ^ (b >>> 15); return c; }
class class_name[name] begin[{] method[mix, return_type[type[int]], modifier[public static], parameter[a, b, c]] begin[{] assign[member[.a], binary_operation[member[.a], -, member[.b]]] assign[member[.a], binary_operation[member[.a], -, member[.c]]] assign[member[.a], binary_operation[member[.a], ^, binary_operation[member[.c], >>>, literal[13]]]] assign[member[.b], binary_operation[member[.b], -, member[.c]]] assign[member[.b], binary_operation[member[.b], -, member[.a]]] assign[member[.b], binary_operation[member[.b], ^, binary_operation[member[.a], <<, literal[8]]]] assign[member[.c], binary_operation[member[.c], -, member[.a]]] assign[member[.c], binary_operation[member[.c], -, member[.b]]] assign[member[.c], binary_operation[member[.c], ^, binary_operation[member[.b], >>>, literal[13]]]] assign[member[.a], binary_operation[member[.a], -, member[.b]]] assign[member[.a], binary_operation[member[.a], -, member[.c]]] assign[member[.a], binary_operation[member[.a], ^, binary_operation[member[.c], >>>, literal[12]]]] assign[member[.b], binary_operation[member[.b], -, member[.c]]] assign[member[.b], binary_operation[member[.b], -, member[.a]]] assign[member[.b], binary_operation[member[.b], ^, binary_operation[member[.a], <<, literal[16]]]] assign[member[.c], binary_operation[member[.c], -, member[.a]]] assign[member[.c], binary_operation[member[.c], -, member[.b]]] assign[member[.c], binary_operation[member[.c], ^, binary_operation[member[.b], >>>, literal[5]]]] assign[member[.a], binary_operation[member[.a], -, member[.b]]] assign[member[.a], binary_operation[member[.a], -, member[.c]]] assign[member[.a], binary_operation[member[.a], ^, binary_operation[member[.c], >>>, literal[3]]]] assign[member[.b], binary_operation[member[.b], -, member[.c]]] assign[member[.b], binary_operation[member[.b], -, member[.a]]] assign[member[.b], binary_operation[member[.b], ^, binary_operation[member[.a], <<, literal[10]]]] assign[member[.c], binary_operation[member[.c], -, member[.a]]] assign[member[.c], binary_operation[member[.c], -, member[.b]]] assign[member[.c], binary_operation[member[.c], ^, binary_operation[member[.b], >>>, literal[15]]]] return[member[.c]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[mix] operator[SEP] Keyword[int] identifier[a] , Keyword[int] identifier[b] , Keyword[int] identifier[c] operator[SEP] { identifier[a] operator[=] identifier[a] operator[-] identifier[b] operator[SEP] identifier[a] operator[=] identifier[a] operator[-] identifier[c] operator[SEP] identifier[a] operator[=] identifier[a] operator[^] operator[SEP] identifier[c] operator[>] operator[>] operator[>] Other[13] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[b] operator[-] identifier[c] operator[SEP] identifier[b] operator[=] identifier[b] operator[-] identifier[a] operator[SEP] identifier[b] operator[=] identifier[b] operator[^] operator[SEP] identifier[a] operator[<<] Other[8] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[c] operator[-] identifier[a] operator[SEP] identifier[c] operator[=] identifier[c] operator[-] identifier[b] operator[SEP] identifier[c] operator[=] identifier[c] operator[^] operator[SEP] identifier[b] operator[>] operator[>] operator[>] Other[13] operator[SEP] operator[SEP] identifier[a] operator[=] identifier[a] operator[-] identifier[b] operator[SEP] identifier[a] operator[=] identifier[a] operator[-] identifier[c] operator[SEP] identifier[a] operator[=] identifier[a] operator[^] operator[SEP] identifier[c] operator[>] operator[>] operator[>] Other[12] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[b] operator[-] identifier[c] operator[SEP] identifier[b] operator[=] identifier[b] operator[-] identifier[a] operator[SEP] identifier[b] operator[=] identifier[b] operator[^] operator[SEP] identifier[a] operator[<<] Other[16] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[c] operator[-] identifier[a] operator[SEP] identifier[c] operator[=] identifier[c] operator[-] identifier[b] operator[SEP] identifier[c] operator[=] identifier[c] operator[^] operator[SEP] identifier[b] operator[>] operator[>] operator[>] Other[5] operator[SEP] operator[SEP] identifier[a] operator[=] identifier[a] operator[-] identifier[b] operator[SEP] identifier[a] operator[=] identifier[a] operator[-] identifier[c] operator[SEP] identifier[a] operator[=] identifier[a] operator[^] operator[SEP] identifier[c] operator[>] operator[>] operator[>] Other[3] operator[SEP] operator[SEP] identifier[b] operator[=] identifier[b] operator[-] identifier[c] operator[SEP] identifier[b] operator[=] identifier[b] operator[-] identifier[a] operator[SEP] identifier[b] operator[=] identifier[b] operator[^] operator[SEP] identifier[a] operator[<<] Other[10] operator[SEP] operator[SEP] identifier[c] operator[=] identifier[c] operator[-] identifier[a] operator[SEP] identifier[c] operator[=] identifier[c] operator[-] identifier[b] operator[SEP] identifier[c] operator[=] identifier[c] operator[^] operator[SEP] identifier[b] operator[>] operator[>] operator[>] Other[15] operator[SEP] operator[SEP] Keyword[return] identifier[c] operator[SEP] }
@SuppressWarnings("unchecked") public static ISharedContext<IUser> getUserContext() { return (ISharedContext<IUser>) ContextManager.getInstance().getSharedContext(UserContext.class.getName()); }
class class_name[name] begin[{] method[getUserContext, return_type[type[ISharedContext]], modifier[public static], parameter[]] begin[{] return[Cast(expression=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=ContextManager, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=UserContext, sub_type=None))], member=getSharedContext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IUser, sub_type=None))], dimensions=[], name=ISharedContext, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] identifier[ISharedContext] operator[<] identifier[IUser] operator[>] identifier[getUserContext] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] identifier[ISharedContext] operator[<] identifier[IUser] operator[>] operator[SEP] identifier[ContextManager] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getSharedContext] operator[SEP] identifier[UserContext] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void toLeftJoin() { assert((m_leftNode != null && m_rightNode != null) || (m_leftNode == null && m_rightNode == null)); if (m_leftNode == null && m_rightNode == null) { // End of recursion return; } // recursive calls if (m_leftNode instanceof BranchNode) { ((BranchNode)m_leftNode).toLeftJoin(); } if (m_rightNode instanceof BranchNode) { ((BranchNode)m_rightNode).toLeftJoin(); } // Swap own children if (m_joinType == JoinType.RIGHT) { JoinNode node = m_rightNode; m_rightNode = m_leftNode; m_leftNode = node; m_joinType = JoinType.LEFT; } }
class class_name[name] begin[{] method[toLeftJoin, return_type[void], modifier[public], parameter[]] begin[{] AssertStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m_leftNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=m_rightNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=m_leftNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MemberReference(member=m_rightNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operator=&&), operator=||), label=None, value=None) if[binary_operation[binary_operation[member[.m_leftNode], ==, literal[null]], &&, binary_operation[member[.m_rightNode], ==, literal[null]]]] begin[{] return[None] else begin[{] None end[}] if[binary_operation[member[.m_leftNode], instanceof, type[BranchNode]]] begin[{] Cast(expression=MemberReference(member=m_leftNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BranchNode, sub_type=None)) else begin[{] None end[}] if[binary_operation[member[.m_rightNode], instanceof, type[BranchNode]]] begin[{] Cast(expression=MemberReference(member=m_rightNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BranchNode, sub_type=None)) else begin[{] None end[}] if[binary_operation[member[.m_joinType], ==, member[JoinType.RIGHT]]] begin[{] local_variable[type[JoinNode], node] assign[member[.m_rightNode], member[.m_leftNode]] assign[member[.m_leftNode], member[.node]] assign[member[.m_joinType], member[JoinType.LEFT]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[toLeftJoin] operator[SEP] operator[SEP] { Keyword[assert] operator[SEP] operator[SEP] identifier[m_leftNode] operator[!=] Other[null] operator[&&] identifier[m_rightNode] operator[!=] Other[null] operator[SEP] operator[||] operator[SEP] identifier[m_leftNode] operator[==] Other[null] operator[&&] identifier[m_rightNode] operator[==] Other[null] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_leftNode] operator[==] Other[null] operator[&&] identifier[m_rightNode] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[m_leftNode] Keyword[instanceof] identifier[BranchNode] operator[SEP] { operator[SEP] operator[SEP] identifier[BranchNode] operator[SEP] identifier[m_leftNode] operator[SEP] operator[SEP] identifier[toLeftJoin] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[m_rightNode] Keyword[instanceof] identifier[BranchNode] operator[SEP] { operator[SEP] operator[SEP] identifier[BranchNode] operator[SEP] identifier[m_rightNode] operator[SEP] operator[SEP] identifier[toLeftJoin] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[m_joinType] operator[==] identifier[JoinType] operator[SEP] identifier[RIGHT] operator[SEP] { identifier[JoinNode] identifier[node] operator[=] identifier[m_rightNode] operator[SEP] identifier[m_rightNode] operator[=] identifier[m_leftNode] operator[SEP] identifier[m_leftNode] operator[=] identifier[node] operator[SEP] identifier[m_joinType] operator[=] identifier[JoinType] operator[SEP] identifier[LEFT] operator[SEP] } }
public java.security.cert.Certificate[] getCertificates() throws IOException { JarEntry e = getJarEntry(); return e != null ? e.getCertificates() : null; }
class class_name[name] begin[{] method[getCertificates, return_type[type[java]], modifier[public], parameter[]] begin[{] local_variable[type[JarEntry], e] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=e, 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=[], member=getCertificates, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[security] operator[SEP] identifier[cert] operator[SEP] identifier[Certificate] operator[SEP] operator[SEP] identifier[getCertificates] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] { identifier[JarEntry] identifier[e] operator[=] identifier[getJarEntry] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[e] operator[!=] Other[null] operator[?] identifier[e] operator[SEP] identifier[getCertificates] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] }
public void setConfig(Map<String, ? extends CacheConfig> config) { this.configMap = (Map<String, CacheConfig>) config; }
class class_name[name] begin[{] method[setConfig, return_type[void], modifier[public], parameter[config]] begin[{] assign[THIS[member[None.configMap]], Cast(expression=MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=CacheConfig, sub_type=None))], dimensions=[], name=Map, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[void] identifier[setConfig] operator[SEP] identifier[Map] operator[<] identifier[String] , operator[?] Keyword[extends] identifier[CacheConfig] operator[>] identifier[config] operator[SEP] { Keyword[this] operator[SEP] identifier[configMap] operator[=] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[CacheConfig] operator[>] operator[SEP] identifier[config] operator[SEP] }
private ResolveTask processTopic(final FileInfo f, final KeyScope scope, final boolean isResourceOnly) { final int increment = isResourceOnly ? 0 : 1; final Integer used = usage.containsKey(f.uri) ? usage.get(f.uri) + increment : increment; usage.put(f.uri, used); if (used > 1) { final URI result = addSuffix(f.result, "-" + (used - 1)); final URI out = tempFileNameScheme.generateTempFileName(result); final FileInfo fo = new FileInfo.Builder(f) .uri(out) .result(result) .build(); // TODO: Should this be added when content is actually generated? job.add(fo); return new ResolveTask(scope, f, fo); } else { return new ResolveTask(scope, f, null); } }
class class_name[name] begin[{] method[processTopic, return_type[type[ResolveTask]], modifier[private], parameter[f, scope, isResourceOnly]] begin[{] local_variable[type[int], increment] local_variable[type[Integer], used] call[usage.put, parameter[member[f.uri], member[.used]]] if[binary_operation[member[.used], >, literal[1]]] begin[{] local_variable[type[URI], result] local_variable[type[URI], out] local_variable[type[FileInfo], fo] call[job.add, parameter[member[.fo]]] return[ClassCreator(arguments=[MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fo, 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=ResolveTask, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=ResolveTask, sub_type=None))] end[}] end[}] END[}]
Keyword[private] identifier[ResolveTask] identifier[processTopic] operator[SEP] Keyword[final] identifier[FileInfo] identifier[f] , Keyword[final] identifier[KeyScope] identifier[scope] , Keyword[final] Keyword[boolean] identifier[isResourceOnly] operator[SEP] { Keyword[final] Keyword[int] identifier[increment] operator[=] identifier[isResourceOnly] operator[?] Other[0] operator[:] Other[1] operator[SEP] Keyword[final] identifier[Integer] identifier[used] operator[=] identifier[usage] operator[SEP] identifier[containsKey] operator[SEP] identifier[f] operator[SEP] identifier[uri] operator[SEP] operator[?] identifier[usage] operator[SEP] identifier[get] operator[SEP] identifier[f] operator[SEP] identifier[uri] operator[SEP] operator[+] identifier[increment] operator[:] identifier[increment] operator[SEP] identifier[usage] operator[SEP] identifier[put] operator[SEP] identifier[f] operator[SEP] identifier[uri] , identifier[used] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[used] operator[>] Other[1] operator[SEP] { Keyword[final] identifier[URI] identifier[result] operator[=] identifier[addSuffix] operator[SEP] identifier[f] operator[SEP] identifier[result] , literal[String] operator[+] operator[SEP] identifier[used] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[URI] identifier[out] operator[=] identifier[tempFileNameScheme] operator[SEP] identifier[generateTempFileName] operator[SEP] identifier[result] operator[SEP] operator[SEP] Keyword[final] identifier[FileInfo] identifier[fo] operator[=] Keyword[new] identifier[FileInfo] operator[SEP] identifier[Builder] operator[SEP] identifier[f] operator[SEP] operator[SEP] identifier[uri] operator[SEP] identifier[out] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[result] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[job] operator[SEP] identifier[add] operator[SEP] identifier[fo] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ResolveTask] operator[SEP] identifier[scope] , identifier[f] , identifier[fo] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[ResolveTask] operator[SEP] identifier[scope] , identifier[f] , Other[null] operator[SEP] operator[SEP] } }
@Override public String getMessage() { return new StringBuilder() .append("Request [").append(requestMethod.toString()).append("] ") .append("to URL: ").append(requestUri).append(" has failed with ") .append("Status code: ") .append(statusCode).append('\n') .append("Status message: ") .append(statusMessage).append('\n') .append("Content: '").append(content).append('\'') .toString(); }
class class_name[name] begin[{] method[getMessage, return_type[type[String]], modifier[public], parameter[]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Request [")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=requestMethod, selectors=[], type_arguments=None)], 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="to URL: ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=requestUri, 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=" has failed with ")], 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="Status code: ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=statusCode, 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='\n')], 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="Status message: ")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=statusMessage, 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='\n')], 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="Content: '")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=content, 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))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getMessage] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[requestMethod] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[requestUri] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[statusCode] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[statusMessage] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[content] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static double goodmanKruskalGamma(DoubleVector a, DoubleVector b) { check(a, b); // NOTE: slow n^2 version. Needs to be replaced at some point with the // n-log-n method and to take into account sparse vectors. -jurgens int length = a.length(); double numerator = 0; int concordant = 0; int discordant = 0; // For all pairs, track how many pairs satisfy the ordering for (int i = 0; i < length; ++i) { for (int j = i+1; j < length; ++j) { // NOTE: this value will be 1 if there exists an match or // "concordance" in the ordering of the two pairs. Otherwise // it, will be a -1 of the pairs are not matched or are // "discordant. double ai = a.get(i); double aj = a.get(j); double bi = b.get(i); double bj = b.get(j); // If there was a tied rank, don't count the comparisons towards // the concordance totals if (ai != aj && bi != bj) { if ((ai < aj && bi < bj) || (ai > aj && bi > bj)) concordant++; else discordant++; } } } int cd = concordant + discordant; return (cd == 0) ? 0 : ((double)(concordant - discordant)) / cd; }
class class_name[name] begin[{] method[goodmanKruskalGamma, return_type[type[double]], modifier[public static], parameter[a, b]] begin[{] call[.check, parameter[member[.a], member[.b]]] local_variable[type[int], length] local_variable[type[double], numerator] local_variable[type[int], concordant] local_variable[type[int], discordant] ForStatement(body=BlockStatement(label=None, statements=[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=a, selectors=[], type_arguments=None), name=ai)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), name=aj)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), name=bi)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None), name=bj)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ai, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=aj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=bi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ai, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=aj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=bi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ai, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=aj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=bi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=&&), operator=||), else_statement=StatementExpression(expression=MemberReference(member=discordant, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), label=None, then_statement=StatementExpression(expression=MemberReference(member=concordant, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) local_variable[type[int], cd] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=BinaryOperation(operandl=Cast(expression=BinaryOperation(operandl=MemberReference(member=concordant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=discordant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), type=BasicType(dimensions=[], name=double)), operandr=MemberReference(member=cd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[goodmanKruskalGamma] operator[SEP] identifier[DoubleVector] identifier[a] , identifier[DoubleVector] identifier[b] operator[SEP] { identifier[check] operator[SEP] identifier[a] , identifier[b] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[a] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[numerator] operator[=] Other[0] operator[SEP] Keyword[int] identifier[concordant] operator[=] Other[0] operator[SEP] Keyword[int] identifier[discordant] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[i] operator[+] Other[1] operator[SEP] identifier[j] operator[<] identifier[length] operator[SEP] operator[++] identifier[j] operator[SEP] { Keyword[double] identifier[ai] operator[=] identifier[a] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[double] identifier[aj] operator[=] identifier[a] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[double] identifier[bi] operator[=] identifier[b] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[double] identifier[bj] operator[=] identifier[b] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ai] operator[!=] identifier[aj] operator[&&] identifier[bi] operator[!=] identifier[bj] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[ai] operator[<] identifier[aj] operator[&&] identifier[bi] operator[<] identifier[bj] operator[SEP] operator[||] operator[SEP] identifier[ai] operator[>] identifier[aj] operator[&&] identifier[bi] operator[>] identifier[bj] operator[SEP] operator[SEP] identifier[concordant] operator[++] operator[SEP] Keyword[else] identifier[discordant] operator[++] operator[SEP] } } } Keyword[int] identifier[cd] operator[=] identifier[concordant] operator[+] identifier[discordant] operator[SEP] Keyword[return] operator[SEP] identifier[cd] operator[==] Other[0] operator[SEP] operator[?] Other[0] operator[:] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[concordant] operator[-] identifier[discordant] operator[SEP] operator[SEP] operator[/] identifier[cd] operator[SEP] }
@Override public CreateStorediSCSIVolumeResult createStorediSCSIVolume(CreateStorediSCSIVolumeRequest request) { request = beforeClientExecution(request); return executeCreateStorediSCSIVolume(request); }
class class_name[name] begin[{] method[createStorediSCSIVolume, return_type[type[CreateStorediSCSIVolumeResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeCreateStorediSCSIVolume, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CreateStorediSCSIVolumeResult] identifier[createStorediSCSIVolume] operator[SEP] identifier[CreateStorediSCSIVolumeRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeCreateStorediSCSIVolume] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
@Override public BigDecimalMapper build(String field) { return new BigDecimalMapper(field, column, validated, integerDigits, decimalDigits); }
class class_name[name] begin[{] method[build, return_type[type[BigDecimalMapper]], modifier[public], parameter[field]] begin[{] return[ClassCreator(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=validated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=integerDigits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=decimalDigits, 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=BigDecimalMapper, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[BigDecimalMapper] identifier[build] operator[SEP] identifier[String] identifier[field] operator[SEP] { Keyword[return] Keyword[new] identifier[BigDecimalMapper] operator[SEP] identifier[field] , identifier[column] , identifier[validated] , identifier[integerDigits] , identifier[decimalDigits] operator[SEP] operator[SEP] }
private Metric collectCounter(String dropwizardName, Counter counter) { String metricName = DropWizardUtils.generateFullMetricName(dropwizardName, "counter"); String metricDescription = DropWizardUtils.generateFullMetricDescription(dropwizardName, counter); MetricDescriptor metricDescriptor = MetricDescriptor.create( metricName, metricDescription, DEFAULT_UNIT, Type.GAUGE_INT64, Collections.<LabelKey>emptyList()); TimeSeries timeSeries = TimeSeries.createWithOnePoint( Collections.<LabelValue>emptyList(), Point.create(Value.longValue(counter.getCount()), clock.now()), null); return Metric.createWithOneTimeSeries(metricDescriptor, timeSeries); }
class class_name[name] begin[{] method[collectCounter, return_type[type[Metric]], modifier[private], parameter[dropwizardName, counter]] begin[{] local_variable[type[String], metricName] local_variable[type[String], metricDescription] local_variable[type[MetricDescriptor], metricDescriptor] local_variable[type[TimeSeries], timeSeries] return[call[Metric.createWithOneTimeSeries, parameter[member[.metricDescriptor], member[.timeSeries]]]] end[}] END[}]
Keyword[private] identifier[Metric] identifier[collectCounter] operator[SEP] identifier[String] identifier[dropwizardName] , identifier[Counter] identifier[counter] operator[SEP] { identifier[String] identifier[metricName] operator[=] identifier[DropWizardUtils] operator[SEP] identifier[generateFullMetricName] operator[SEP] identifier[dropwizardName] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[metricDescription] operator[=] identifier[DropWizardUtils] operator[SEP] identifier[generateFullMetricDescription] operator[SEP] identifier[dropwizardName] , identifier[counter] operator[SEP] operator[SEP] identifier[MetricDescriptor] identifier[metricDescriptor] operator[=] identifier[MetricDescriptor] operator[SEP] identifier[create] operator[SEP] identifier[metricName] , identifier[metricDescription] , identifier[DEFAULT_UNIT] , identifier[Type] operator[SEP] identifier[GAUGE_INT64] , identifier[Collections] operator[SEP] operator[<] identifier[LabelKey] operator[>] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[TimeSeries] identifier[timeSeries] operator[=] identifier[TimeSeries] operator[SEP] identifier[createWithOnePoint] operator[SEP] identifier[Collections] operator[SEP] operator[<] identifier[LabelValue] operator[>] identifier[emptyList] operator[SEP] operator[SEP] , identifier[Point] operator[SEP] identifier[create] operator[SEP] identifier[Value] operator[SEP] identifier[longValue] operator[SEP] identifier[counter] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] identifier[now] operator[SEP] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[Metric] operator[SEP] identifier[createWithOneTimeSeries] operator[SEP] identifier[metricDescriptor] , identifier[timeSeries] operator[SEP] operator[SEP] }
public void marshall(ListFunctionDefinitionVersionsRequest listFunctionDefinitionVersionsRequest, ProtocolMarshaller protocolMarshaller) { if (listFunctionDefinitionVersionsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listFunctionDefinitionVersionsRequest.getFunctionDefinitionId(), FUNCTIONDEFINITIONID_BINDING); protocolMarshaller.marshall(listFunctionDefinitionVersionsRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(listFunctionDefinitionVersionsRequest.getNextToken(), NEXTTOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[listFunctionDefinitionVersionsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.listFunctionDefinitionVersionsRequest], ==, 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=getFunctionDefinitionId, postfix_operators=[], prefix_operators=[], qualifier=listFunctionDefinitionVersionsRequest, selectors=[], type_arguments=None), MemberReference(member=FUNCTIONDEFINITIONID_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=getMaxResults, postfix_operators=[], prefix_operators=[], qualifier=listFunctionDefinitionVersionsRequest, selectors=[], type_arguments=None), MemberReference(member=MAXRESULTS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNextToken, postfix_operators=[], prefix_operators=[], qualifier=listFunctionDefinitionVersionsRequest, selectors=[], type_arguments=None), MemberReference(member=NEXTTOKEN_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[ListFunctionDefinitionVersionsRequest] identifier[listFunctionDefinitionVersionsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[listFunctionDefinitionVersionsRequest] 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[listFunctionDefinitionVersionsRequest] operator[SEP] identifier[getFunctionDefinitionId] operator[SEP] operator[SEP] , identifier[FUNCTIONDEFINITIONID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listFunctionDefinitionVersionsRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listFunctionDefinitionVersionsRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static <V> ListenableFuture<V> withFallback( ListenableFuture<? extends V> input, FutureFallback<? extends V> fallback) { return withFallback(input, fallback, directExecutor()); }
class class_name[name] begin[{] method[withFallback, return_type[type[ListenableFuture]], modifier[public static], parameter[input, fallback]] begin[{] return[call[.withFallback, parameter[member[.input], member[.fallback], call[.directExecutor, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[V] operator[>] identifier[ListenableFuture] operator[<] identifier[V] operator[>] identifier[withFallback] operator[SEP] identifier[ListenableFuture] operator[<] operator[?] Keyword[extends] identifier[V] operator[>] identifier[input] , identifier[FutureFallback] operator[<] operator[?] Keyword[extends] identifier[V] operator[>] identifier[fallback] operator[SEP] { Keyword[return] identifier[withFallback] operator[SEP] identifier[input] , identifier[fallback] , identifier[directExecutor] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@FFDCIgnore(BatchCDIAmbiguousResolutionCheckedException.class) protected Bean<?> getUniqueBeanForBatchXMLEntry(BeanManager bm, String batchId) { ClassLoader loader = getContextClassLoader(); BatchXMLMapper batchXMLMapper = new BatchXMLMapper(loader); Class<?> clazz = batchXMLMapper.getArtifactById(batchId); if (clazz != null) { try { return findUniqueBeanForClass(bm, clazz); } catch (BatchCDIAmbiguousResolutionCheckedException e) { if (logger.isLoggable(Level.FINER)) { logger.finer("getBeanForBatchXML: BatchCDIAmbiguousResolutionCheckedException: " + e.getMessage()); } return null; } } else { return null; } }
class class_name[name] begin[{] method[getUniqueBeanForBatchXMLEntry, return_type[type[Bean]], modifier[protected], parameter[bm, batchId]] begin[{] local_variable[type[ClassLoader], loader] local_variable[type[BatchXMLMapper], batchXMLMapper] local_variable[type[Class], clazz] if[binary_operation[member[.clazz], !=, literal[null]]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=bm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findUniqueBeanForClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=FINER, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[])], member=isLoggable, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getBeanForBatchXML: BatchCDIAmbiguousResolutionCheckedException: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=finer, 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=e, types=['BatchCDIAmbiguousResolutionCheckedException']))], finally_block=None, label=None, resources=None) else begin[{] return[literal[null]] end[}] end[}] END[}]
annotation[@] identifier[FFDCIgnore] operator[SEP] identifier[BatchCDIAmbiguousResolutionCheckedException] operator[SEP] Keyword[class] operator[SEP] Keyword[protected] identifier[Bean] operator[<] operator[?] operator[>] identifier[getUniqueBeanForBatchXMLEntry] operator[SEP] identifier[BeanManager] identifier[bm] , identifier[String] identifier[batchId] operator[SEP] { identifier[ClassLoader] identifier[loader] operator[=] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] identifier[BatchXMLMapper] identifier[batchXMLMapper] operator[=] Keyword[new] identifier[BatchXMLMapper] operator[SEP] identifier[loader] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[=] identifier[batchXMLMapper] operator[SEP] identifier[getArtifactById] operator[SEP] identifier[batchId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clazz] operator[!=] Other[null] operator[SEP] { Keyword[try] { Keyword[return] identifier[findUniqueBeanForClass] operator[SEP] identifier[bm] , identifier[clazz] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[BatchCDIAmbiguousResolutionCheckedException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINER] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[finer] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] } } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
public String build(Class<?> clazz) { String packageName = clazz.getPackage().getName(); String formattedPackageName = packageName.replace(".", "/"); return formattedPackageName + "/" + clazz.getSimpleName() + "-BeanohContext.xml"; }
class class_name[name] begin[{] method[build, return_type[type[String]], modifier[public], parameter[clazz]] begin[{] local_variable[type[String], packageName] local_variable[type[String], formattedPackageName] return[binary_operation[binary_operation[binary_operation[member[.formattedPackageName], +, literal["/"]], +, call[clazz.getSimpleName, parameter[]]], +, literal["-BeanohContext.xml"]]] end[}] END[}]
Keyword[public] identifier[String] identifier[build] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] { identifier[String] identifier[packageName] operator[=] identifier[clazz] operator[SEP] identifier[getPackage] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[formattedPackageName] operator[=] identifier[packageName] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[formattedPackageName] operator[+] literal[String] operator[+] identifier[clazz] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] }
public List<UploadFile> getFilesSaveToDatePath(Integer maxPostSize, String encoding) { return super.getFiles(UploadPathKit.getDatePath(), maxPostSize, encoding); }
class class_name[name] begin[{] method[getFilesSaveToDatePath, return_type[type[List]], modifier[public], parameter[maxPostSize, encoding]] begin[{] return[SuperMethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDatePath, postfix_operators=[], prefix_operators=[], qualifier=UploadPathKit, selectors=[], type_arguments=None), MemberReference(member=maxPostSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFiles, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[UploadFile] operator[>] identifier[getFilesSaveToDatePath] operator[SEP] identifier[Integer] identifier[maxPostSize] , identifier[String] identifier[encoding] operator[SEP] { Keyword[return] Keyword[super] operator[SEP] identifier[getFiles] operator[SEP] identifier[UploadPathKit] operator[SEP] identifier[getDatePath] operator[SEP] operator[SEP] , identifier[maxPostSize] , identifier[encoding] operator[SEP] operator[SEP] }
private void initializeFont(Font baseFont, int size, boolean bold, boolean italic) { Map attributes = baseFont.getAttributes(); attributes.put(TextAttribute.SIZE, new Float(size)); attributes.put(TextAttribute.WEIGHT, bold ? TextAttribute.WEIGHT_BOLD : TextAttribute.WEIGHT_REGULAR); attributes.put(TextAttribute.POSTURE, italic ? TextAttribute.POSTURE_OBLIQUE : TextAttribute.POSTURE_REGULAR); try { attributes.put(TextAttribute.class.getDeclaredField("KERNING").get(null), TextAttribute.class.getDeclaredField( "KERNING_ON").get(null)); } catch (Exception ignored) { } font = baseFont.deriveFont(attributes); FontMetrics metrics = GlyphPage.getScratchGraphics().getFontMetrics(font); ascent = metrics.getAscent(); descent = metrics.getDescent(); leading = metrics.getLeading(); // Determine width of space glyph (getGlyphPixelBounds gives a width of zero). char[] chars = " ".toCharArray(); GlyphVector vector = font.layoutGlyphVector(GlyphPage.renderContext, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT); spaceWidth = vector.getGlyphLogicalBounds(0).getBounds().width; }
class class_name[name] begin[{] method[initializeFont, return_type[void], modifier[private], parameter[baseFont, size, bold, italic]] begin[{] local_variable[type[Map], attributes] call[attributes.put, parameter[member[TextAttribute.SIZE], ClassCreator(arguments=[MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))]] call[attributes.put, parameter[member[TextAttribute.WEIGHT], TernaryExpression(condition=MemberReference(member=bold, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=WEIGHT_REGULAR, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[]), if_true=MemberReference(member=WEIGHT_BOLD, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[]))]] call[attributes.put, parameter[member[TextAttribute.POSTURE], TernaryExpression(condition=MemberReference(member=italic, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=POSTURE_REGULAR, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[]), if_true=MemberReference(member=POSTURE_OBLIQUE, postfix_operators=[], prefix_operators=[], qualifier=TextAttribute, selectors=[]))]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="KERNING")], member=getDeclaredField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TextAttribute, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="KERNING_ON")], member=getDeclaredField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TextAttribute, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['Exception']))], finally_block=None, label=None, resources=None) assign[member[.font], call[baseFont.deriveFont, parameter[member[.attributes]]]] local_variable[type[FontMetrics], metrics] assign[member[.ascent], call[metrics.getAscent, parameter[]]] assign[member[.descent], call[metrics.getDescent, parameter[]]] assign[member[.leading], call[metrics.getLeading, parameter[]]] local_variable[type[char], chars] local_variable[type[GlyphVector], vector] assign[member[.spaceWidth], call[vector.getGlyphLogicalBounds, parameter[literal[0]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[initializeFont] operator[SEP] identifier[Font] identifier[baseFont] , Keyword[int] identifier[size] , Keyword[boolean] identifier[bold] , Keyword[boolean] identifier[italic] operator[SEP] { identifier[Map] identifier[attributes] operator[=] identifier[baseFont] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[put] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[SIZE] , Keyword[new] identifier[Float] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[put] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[WEIGHT] , identifier[bold] operator[?] identifier[TextAttribute] operator[SEP] identifier[WEIGHT_BOLD] operator[:] identifier[TextAttribute] operator[SEP] identifier[WEIGHT_REGULAR] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[put] operator[SEP] identifier[TextAttribute] operator[SEP] identifier[POSTURE] , identifier[italic] operator[?] identifier[TextAttribute] operator[SEP] identifier[POSTURE_OBLIQUE] operator[:] identifier[TextAttribute] operator[SEP] identifier[POSTURE_REGULAR] operator[SEP] operator[SEP] Keyword[try] { identifier[attributes] operator[SEP] identifier[put] operator[SEP] identifier[TextAttribute] operator[SEP] Keyword[class] operator[SEP] identifier[getDeclaredField] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[null] operator[SEP] , identifier[TextAttribute] operator[SEP] Keyword[class] operator[SEP] identifier[getDeclaredField] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[null] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ignored] operator[SEP] { } identifier[font] operator[=] identifier[baseFont] operator[SEP] identifier[deriveFont] operator[SEP] identifier[attributes] operator[SEP] operator[SEP] identifier[FontMetrics] identifier[metrics] operator[=] identifier[GlyphPage] operator[SEP] identifier[getScratchGraphics] operator[SEP] operator[SEP] operator[SEP] identifier[getFontMetrics] operator[SEP] identifier[font] operator[SEP] operator[SEP] identifier[ascent] operator[=] identifier[metrics] operator[SEP] identifier[getAscent] operator[SEP] operator[SEP] operator[SEP] identifier[descent] operator[=] identifier[metrics] operator[SEP] identifier[getDescent] operator[SEP] operator[SEP] operator[SEP] identifier[leading] operator[=] identifier[metrics] operator[SEP] identifier[getLeading] operator[SEP] operator[SEP] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[chars] operator[=] literal[String] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] identifier[GlyphVector] identifier[vector] operator[=] identifier[font] operator[SEP] identifier[layoutGlyphVector] operator[SEP] identifier[GlyphPage] operator[SEP] identifier[renderContext] , identifier[chars] , Other[0] , identifier[chars] operator[SEP] identifier[length] , identifier[Font] operator[SEP] identifier[LAYOUT_LEFT_TO_RIGHT] operator[SEP] operator[SEP] identifier[spaceWidth] operator[=] identifier[vector] operator[SEP] identifier[getGlyphLogicalBounds] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getBounds] operator[SEP] operator[SEP] operator[SEP] identifier[width] operator[SEP] }
public BitZTickerAll getTickerAll(CurrencyPair... currencyPairs) throws IOException { List<String> symbolList = new ArrayList<>(currencyPairs.length); Arrays.stream(currencyPairs) .forEach(currencyPair -> symbolList.add(BitZUtils.toPairString(currencyPair))); String symbols = symbolList.stream().collect(Collectors.joining(",")); BitZTickerAllResult result = bitz.getTickerAll(symbols); return result.getData(); }
class class_name[name] begin[{] method[getTickerAll, return_type[type[BitZTickerAll]], modifier[public], parameter[currencyPairs]] begin[{] local_variable[type[List], symbolList] call[Arrays.stream, parameter[member[.currencyPairs]]] local_variable[type[String], symbols] local_variable[type[BitZTickerAllResult], result] return[call[result.getData, parameter[]]] end[}] END[}]
Keyword[public] identifier[BitZTickerAll] identifier[getTickerAll] operator[SEP] identifier[CurrencyPair] operator[...] identifier[currencyPairs] operator[SEP] Keyword[throws] identifier[IOException] { identifier[List] operator[<] identifier[String] operator[>] identifier[symbolList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[currencyPairs] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[stream] operator[SEP] identifier[currencyPairs] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[currencyPair] operator[->] identifier[symbolList] operator[SEP] identifier[add] operator[SEP] identifier[BitZUtils] operator[SEP] identifier[toPairString] operator[SEP] identifier[currencyPair] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[symbols] operator[=] identifier[symbolList] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[joining] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[BitZTickerAllResult] identifier[result] operator[=] identifier[bitz] operator[SEP] identifier[getTickerAll] operator[SEP] identifier[symbols] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] }
public HistoryPageFilter getHistoryPageFilter() { HistoryPageFilter<T> historyPageFilter = newPageFilter(); historyPageFilter.add(baseList); historyPageFilter.widget = this; return updateFirstTransientBuildKey(historyPageFilter); }
class class_name[name] begin[{] method[getHistoryPageFilter, return_type[type[HistoryPageFilter]], modifier[public], parameter[]] begin[{] local_variable[type[HistoryPageFilter], historyPageFilter] call[historyPageFilter.add, parameter[member[.baseList]]] assign[member[historyPageFilter.widget], THIS[]] return[call[.updateFirstTransientBuildKey, parameter[member[.historyPageFilter]]]] end[}] END[}]
Keyword[public] identifier[HistoryPageFilter] identifier[getHistoryPageFilter] operator[SEP] operator[SEP] { identifier[HistoryPageFilter] operator[<] identifier[T] operator[>] identifier[historyPageFilter] operator[=] identifier[newPageFilter] operator[SEP] operator[SEP] operator[SEP] identifier[historyPageFilter] operator[SEP] identifier[add] operator[SEP] identifier[baseList] operator[SEP] operator[SEP] identifier[historyPageFilter] operator[SEP] identifier[widget] operator[=] Keyword[this] operator[SEP] Keyword[return] identifier[updateFirstTransientBuildKey] operator[SEP] identifier[historyPageFilter] operator[SEP] operator[SEP] }
private OmemoMessage.Sent encrypt(OmemoManager.LoggedInOmemoManager managerGuard, Set<OmemoDevice> contactsDevices, byte[] messageKey, byte[] iv, String message) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, UndecidedOmemoIdentityException, CryptoFailedException { OmemoManager manager = managerGuard.get(); OmemoDevice userDevice = manager.getOwnDevice(); // Do not encrypt for our own device. removeOurDevice(userDevice, contactsDevices); buildMissingSessionsWithDevices(manager.getConnection(), userDevice, contactsDevices); Set<OmemoDevice> undecidedDevices = getUndecidedDevices(userDevice, manager.getTrustCallback(), contactsDevices); if (!undecidedDevices.isEmpty()) { throw new UndecidedOmemoIdentityException(undecidedDevices); } // Keep track of skipped devices HashMap<OmemoDevice, Throwable> skippedRecipients = new HashMap<>(); OmemoMessageBuilder<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> builder; try { builder = new OmemoMessageBuilder<>( userDevice, manager.getTrustCallback(), getOmemoRatchet(managerGuard.get()), messageKey, iv, message); } catch (UnsupportedEncodingException | BadPaddingException | IllegalBlockSizeException | NoSuchPaddingException | InvalidAlgorithmParameterException | InvalidKeyException | NoSuchAlgorithmException e) { throw new CryptoFailedException(e); } for (OmemoDevice contactsDevice : contactsDevices) { // Build missing sessions if (!hasSession(userDevice, contactsDevice)) { try { buildFreshSessionWithDevice(manager.getConnection(), userDevice, contactsDevice); } catch (CorruptedOmemoKeyException | CannotEstablishOmemoSessionException e) { LOGGER.log(Level.WARNING, "Could not build session with " + contactsDevice + ".", e); skippedRecipients.put(contactsDevice, e); continue; } } int messageCounter = omemoStore.loadOmemoMessageCounter(userDevice, contactsDevice); // Ignore read-only devices if (OmemoConfiguration.getIgnoreReadOnlyDevices()) { boolean readOnly = messageCounter >= OmemoConfiguration.getMaxReadOnlyMessageCount(); if (readOnly) { LOGGER.log(Level.FINE, "Device " + contactsDevice + " seems to be read-only (We sent " + messageCounter + " messages without getting a reply back (max allowed is " + OmemoConfiguration.getMaxReadOnlyMessageCount() + "). Ignoring the device."); skippedRecipients.put(contactsDevice, new ReadOnlyDeviceException(contactsDevice)); // Skip this device and handle next device continue; } } // Add recipients try { builder.addRecipient(contactsDevice); } catch (NoIdentityKeyException | CorruptedOmemoKeyException e) { LOGGER.log(Level.WARNING, "Encryption failed for device " + contactsDevice + ".", e); skippedRecipients.put(contactsDevice, e); } catch (UndecidedOmemoIdentityException e) { throw new AssertionError("Recipients device seems to be undecided, even though we should have thrown" + " an exception earlier in that case. " + e); } catch (UntrustedOmemoIdentityException e) { LOGGER.log(Level.WARNING, "Device " + contactsDevice + " is untrusted. Message is not encrypted for it."); skippedRecipients.put(contactsDevice, e); } // Increment the message counter of the device omemoStore.storeOmemoMessageCounter(userDevice, contactsDevice, messageCounter + 1); } OmemoElement element = builder.finish(); return new OmemoMessage.Sent(element, messageKey, iv, contactsDevices, skippedRecipients); }
class class_name[name] begin[{] method[encrypt, return_type[type[OmemoMessage]], modifier[private], parameter[managerGuard, contactsDevices, messageKey, iv, message]] begin[{] local_variable[type[OmemoManager], manager] local_variable[type[OmemoDevice], userDevice] call[.removeOurDevice, parameter[member[.userDevice], member[.contactsDevices]]] call[.buildMissingSessionsWithDevices, parameter[call[manager.getConnection, parameter[]], member[.userDevice], member[.contactsDevices]]] local_variable[type[Set], undecidedDevices] if[call[undecidedDevices.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=undecidedDevices, 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=UndecidedOmemoIdentityException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[HashMap], skippedRecipients] local_variable[type[OmemoMessageBuilder], builder] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=userDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTrustCallback, postfix_operators=[], prefix_operators=[], qualifier=manager, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=managerGuard, selectors=[], type_arguments=None)], member=getOmemoRatchet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MemberReference(member=messageKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, 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=OmemoMessageBuilder, 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=CryptoFailedException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException', 'BadPaddingException', 'IllegalBlockSizeException', 'NoSuchPaddingException', 'InvalidAlgorithmParameterException', 'InvalidKeyException', 'NoSuchAlgorithmException']))], finally_block=None, label=None, resources=None) ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=userDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasSession, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=manager, selectors=[], type_arguments=None), MemberReference(member=userDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=buildFreshSessionWithDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not build session with "), operandr=MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=skippedRecipients, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CorruptedOmemoKeyException', 'CannotEstablishOmemoSessionException']))], finally_block=None, label=None, resources=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=userDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadOmemoMessageCounter, postfix_operators=[], prefix_operators=[], qualifier=omemoStore, selectors=[], type_arguments=None), name=messageCounter)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[], member=getIgnoreReadOnlyDevices, postfix_operators=[], prefix_operators=[], qualifier=OmemoConfiguration, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=messageCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMaxReadOnlyMessageCount, postfix_operators=[], prefix_operators=[], qualifier=OmemoConfiguration, selectors=[], type_arguments=None), operator=>=), name=readOnly)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), IfStatement(condition=MemberReference(member=readOnly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Device "), operandr=MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" seems to be read-only (We sent "), operator=+), operandr=MemberReference(member=messageCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" messages without getting a reply back (max allowed is "), operator=+), operandr=MethodInvocation(arguments=[], member=getMaxReadOnlyMessageCount, postfix_operators=[], prefix_operators=[], qualifier=OmemoConfiguration, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="). Ignoring the device."), operator=+)], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=contactsDevice, 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=ReadOnlyDeviceException, sub_type=None))], member=put, postfix_operators=[], prefix_operators=[], qualifier=skippedRecipients, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)]))])), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRecipient, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Encryption failed for device "), operandr=MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=skippedRecipients, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoIdentityKeyException', 'CorruptedOmemoKeyException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Recipients device seems to be undecided, even though we should have thrown"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" an exception earlier in that case. "), operator=+), operandr=MemberReference(member=e, 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=AssertionError, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UndecidedOmemoIdentityException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=WARNING, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Device "), operandr=MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is untrusted. Message is not encrypted for it."), operator=+)], member=log, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=skippedRecipients, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UntrustedOmemoIdentityException']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=userDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contactsDevice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=messageCounter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=storeOmemoMessageCounter, postfix_operators=[], prefix_operators=[], qualifier=omemoStore, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=contactsDevices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=contactsDevice)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OmemoDevice, sub_type=None))), label=None) local_variable[type[OmemoElement], element] return[ClassCreator(arguments=[MemberReference(member=element, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=messageKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contactsDevices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=skippedRecipients, 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=OmemoMessage, sub_type=ReferenceType(arguments=None, dimensions=None, name=Sent, sub_type=None)))] end[}] END[}]
Keyword[private] identifier[OmemoMessage] operator[SEP] identifier[Sent] identifier[encrypt] operator[SEP] identifier[OmemoManager] operator[SEP] identifier[LoggedInOmemoManager] identifier[managerGuard] , identifier[Set] operator[<] identifier[OmemoDevice] operator[>] identifier[contactsDevices] , Keyword[byte] operator[SEP] operator[SEP] identifier[messageKey] , Keyword[byte] operator[SEP] operator[SEP] identifier[iv] , identifier[String] identifier[message] operator[SEP] Keyword[throws] identifier[SmackException] operator[SEP] identifier[NotConnectedException] , identifier[InterruptedException] , identifier[SmackException] operator[SEP] identifier[NoResponseException] , identifier[UndecidedOmemoIdentityException] , identifier[CryptoFailedException] { identifier[OmemoManager] identifier[manager] operator[=] identifier[managerGuard] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[OmemoDevice] identifier[userDevice] operator[=] identifier[manager] operator[SEP] identifier[getOwnDevice] operator[SEP] operator[SEP] operator[SEP] identifier[removeOurDevice] operator[SEP] identifier[userDevice] , identifier[contactsDevices] operator[SEP] operator[SEP] identifier[buildMissingSessionsWithDevices] operator[SEP] identifier[manager] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] , identifier[userDevice] , identifier[contactsDevices] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[OmemoDevice] operator[>] identifier[undecidedDevices] operator[=] identifier[getUndecidedDevices] operator[SEP] identifier[userDevice] , identifier[manager] operator[SEP] identifier[getTrustCallback] operator[SEP] operator[SEP] , identifier[contactsDevices] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[undecidedDevices] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[UndecidedOmemoIdentityException] operator[SEP] identifier[undecidedDevices] operator[SEP] operator[SEP] } identifier[HashMap] operator[<] identifier[OmemoDevice] , identifier[Throwable] operator[>] identifier[skippedRecipients] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[OmemoMessageBuilder] operator[<] identifier[T_IdKeyPair] , identifier[T_IdKey] , identifier[T_PreKey] , identifier[T_SigPreKey] , identifier[T_Sess] , identifier[T_Addr] , identifier[T_ECPub] , identifier[T_Bundle] , identifier[T_Ciph] operator[>] identifier[builder] operator[SEP] Keyword[try] { identifier[builder] operator[=] Keyword[new] identifier[OmemoMessageBuilder] operator[<] operator[>] operator[SEP] identifier[userDevice] , identifier[manager] operator[SEP] identifier[getTrustCallback] operator[SEP] operator[SEP] , identifier[getOmemoRatchet] operator[SEP] identifier[managerGuard] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] , identifier[messageKey] , identifier[iv] , identifier[message] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] operator[|] identifier[BadPaddingException] operator[|] identifier[IllegalBlockSizeException] operator[|] identifier[NoSuchPaddingException] operator[|] identifier[InvalidAlgorithmParameterException] operator[|] identifier[InvalidKeyException] operator[|] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CryptoFailedException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[OmemoDevice] identifier[contactsDevice] operator[:] identifier[contactsDevices] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[hasSession] operator[SEP] identifier[userDevice] , identifier[contactsDevice] operator[SEP] operator[SEP] { Keyword[try] { identifier[buildFreshSessionWithDevice] operator[SEP] identifier[manager] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] , identifier[userDevice] , identifier[contactsDevice] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[CorruptedOmemoKeyException] operator[|] identifier[CannotEstablishOmemoSessionException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[contactsDevice] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[skippedRecipients] operator[SEP] identifier[put] operator[SEP] identifier[contactsDevice] , identifier[e] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } } Keyword[int] identifier[messageCounter] operator[=] identifier[omemoStore] operator[SEP] identifier[loadOmemoMessageCounter] operator[SEP] identifier[userDevice] , identifier[contactsDevice] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[OmemoConfiguration] operator[SEP] identifier[getIgnoreReadOnlyDevices] operator[SEP] operator[SEP] operator[SEP] { Keyword[boolean] identifier[readOnly] operator[=] identifier[messageCounter] operator[>=] identifier[OmemoConfiguration] operator[SEP] identifier[getMaxReadOnlyMessageCount] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readOnly] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] operator[+] identifier[contactsDevice] operator[+] literal[String] operator[+] identifier[messageCounter] operator[+] literal[String] operator[+] identifier[OmemoConfiguration] operator[SEP] identifier[getMaxReadOnlyMessageCount] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[skippedRecipients] operator[SEP] identifier[put] operator[SEP] identifier[contactsDevice] , Keyword[new] identifier[ReadOnlyDeviceException] operator[SEP] identifier[contactsDevice] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } } Keyword[try] { identifier[builder] operator[SEP] identifier[addRecipient] operator[SEP] identifier[contactsDevice] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoIdentityKeyException] operator[|] identifier[CorruptedOmemoKeyException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[contactsDevice] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] identifier[skippedRecipients] operator[SEP] identifier[put] operator[SEP] identifier[contactsDevice] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UndecidedOmemoIdentityException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[AssertionError] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UntrustedOmemoIdentityException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[WARNING] , literal[String] operator[+] identifier[contactsDevice] operator[+] literal[String] operator[SEP] operator[SEP] identifier[skippedRecipients] operator[SEP] identifier[put] operator[SEP] identifier[contactsDevice] , identifier[e] operator[SEP] operator[SEP] } identifier[omemoStore] operator[SEP] identifier[storeOmemoMessageCounter] operator[SEP] identifier[userDevice] , identifier[contactsDevice] , identifier[messageCounter] operator[+] Other[1] operator[SEP] operator[SEP] } identifier[OmemoElement] identifier[element] operator[=] identifier[builder] operator[SEP] identifier[finish] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[OmemoMessage] operator[SEP] identifier[Sent] operator[SEP] identifier[element] , identifier[messageKey] , identifier[iv] , identifier[contactsDevices] , identifier[skippedRecipients] operator[SEP] operator[SEP] }
@Override public void destroy() { try { super.destroy(); } finally { if (defaultMongoClient != null && myOwnMongoClient) { try { defaultMongoClient.close(); } catch (Exception e) { LOGGER.warn(e.getMessage(), e); } finally { defaultMongoClient = null; } } } }
class class_name[name] begin[{] method[destroy, return_type[void], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=SuperMethodInvocation(arguments=[], member=destroy, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=defaultMongoClient, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MemberReference(member=myOwnMongoClient, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=defaultMongoClient, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=defaultMongoClient, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None)]))], label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[destroy] operator[SEP] operator[SEP] { Keyword[try] { Keyword[super] operator[SEP] identifier[destroy] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[if] operator[SEP] identifier[defaultMongoClient] operator[!=] Other[null] operator[&&] identifier[myOwnMongoClient] operator[SEP] { Keyword[try] { identifier[defaultMongoClient] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[defaultMongoClient] operator[=] Other[null] operator[SEP] } } } }
public boolean recoverLease(Path f, boolean discardLastBlock) throws IOException { return dfs.recoverLease(getPathName(f), discardLastBlock); }
class class_name[name] begin[{] method[recoverLease, return_type[type[boolean]], modifier[public], parameter[f, discardLastBlock]] begin[{] return[call[dfs.recoverLease, parameter[call[.getPathName, parameter[member[.f]]], member[.discardLastBlock]]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[recoverLease] operator[SEP] identifier[Path] identifier[f] , Keyword[boolean] identifier[discardLastBlock] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[dfs] operator[SEP] identifier[recoverLease] operator[SEP] identifier[getPathName] operator[SEP] identifier[f] operator[SEP] , identifier[discardLastBlock] operator[SEP] operator[SEP] }
public long getDateLastModified() { int pos = m_flexContextInfoList.size() - 1; if (pos < 0) { // ensure a valid position is used return CmsResource.DATE_RELEASED_DEFAULT; } return (m_flexContextInfoList.get(pos)).getDateLastModified(); }
class class_name[name] begin[{] method[getDateLastModified, return_type[type[long]], modifier[public], parameter[]] begin[{] local_variable[type[int], pos] if[binary_operation[member[.pos], <, literal[0]]] begin[{] return[member[CmsResource.DATE_RELEASED_DEFAULT]] else begin[{] None end[}] return[call[m_flexContextInfoList.get, parameter[member[.pos]]]] end[}] END[}]
Keyword[public] Keyword[long] identifier[getDateLastModified] operator[SEP] operator[SEP] { Keyword[int] identifier[pos] operator[=] identifier[m_flexContextInfoList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[<] Other[0] operator[SEP] { Keyword[return] identifier[CmsResource] operator[SEP] identifier[DATE_RELEASED_DEFAULT] operator[SEP] } Keyword[return] operator[SEP] identifier[m_flexContextInfoList] operator[SEP] identifier[get] operator[SEP] identifier[pos] operator[SEP] operator[SEP] operator[SEP] identifier[getDateLastModified] operator[SEP] operator[SEP] operator[SEP] }
@Override public EClass getIfcColumn() { if (ifcColumnEClass == null) { ifcColumnEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers() .get(104); } return ifcColumnEClass; }
class class_name[name] begin[{] method[getIfcColumn, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcColumnEClass], ==, literal[null]]] begin[{] assign[member[.ifcColumnEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=104)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcColumnEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcColumn] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcColumnEClass] operator[==] Other[null] operator[SEP] { identifier[ifcColumnEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[104] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcColumnEClass] operator[SEP] }
public ManagementGate getInputGate(final int index) { if (index < this.inputGates.size()) { return this.inputGates.get(index); } return null; }
class class_name[name] begin[{] method[getInputGate, return_type[type[ManagementGate]], modifier[public], parameter[index]] begin[{] if[binary_operation[member[.index], <, THIS[member[None.inputGates]call[None.size, parameter[]]]]] begin[{] return[THIS[member[None.inputGates]call[None.get, parameter[member[.index]]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[ManagementGate] identifier[getInputGate] operator[SEP] Keyword[final] Keyword[int] identifier[index] operator[SEP] { Keyword[if] operator[SEP] identifier[index] operator[<] Keyword[this] operator[SEP] identifier[inputGates] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[inputGates] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public static String decode(Image image, boolean isTryHarder, boolean isPureBarcode) { final MultiFormatReader formatReader = new MultiFormatReader(); final LuminanceSource source = new BufferedImageLuminanceSource(ImgUtil.toBufferedImage(image)); final Binarizer binarizer = new HybridBinarizer(source); final BinaryBitmap binaryBitmap = new BinaryBitmap(binarizer); final HashMap<DecodeHintType, Object> hints = new HashMap<>(); hints.put(DecodeHintType.CHARACTER_SET, CharsetUtil.UTF_8); // 优化精度 hints.put(DecodeHintType.TRY_HARDER, Boolean.valueOf(isTryHarder)); // 复杂模式,开启PURE_BARCODE模式 hints.put(DecodeHintType.PURE_BARCODE, Boolean.valueOf(isPureBarcode)); Result result; try { result = formatReader.decode(binaryBitmap, hints); } catch (NotFoundException e) { // 报错尝试关闭复杂模式 hints.remove(DecodeHintType.PURE_BARCODE); try { result = formatReader.decode(binaryBitmap, hints); } catch (NotFoundException e1) { throw new QrCodeException(e1); } } return result.getText(); }
class class_name[name] begin[{] method[decode, return_type[type[String]], modifier[public static], parameter[image, isTryHarder, isPureBarcode]] begin[{] local_variable[type[MultiFormatReader], formatReader] local_variable[type[LuminanceSource], source] local_variable[type[Binarizer], binarizer] local_variable[type[BinaryBitmap], binaryBitmap] local_variable[type[HashMap], hints] call[hints.put, parameter[member[DecodeHintType.CHARACTER_SET], member[CharsetUtil.UTF_8]]] call[hints.put, parameter[member[DecodeHintType.TRY_HARDER], call[Boolean.valueOf, parameter[member[.isTryHarder]]]]] call[hints.put, parameter[member[DecodeHintType.PURE_BARCODE], call[Boolean.valueOf, parameter[member[.isPureBarcode]]]]] local_variable[type[Result], result] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=binaryBitmap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decode, postfix_operators=[], prefix_operators=[], qualifier=formatReader, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=PURE_BARCODE, postfix_operators=[], prefix_operators=[], qualifier=DecodeHintType, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=hints, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=binaryBitmap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decode, postfix_operators=[], prefix_operators=[], qualifier=formatReader, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e1, 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=QrCodeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['NotFoundException']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NotFoundException']))], finally_block=None, label=None, resources=None) return[call[result.getText, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[decode] operator[SEP] identifier[Image] identifier[image] , Keyword[boolean] identifier[isTryHarder] , Keyword[boolean] identifier[isPureBarcode] operator[SEP] { Keyword[final] identifier[MultiFormatReader] identifier[formatReader] operator[=] Keyword[new] identifier[MultiFormatReader] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[LuminanceSource] identifier[source] operator[=] Keyword[new] identifier[BufferedImageLuminanceSource] operator[SEP] identifier[ImgUtil] operator[SEP] identifier[toBufferedImage] operator[SEP] identifier[image] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Binarizer] identifier[binarizer] operator[=] Keyword[new] identifier[HybridBinarizer] operator[SEP] identifier[source] operator[SEP] operator[SEP] Keyword[final] identifier[BinaryBitmap] identifier[binaryBitmap] operator[=] Keyword[new] identifier[BinaryBitmap] operator[SEP] identifier[binarizer] operator[SEP] operator[SEP] Keyword[final] identifier[HashMap] operator[<] identifier[DecodeHintType] , identifier[Object] operator[>] identifier[hints] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[hints] operator[SEP] identifier[put] operator[SEP] identifier[DecodeHintType] operator[SEP] identifier[CHARACTER_SET] , identifier[CharsetUtil] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] identifier[hints] operator[SEP] identifier[put] operator[SEP] identifier[DecodeHintType] operator[SEP] identifier[TRY_HARDER] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[isTryHarder] operator[SEP] operator[SEP] operator[SEP] identifier[hints] operator[SEP] identifier[put] operator[SEP] identifier[DecodeHintType] operator[SEP] identifier[PURE_BARCODE] , identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[isPureBarcode] operator[SEP] operator[SEP] operator[SEP] identifier[Result] identifier[result] operator[SEP] Keyword[try] { identifier[result] operator[=] identifier[formatReader] operator[SEP] identifier[decode] operator[SEP] identifier[binaryBitmap] , identifier[hints] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NotFoundException] identifier[e] operator[SEP] { identifier[hints] operator[SEP] identifier[remove] operator[SEP] identifier[DecodeHintType] operator[SEP] identifier[PURE_BARCODE] operator[SEP] operator[SEP] Keyword[try] { identifier[result] operator[=] identifier[formatReader] operator[SEP] identifier[decode] operator[SEP] identifier[binaryBitmap] , identifier[hints] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NotFoundException] identifier[e1] operator[SEP] { Keyword[throw] Keyword[new] identifier[QrCodeException] operator[SEP] identifier[e1] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] }
public Matrix getMatrix(int i0, int i1, int j0, int j1) { Matrix X = new Matrix(i1 - i0 + 1, j1 - j0 + 1); double[][] B = X.getArray(); try { for (int i = i0; i <= i1; i++) { for (int j = j0; j <= j1; j++) { B[i - i0][j - j0] = A[i][j]; } } } catch (ArrayIndexOutOfBoundsException e) { throw new ArrayIndexOutOfBoundsException("Submatrix indices"); } return X; }
class class_name[name] begin[{] method[getMatrix, return_type[type[Matrix]], modifier[public], parameter[i0, i1, j0, j1]] begin[{] local_variable[type[Matrix], X] local_variable[type[double], B] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=B, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-))]), type==, value=MemberReference(member=A, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=j1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=j0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=i0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Submatrix indices")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayIndexOutOfBoundsException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ArrayIndexOutOfBoundsException']))], finally_block=None, label=None, resources=None) return[member[.X]] end[}] END[}]
Keyword[public] identifier[Matrix] identifier[getMatrix] operator[SEP] Keyword[int] identifier[i0] , Keyword[int] identifier[i1] , Keyword[int] identifier[j0] , Keyword[int] identifier[j1] operator[SEP] { identifier[Matrix] identifier[X] operator[=] Keyword[new] identifier[Matrix] operator[SEP] identifier[i1] operator[-] identifier[i0] operator[+] Other[1] , identifier[j1] operator[-] identifier[j0] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[B] operator[=] identifier[X] operator[SEP] identifier[getArray] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[i0] operator[SEP] identifier[i] operator[<=] identifier[i1] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] identifier[j0] operator[SEP] identifier[j] operator[<=] identifier[j1] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[B] operator[SEP] identifier[i] operator[-] identifier[i0] operator[SEP] operator[SEP] identifier[j] operator[-] identifier[j0] operator[SEP] operator[=] identifier[A] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[ArrayIndexOutOfBoundsException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ArrayIndexOutOfBoundsException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[X] operator[SEP] }
public <T> T getResponseValue(String path, Class<T> clazz) { return JacksonUtils.getValue(responseJson, path, clazz); }
class class_name[name] begin[{] method[getResponseValue, return_type[type[T]], modifier[public], parameter[path, clazz]] begin[{] return[call[JacksonUtils.getValue, parameter[member[.responseJson], member[.path], member[.clazz]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[getResponseValue] operator[SEP] identifier[String] identifier[path] , identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] { Keyword[return] identifier[JacksonUtils] operator[SEP] identifier[getValue] operator[SEP] identifier[responseJson] , identifier[path] , identifier[clazz] operator[SEP] operator[SEP] }
public DataTable createRow(String... values) throws TooManyColumnsException { rows.add(new DataRow(columns).setAll(values)); return this; }
class class_name[name] begin[{] method[createRow, return_type[type[DataTable]], modifier[public], parameter[values]] begin[{] call[rows.add, parameter[ClassCreator(arguments=[MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAll, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=DataRow, sub_type=None))]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[DataTable] identifier[createRow] operator[SEP] identifier[String] operator[...] identifier[values] operator[SEP] Keyword[throws] identifier[TooManyColumnsException] { identifier[rows] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[DataRow] operator[SEP] identifier[columns] operator[SEP] operator[SEP] identifier[setAll] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private DefBase getDefForLevel(String level) { if (LEVEL_CLASS.equals(level)) { return _curClassDef; } else if (LEVEL_FIELD.equals(level)) { return _curFieldDef; } else if (LEVEL_REFERENCE.equals(level)) { return _curReferenceDef; } else if (LEVEL_COLLECTION.equals(level)) { return _curCollectionDef; } else if (LEVEL_OBJECT_CACHE.equals(level)) { return _curObjectCacheDef; } else if (LEVEL_INDEX_DESC.equals(level)) { return _curIndexDescriptorDef; } else if (LEVEL_TABLE.equals(level)) { return _curTableDef; } else if (LEVEL_COLUMN.equals(level)) { return _curColumnDef; } else if (LEVEL_FOREIGNKEY.equals(level)) { return _curForeignkeyDef; } else if (LEVEL_INDEX.equals(level)) { return _curIndexDef; } else if (LEVEL_PROCEDURE.equals(level)) { return _curProcedureDef; } else if (LEVEL_PROCEDURE_ARGUMENT.equals(level)) { return _curProcedureArgumentDef; } else { return null; } }
class class_name[name] begin[{] method[getDefForLevel, return_type[type[DefBase]], modifier[private], parameter[level]] begin[{] if[call[LEVEL_CLASS.equals, parameter[member[.level]]]] begin[{] return[member[._curClassDef]] else begin[{] if[call[LEVEL_FIELD.equals, parameter[member[.level]]]] begin[{] return[member[._curFieldDef]] else begin[{] if[call[LEVEL_REFERENCE.equals, parameter[member[.level]]]] begin[{] return[member[._curReferenceDef]] else begin[{] if[call[LEVEL_COLLECTION.equals, parameter[member[.level]]]] begin[{] return[member[._curCollectionDef]] else begin[{] if[call[LEVEL_OBJECT_CACHE.equals, parameter[member[.level]]]] begin[{] return[member[._curObjectCacheDef]] else begin[{] if[call[LEVEL_INDEX_DESC.equals, parameter[member[.level]]]] begin[{] return[member[._curIndexDescriptorDef]] else begin[{] if[call[LEVEL_TABLE.equals, parameter[member[.level]]]] begin[{] return[member[._curTableDef]] else begin[{] if[call[LEVEL_COLUMN.equals, parameter[member[.level]]]] begin[{] return[member[._curColumnDef]] else begin[{] if[call[LEVEL_FOREIGNKEY.equals, parameter[member[.level]]]] begin[{] return[member[._curForeignkeyDef]] else begin[{] if[call[LEVEL_INDEX.equals, parameter[member[.level]]]] begin[{] return[member[._curIndexDef]] else begin[{] if[call[LEVEL_PROCEDURE.equals, parameter[member[.level]]]] begin[{] return[member[._curProcedureDef]] else begin[{] if[call[LEVEL_PROCEDURE_ARGUMENT.equals, parameter[member[.level]]]] begin[{] return[member[._curProcedureArgumentDef]] else begin[{] return[literal[null]] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[private] identifier[DefBase] identifier[getDefForLevel] operator[SEP] identifier[String] identifier[level] operator[SEP] { Keyword[if] operator[SEP] identifier[LEVEL_CLASS] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curClassDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_FIELD] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curFieldDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_REFERENCE] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curReferenceDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_COLLECTION] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curCollectionDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_OBJECT_CACHE] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curObjectCacheDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_INDEX_DESC] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curIndexDescriptorDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_TABLE] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curTableDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_COLUMN] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curColumnDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_FOREIGNKEY] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curForeignkeyDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_INDEX] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curIndexDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_PROCEDURE] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curProcedureDef] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LEVEL_PROCEDURE_ARGUMENT] operator[SEP] identifier[equals] operator[SEP] identifier[level] operator[SEP] operator[SEP] { Keyword[return] identifier[_curProcedureArgumentDef] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
public SDVariable batchNorm(String name, SDVariable input, SDVariable mean, SDVariable variance, SDVariable gamma, SDVariable beta, double epsilon, int... axis) { return batchNorm(name, input, mean, variance, gamma, beta, true, true, epsilon, axis); }
class class_name[name] begin[{] method[batchNorm, return_type[type[SDVariable]], modifier[public], parameter[name, input, mean, variance, gamma, beta, epsilon, axis]] begin[{] return[call[.batchNorm, parameter[member[.name], member[.input], member[.mean], member[.variance], member[.gamma], member[.beta], literal[true], literal[true], member[.epsilon], member[.axis]]]] end[}] END[}]
Keyword[public] identifier[SDVariable] identifier[batchNorm] operator[SEP] identifier[String] identifier[name] , identifier[SDVariable] identifier[input] , identifier[SDVariable] identifier[mean] , identifier[SDVariable] identifier[variance] , identifier[SDVariable] identifier[gamma] , identifier[SDVariable] identifier[beta] , Keyword[double] identifier[epsilon] , Keyword[int] operator[...] identifier[axis] operator[SEP] { Keyword[return] identifier[batchNorm] operator[SEP] identifier[name] , identifier[input] , identifier[mean] , identifier[variance] , identifier[gamma] , identifier[beta] , literal[boolean] , literal[boolean] , identifier[epsilon] , identifier[axis] operator[SEP] operator[SEP] }
public void write(String s, int offset, int length) throws IOException { while (length > 0) { if (_tail == null) addBuffer(TempCharBuffer.allocate()); else if (_tail._buf.length <= _tail._length) { addBuffer(TempCharBuffer.allocate()); // XXX: see TempStream for backing files } int sublen = _tail._buf.length - _tail._length; if (length < sublen) sublen = length; s.getChars(offset, offset + sublen, _tail._buf, _tail._length); offset += sublen; length -= sublen; _tail._length += sublen; } }
class class_name[name] begin[{] method[write, return_type[void], modifier[public], parameter[s, offset, length]] begin[{] while[binary_operation[member[.length], >, literal[0]]] begin[{] if[binary_operation[member[._tail], ==, literal[null]]] begin[{] call[.addBuffer, parameter[call[TempCharBuffer.allocate, parameter[]]]] else begin[{] if[binary_operation[member[_tail._buf.length], <=, member[_tail._length]]] begin[{] call[.addBuffer, parameter[call[TempCharBuffer.allocate, parameter[]]]] else begin[{] None end[}] end[}] local_variable[type[int], sublen] if[binary_operation[member[.length], <, member[.sublen]]] begin[{] assign[member[.sublen], member[.length]] else begin[{] None end[}] call[s.getChars, parameter[member[.offset], binary_operation[member[.offset], +, member[.sublen]], member[_tail._buf], member[_tail._length]]] assign[member[.offset], member[.sublen]] assign[member[.length], member[.sublen]] assign[member[_tail._length], member[.sublen]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[String] identifier[s] , Keyword[int] identifier[offset] , Keyword[int] identifier[length] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[while] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[_tail] operator[==] Other[null] operator[SEP] identifier[addBuffer] operator[SEP] identifier[TempCharBuffer] operator[SEP] identifier[allocate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[_tail] operator[SEP] identifier[_buf] operator[SEP] identifier[length] operator[<=] identifier[_tail] operator[SEP] identifier[_length] operator[SEP] { identifier[addBuffer] operator[SEP] identifier[TempCharBuffer] operator[SEP] identifier[allocate] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[int] identifier[sublen] operator[=] identifier[_tail] operator[SEP] identifier[_buf] operator[SEP] identifier[length] operator[-] identifier[_tail] operator[SEP] identifier[_length] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[<] identifier[sublen] operator[SEP] identifier[sublen] operator[=] identifier[length] operator[SEP] identifier[s] operator[SEP] identifier[getChars] operator[SEP] identifier[offset] , identifier[offset] operator[+] identifier[sublen] , identifier[_tail] operator[SEP] identifier[_buf] , identifier[_tail] operator[SEP] identifier[_length] operator[SEP] operator[SEP] identifier[offset] operator[+=] identifier[sublen] operator[SEP] identifier[length] operator[-=] identifier[sublen] operator[SEP] identifier[_tail] operator[SEP] identifier[_length] operator[+=] identifier[sublen] operator[SEP] } }
@Override public void setRollbackOnly() throws TransactionManagementException { logger.entering(CLASSNAME, "setRollbackOnly"); try { userTran.setRollbackOnly(); logger.log(Level.FINE, "javax.transaction.Status: {0}", userTran.getStatus()); } catch (IllegalStateException e) { throw new TransactionManagementException(e); } catch (SystemException e) { throw new TransactionManagementException(e); } logger.exiting(CLASSNAME, "setRollbackOnly"); }
class class_name[name] begin[{] method[setRollbackOnly, return_type[void], modifier[public], parameter[]] begin[{] call[logger.entering, parameter[member[.CLASSNAME], literal["setRollbackOnly"]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=setRollbackOnly, postfix_operators=[], prefix_operators=[], qualifier=userTran, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FINE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="javax.transaction.Status: {0}"), MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=userTran, selectors=[], type_arguments=None)], member=log, postfix_operators=[], prefix_operators=[], qualifier=logger, 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=TransactionManagementException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalStateException'])), 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=TransactionManagementException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SystemException']))], finally_block=None, label=None, resources=None) call[logger.exiting, parameter[member[.CLASSNAME], literal["setRollbackOnly"]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setRollbackOnly] operator[SEP] operator[SEP] Keyword[throws] identifier[TransactionManagementException] { identifier[logger] operator[SEP] identifier[entering] operator[SEP] identifier[CLASSNAME] , literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[userTran] operator[SEP] identifier[setRollbackOnly] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , literal[String] , identifier[userTran] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalStateException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[TransactionManagementException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SystemException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[TransactionManagementException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[logger] operator[SEP] identifier[exiting] operator[SEP] identifier[CLASSNAME] , literal[String] operator[SEP] operator[SEP] }
public java.util.List<String> getPipelineIds() { if (pipelineIds == null) { pipelineIds = new com.amazonaws.internal.SdkInternalList<String>(); } return pipelineIds; }
class class_name[name] begin[{] method[getPipelineIds, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.pipelineIds], ==, literal[null]]] begin[{] assign[member[.pipelineIds], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.pipelineIds]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[getPipelineIds] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[pipelineIds] operator[==] Other[null] operator[SEP] { identifier[pipelineIds] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[pipelineIds] operator[SEP] }
public String removeExtraneousCharacters(final String fragment, final CleaningContext context) { if (fragment == null || fragment.length() == 0) { return fragment; } Matcher matcher; Matcher alphanumLiteralMatcher; StringBuilder cleanedLine = new StringBuilder(); if (context.isLookingForLevel()) { matcher = DATA_DESCRIPTION_START.matcher(fragment); if (matcher.find()) { /* * if the level does not start on the first character, the regex * starts on the space or period character that precedes the * level. */ int start = (matcher.start() > 0) ? matcher.start() + 1 : matcher.start(); int endClean = start; if (start > 0) { /* * If there are non blank characters before the level, make * sure they are period terminated otherwise assume this is * not a level but more likely an argument for a keyword. In * this last case, we need to clean the argument as well as * all the previous characters. */ if (isArgument(fragment.substring(0, start))) { endClean = matcher.end() - 1; } /* * Warn that we are about to get rid of these extra * characters. */ String extraneous = fragment.substring(0, endClean).trim(); if (extraneous.length() > 0) { emitErrorMessage("Extraneous characters ignored: " + extraneous); } } /* Any extraneous character is replaced with spaces. */ for (int i = 0; i < endClean; i++) { cleanedLine.append(' '); } /* * If we actually found a level, keep it and start looking for a * delimiter. */ if (endClean == start) { cleanedLine.append(fragment.substring(start, matcher.end() - 1)); context.setLookingForLevel(false); } cleanedLine.append(removeExtraneousCharacters( fragment.substring(matcher.end() - 1), context)); } else { if (fragment.trim().length() > 0) { emitErrorMessage("Extraneous characters ignored: " + fragment); } } } else if (context.isAlphanumStarted()) { Pattern alphanumLiteralEnd = Pattern.compile("\\" + context.getAlphanumDelimiter() + "($|\\s|,|;|\\" + COBOL_DELIMITER + ")"); alphanumLiteralMatcher = alphanumLiteralEnd.matcher(fragment); if (alphanumLiteralMatcher.find()) { cleanedLine.append(fragment.substring(0, alphanumLiteralMatcher.end() - 1)); context.setAlphanumStarted(false); cleanedLine.append(removeExtraneousCharacters( fragment.substring(alphanumLiteralMatcher.end() - 1), context)); } else { cleanedLine.append(fragment); } } else { alphanumLiteralMatcher = ALPHANUM_LITERAL_START.matcher(fragment); matcher = DATA_DESCRIPTION_END.matcher(fragment); if (alphanumLiteralMatcher.find()) { if (matcher.find()) { if (matcher.end() < alphanumLiteralMatcher.end()) { cleanedLine.append(replaceLongSeparators(fragment .substring(0, matcher.end()))); context.setLookingForLevel(true); cleanedLine.append(removeExtraneousCharacters( fragment.substring(matcher.end()), context)); } else { cleanedLine.append(replaceLongSeparators(fragment .substring(0, alphanumLiteralMatcher.end()))); context.setAlphanumDelimiter(fragment.substring( alphanumLiteralMatcher.end() - 1).charAt(0)); context.setAlphanumStarted(true); cleanedLine.append(removeExtraneousCharacters(fragment .substring(alphanumLiteralMatcher.end()), context)); } } else { cleanedLine.append(replaceLongSeparators(fragment .substring(0, alphanumLiteralMatcher.end()))); context.setAlphanumDelimiter(fragment.substring( alphanumLiteralMatcher.end() - 1).charAt(0)); context.setAlphanumStarted(true); cleanedLine.append(removeExtraneousCharacters( fragment.substring(alphanumLiteralMatcher.end()), context)); } } else { if (matcher.find()) { cleanedLine.append(replaceLongSeparators(fragment .substring(0, matcher.end()))); context.setLookingForLevel(true); cleanedLine.append(removeExtraneousCharacters( fragment.substring(matcher.end()), context)); } else { cleanedLine.append(fragment); } } } return cleanedLine.toString(); }
class class_name[name] begin[{] method[removeExtraneousCharacters, return_type[type[String]], modifier[public], parameter[fragment, context]] begin[{] if[binary_operation[binary_operation[member[.fragment], ==, literal[null]], ||, binary_operation[call[fragment.length, parameter[]], ==, literal[0]]]] begin[{] return[member[.fragment]] else begin[{] None end[}] local_variable[type[Matcher], matcher] local_variable[type[Matcher], alphanumLiteralMatcher] local_variable[type[StringBuilder], cleanedLine] if[call[context.isLookingForLevel, parameter[]]] begin[{] assign[member[.matcher], call[DATA_DESCRIPTION_START.matcher, parameter[member[.fragment]]]] if[call[matcher.find, parameter[]]] begin[{] local_variable[type[int], start] local_variable[type[int], endClean] if[binary_operation[member[.start], >, literal[0]]] begin[{] if[call[.isArgument, parameter[call[fragment.substring, parameter[literal[0], member[.start]]]]]] begin[{] assign[member[.endClean], binary_operation[call[matcher.end, parameter[]], -, literal[1]]] else begin[{] None end[}] local_variable[type[String], extraneous] if[binary_operation[call[extraneous.length, parameter[]], >, literal[0]]] begin[{] call[.emitErrorMessage, parameter[binary_operation[literal["Extraneous characters ignored: "], +, member[.extraneous]]]] else begin[{] None end[}] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=append, postfix_operators=[], prefix_operators=[], qualifier=cleanedLine, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=endClean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.endClean], ==, member[.start]]] begin[{] call[cleanedLine.append, parameter[call[fragment.substring, parameter[member[.start], binary_operation[call[matcher.end, parameter[]], -, literal[1]]]]]] call[context.setLookingForLevel, parameter[literal[false]]] else begin[{] None end[}] call[cleanedLine.append, parameter[call[.removeExtraneousCharacters, parameter[call[fragment.substring, parameter[binary_operation[call[matcher.end, parameter[]], -, literal[1]]]], member[.context]]]]] else begin[{] if[binary_operation[call[fragment.trim, parameter[]], >, literal[0]]] begin[{] call[.emitErrorMessage, parameter[binary_operation[literal["Extraneous characters ignored: "], +, member[.fragment]]]] else begin[{] None end[}] end[}] else begin[{] if[call[context.isAlphanumStarted, parameter[]]] begin[{] local_variable[type[Pattern], alphanumLiteralEnd] assign[member[.alphanumLiteralMatcher], call[alphanumLiteralEnd.matcher, parameter[member[.fragment]]]] if[call[alphanumLiteralMatcher.find, parameter[]]] begin[{] call[cleanedLine.append, parameter[call[fragment.substring, parameter[literal[0], binary_operation[call[alphanumLiteralMatcher.end, parameter[]], -, literal[1]]]]]] call[context.setAlphanumStarted, parameter[literal[false]]] call[cleanedLine.append, parameter[call[.removeExtraneousCharacters, parameter[call[fragment.substring, parameter[binary_operation[call[alphanumLiteralMatcher.end, parameter[]], -, literal[1]]]], member[.context]]]]] else begin[{] call[cleanedLine.append, parameter[member[.fragment]]] end[}] else begin[{] assign[member[.alphanumLiteralMatcher], call[ALPHANUM_LITERAL_START.matcher, parameter[member[.fragment]]]] assign[member[.matcher], call[DATA_DESCRIPTION_END.matcher, parameter[member[.fragment]]]] if[call[alphanumLiteralMatcher.find, parameter[]]] begin[{] if[call[matcher.find, parameter[]]] begin[{] if[binary_operation[call[matcher.end, parameter[]], <, call[alphanumLiteralMatcher.end, parameter[]]]] begin[{] call[cleanedLine.append, parameter[call[.replaceLongSeparators, parameter[call[fragment.substring, parameter[literal[0], call[matcher.end, parameter[]]]]]]]] call[context.setLookingForLevel, parameter[literal[true]]] call[cleanedLine.append, parameter[call[.removeExtraneousCharacters, parameter[call[fragment.substring, parameter[call[matcher.end, parameter[]]]], member[.context]]]]] else begin[{] call[cleanedLine.append, parameter[call[.replaceLongSeparators, parameter[call[fragment.substring, parameter[literal[0], call[alphanumLiteralMatcher.end, parameter[]]]]]]]] call[context.setAlphanumDelimiter, parameter[call[fragment.substring, parameter[binary_operation[call[alphanumLiteralMatcher.end, parameter[]], -, literal[1]]]]]] call[context.setAlphanumStarted, parameter[literal[true]]] call[cleanedLine.append, parameter[call[.removeExtraneousCharacters, parameter[call[fragment.substring, parameter[call[alphanumLiteralMatcher.end, parameter[]]]], member[.context]]]]] end[}] else begin[{] call[cleanedLine.append, parameter[call[.replaceLongSeparators, parameter[call[fragment.substring, parameter[literal[0], call[alphanumLiteralMatcher.end, parameter[]]]]]]]] call[context.setAlphanumDelimiter, parameter[call[fragment.substring, parameter[binary_operation[call[alphanumLiteralMatcher.end, parameter[]], -, literal[1]]]]]] call[context.setAlphanumStarted, parameter[literal[true]]] call[cleanedLine.append, parameter[call[.removeExtraneousCharacters, parameter[call[fragment.substring, parameter[call[alphanumLiteralMatcher.end, parameter[]]]], member[.context]]]]] end[}] else begin[{] if[call[matcher.find, parameter[]]] begin[{] call[cleanedLine.append, parameter[call[.replaceLongSeparators, parameter[call[fragment.substring, parameter[literal[0], call[matcher.end, parameter[]]]]]]]] call[context.setLookingForLevel, parameter[literal[true]]] call[cleanedLine.append, parameter[call[.removeExtraneousCharacters, parameter[call[fragment.substring, parameter[call[matcher.end, parameter[]]]], member[.context]]]]] else begin[{] call[cleanedLine.append, parameter[member[.fragment]]] end[}] end[}] end[}] end[}] return[call[cleanedLine.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[removeExtraneousCharacters] operator[SEP] Keyword[final] identifier[String] identifier[fragment] , Keyword[final] identifier[CleaningContext] identifier[context] operator[SEP] { Keyword[if] operator[SEP] identifier[fragment] operator[==] Other[null] operator[||] identifier[fragment] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[fragment] operator[SEP] } identifier[Matcher] identifier[matcher] operator[SEP] identifier[Matcher] identifier[alphanumLiteralMatcher] operator[SEP] identifier[StringBuilder] identifier[cleanedLine] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[isLookingForLevel] operator[SEP] operator[SEP] operator[SEP] { identifier[matcher] operator[=] identifier[DATA_DESCRIPTION_START] operator[SEP] identifier[matcher] operator[SEP] identifier[fragment] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[start] operator[=] operator[SEP] identifier[matcher] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[?] identifier[matcher] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[+] Other[1] operator[:] identifier[matcher] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[endClean] operator[=] identifier[start] operator[SEP] Keyword[if] operator[SEP] identifier[start] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[isArgument] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[start] operator[SEP] operator[SEP] operator[SEP] { identifier[endClean] operator[=] identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] } identifier[String] identifier[extraneous] operator[=] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[endClean] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[extraneous] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[emitErrorMessage] operator[SEP] literal[String] operator[+] identifier[extraneous] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[endClean] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[endClean] operator[==] identifier[start] operator[SEP] { identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setLookingForLevel] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[removeExtraneousCharacters] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[context] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[fragment] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[emitErrorMessage] operator[SEP] literal[String] operator[+] identifier[fragment] operator[SEP] operator[SEP] } } } Keyword[else] Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[isAlphanumStarted] operator[SEP] operator[SEP] operator[SEP] { identifier[Pattern] identifier[alphanumLiteralEnd] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] literal[String] operator[+] identifier[context] operator[SEP] identifier[getAlphanumDelimiter] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[COBOL_DELIMITER] operator[+] literal[String] operator[SEP] operator[SEP] identifier[alphanumLiteralMatcher] operator[=] identifier[alphanumLiteralEnd] operator[SEP] identifier[matcher] operator[SEP] identifier[fragment] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[alphanumLiteralMatcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[alphanumLiteralMatcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setAlphanumStarted] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[removeExtraneousCharacters] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[alphanumLiteralMatcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[context] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[fragment] operator[SEP] operator[SEP] } } Keyword[else] { identifier[alphanumLiteralMatcher] operator[=] identifier[ALPHANUM_LITERAL_START] operator[SEP] identifier[matcher] operator[SEP] identifier[fragment] operator[SEP] operator[SEP] identifier[matcher] operator[=] identifier[DATA_DESCRIPTION_END] operator[SEP] identifier[matcher] operator[SEP] identifier[fragment] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[alphanumLiteralMatcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[<] identifier[alphanumLiteralMatcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] { identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[replaceLongSeparators] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setLookingForLevel] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[removeExtraneousCharacters] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] , identifier[context] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[replaceLongSeparators] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[alphanumLiteralMatcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setAlphanumDelimiter] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[alphanumLiteralMatcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setAlphanumStarted] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[removeExtraneousCharacters] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[alphanumLiteralMatcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] , identifier[context] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[replaceLongSeparators] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[alphanumLiteralMatcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setAlphanumDelimiter] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[alphanumLiteralMatcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setAlphanumStarted] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[removeExtraneousCharacters] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[alphanumLiteralMatcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] , identifier[context] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[replaceLongSeparators] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[setLookingForLevel] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[removeExtraneousCharacters] operator[SEP] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[matcher] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] , identifier[context] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[cleanedLine] operator[SEP] identifier[append] operator[SEP] identifier[fragment] operator[SEP] operator[SEP] } } } Keyword[return] identifier[cleanedLine] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
@Override public DisassociateElasticIpResult disassociateElasticIp(DisassociateElasticIpRequest request) { request = beforeClientExecution(request); return executeDisassociateElasticIp(request); }
class class_name[name] begin[{] method[disassociateElasticIp, return_type[type[DisassociateElasticIpResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDisassociateElasticIp, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DisassociateElasticIpResult] identifier[disassociateElasticIp] operator[SEP] identifier[DisassociateElasticIpRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDisassociateElasticIp] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void register(Object subscriber) { Class<?> subscriberClass = subscriber.getClass(); List<SubscriberMethod> subscriberMethods = subscriberMethodFinder.findSubscriberMethods(subscriberClass); synchronized (this) { for (SubscriberMethod subscriberMethod : subscriberMethods) { subscribe(subscriber, subscriberMethod); } } }
class class_name[name] begin[{] method[register, return_type[void], modifier[public], parameter[subscriber]] begin[{] local_variable[type[Class], subscriberClass] local_variable[type[List], subscriberMethods] SYNCHRONIZED[THIS[]] BEGIN[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=subscriber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=subscriberMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=subscribe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=subscriberMethods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subscriberMethod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SubscriberMethod, sub_type=None))), label=None) END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[register] operator[SEP] identifier[Object] identifier[subscriber] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[subscriberClass] operator[=] identifier[subscriber] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[SubscriberMethod] operator[>] identifier[subscriberMethods] operator[=] identifier[subscriberMethodFinder] operator[SEP] identifier[findSubscriberMethods] operator[SEP] identifier[subscriberClass] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[for] operator[SEP] identifier[SubscriberMethod] identifier[subscriberMethod] operator[:] identifier[subscriberMethods] operator[SEP] { identifier[subscribe] operator[SEP] identifier[subscriber] , identifier[subscriberMethod] operator[SEP] operator[SEP] } } }
@SuppressWarnings("unchecked") public SimpleOrderedMap<Object> create(ComponentGroup group, Boolean encode) throws IOException { SimpleOrderedMap<Object> mtasGroupResponse = new SimpleOrderedMap<>(); mtasGroupResponse.add("key", group.key); MtasSolrMtasResult data = new MtasSolrMtasResult(group.dataCollector, new String[] { group.dataType }, new String[] { group.statsType }, new SortedSet[] { group.statsItems }, new List[] { null }, new String[] { group.sortType }, new String[] { group.sortDirection }, new Integer[] { group.start }, new Integer[] { group.number }, null); if (encode) { mtasGroupResponse.add("_encoded_list", MtasSolrResultUtil.encode(data)); } else { mtasGroupResponse.add("list", data); MtasSolrResultUtil.rewrite(mtasGroupResponse, searchComponent); } return mtasGroupResponse; }
class class_name[name] begin[{] method[create, return_type[type[SimpleOrderedMap]], modifier[public], parameter[group, encode]] begin[{] local_variable[type[SimpleOrderedMap], mtasGroupResponse] call[mtasGroupResponse.add, parameter[literal["key"], member[group.key]]] local_variable[type[MtasSolrMtasResult], data] if[member[.encode]] begin[{] call[mtasGroupResponse.add, parameter[literal["_encoded_list"], call[MtasSolrResultUtil.encode, parameter[member[.data]]]]] else begin[{] call[mtasGroupResponse.add, parameter[literal["list"], member[.data]]] call[MtasSolrResultUtil.rewrite, parameter[member[.mtasGroupResponse], member[.searchComponent]]] end[}] return[member[.mtasGroupResponse]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[SimpleOrderedMap] operator[<] identifier[Object] operator[>] identifier[create] operator[SEP] identifier[ComponentGroup] identifier[group] , identifier[Boolean] identifier[encode] operator[SEP] Keyword[throws] identifier[IOException] { identifier[SimpleOrderedMap] operator[<] identifier[Object] operator[>] identifier[mtasGroupResponse] operator[=] Keyword[new] identifier[SimpleOrderedMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[mtasGroupResponse] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[group] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[MtasSolrMtasResult] identifier[data] operator[=] Keyword[new] identifier[MtasSolrMtasResult] operator[SEP] identifier[group] operator[SEP] identifier[dataCollector] , Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[group] operator[SEP] identifier[dataType] } , Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[group] operator[SEP] identifier[statsType] } , Keyword[new] identifier[SortedSet] operator[SEP] operator[SEP] { identifier[group] operator[SEP] identifier[statsItems] } , Keyword[new] identifier[List] operator[SEP] operator[SEP] { Other[null] } , Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[group] operator[SEP] identifier[sortType] } , Keyword[new] identifier[String] operator[SEP] operator[SEP] { identifier[group] operator[SEP] identifier[sortDirection] } , Keyword[new] identifier[Integer] operator[SEP] operator[SEP] { identifier[group] operator[SEP] identifier[start] } , Keyword[new] identifier[Integer] operator[SEP] operator[SEP] { identifier[group] operator[SEP] identifier[number] } , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[encode] operator[SEP] { identifier[mtasGroupResponse] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[MtasSolrResultUtil] operator[SEP] identifier[encode] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[mtasGroupResponse] operator[SEP] identifier[add] operator[SEP] literal[String] , identifier[data] operator[SEP] operator[SEP] identifier[MtasSolrResultUtil] operator[SEP] identifier[rewrite] operator[SEP] identifier[mtasGroupResponse] , identifier[searchComponent] operator[SEP] operator[SEP] } Keyword[return] identifier[mtasGroupResponse] operator[SEP] }
public static MutationNt2AADescriptor[] nt2aaDetailed(NucleotideSequence seq1, Mutations<NucleotideSequence> mutations, TranslationParameters translationParameters, int maxShiftedTriplets) { MutationsWitMapping mutationsWitMapping = nt2aaWithMapping(seq1, mutations, translationParameters, maxShiftedTriplets); int[] individualMutations = nt2IndividualAA(seq1, mutations, translationParameters); MutationNt2AADescriptor[] result = new MutationNt2AADescriptor[mutations.size()]; for (int i = 0; i < mutations.size(); i++) { result[i] = new MutationNt2AADescriptor(mutations.getMutation(i), individualMutations[i], mutationsWitMapping.mapping[i] == -1 ? NON_MUTATION : mutationsWitMapping.mutations.getMutation(mutationsWitMapping.mapping[i])); } return result; }
class class_name[name] begin[{] method[nt2aaDetailed, return_type[type[MutationNt2AADescriptor]], modifier[public static], parameter[seq1, mutations, translationParameters, maxShiftedTriplets]] begin[{] local_variable[type[MutationsWitMapping], mutationsWitMapping] local_variable[type[int], individualMutations] local_variable[type[MutationNt2AADescriptor], result] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMutation, postfix_operators=[], prefix_operators=[], qualifier=mutations, selectors=[], type_arguments=None), MemberReference(member=individualMutations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=mapping, postfix_operators=[], prefix_operators=[], qualifier=mutationsWitMapping, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), if_false=MethodInvocation(arguments=[MemberReference(member=mapping, postfix_operators=[], prefix_operators=[], qualifier=mutationsWitMapping, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getMutation, postfix_operators=[], prefix_operators=[], qualifier=mutationsWitMapping.mutations, selectors=[], type_arguments=None), if_true=MemberReference(member=NON_MUTATION, 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=MutationNt2AADescriptor, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=mutations, 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) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MutationNt2AADescriptor] operator[SEP] operator[SEP] identifier[nt2aaDetailed] operator[SEP] identifier[NucleotideSequence] identifier[seq1] , identifier[Mutations] operator[<] identifier[NucleotideSequence] operator[>] identifier[mutations] , identifier[TranslationParameters] identifier[translationParameters] , Keyword[int] identifier[maxShiftedTriplets] operator[SEP] { identifier[MutationsWitMapping] identifier[mutationsWitMapping] operator[=] identifier[nt2aaWithMapping] operator[SEP] identifier[seq1] , identifier[mutations] , identifier[translationParameters] , identifier[maxShiftedTriplets] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[individualMutations] operator[=] identifier[nt2IndividualAA] operator[SEP] identifier[seq1] , identifier[mutations] , identifier[translationParameters] operator[SEP] operator[SEP] identifier[MutationNt2AADescriptor] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[MutationNt2AADescriptor] operator[SEP] identifier[mutations] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[mutations] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[MutationNt2AADescriptor] operator[SEP] identifier[mutations] operator[SEP] identifier[getMutation] operator[SEP] identifier[i] operator[SEP] , identifier[individualMutations] operator[SEP] identifier[i] operator[SEP] , identifier[mutationsWitMapping] operator[SEP] identifier[mapping] operator[SEP] identifier[i] operator[SEP] operator[==] operator[-] Other[1] operator[?] identifier[NON_MUTATION] operator[:] identifier[mutationsWitMapping] operator[SEP] identifier[mutations] operator[SEP] identifier[getMutation] operator[SEP] identifier[mutationsWitMapping] operator[SEP] identifier[mapping] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
@Override protected void handleEvents(final String EVENT_TYPE) { super.handleEvents(EVENT_TYPE); if ("VISIBILITY".equals(EVENT_TYPE)) { Helper.enableNode(titleText, !tile.getTitle().isEmpty()); Helper.enableNode(text, tile.isTextVisible()); } else if ("RECALC".equals(EVENT_TYPE)) { matrix.setColsAndRows(tile.getMatrixSize()); resize(); } }
class class_name[name] begin[{] method[handleEvents, return_type[void], modifier[protected], parameter[EVENT_TYPE]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=EVENT_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleEvents, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) if[literal["VISIBILITY"]] begin[{] call[Helper.enableNode, parameter[member[.titleText], call[tile.getTitle, parameter[]]]] call[Helper.enableNode, parameter[member[.text], call[tile.isTextVisible, parameter[]]]] else begin[{] if[literal["RECALC"]] begin[{] call[matrix.setColsAndRows, parameter[call[tile.getMatrixSize, parameter[]]]] call[.resize, parameter[]] else begin[{] None end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[handleEvents] operator[SEP] Keyword[final] identifier[String] identifier[EVENT_TYPE] operator[SEP] { Keyword[super] operator[SEP] identifier[handleEvents] operator[SEP] identifier[EVENT_TYPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[EVENT_TYPE] operator[SEP] operator[SEP] { identifier[Helper] operator[SEP] identifier[enableNode] operator[SEP] identifier[titleText] , operator[!] identifier[tile] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Helper] operator[SEP] identifier[enableNode] operator[SEP] identifier[text] , identifier[tile] operator[SEP] identifier[isTextVisible] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[EVENT_TYPE] operator[SEP] operator[SEP] { identifier[matrix] operator[SEP] identifier[setColsAndRows] operator[SEP] identifier[tile] operator[SEP] identifier[getMatrixSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resize] operator[SEP] operator[SEP] operator[SEP] } }
private boolean isSessionNameUnique(final String name) { synchronized (this.sessions) { for (HttpSession session : sessions) { if (name.equals(session.getName())) { return false; } } } return true; }
class class_name[name] begin[{] method[isSessionNameUnique, return_type[type[boolean]], modifier[private], parameter[name]] begin[{] SYNCHRONIZED[THIS[member[None.sessions]]] BEGIN[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], 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=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=sessions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=session)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpSession, sub_type=None))), label=None) END[}] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isSessionNameUnique] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[sessions] operator[SEP] { Keyword[for] operator[SEP] identifier[HttpSession] identifier[session] operator[:] identifier[sessions] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[session] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
public static String byteCountToDisplaySize(BigInteger size, int maxChars) { String displaySize; BigDecimal bdSize = new BigDecimal(size); SizeSuffix selectedSuffix = SizeSuffix.B; for (SizeSuffix sizeSuffix : SizeSuffix.values()) { if (sizeSuffix.equals(SizeSuffix.B)) { continue; } if (bdSize.setScale(0, RoundingMode.HALF_UP).toString().length() <= maxChars) { break; } selectedSuffix = sizeSuffix; bdSize = bdSize.divide(ONE_KB_BD); } displaySize = bdSize.setScale(0, RoundingMode.HALF_UP).toString(); if (displaySize.length() < maxChars - 1) { displaySize = bdSize.setScale( maxChars - 1 - displaySize.length(), RoundingMode.HALF_UP).toString(); } return displaySize + " " + selectedSuffix.toString(); }
class class_name[name] begin[{] method[byteCountToDisplaySize, return_type[type[String]], modifier[public static], parameter[size, maxChars]] begin[{] local_variable[type[String], displaySize] local_variable[type[BigDecimal], bdSize] local_variable[type[SizeSuffix], selectedSuffix] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=B, postfix_operators=[], prefix_operators=[], qualifier=SizeSuffix, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=sizeSuffix, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=HALF_UP, postfix_operators=[], prefix_operators=[], qualifier=RoundingMode, selectors=[])], member=setScale, postfix_operators=[], prefix_operators=[], qualifier=bdSize, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=maxChars, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=selectedSuffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=sizeSuffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=bdSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ONE_KB_BD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=divide, postfix_operators=[], prefix_operators=[], qualifier=bdSize, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=SizeSuffix, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sizeSuffix)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SizeSuffix, sub_type=None))), label=None) assign[member[.displaySize], call[bdSize.setScale, parameter[literal[0], member[RoundingMode.HALF_UP]]]] if[binary_operation[call[displaySize.length, parameter[]], <, binary_operation[member[.maxChars], -, literal[1]]]] begin[{] assign[member[.displaySize], call[bdSize.setScale, parameter[binary_operation[binary_operation[member[.maxChars], -, literal[1]], -, call[displaySize.length, parameter[]]], member[RoundingMode.HALF_UP]]]] else begin[{] None end[}] return[binary_operation[binary_operation[member[.displaySize], +, literal[" "]], +, call[selectedSuffix.toString, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[byteCountToDisplaySize] operator[SEP] identifier[BigInteger] identifier[size] , Keyword[int] identifier[maxChars] operator[SEP] { identifier[String] identifier[displaySize] operator[SEP] identifier[BigDecimal] identifier[bdSize] operator[=] Keyword[new] identifier[BigDecimal] operator[SEP] identifier[size] operator[SEP] operator[SEP] identifier[SizeSuffix] identifier[selectedSuffix] operator[=] identifier[SizeSuffix] operator[SEP] identifier[B] operator[SEP] Keyword[for] operator[SEP] identifier[SizeSuffix] identifier[sizeSuffix] operator[:] identifier[SizeSuffix] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[sizeSuffix] operator[SEP] identifier[equals] operator[SEP] identifier[SizeSuffix] operator[SEP] identifier[B] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[if] operator[SEP] identifier[bdSize] operator[SEP] identifier[setScale] operator[SEP] Other[0] , identifier[RoundingMode] operator[SEP] identifier[HALF_UP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<=] identifier[maxChars] operator[SEP] { Keyword[break] operator[SEP] } identifier[selectedSuffix] operator[=] identifier[sizeSuffix] operator[SEP] identifier[bdSize] operator[=] identifier[bdSize] operator[SEP] identifier[divide] operator[SEP] identifier[ONE_KB_BD] operator[SEP] operator[SEP] } identifier[displaySize] operator[=] identifier[bdSize] operator[SEP] identifier[setScale] operator[SEP] Other[0] , identifier[RoundingMode] operator[SEP] identifier[HALF_UP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[displaySize] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[<] identifier[maxChars] operator[-] Other[1] operator[SEP] { identifier[displaySize] operator[=] identifier[bdSize] operator[SEP] identifier[setScale] operator[SEP] identifier[maxChars] operator[-] Other[1] operator[-] identifier[displaySize] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[RoundingMode] operator[SEP] identifier[HALF_UP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[displaySize] operator[+] literal[String] operator[+] identifier[selectedSuffix] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
static InputSource createInputSource(Identifier id, Input input) { InputSource inputSource = createInputSource(input); if (id instanceof ExternalIdentifier) inputSource.setPublicId(((ExternalIdentifier)id).getPublicId()); if (inputSource.getSystemId() == null) inputSource.setSystemId(getSystemId(id)); return inputSource; }
class class_name[name] begin[{] method[createInputSource, return_type[type[InputSource]], modifier[static], parameter[id, input]] begin[{] local_variable[type[InputSource], inputSource] if[binary_operation[member[.id], instanceof, type[ExternalIdentifier]]] begin[{] call[inputSource.setPublicId, parameter[Cast(expression=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ExternalIdentifier, sub_type=None))]] else begin[{] None end[}] if[binary_operation[call[inputSource.getSystemId, parameter[]], ==, literal[null]]] begin[{] call[inputSource.setSystemId, parameter[call[.getSystemId, parameter[member[.id]]]]] else begin[{] None end[}] return[member[.inputSource]] end[}] END[}]
Keyword[static] identifier[InputSource] identifier[createInputSource] operator[SEP] identifier[Identifier] identifier[id] , identifier[Input] identifier[input] operator[SEP] { identifier[InputSource] identifier[inputSource] operator[=] identifier[createInputSource] operator[SEP] identifier[input] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[id] Keyword[instanceof] identifier[ExternalIdentifier] operator[SEP] identifier[inputSource] operator[SEP] identifier[setPublicId] operator[SEP] operator[SEP] operator[SEP] identifier[ExternalIdentifier] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[getPublicId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inputSource] operator[SEP] identifier[getSystemId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] identifier[inputSource] operator[SEP] identifier[setSystemId] operator[SEP] identifier[getSystemId] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[inputSource] operator[SEP] }
public Response createChatRoom(MUCRoomEntity chatRoom) { return restClient.post("chatrooms", chatRoom, new HashMap<String, String>()); }
class class_name[name] begin[{] method[createChatRoom, return_type[type[Response]], modifier[public], parameter[chatRoom]] begin[{] return[call[restClient.post, parameter[literal["chatrooms"], member[.chatRoom], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Response] identifier[createChatRoom] operator[SEP] identifier[MUCRoomEntity] identifier[chatRoom] operator[SEP] { Keyword[return] identifier[restClient] operator[SEP] identifier[post] operator[SEP] literal[String] , identifier[chatRoom] , Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static int parseInt(Object val) { if (val instanceof String) { return Integer.parseInt((String) val); } else if (val instanceof Number) { return ((Number) val).intValue(); } else { if (val == null) { throw new NullPointerException("Input is null"); } else { throw new ISE("Unknown type [%s]", val.getClass()); } } }
class class_name[name] begin[{] method[parseInt, return_type[type[int]], modifier[public static], parameter[val]] begin[{] if[binary_operation[member[.val], instanceof, type[String]]] begin[{] return[call[Integer.parseInt, parameter[Cast(expression=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]] else begin[{] if[binary_operation[member[.val], instanceof, type[Number]]] begin[{] return[Cast(expression=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))] else begin[{] if[binary_operation[member[.val], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Input is null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown type [%s]"), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=val, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ISE, sub_type=None)), label=None) end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[parseInt] operator[SEP] identifier[Object] identifier[val] operator[SEP] { Keyword[if] operator[SEP] identifier[val] Keyword[instanceof] identifier[String] operator[SEP] { Keyword[return] identifier[Integer] operator[SEP] identifier[parseInt] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[val] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[val] Keyword[instanceof] identifier[Number] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[val] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[val] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[ISE] operator[SEP] literal[String] , identifier[val] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
private Path2D pathToShape(final List<List<AdobePathSegment>> paths) { GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD, paths.size()); GeneralPath subpath = null; for (List<AdobePathSegment> points : paths) { int length = points.size(); for (int i = 0; i < points.size(); i++) { AdobePathSegment current = points.get(i); int step = i == 0 ? 0 : i == length - 1 ? 2 : 1; switch (step) { // begin case 0: { subpath = new GeneralPath(Path2D.WIND_EVEN_ODD, length); subpath.moveTo(current.apx, current.apy); if (length > 1) { AdobePathSegment next = points.get((i + 1)); subpath.curveTo(current.cplx, current.cply, next.cppx, next.cppy, next.apx, next.apy); } else { subpath.lineTo(current.apx, current.apy); } break; } // middle case 1: { AdobePathSegment next = points.get((i + 1)); // we are always guaranteed one more. subpath.curveTo(current.cplx, current.cply, next.cppx, next.cppy, next.apx, next.apy); break; } // end case 2: { AdobePathSegment first = points.get(0); if (first.selector == AdobePathSegment.CLOSED_SUBPATH_BEZIER_LINKED || first.selector == AdobePathSegment.CLOSED_SUBPATH_BEZIER_UNLINKED) { subpath.curveTo(current.cplx, current.cply, first.cppx, first.cppy, first.apx, first.apy); subpath.closePath(); path.append(subpath, false); } else { subpath.lineTo(current.apx, current.apy); path.append(subpath, true); } break; } } } } return path; }
class class_name[name] begin[{] method[pathToShape, return_type[type[Path2D]], modifier[private], parameter[paths]] begin[{] local_variable[type[GeneralPath], path] local_variable[type[GeneralPath], subpath] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=points, selectors=[], type_arguments=None), name=length)], modifiers=set(), type=BasicType(dimensions=[], name=int)), 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=points, selectors=[], type_arguments=None), name=current)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AdobePathSegment, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), name=step)], modifiers=set(), type=BasicType(dimensions=[], name=int)), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=subpath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=WIND_EVEN_ODD, postfix_operators=[], prefix_operators=[], qualifier=Path2D, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GeneralPath, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=apx, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[]), MemberReference(member=apy, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[])], member=moveTo, postfix_operators=[], prefix_operators=[], qualifier=subpath, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=apx, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[]), MemberReference(member=apy, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[])], member=lineTo, postfix_operators=[], prefix_operators=[], qualifier=subpath, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[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=points, selectors=[], type_arguments=None), name=next)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AdobePathSegment, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cplx, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[]), MemberReference(member=cply, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[]), MemberReference(member=cppx, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[]), MemberReference(member=cppy, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[]), MemberReference(member=apx, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[]), MemberReference(member=apy, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[])], member=curveTo, postfix_operators=[], prefix_operators=[], qualifier=subpath, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[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=points, selectors=[], type_arguments=None), name=next)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AdobePathSegment, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cplx, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[]), MemberReference(member=cply, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[]), MemberReference(member=cppx, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[]), MemberReference(member=cppy, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[]), MemberReference(member=apx, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[]), MemberReference(member=apy, postfix_operators=[], prefix_operators=[], qualifier=next, selectors=[])], member=curveTo, postfix_operators=[], prefix_operators=[], qualifier=subpath, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=get, postfix_operators=[], prefix_operators=[], qualifier=points, selectors=[], type_arguments=None), name=first)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AdobePathSegment, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=selector, postfix_operators=[], prefix_operators=[], qualifier=first, selectors=[]), operandr=MemberReference(member=CLOSED_SUBPATH_BEZIER_LINKED, postfix_operators=[], prefix_operators=[], qualifier=AdobePathSegment, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=selector, postfix_operators=[], prefix_operators=[], qualifier=first, selectors=[]), operandr=MemberReference(member=CLOSED_SUBPATH_BEZIER_UNLINKED, postfix_operators=[], prefix_operators=[], qualifier=AdobePathSegment, selectors=[]), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=apx, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[]), MemberReference(member=apy, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[])], member=lineTo, postfix_operators=[], prefix_operators=[], qualifier=subpath, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=subpath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=append, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cplx, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[]), MemberReference(member=cply, postfix_operators=[], prefix_operators=[], qualifier=current, selectors=[]), MemberReference(member=cppx, postfix_operators=[], prefix_operators=[], qualifier=first, selectors=[]), MemberReference(member=cppy, postfix_operators=[], prefix_operators=[], qualifier=first, selectors=[]), MemberReference(member=apx, postfix_operators=[], prefix_operators=[], qualifier=first, selectors=[]), MemberReference(member=apy, postfix_operators=[], prefix_operators=[], qualifier=first, selectors=[])], member=curveTo, postfix_operators=[], prefix_operators=[], qualifier=subpath, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=closePath, postfix_operators=[], prefix_operators=[], qualifier=subpath, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=subpath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=append, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])])], expression=MemberReference(member=step, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=points, 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)]), control=EnhancedForControl(iterable=MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=points)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AdobePathSegment, sub_type=None))], dimensions=[], name=List, sub_type=None))), label=None) return[member[.path]] end[}] END[}]
Keyword[private] identifier[Path2D] identifier[pathToShape] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[List] operator[<] identifier[AdobePathSegment] operator[>] operator[>] identifier[paths] operator[SEP] { identifier[GeneralPath] identifier[path] operator[=] Keyword[new] identifier[GeneralPath] operator[SEP] identifier[Path2D] operator[SEP] identifier[WIND_EVEN_ODD] , identifier[paths] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[GeneralPath] identifier[subpath] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[List] operator[<] identifier[AdobePathSegment] operator[>] identifier[points] operator[:] identifier[paths] operator[SEP] { Keyword[int] identifier[length] operator[=] identifier[points] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[points] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[AdobePathSegment] identifier[current] operator[=] identifier[points] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[step] operator[=] identifier[i] operator[==] Other[0] operator[?] Other[0] operator[:] identifier[i] operator[==] identifier[length] operator[-] Other[1] operator[?] Other[2] operator[:] Other[1] operator[SEP] Keyword[switch] operator[SEP] identifier[step] operator[SEP] { Keyword[case] Other[0] operator[:] { identifier[subpath] operator[=] Keyword[new] identifier[GeneralPath] operator[SEP] identifier[Path2D] operator[SEP] identifier[WIND_EVEN_ODD] , identifier[length] operator[SEP] operator[SEP] identifier[subpath] operator[SEP] identifier[moveTo] operator[SEP] identifier[current] operator[SEP] identifier[apx] , identifier[current] operator[SEP] identifier[apy] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[>] Other[1] operator[SEP] { identifier[AdobePathSegment] identifier[next] operator[=] identifier[points] operator[SEP] identifier[get] operator[SEP] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[subpath] operator[SEP] identifier[curveTo] operator[SEP] identifier[current] operator[SEP] identifier[cplx] , identifier[current] operator[SEP] identifier[cply] , identifier[next] operator[SEP] identifier[cppx] , identifier[next] operator[SEP] identifier[cppy] , identifier[next] operator[SEP] identifier[apx] , identifier[next] operator[SEP] identifier[apy] operator[SEP] operator[SEP] } Keyword[else] { identifier[subpath] operator[SEP] identifier[lineTo] operator[SEP] identifier[current] operator[SEP] identifier[apx] , identifier[current] operator[SEP] identifier[apy] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } Keyword[case] Other[1] operator[:] { identifier[AdobePathSegment] identifier[next] operator[=] identifier[points] operator[SEP] identifier[get] operator[SEP] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[subpath] operator[SEP] identifier[curveTo] operator[SEP] identifier[current] operator[SEP] identifier[cplx] , identifier[current] operator[SEP] identifier[cply] , identifier[next] operator[SEP] identifier[cppx] , identifier[next] operator[SEP] identifier[cppy] , identifier[next] operator[SEP] identifier[apx] , identifier[next] operator[SEP] identifier[apy] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[case] Other[2] operator[:] { identifier[AdobePathSegment] identifier[first] operator[=] identifier[points] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[first] operator[SEP] identifier[selector] operator[==] identifier[AdobePathSegment] operator[SEP] identifier[CLOSED_SUBPATH_BEZIER_LINKED] operator[||] identifier[first] operator[SEP] identifier[selector] operator[==] identifier[AdobePathSegment] operator[SEP] identifier[CLOSED_SUBPATH_BEZIER_UNLINKED] operator[SEP] { identifier[subpath] operator[SEP] identifier[curveTo] operator[SEP] identifier[current] operator[SEP] identifier[cplx] , identifier[current] operator[SEP] identifier[cply] , identifier[first] operator[SEP] identifier[cppx] , identifier[first] operator[SEP] identifier[cppy] , identifier[first] operator[SEP] identifier[apx] , identifier[first] operator[SEP] identifier[apy] operator[SEP] operator[SEP] identifier[subpath] operator[SEP] identifier[closePath] operator[SEP] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[append] operator[SEP] identifier[subpath] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[subpath] operator[SEP] identifier[lineTo] operator[SEP] identifier[current] operator[SEP] identifier[apx] , identifier[current] operator[SEP] identifier[apy] operator[SEP] operator[SEP] identifier[path] operator[SEP] identifier[append] operator[SEP] identifier[subpath] , literal[boolean] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } } } } Keyword[return] identifier[path] operator[SEP] }
private void parseSinglePattern(String pattern) { final String[] parts = pattern.split("\\s"); int offset = 0;// 偏移量用于兼容Quartz表达式,当表达式有6或7项时,第一项为秒 if (parts.length == 6 || parts.length == 7) { offset = 1; } else if (parts.length != 5) { throw new CronException("Pattern [{}] is invalid, it must be 5-7 parts!", pattern); } // 秒 if (1 == offset) {// 支持秒的表达式 try { this.secondMatchers.add(ValueMatcherBuilder.build(parts[0], SECOND_VALUE_PARSER)); } catch (Exception e) { throw new CronException(e, "Invalid pattern [{}], parsing 'second' field error!", pattern); } } else {// 不支持秒的表达式,则第一位按照表达式生成时间的秒数赋值,表示整分匹配 this.secondMatchers.add(ValueMatcherBuilder.build(String.valueOf(DateUtil.date().second()), SECOND_VALUE_PARSER)); } // 分 try { this.minuteMatchers.add(ValueMatcherBuilder.build(parts[0 + offset], MINUTE_VALUE_PARSER)); } catch (Exception e) { throw new CronException(e, "Invalid pattern [{}], parsing 'minute' field error!", pattern); } // 小时 try { this.hourMatchers.add(ValueMatcherBuilder.build(parts[1 + offset], HOUR_VALUE_PARSER)); } catch (Exception e) { throw new CronException(e, "Invalid pattern [{}], parsing 'hour' field error!", pattern); } // 每月第几天 try { this.dayOfMonthMatchers.add(ValueMatcherBuilder.build(parts[2 + offset], DAY_OF_MONTH_VALUE_PARSER)); } catch (Exception e) { throw new CronException(e, "Invalid pattern [{}], parsing 'day of month' field error!", pattern); } // 月 try { this.monthMatchers.add(ValueMatcherBuilder.build(parts[3 + offset], MONTH_VALUE_PARSER)); } catch (Exception e) { throw new CronException(e, "Invalid pattern [{}], parsing 'month' field error!", pattern); } // 星期几 try { this.dayOfWeekMatchers.add(ValueMatcherBuilder.build(parts[4 + offset], DAY_OF_WEEK_VALUE_PARSER)); } catch (Exception e) { throw new CronException(e, "Invalid pattern [{}], parsing 'day of week' field error!", pattern); } // 年 if (parts.length == 7) {// 支持年的表达式 try { this.yearMatchers.add(ValueMatcherBuilder.build(parts[6], YEAR_VALUE_PARSER)); } catch (Exception e) { throw new CronException(e, "Invalid pattern [{}], parsing 'year' field error!", pattern); } } else {// 不支持年的表达式,全部匹配 this.secondMatchers.add(new AlwaysTrueValueMatcher()); } matcherSize++; }
class class_name[name] begin[{] method[parseSinglePattern, return_type[void], modifier[private], parameter[pattern]] begin[{] local_variable[type[String], parts] local_variable[type[int], offset] if[binary_operation[binary_operation[member[parts.length], ==, literal[6]], ||, binary_operation[member[parts.length], ==, literal[7]]]] begin[{] assign[member[.offset], literal[1]] else begin[{] if[binary_operation[member[parts.length], !=, literal[5]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Pattern [{}] is invalid, it must be 5-7 parts!"), MemberReference(member=pattern, 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=CronException, sub_type=None)), label=None) else begin[{] None end[}] end[}] if[binary_operation[literal[1], ==, member[.offset]]] begin[{] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=secondMatchers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=SECOND_VALUE_PARSER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=ValueMatcherBuilder, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid pattern [{}], parsing 'second' field error!"), MemberReference(member=pattern, 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=CronException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] THIS[member[None.secondMatchers]call[None.add, parameter[call[ValueMatcherBuilder.build, parameter[call[String.valueOf, parameter[call[DateUtil.date, parameter[]]]], member[.SECOND_VALUE_PARSER]]]]]] end[}] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=minuteMatchers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), MemberReference(member=MINUTE_VALUE_PARSER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=ValueMatcherBuilder, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid pattern [{}], parsing 'minute' field error!"), MemberReference(member=pattern, 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=CronException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=hourMatchers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), MemberReference(member=HOUR_VALUE_PARSER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=ValueMatcherBuilder, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid pattern [{}], parsing 'hour' field error!"), MemberReference(member=pattern, 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=CronException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dayOfMonthMatchers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), MemberReference(member=DAY_OF_MONTH_VALUE_PARSER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=ValueMatcherBuilder, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid pattern [{}], parsing 'day of month' field error!"), MemberReference(member=pattern, 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=CronException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=monthMatchers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), MemberReference(member=MONTH_VALUE_PARSER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=ValueMatcherBuilder, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid pattern [{}], parsing 'month' field error!"), MemberReference(member=pattern, 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=CronException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=dayOfWeekMatchers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), MemberReference(member=DAY_OF_WEEK_VALUE_PARSER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=ValueMatcherBuilder, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid pattern [{}], parsing 'day of week' field error!"), MemberReference(member=pattern, 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=CronException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) if[binary_operation[member[parts.length], ==, literal[7]]] begin[{] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=yearMatchers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6))]), MemberReference(member=YEAR_VALUE_PARSER, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=build, postfix_operators=[], prefix_operators=[], qualifier=ValueMatcherBuilder, selectors=[], type_arguments=None)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid pattern [{}], parsing 'year' field error!"), MemberReference(member=pattern, 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=CronException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) else begin[{] THIS[member[None.secondMatchers]call[None.add, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AlwaysTrueValueMatcher, sub_type=None))]]] end[}] member[.matcherSize] end[}] END[}]
Keyword[private] Keyword[void] identifier[parseSinglePattern] operator[SEP] identifier[String] identifier[pattern] operator[SEP] { Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[parts] operator[=] identifier[pattern] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[offset] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[==] Other[6] operator[||] identifier[parts] operator[SEP] identifier[length] operator[==] Other[7] operator[SEP] { identifier[offset] operator[=] Other[1] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[!=] Other[5] operator[SEP] { Keyword[throw] Keyword[new] identifier[CronException] operator[SEP] literal[String] , identifier[pattern] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Other[1] operator[==] identifier[offset] operator[SEP] { Keyword[try] { Keyword[this] operator[SEP] identifier[secondMatchers] operator[SEP] identifier[add] operator[SEP] identifier[ValueMatcherBuilder] operator[SEP] identifier[build] operator[SEP] identifier[parts] operator[SEP] Other[0] operator[SEP] , identifier[SECOND_VALUE_PARSER] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CronException] operator[SEP] identifier[e] , literal[String] , identifier[pattern] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[this] operator[SEP] identifier[secondMatchers] operator[SEP] identifier[add] operator[SEP] identifier[ValueMatcherBuilder] operator[SEP] identifier[build] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[DateUtil] operator[SEP] identifier[date] operator[SEP] operator[SEP] operator[SEP] identifier[second] operator[SEP] operator[SEP] operator[SEP] , identifier[SECOND_VALUE_PARSER] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { Keyword[this] operator[SEP] identifier[minuteMatchers] operator[SEP] identifier[add] operator[SEP] identifier[ValueMatcherBuilder] operator[SEP] identifier[build] operator[SEP] identifier[parts] operator[SEP] Other[0] operator[+] identifier[offset] operator[SEP] , identifier[MINUTE_VALUE_PARSER] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CronException] operator[SEP] identifier[e] , literal[String] , identifier[pattern] operator[SEP] operator[SEP] } Keyword[try] { Keyword[this] operator[SEP] identifier[hourMatchers] operator[SEP] identifier[add] operator[SEP] identifier[ValueMatcherBuilder] operator[SEP] identifier[build] operator[SEP] identifier[parts] operator[SEP] Other[1] operator[+] identifier[offset] operator[SEP] , identifier[HOUR_VALUE_PARSER] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CronException] operator[SEP] identifier[e] , literal[String] , identifier[pattern] operator[SEP] operator[SEP] } Keyword[try] { Keyword[this] operator[SEP] identifier[dayOfMonthMatchers] operator[SEP] identifier[add] operator[SEP] identifier[ValueMatcherBuilder] operator[SEP] identifier[build] operator[SEP] identifier[parts] operator[SEP] Other[2] operator[+] identifier[offset] operator[SEP] , identifier[DAY_OF_MONTH_VALUE_PARSER] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CronException] operator[SEP] identifier[e] , literal[String] , identifier[pattern] operator[SEP] operator[SEP] } Keyword[try] { Keyword[this] operator[SEP] identifier[monthMatchers] operator[SEP] identifier[add] operator[SEP] identifier[ValueMatcherBuilder] operator[SEP] identifier[build] operator[SEP] identifier[parts] operator[SEP] Other[3] operator[+] identifier[offset] operator[SEP] , identifier[MONTH_VALUE_PARSER] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CronException] operator[SEP] identifier[e] , literal[String] , identifier[pattern] operator[SEP] operator[SEP] } Keyword[try] { Keyword[this] operator[SEP] identifier[dayOfWeekMatchers] operator[SEP] identifier[add] operator[SEP] identifier[ValueMatcherBuilder] operator[SEP] identifier[build] operator[SEP] identifier[parts] operator[SEP] Other[4] operator[+] identifier[offset] operator[SEP] , identifier[DAY_OF_WEEK_VALUE_PARSER] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CronException] operator[SEP] identifier[e] , literal[String] , identifier[pattern] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[parts] operator[SEP] identifier[length] operator[==] Other[7] operator[SEP] { Keyword[try] { Keyword[this] operator[SEP] identifier[yearMatchers] operator[SEP] identifier[add] operator[SEP] identifier[ValueMatcherBuilder] operator[SEP] identifier[build] operator[SEP] identifier[parts] operator[SEP] Other[6] operator[SEP] , identifier[YEAR_VALUE_PARSER] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[CronException] operator[SEP] identifier[e] , literal[String] , identifier[pattern] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[this] operator[SEP] identifier[secondMatchers] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[AlwaysTrueValueMatcher] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[matcherSize] operator[++] operator[SEP] }
public static EigenDecomposition_F64<DMatrixRMaj> eig(int matrixSize , boolean computeVectors , boolean isSymmetric ) { if( isSymmetric ) { TridiagonalSimilarDecomposition_F64<DMatrixRMaj> decomp = DecompositionFactory_DDRM.tridiagonal(matrixSize); return new SymmetricQRAlgorithmDecomposition_DDRM(decomp,computeVectors); } else return new WatchedDoubleStepQRDecomposition_DDRM(computeVectors); }
class class_name[name] begin[{] method[eig, return_type[type[EigenDecomposition_F64]], modifier[public static], parameter[matrixSize, computeVectors, isSymmetric]] begin[{] if[member[.isSymmetric]] begin[{] local_variable[type[TridiagonalSimilarDecomposition_F64], decomp] return[ClassCreator(arguments=[MemberReference(member=decomp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=computeVectors, 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=SymmetricQRAlgorithmDecomposition_DDRM, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MemberReference(member=computeVectors, 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=WatchedDoubleStepQRDecomposition_DDRM, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[EigenDecomposition_F64] operator[<] identifier[DMatrixRMaj] operator[>] identifier[eig] operator[SEP] Keyword[int] identifier[matrixSize] , Keyword[boolean] identifier[computeVectors] , Keyword[boolean] identifier[isSymmetric] operator[SEP] { Keyword[if] operator[SEP] identifier[isSymmetric] operator[SEP] { identifier[TridiagonalSimilarDecomposition_F64] operator[<] identifier[DMatrixRMaj] operator[>] identifier[decomp] operator[=] identifier[DecompositionFactory_DDRM] operator[SEP] identifier[tridiagonal] operator[SEP] identifier[matrixSize] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[SymmetricQRAlgorithmDecomposition_DDRM] operator[SEP] identifier[decomp] , identifier[computeVectors] operator[SEP] operator[SEP] } Keyword[else] Keyword[return] Keyword[new] identifier[WatchedDoubleStepQRDecomposition_DDRM] operator[SEP] identifier[computeVectors] operator[SEP] operator[SEP] }
public boolean remove(final long value) { int index = longHash(value, mask); while (values[index] != missingValue) { if (values[index] == value) { values[index] = missingValue; compactChain(index); size--; return true; } index = next(index); } return false; }
class class_name[name] begin[{] method[remove, return_type[type[boolean]], modifier[public], parameter[value]] begin[{] local_variable[type[int], index] while[binary_operation[member[.values], !=, member[.missingValue]]] begin[{] if[binary_operation[member[.values], ==, member[.value]]] begin[{] assign[member[.values], member[.missingValue]] call[.compactChain, parameter[member[.index]]] member[.size] return[literal[true]] else begin[{] None end[}] assign[member[.index], call[.next, parameter[member[.index]]]] end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[remove] operator[SEP] Keyword[final] Keyword[long] identifier[value] operator[SEP] { Keyword[int] identifier[index] operator[=] identifier[longHash] operator[SEP] identifier[value] , identifier[mask] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[values] operator[SEP] identifier[index] operator[SEP] operator[!=] identifier[missingValue] operator[SEP] { Keyword[if] operator[SEP] identifier[values] operator[SEP] identifier[index] operator[SEP] operator[==] identifier[value] operator[SEP] { identifier[values] operator[SEP] identifier[index] operator[SEP] operator[=] identifier[missingValue] operator[SEP] identifier[compactChain] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[size] operator[--] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } identifier[index] operator[=] identifier[next] operator[SEP] identifier[index] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static <T> List<Tag<T>> fromMap(Map<? extends String, T> tagsMap) { ImmutableList.Builder<Tag<T>> tagsBuilder = ImmutableList.builder(); for (Map.Entry<? extends String, T> entry : tagsMap.entrySet()) { tagsBuilder.add(new Tag<>(entry)); } return tagsBuilder.build(); }
class class_name[name] begin[{] method[fromMap, return_type[type[List]], modifier[public static], parameter[tagsMap]] begin[{] local_variable[type[ImmutableList], tagsBuilder] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=entry, 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=Tag, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=tagsBuilder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=tagsMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[call[tagsBuilder.build, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[Tag] operator[<] identifier[T] operator[>] operator[>] identifier[fromMap] operator[SEP] identifier[Map] operator[<] operator[?] Keyword[extends] identifier[String] , identifier[T] operator[>] identifier[tagsMap] operator[SEP] { identifier[ImmutableList] operator[SEP] identifier[Builder] operator[<] identifier[Tag] operator[<] identifier[T] operator[>] operator[>] identifier[tagsBuilder] operator[=] identifier[ImmutableList] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] operator[?] Keyword[extends] identifier[String] , identifier[T] operator[>] identifier[entry] operator[:] identifier[tagsMap] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[tagsBuilder] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Tag] operator[<] operator[>] operator[SEP] identifier[entry] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[tagsBuilder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public static String concatSortedPercentEncodedParams(Map<String, String> params) { StringBuilder result = new StringBuilder(); for (Map.Entry<String, String> entry : params.entrySet()) { result.append(entry.getKey()).append(PAIR_SEPARATOR); result.append(entry.getValue()).append(PARAM_SEPARATOR); } return result.toString().substring(0, result.length() - 1); }
class class_name[name] begin[{] method[concatSortedPercentEncodedParams, return_type[type[String]], modifier[public static], parameter[params]] begin[{] local_variable[type[StringBuilder], result] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[MemberReference(member=PAIR_SEPARATOR, 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=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[MemberReference(member=PARAM_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[concatSortedPercentEncodedParams] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[SEP] { identifier[StringBuilder] identifier[result] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[String] operator[>] identifier[entry] operator[:] identifier[params] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[PAIR_SEPARATOR] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[append] operator[SEP] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[PARAM_SEPARATOR] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[result] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] }
private boolean shouldFilterJobStatus(List<String> tableNames, String tableName) { return tableNames.size() > 1 && JobStatusRetriever.NA_KEY .equals(Splitter.on(KafkaJobStatusMonitor.STATE_STORE_KEY_SEPARATION_CHARACTER).splitToList(tableName).get(1)); }
class class_name[name] begin[{] method[shouldFilterJobStatus, return_type[type[boolean]], modifier[private], parameter[tableNames, tableName]] begin[{] return[binary_operation[binary_operation[call[tableNames.size, parameter[]], >, literal[1]], &&, call[JobStatusRetriever.NA_KEY.equals, parameter[call[Splitter.on, parameter[member[KafkaJobStatusMonitor.STATE_STORE_KEY_SEPARATION_CHARACTER]]]]]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[shouldFilterJobStatus] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[tableNames] , identifier[String] identifier[tableName] operator[SEP] { Keyword[return] identifier[tableNames] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[&&] identifier[JobStatusRetriever] operator[SEP] identifier[NA_KEY] operator[SEP] identifier[equals] operator[SEP] identifier[Splitter] operator[SEP] identifier[on] operator[SEP] identifier[KafkaJobStatusMonitor] operator[SEP] identifier[STATE_STORE_KEY_SEPARATION_CHARACTER] operator[SEP] operator[SEP] identifier[splitToList] operator[SEP] identifier[tableName] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] }
@Override public R getLocalResult() { if (isRoot()) { R answer = sharedResult.get(); return (answer == null) ? getEmptyResult() : answer; } else return super.getLocalResult(); }
class class_name[name] begin[{] method[getLocalResult, return_type[type[R]], modifier[public], parameter[]] begin[{] if[call[.isRoot, parameter[]]] begin[{] local_variable[type[R], answer] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=answer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=answer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=getEmptyResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None))] else begin[{] return[SuperMethodInvocation(arguments=[], member=getLocalResult, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[R] identifier[getLocalResult] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[isRoot] operator[SEP] operator[SEP] operator[SEP] { identifier[R] identifier[answer] operator[=] identifier[sharedResult] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[answer] operator[==] Other[null] operator[SEP] operator[?] identifier[getEmptyResult] operator[SEP] operator[SEP] operator[:] identifier[answer] operator[SEP] } Keyword[else] Keyword[return] Keyword[super] operator[SEP] identifier[getLocalResult] operator[SEP] operator[SEP] operator[SEP] }
final void verifyExistingDestination() { PartitionReplica destination = migrationInfo.getDestination(); Member target = getNodeEngine().getClusterService().getMember(destination.address(), destination.uuid()); if (target == null) { throw new TargetNotMemberException("Destination of migration could not be found! => " + toString()); } }
class class_name[name] begin[{] method[verifyExistingDestination, return_type[void], modifier[final], parameter[]] begin[{] local_variable[type[PartitionReplica], destination] local_variable[type[Member], target] if[binary_operation[member[.target], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Destination of migration could not be found! => "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TargetNotMemberException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[final] Keyword[void] identifier[verifyExistingDestination] operator[SEP] operator[SEP] { identifier[PartitionReplica] identifier[destination] operator[=] identifier[migrationInfo] operator[SEP] identifier[getDestination] operator[SEP] operator[SEP] operator[SEP] identifier[Member] identifier[target] operator[=] identifier[getNodeEngine] operator[SEP] operator[SEP] operator[SEP] identifier[getClusterService] operator[SEP] operator[SEP] operator[SEP] identifier[getMember] operator[SEP] identifier[destination] operator[SEP] identifier[address] operator[SEP] operator[SEP] , identifier[destination] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[target] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[TargetNotMemberException] operator[SEP] literal[String] operator[+] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
private static void addEJBInterceptorMethod(ClassWriter cw, String className, String implClassName, Method method) throws EJBConfigurationException { GeneratorAdapter mg; String methodName = method.getName(); String methodSignature = MethodAttribUtils.jdiMethodSignature(method); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, INDENT + "adding method : " + methodName + " " + methodSignature + " : isBridge = " + method.isBridge() + " : aroundInvoke = true"); // Determine the list of all exceptions, which will be on the throws // clause of the proxy method. This will be all of the exceptions // on the bean implementation method throws clause. This may not be // the same as the throws clause of the corresponding method on the // enpoint interface (if present), as the endpoint interface methods // may also throw RemoteException. A Proxy represents the actual // bean implementation, unlike a Wrapper, which represents the // interface. Class<?>[] methodExceptions = method.getExceptionTypes(); // Determine the list of 'checked' exceptions, which will need to have // catch blocks in the proxy. Exceptions that are subclasses of other // 'checked' exceptions will be eliminated, to avoid 'unreachable' code. Class<?>[] checkedExceptions = sortExceptions(methodExceptions, true); // Convert the return value, arguments, and exception classes to // ASM Type objects, and create the ASM Method object which will // be used to actually add the method and method code. Type returnType = Type.getType(method.getReturnType()); Type[] argTypes = getTypes(method.getParameterTypes()); Type[] exceptionTypes = getTypes(methodExceptions); org.objectweb.asm.commons.Method m = new org.objectweb.asm.commons.Method(methodName, returnType, argTypes); // Create an ASM GeneratorAdapter object for the ASM Method, which // makes generating dynamic code much easier... as it keeps track // of the position of the arguements and local variables, etc. mg = new GeneratorAdapter(ACC_PUBLIC, m, null, exceptionTypes, cw); // ----------------------------------------------------------------------- // Begin Method Code... // ----------------------------------------------------------------------- mg.visitCode(); // ----------------------------------------------------------------------- // <return type> returnValue = false | 0 | null; // ----------------------------------------------------------------------- int returnValue = -1; if (returnType != Type.VOID_TYPE) { returnValue = mg.newLocal(returnType); switch (returnType.getSort()) { case Type.BOOLEAN: mg.push(false); break; case Type.CHAR: case Type.BYTE: case Type.SHORT: case Type.INT: mg.push(0); break; case Type.FLOAT: mg.push((float) 0); break; case Type.LONG: mg.push((long) 0); break; case Type.DOUBLE: mg.push((double) 0); break; // ARRAY & OBJECT - push a null on the stack default: mg.visitInsn(ACONST_NULL); break; } mg.storeLocal(returnValue); } // ----------------------------------------------------------------------- // Parameters were not available during preInvoke, so must be captured // here to pass to the around invoke interceptor processing. d507967 // // Object[] args = new Object[# of args]; // args[i] = "parameter"; -> for each parameter // ----------------------------------------------------------------------- int args = createParameterArray(mg, argTypes); // ----------------------------------------------------------------------- // Now invoke the business method; // - Through the interceptors via EJSContainer.invoke() // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- // try // { // ----------------------------------------------------------------------- Label main_try_begin = new Label(); mg.visitLabel(main_try_begin); // -------------------------------------------------------------------- // ivContainer.invoke(s, args); // or // rtnValue = (type)ivContainer.invoke(s, args); // or // rtnValue = ((object type)ivContainer.invoke(s, args)).<type>Value(); // unbox // -------------------------------------------------------------------- mg.loadThis(); mg.visitFieldInsn(GETFIELD, className, "ivContainer", "Lcom/ibm/ejs/container/EJSContainer;"); mg.loadThis(); mg.visitFieldInsn(GETFIELD, className, "ivMethodContext", "Lcom/ibm/ejs/container/EJSDeployedSupport;"); mg.loadLocal(args); // d507967 mg.visitMethodInsn(INVOKEVIRTUAL, "com/ibm/ejs/container/EJSContainer", "invoke", "(Lcom/ibm/ejs/container/EJSDeployedSupport;[Ljava/lang/Object;)Ljava/lang/Object;"); if (returnType == Type.VOID_TYPE) { // No return value, just pop the returned value (null) off the stack mg.pop(); } else { // Unbox any primitive values or add the appropriate cast // for object/array values, and then store in local variable. unbox(mg, returnType); mg.storeLocal(returnValue); } // ----------------------------------------------------------------------- // } // end of try // ----------------------------------------------------------------------- Label main_try_end = new Label(); mg.visitLabel(main_try_end); // mark the end Label main_tcf_exit = new Label(); mg.visitJumpInsn(GOTO, main_tcf_exit); // Skip to very end // ----------------------------------------------------------------------- // Appear as if bean instance was called directly and just re-throw. // // catch (<checked exception> <ex>) -> for each <checked exception> // { // throw <ex>; // } // ----------------------------------------------------------------------- Label[] main_catch_label = new Label[checkedExceptions.length]; int caught_ex = mg.newLocal(TYPE_Exception); for (int i = 0; i < checkedExceptions.length; i++) { main_catch_label[i] = new Label(); mg.visitLabel(main_catch_label[i]); mg.storeLocal(caught_ex); mg.loadLocal(caught_ex); mg.visitInsn(ATHROW); } // ----------------------------------------------------------------------- // Appear as if bean instance was called directly and just re-throw. // // catch (RuntimeException <ex>) // { // throw <ex>; // } // ----------------------------------------------------------------------- Label main_catch_runtime = new Label(); mg.visitLabel(main_catch_runtime); mg.storeLocal(caught_ex); mg.loadLocal(caught_ex); mg.visitInsn(ATHROW); // ----------------------------------------------------------------------- // Appear as if bean instance was called directly and just re-throw. // // catch (Error <ex>) // { // throw <ex>; // } // ----------------------------------------------------------------------- Label main_catch_error = new Label(); mg.visitLabel(main_catch_error); mg.storeLocal(caught_ex); mg.loadLocal(caught_ex); mg.visitInsn(ATHROW); // ----------------------------------------------------------------------- // Bean instance could not possibly have thrown this (unless Throwable // itself), so this must be coming from a poorly behaving interceptor. // This is a spec violation and cannot be reported dirctly. Do the best // we can, and wrap it in an EJBException (i.e. RuntimeException). // // catch (Throwable <ex>) // { // throw ExceptionUtil.EJBException( <ex> ); // } // ----------------------------------------------------------------------- Label main_catch_throwable = new Label(); mg.visitLabel(main_catch_throwable); mg.storeLocal(caught_ex); mg.loadLocal(caught_ex); mg.visitMethodInsn(INVOKESTATIC, "com/ibm/ejs/container/util/ExceptionUtil", "EJBException", "(Ljava/lang/Throwable;)Ljavax/ejb/EJBException;"); mg.visitInsn(ATHROW); // ----------------------------------------------------------------------- // } // end of try / catch / finally // ----------------------------------------------------------------------- mg.visitLabel(main_tcf_exit); // ----------------------------------------------------------------------- // return // ----------------------------------------------------------------------- if (returnType != Type.VOID_TYPE) { mg.loadLocal(returnValue); } mg.returnValue(); // ----------------------------------------------------------------------- // All Try-Catch-Finally definitions for above // ----------------------------------------------------------------------- for (int i = 0; i < checkedExceptions.length; i++) { mg.visitTryCatchBlock(main_try_begin, main_try_end, main_catch_label[i], convertClassName(checkedExceptions[i].getName())); } mg.visitTryCatchBlock(main_try_begin, main_try_end, main_catch_runtime, "java/lang/RuntimeException"); mg.visitTryCatchBlock(main_try_begin, main_try_end, main_catch_error, "java/lang/Error"); mg.visitTryCatchBlock(main_try_begin, main_try_end, main_catch_throwable, "java/lang/Throwable"); // ----------------------------------------------------------------------- // End Method Code... // ----------------------------------------------------------------------- mg.endMethod(); // GeneratorAdapter accounts for visitMaxs(x,y) mg.visitEnd(); }
class class_name[name] begin[{] method[addEJBInterceptorMethod, return_type[void], modifier[private static], parameter[cw, className, implClassName, method]] begin[{] local_variable[type[GeneratorAdapter], mg] local_variable[type[String], methodName] local_variable[type[String], methodSignature] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.INDENT], +, literal["adding method : "]], +, member[.methodName]], +, literal[" "]], +, member[.methodSignature]], +, literal[" : isBridge = "]], +, call[method.isBridge, parameter[]]], +, literal[" : aroundInvoke = true"]]]] else begin[{] None end[}] local_variable[type[Class], methodExceptions] local_variable[type[Class], checkedExceptions] local_variable[type[Type], returnType] local_variable[type[Type], argTypes] local_variable[type[Type], exceptionTypes] local_variable[type[org], m] assign[member[.mg], ClassCreator(arguments=[MemberReference(member=ACC_PUBLIC, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=exceptionTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cw, 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=GeneratorAdapter, sub_type=None))] call[mg.visitCode, parameter[]] local_variable[type[int], returnValue] if[binary_operation[member[.returnType], !=, member[Type.VOID_TYPE]]] begin[{] assign[member[.returnValue], call[mg.newLocal, parameter[member[.returnType]]]] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=BOOLEAN, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=push, postfix_operators=[], prefix_operators=[], qualifier=mg, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=CHAR, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[]), MemberReference(member=BYTE, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[]), MemberReference(member=SHORT, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[]), MemberReference(member=INT, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=push, postfix_operators=[], prefix_operators=[], qualifier=mg, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=FLOAT, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), type=BasicType(dimensions=[], name=float))], member=push, postfix_operators=[], prefix_operators=[], qualifier=mg, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=LONG, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), type=BasicType(dimensions=[], name=long))], member=push, postfix_operators=[], prefix_operators=[], qualifier=mg, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=DOUBLE, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), type=BasicType(dimensions=[], name=double))], member=push, postfix_operators=[], prefix_operators=[], qualifier=mg, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ACONST_NULL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitInsn, postfix_operators=[], prefix_operators=[], qualifier=mg, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getSort, postfix_operators=[], prefix_operators=[], qualifier=returnType, selectors=[], type_arguments=None), label=None) call[mg.storeLocal, parameter[member[.returnValue]]] else begin[{] None end[}] local_variable[type[int], args] local_variable[type[Label], main_try_begin] call[mg.visitLabel, parameter[member[.main_try_begin]]] call[mg.loadThis, parameter[]] call[mg.visitFieldInsn, parameter[member[.GETFIELD], member[.className], literal["ivContainer"], literal["Lcom/ibm/ejs/container/EJSContainer;"]]] call[mg.loadThis, parameter[]] call[mg.visitFieldInsn, parameter[member[.GETFIELD], member[.className], literal["ivMethodContext"], literal["Lcom/ibm/ejs/container/EJSDeployedSupport;"]]] call[mg.loadLocal, parameter[member[.args]]] call[mg.visitMethodInsn, parameter[member[.INVOKEVIRTUAL], literal["com/ibm/ejs/container/EJSContainer"], literal["invoke"], literal["(Lcom/ibm/ejs/container/EJSDeployedSupport;[Ljava/lang/Object;)Ljava/lang/Object;"]]] if[binary_operation[member[.returnType], ==, member[Type.VOID_TYPE]]] begin[{] call[mg.pop, parameter[]] else begin[{] call[.unbox, parameter[member[.mg], member[.returnType]]] call[mg.storeLocal, parameter[member[.returnValue]]] end[}] local_variable[type[Label], main_try_end] call[mg.visitLabel, parameter[member[.main_try_end]]] local_variable[type[Label], main_tcf_exit] call[mg.visitJumpInsn, parameter[member[.GOTO], member[.main_tcf_exit]]] local_variable[type[Label], main_catch_label] local_variable[type[int], caught_ex] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=main_catch_label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Label, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=main_catch_label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=visitLabel, postfix_operators=[], prefix_operators=[], qualifier=mg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=caught_ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=storeLocal, postfix_operators=[], prefix_operators=[], qualifier=mg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=caught_ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadLocal, postfix_operators=[], prefix_operators=[], qualifier=mg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ATHROW, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=visitInsn, postfix_operators=[], prefix_operators=[], qualifier=mg, 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=checkedExceptions, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[Label], main_catch_runtime] call[mg.visitLabel, parameter[member[.main_catch_runtime]]] call[mg.storeLocal, parameter[member[.caught_ex]]] call[mg.loadLocal, parameter[member[.caught_ex]]] call[mg.visitInsn, parameter[member[.ATHROW]]] local_variable[type[Label], main_catch_error] call[mg.visitLabel, parameter[member[.main_catch_error]]] call[mg.storeLocal, parameter[member[.caught_ex]]] call[mg.loadLocal, parameter[member[.caught_ex]]] call[mg.visitInsn, parameter[member[.ATHROW]]] local_variable[type[Label], main_catch_throwable] call[mg.visitLabel, parameter[member[.main_catch_throwable]]] call[mg.storeLocal, parameter[member[.caught_ex]]] call[mg.loadLocal, parameter[member[.caught_ex]]] call[mg.visitMethodInsn, parameter[member[.INVOKESTATIC], literal["com/ibm/ejs/container/util/ExceptionUtil"], literal["EJBException"], literal["(Ljava/lang/Throwable;)Ljavax/ejb/EJBException;"]]] call[mg.visitInsn, parameter[member[.ATHROW]]] call[mg.visitLabel, parameter[member[.main_tcf_exit]]] if[binary_operation[member[.returnType], !=, member[Type.VOID_TYPE]]] begin[{] call[mg.loadLocal, parameter[member[.returnValue]]] else begin[{] None end[}] call[mg.returnValue, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=main_try_begin, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=main_try_end, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=main_catch_label, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MethodInvocation(arguments=[MemberReference(member=checkedExceptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=convertClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=visitTryCatchBlock, postfix_operators=[], prefix_operators=[], qualifier=mg, 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=checkedExceptions, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[mg.visitTryCatchBlock, parameter[member[.main_try_begin], member[.main_try_end], member[.main_catch_runtime], literal["java/lang/RuntimeException"]]] call[mg.visitTryCatchBlock, parameter[member[.main_try_begin], member[.main_try_end], member[.main_catch_error], literal["java/lang/Error"]]] call[mg.visitTryCatchBlock, parameter[member[.main_try_begin], member[.main_try_end], member[.main_catch_throwable], literal["java/lang/Throwable"]]] call[mg.endMethod, parameter[]] call[mg.visitEnd, parameter[]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[addEJBInterceptorMethod] operator[SEP] identifier[ClassWriter] identifier[cw] , identifier[String] identifier[className] , identifier[String] identifier[implClassName] , identifier[Method] identifier[method] operator[SEP] Keyword[throws] identifier[EJBConfigurationException] { identifier[GeneratorAdapter] identifier[mg] operator[SEP] identifier[String] identifier[methodName] operator[=] identifier[method] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[methodSignature] operator[=] identifier[MethodAttribUtils] operator[SEP] identifier[jdiMethodSignature] operator[SEP] identifier[method] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[INDENT] operator[+] literal[String] operator[+] identifier[methodName] operator[+] literal[String] operator[+] identifier[methodSignature] operator[+] literal[String] operator[+] identifier[method] operator[SEP] identifier[isBridge] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[methodExceptions] operator[=] identifier[method] operator[SEP] identifier[getExceptionTypes] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[checkedExceptions] operator[=] identifier[sortExceptions] operator[SEP] identifier[methodExceptions] , literal[boolean] operator[SEP] operator[SEP] identifier[Type] identifier[returnType] operator[=] identifier[Type] operator[SEP] identifier[getType] operator[SEP] identifier[method] operator[SEP] identifier[getReturnType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Type] operator[SEP] operator[SEP] identifier[argTypes] operator[=] identifier[getTypes] operator[SEP] identifier[method] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Type] operator[SEP] operator[SEP] identifier[exceptionTypes] operator[=] identifier[getTypes] operator[SEP] identifier[methodExceptions] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[objectweb] operator[SEP] identifier[asm] operator[SEP] identifier[commons] operator[SEP] identifier[Method] identifier[m] operator[=] Keyword[new] identifier[org] operator[SEP] identifier[objectweb] operator[SEP] identifier[asm] operator[SEP] identifier[commons] operator[SEP] identifier[Method] operator[SEP] identifier[methodName] , identifier[returnType] , identifier[argTypes] operator[SEP] operator[SEP] identifier[mg] operator[=] Keyword[new] identifier[GeneratorAdapter] operator[SEP] identifier[ACC_PUBLIC] , identifier[m] , Other[null] , identifier[exceptionTypes] , identifier[cw] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitCode] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[returnValue] operator[=] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[returnType] operator[!=] identifier[Type] operator[SEP] identifier[VOID_TYPE] operator[SEP] { identifier[returnValue] operator[=] identifier[mg] operator[SEP] identifier[newLocal] operator[SEP] identifier[returnType] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[returnType] operator[SEP] identifier[getSort] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[Type] operator[SEP] identifier[BOOLEAN] operator[:] identifier[mg] operator[SEP] identifier[push] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Type] operator[SEP] identifier[CHAR] operator[:] Keyword[case] identifier[Type] operator[SEP] identifier[BYTE] operator[:] Keyword[case] identifier[Type] operator[SEP] identifier[SHORT] operator[:] Keyword[case] identifier[Type] operator[SEP] identifier[INT] operator[:] identifier[mg] operator[SEP] identifier[push] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Type] operator[SEP] identifier[FLOAT] operator[:] identifier[mg] operator[SEP] identifier[push] operator[SEP] operator[SEP] Keyword[float] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Type] operator[SEP] identifier[LONG] operator[:] identifier[mg] operator[SEP] identifier[push] operator[SEP] operator[SEP] Keyword[long] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[Type] operator[SEP] identifier[DOUBLE] operator[:] identifier[mg] operator[SEP] identifier[push] operator[SEP] operator[SEP] Keyword[double] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[mg] operator[SEP] identifier[visitInsn] operator[SEP] identifier[ACONST_NULL] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[mg] operator[SEP] identifier[storeLocal] operator[SEP] identifier[returnValue] operator[SEP] operator[SEP] } Keyword[int] identifier[args] operator[=] identifier[createParameterArray] operator[SEP] identifier[mg] , identifier[argTypes] operator[SEP] operator[SEP] identifier[Label] identifier[main_try_begin] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitLabel] operator[SEP] identifier[main_try_begin] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[loadThis] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitFieldInsn] operator[SEP] identifier[GETFIELD] , identifier[className] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[loadThis] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitFieldInsn] operator[SEP] identifier[GETFIELD] , identifier[className] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[loadLocal] operator[SEP] identifier[args] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitMethodInsn] operator[SEP] identifier[INVOKEVIRTUAL] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[returnType] operator[==] identifier[Type] operator[SEP] identifier[VOID_TYPE] operator[SEP] { identifier[mg] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[unbox] operator[SEP] identifier[mg] , identifier[returnType] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[storeLocal] operator[SEP] identifier[returnValue] operator[SEP] operator[SEP] } identifier[Label] identifier[main_try_end] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitLabel] operator[SEP] identifier[main_try_end] operator[SEP] operator[SEP] identifier[Label] identifier[main_tcf_exit] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitJumpInsn] operator[SEP] identifier[GOTO] , identifier[main_tcf_exit] operator[SEP] operator[SEP] identifier[Label] operator[SEP] operator[SEP] identifier[main_catch_label] operator[=] Keyword[new] identifier[Label] operator[SEP] identifier[checkedExceptions] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] identifier[caught_ex] operator[=] identifier[mg] operator[SEP] identifier[newLocal] operator[SEP] identifier[TYPE_Exception] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[checkedExceptions] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[main_catch_label] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitLabel] operator[SEP] identifier[main_catch_label] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[storeLocal] operator[SEP] identifier[caught_ex] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[loadLocal] operator[SEP] identifier[caught_ex] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitInsn] operator[SEP] identifier[ATHROW] operator[SEP] operator[SEP] } identifier[Label] identifier[main_catch_runtime] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitLabel] operator[SEP] identifier[main_catch_runtime] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[storeLocal] operator[SEP] identifier[caught_ex] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[loadLocal] operator[SEP] identifier[caught_ex] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitInsn] operator[SEP] identifier[ATHROW] operator[SEP] operator[SEP] identifier[Label] identifier[main_catch_error] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitLabel] operator[SEP] identifier[main_catch_error] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[storeLocal] operator[SEP] identifier[caught_ex] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[loadLocal] operator[SEP] identifier[caught_ex] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitInsn] operator[SEP] identifier[ATHROW] operator[SEP] operator[SEP] identifier[Label] identifier[main_catch_throwable] operator[=] Keyword[new] identifier[Label] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitLabel] operator[SEP] identifier[main_catch_throwable] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[storeLocal] operator[SEP] identifier[caught_ex] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[loadLocal] operator[SEP] identifier[caught_ex] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitMethodInsn] operator[SEP] identifier[INVOKESTATIC] , literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitInsn] operator[SEP] identifier[ATHROW] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitLabel] operator[SEP] identifier[main_tcf_exit] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[returnType] operator[!=] identifier[Type] operator[SEP] identifier[VOID_TYPE] operator[SEP] { identifier[mg] operator[SEP] identifier[loadLocal] operator[SEP] identifier[returnValue] operator[SEP] operator[SEP] } identifier[mg] operator[SEP] identifier[returnValue] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[checkedExceptions] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[mg] operator[SEP] identifier[visitTryCatchBlock] operator[SEP] identifier[main_try_begin] , identifier[main_try_end] , identifier[main_catch_label] operator[SEP] identifier[i] operator[SEP] , identifier[convertClassName] operator[SEP] identifier[checkedExceptions] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[mg] operator[SEP] identifier[visitTryCatchBlock] operator[SEP] identifier[main_try_begin] , identifier[main_try_end] , identifier[main_catch_runtime] , literal[String] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitTryCatchBlock] operator[SEP] identifier[main_try_begin] , identifier[main_try_end] , identifier[main_catch_error] , literal[String] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitTryCatchBlock] operator[SEP] identifier[main_try_begin] , identifier[main_try_end] , identifier[main_catch_throwable] , literal[String] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[endMethod] operator[SEP] operator[SEP] operator[SEP] identifier[mg] operator[SEP] identifier[visitEnd] operator[SEP] operator[SEP] operator[SEP] }
public int getBoneIndex(String bonename) { for (int i = 0; i < getNumBones(); ++i) if (mBoneNames[i].equals(bonename)) return i; return -1; }
class class_name[name] begin[{] method[getBoneIndex, return_type[type[int]], modifier[public], parameter[bonename]] begin[{] ForStatement(body=IfStatement(condition=MemberReference(member=mBoneNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=bonename, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getNumBones, postfix_operators=[], prefix_operators=[], qualifier=, 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) return[literal[1]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getBoneIndex] operator[SEP] identifier[String] identifier[bonename] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[getNumBones] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] Keyword[if] operator[SEP] identifier[mBoneNames] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[bonename] operator[SEP] operator[SEP] Keyword[return] identifier[i] operator[SEP] Keyword[return] operator[-] Other[1] operator[SEP] }
@XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "extension", scope = UpdateProperties.class) public JAXBElement<CmisExtensionType> createUpdatePropertiesExtension( CmisExtensionType value) { return new JAXBElement<CmisExtensionType>( _GetPropertiesExtension_QNAME, CmisExtensionType.class, UpdateProperties.class, value); }
class class_name[name] begin[{] method[createUpdatePropertiesExtension, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_GetPropertiesExtension_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmisExtensionType, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UpdateProperties, sub_type=None)), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmisExtensionType, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[scope] operator[=] identifier[UpdateProperties] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[CmisExtensionType] operator[>] identifier[createUpdatePropertiesExtension] operator[SEP] identifier[CmisExtensionType] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[CmisExtensionType] operator[>] operator[SEP] identifier[_GetPropertiesExtension_QNAME] , identifier[CmisExtensionType] operator[SEP] Keyword[class] , identifier[UpdateProperties] operator[SEP] Keyword[class] , identifier[value] operator[SEP] operator[SEP] }
public static boolean isAllowedInXml(final int c) { boolean ok = false; if(c >= 0x10000 && c <= 0x10FFFF) { ok = true; } else if(c >= 0xE000 && c <= 0xFFFD) { ok = true; } else if(c >= 0x20 && c <= 0xD7FF) { ok = true; } else if(c == 0x9 || c == 0xA || c == 0xD) { ok = true; } return ok; }
class class_name[name] begin[{] method[isAllowedInXml, return_type[type[boolean]], modifier[public static], parameter[c]] begin[{] local_variable[type[boolean], ok] if[binary_operation[binary_operation[member[.c], >=, literal[0x10000]], &&, binary_operation[member[.c], <=, literal[0x10FFFF]]]] begin[{] assign[member[.ok], literal[true]] else begin[{] if[binary_operation[binary_operation[member[.c], >=, literal[0xE000]], &&, binary_operation[member[.c], <=, literal[0xFFFD]]]] begin[{] assign[member[.ok], literal[true]] else begin[{] if[binary_operation[binary_operation[member[.c], >=, literal[0x20]], &&, binary_operation[member[.c], <=, literal[0xD7FF]]]] begin[{] assign[member[.ok], literal[true]] else begin[{] if[binary_operation[binary_operation[binary_operation[member[.c], ==, literal[0x9]], ||, binary_operation[member[.c], ==, literal[0xA]]], ||, binary_operation[member[.c], ==, literal[0xD]]]] begin[{] assign[member[.ok], literal[true]] else begin[{] None end[}] end[}] end[}] end[}] return[member[.ok]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isAllowedInXml] operator[SEP] Keyword[final] Keyword[int] identifier[c] operator[SEP] { Keyword[boolean] identifier[ok] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[>=] literal[Integer] operator[&&] identifier[c] operator[<=] literal[Integer] operator[SEP] { identifier[ok] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[>=] literal[Integer] operator[&&] identifier[c] operator[<=] literal[Integer] operator[SEP] { identifier[ok] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[>=] literal[Integer] operator[&&] identifier[c] operator[<=] literal[Integer] operator[SEP] { identifier[ok] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[Integer] operator[||] identifier[c] operator[==] literal[Integer] operator[||] identifier[c] operator[==] literal[Integer] operator[SEP] { identifier[ok] operator[=] literal[boolean] operator[SEP] } Keyword[return] identifier[ok] operator[SEP] }
public <E extends T> E min(@NullableDecl E a, @NullableDecl E b, @NullableDecl E c, E... rest) { E minSoFar = min(min(a, b), c); for (E r : rest) { minSoFar = min(minSoFar, r); } return minSoFar; }
class class_name[name] begin[{] method[min, return_type[type[E]], modifier[public], parameter[a, b, c, rest]] begin[{] local_variable[type[E], minSoFar] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=minSoFar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=minSoFar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=rest, 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=E, sub_type=None))), label=None) return[member[.minSoFar]] end[}] END[}]
Keyword[public] operator[<] identifier[E] Keyword[extends] identifier[T] operator[>] identifier[E] identifier[min] operator[SEP] annotation[@] identifier[NullableDecl] identifier[E] identifier[a] , annotation[@] identifier[NullableDecl] identifier[E] identifier[b] , annotation[@] identifier[NullableDecl] identifier[E] identifier[c] , identifier[E] operator[...] identifier[rest] operator[SEP] { identifier[E] identifier[minSoFar] operator[=] identifier[min] operator[SEP] identifier[min] operator[SEP] identifier[a] , identifier[b] operator[SEP] , identifier[c] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[E] identifier[r] operator[:] identifier[rest] operator[SEP] { identifier[minSoFar] operator[=] identifier[min] operator[SEP] identifier[minSoFar] , identifier[r] operator[SEP] operator[SEP] } Keyword[return] identifier[minSoFar] operator[SEP] }
<T> Converter<Object, T> converterForValue(String attribute, Object value, Class<T> destinationClass) { return converterForClass(attribute, value != null ? (Class<Object>) value.getClass() : Object.class, destinationClass); }
class class_name[name] begin[{] method[converterForValue, return_type[type[Converter]], modifier[default], parameter[attribute, value, destinationClass]] begin[{] return[call[.converterForClass, parameter[member[.attribute], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), if_true=Cast(expression=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Class, sub_type=None))), member[.destinationClass]]]] end[}] END[}]
operator[<] identifier[T] operator[>] identifier[Converter] operator[<] identifier[Object] , identifier[T] operator[>] identifier[converterForValue] operator[SEP] identifier[String] identifier[attribute] , identifier[Object] identifier[value] , identifier[Class] operator[<] identifier[T] operator[>] identifier[destinationClass] operator[SEP] { Keyword[return] identifier[converterForClass] operator[SEP] identifier[attribute] , identifier[value] operator[!=] Other[null] operator[?] operator[SEP] identifier[Class] operator[<] identifier[Object] operator[>] operator[SEP] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[:] identifier[Object] operator[SEP] Keyword[class] , identifier[destinationClass] operator[SEP] operator[SEP] }
@BetaApi public final Operation insertNodeTemplate( ProjectRegionName region, NodeTemplate nodeTemplateResource) { InsertNodeTemplateHttpRequest request = InsertNodeTemplateHttpRequest.newBuilder() .setRegion(region == null ? null : region.toString()) .setNodeTemplateResource(nodeTemplateResource) .build(); return insertNodeTemplate(request); }
class class_name[name] begin[{] method[insertNodeTemplate, return_type[type[Operation]], modifier[final public], parameter[region, nodeTemplateResource]] begin[{] local_variable[type[InsertNodeTemplateHttpRequest], request] return[call[.insertNodeTemplate, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Operation] identifier[insertNodeTemplate] operator[SEP] identifier[ProjectRegionName] identifier[region] , identifier[NodeTemplate] identifier[nodeTemplateResource] operator[SEP] { identifier[InsertNodeTemplateHttpRequest] identifier[request] operator[=] identifier[InsertNodeTemplateHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setRegion] operator[SEP] identifier[region] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[region] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setNodeTemplateResource] operator[SEP] identifier[nodeTemplateResource] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[insertNodeTemplate] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
protected void checkObserverMethods() { Collection<EnhancedAnnotatedMethod<?, ? super T>> observerMethods = BeanMethods.getObserverMethods(this.getEnhancedAnnotated()); Collection<EnhancedAnnotatedMethod<?, ? super T>> asyncObserverMethods = BeanMethods.getAsyncObserverMethods(this.getEnhancedAnnotated()); checkObserverMethods(observerMethods); checkObserverMethods(asyncObserverMethods); }
class class_name[name] begin[{] method[checkObserverMethods, return_type[void], modifier[protected], parameter[]] begin[{] local_variable[type[Collection], observerMethods] local_variable[type[Collection], asyncObserverMethods] call[.checkObserverMethods, parameter[member[.observerMethods]]] call[.checkObserverMethods, parameter[member[.asyncObserverMethods]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[checkObserverMethods] operator[SEP] operator[SEP] { identifier[Collection] operator[<] identifier[EnhancedAnnotatedMethod] operator[<] operator[?] , operator[?] Keyword[super] identifier[T] operator[>] operator[>] identifier[observerMethods] operator[=] identifier[BeanMethods] operator[SEP] identifier[getObserverMethods] operator[SEP] Keyword[this] operator[SEP] identifier[getEnhancedAnnotated] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[EnhancedAnnotatedMethod] operator[<] operator[?] , operator[?] Keyword[super] identifier[T] operator[>] operator[>] identifier[asyncObserverMethods] operator[=] identifier[BeanMethods] operator[SEP] identifier[getAsyncObserverMethods] operator[SEP] Keyword[this] operator[SEP] identifier[getEnhancedAnnotated] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[checkObserverMethods] operator[SEP] identifier[observerMethods] operator[SEP] operator[SEP] identifier[checkObserverMethods] operator[SEP] identifier[asyncObserverMethods] operator[SEP] operator[SEP] }
public void init() throws ServletException { org.slf4j.Logger logServerStartup = org.slf4j.LoggerFactory.getLogger("serverStartup"); logServerStartup.info(getClass().getName() + " initialization start"); try { System.setProperty("file.encoding", "UTF-8"); Field charset = Charset.class.getDeclaredField("defaultCharset"); charset.setAccessible(true); charset.set(null, null); initialize(); } catch (Exception e) { throw new ServletException(e); } }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[org], logServerStartup] call[logServerStartup.info, parameter[binary_operation[call[.getClass, parameter[]], +, literal[" initialization start"]]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="file.encoding"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=setProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="defaultCharset")], member=getDeclaredField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Charset, sub_type=None)), name=charset)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=charset, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=set, postfix_operators=[], prefix_operators=[], qualifier=charset, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=initialize, 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=ServletException, 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[init] operator[SEP] operator[SEP] Keyword[throws] identifier[ServletException] { identifier[org] operator[SEP] identifier[slf4j] operator[SEP] identifier[Logger] identifier[logServerStartup] operator[=] identifier[org] operator[SEP] identifier[slf4j] operator[SEP] identifier[LoggerFactory] operator[SEP] identifier[getLogger] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[logServerStartup] operator[SEP] identifier[info] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[System] operator[SEP] identifier[setProperty] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[Field] identifier[charset] operator[=] identifier[Charset] operator[SEP] Keyword[class] operator[SEP] identifier[getDeclaredField] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[charset] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[charset] operator[SEP] identifier[set] operator[SEP] Other[null] , Other[null] operator[SEP] operator[SEP] identifier[initialize] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ServletException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static CPDefinitionOptionValueRel fetchByUuid_C_Last(String uuid, long companyId, OrderByComparator<CPDefinitionOptionValueRel> orderByComparator) { return getPersistence() .fetchByUuid_C_Last(uuid, companyId, orderByComparator); }
class class_name[name] begin[{] method[fetchByUuid_C_Last, return_type[type[CPDefinitionOptionValueRel]], modifier[public static], parameter[uuid, companyId, orderByComparator]] begin[{] return[call[.getPersistence, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[CPDefinitionOptionValueRel] identifier[fetchByUuid_C_Last] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[companyId] , identifier[OrderByComparator] operator[<] identifier[CPDefinitionOptionValueRel] operator[>] identifier[orderByComparator] operator[SEP] { Keyword[return] identifier[getPersistence] operator[SEP] operator[SEP] operator[SEP] identifier[fetchByUuid_C_Last] operator[SEP] identifier[uuid] , identifier[companyId] , identifier[orderByComparator] operator[SEP] operator[SEP] }
public void doSignup( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { if (getSecurityRealm().allowsSignup()) { req.getView(getSecurityRealm(), "signup.jelly").forward(req, rsp); return; } req.getView(SecurityRealm.class, "signup.jelly").forward(req, rsp); }
class class_name[name] begin[{] method[doSignup, return_type[void], modifier[public], parameter[req, rsp]] begin[{] if[call[.getSecurityRealm, parameter[]]] begin[{] call[req.getView, parameter[call[.getSecurityRealm, parameter[]], literal["signup.jelly"]]] return[None] else begin[{] None end[}] call[req.getView, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecurityRealm, sub_type=None)), literal["signup.jelly"]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[doSignup] operator[SEP] identifier[StaplerRequest] identifier[req] , identifier[StaplerResponse] identifier[rsp] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ServletException] { Keyword[if] operator[SEP] identifier[getSecurityRealm] operator[SEP] operator[SEP] operator[SEP] identifier[allowsSignup] operator[SEP] operator[SEP] operator[SEP] { identifier[req] operator[SEP] identifier[getView] operator[SEP] identifier[getSecurityRealm] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[forward] operator[SEP] identifier[req] , identifier[rsp] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[req] operator[SEP] identifier[getView] operator[SEP] identifier[SecurityRealm] operator[SEP] Keyword[class] , literal[String] operator[SEP] operator[SEP] identifier[forward] operator[SEP] identifier[req] , identifier[rsp] operator[SEP] operator[SEP] }
public EClass getIfcCurtainWallType() { if (ifcCurtainWallTypeEClass == null) { ifcCurtainWallTypeEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(134); } return ifcCurtainWallTypeEClass; }
class class_name[name] begin[{] method[getIfcCurtainWallType, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcCurtainWallTypeEClass], ==, literal[null]]] begin[{] assign[member[.ifcCurtainWallTypeEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=134)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcCurtainWallTypeEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcCurtainWallType] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcCurtainWallTypeEClass] operator[==] Other[null] operator[SEP] { identifier[ifcCurtainWallTypeEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[134] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcCurtainWallTypeEClass] operator[SEP] }
public static byte[] decryptAsBytes(final SecretKey secretKey, final byte[] encryptedIvTextBytes) throws Exception { int ivSize = 16; // Extract IV final byte[] iv = new byte[ivSize]; System.arraycopy(encryptedIvTextBytes, 0, iv, 0, iv.length); final IvParameterSpec ivParameterSpec = new IvParameterSpec(iv); // Extract encrypted bytes final int encryptedSize = encryptedIvTextBytes.length - ivSize; final byte[] encryptedBytes = new byte[encryptedSize]; System.arraycopy(encryptedIvTextBytes, ivSize, encryptedBytes, 0, encryptedSize); // Decrypt final Cipher cipherDecrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipherDecrypt.init(Cipher.DECRYPT_MODE, secretKey, ivParameterSpec); return cipherDecrypt.doFinal(encryptedBytes); }
class class_name[name] begin[{] method[decryptAsBytes, return_type[type[byte]], modifier[public static], parameter[secretKey, encryptedIvTextBytes]] begin[{] local_variable[type[int], ivSize] local_variable[type[byte], iv] call[System.arraycopy, parameter[member[.encryptedIvTextBytes], literal[0], member[.iv], literal[0], member[iv.length]]] local_variable[type[IvParameterSpec], ivParameterSpec] local_variable[type[int], encryptedSize] local_variable[type[byte], encryptedBytes] call[System.arraycopy, parameter[member[.encryptedIvTextBytes], member[.ivSize], member[.encryptedBytes], literal[0], member[.encryptedSize]]] local_variable[type[Cipher], cipherDecrypt] call[cipherDecrypt.init, parameter[member[Cipher.DECRYPT_MODE], member[.secretKey], member[.ivParameterSpec]]] return[call[cipherDecrypt.doFinal, parameter[member[.encryptedBytes]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[decryptAsBytes] operator[SEP] Keyword[final] identifier[SecretKey] identifier[secretKey] , Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[encryptedIvTextBytes] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[int] identifier[ivSize] operator[=] Other[16] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[iv] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[ivSize] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[encryptedIvTextBytes] , Other[0] , identifier[iv] , Other[0] , identifier[iv] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[final] identifier[IvParameterSpec] identifier[ivParameterSpec] operator[=] Keyword[new] identifier[IvParameterSpec] operator[SEP] identifier[iv] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[encryptedSize] operator[=] identifier[encryptedIvTextBytes] operator[SEP] identifier[length] operator[-] identifier[ivSize] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[encryptedBytes] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[encryptedSize] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[encryptedIvTextBytes] , identifier[ivSize] , identifier[encryptedBytes] , Other[0] , identifier[encryptedSize] operator[SEP] operator[SEP] Keyword[final] identifier[Cipher] identifier[cipherDecrypt] operator[=] identifier[Cipher] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cipherDecrypt] operator[SEP] identifier[init] operator[SEP] identifier[Cipher] operator[SEP] identifier[DECRYPT_MODE] , identifier[secretKey] , identifier[ivParameterSpec] operator[SEP] operator[SEP] Keyword[return] identifier[cipherDecrypt] operator[SEP] identifier[doFinal] operator[SEP] identifier[encryptedBytes] operator[SEP] operator[SEP] }
public static gslbvserver_stats get(nitro_service service, String name) throws Exception{ gslbvserver_stats obj = new gslbvserver_stats(); obj.set_name(name); gslbvserver_stats response = (gslbvserver_stats) obj.stat_resource(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[gslbvserver_stats]], modifier[public static], parameter[service, name]] begin[{] local_variable[type[gslbvserver_stats], obj] call[obj.set_name, parameter[member[.name]]] local_variable[type[gslbvserver_stats], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[gslbvserver_stats] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[Exception] { identifier[gslbvserver_stats] identifier[obj] operator[=] Keyword[new] identifier[gslbvserver_stats] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_name] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[gslbvserver_stats] identifier[response] operator[=] operator[SEP] identifier[gslbvserver_stats] operator[SEP] identifier[obj] operator[SEP] identifier[stat_resource] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
public TemplateBase __setRenderArgs0(__ParameterList params) { _params = null == params ? new __ParameterList() : params; __renderArgs.putAll(_params.asMap()); return this; }
class class_name[name] begin[{] method[__setRenderArgs0, return_type[type[TemplateBase]], modifier[public], parameter[params]] begin[{] assign[member[._params], TernaryExpression(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), if_false=MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=__ParameterList, sub_type=None)))] call[__renderArgs.putAll, parameter[call[_params.asMap, parameter[]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[TemplateBase] identifier[__setRenderArgs0] operator[SEP] identifier[__ParameterList] identifier[params] operator[SEP] { identifier[_params] operator[=] Other[null] operator[==] identifier[params] operator[?] Keyword[new] identifier[__ParameterList] operator[SEP] operator[SEP] operator[:] identifier[params] operator[SEP] identifier[__renderArgs] operator[SEP] identifier[putAll] operator[SEP] identifier[_params] operator[SEP] identifier[asMap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public void onAction(ListView listView, int[] position, SwipeDirection[] direction){ if(mSwipeActionListener != null) mSwipeActionListener.onSwipe(position, direction); }
class class_name[name] begin[{] method[onAction, return_type[void], modifier[public], parameter[listView, position, direction]] begin[{] if[binary_operation[member[.mSwipeActionListener], !=, literal[null]]] begin[{] call[mSwipeActionListener.onSwipe, parameter[member[.position], member[.direction]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[onAction] operator[SEP] identifier[ListView] identifier[listView] , Keyword[int] operator[SEP] operator[SEP] identifier[position] , identifier[SwipeDirection] operator[SEP] operator[SEP] identifier[direction] operator[SEP] { Keyword[if] operator[SEP] identifier[mSwipeActionListener] operator[!=] Other[null] operator[SEP] identifier[mSwipeActionListener] operator[SEP] identifier[onSwipe] operator[SEP] identifier[position] , identifier[direction] operator[SEP] operator[SEP] }
public static void same(Object obj1, Object obj2, RuntimeException cause) { if (obj1 != obj2) { throw cause; } }
class class_name[name] begin[{] method[same, return_type[void], modifier[public static], parameter[obj1, obj2, cause]] begin[{] if[binary_operation[member[.obj1], !=, member[.obj2]]] begin[{] ThrowStatement(expression=MemberReference(member=cause, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[same] operator[SEP] identifier[Object] identifier[obj1] , identifier[Object] identifier[obj2] , identifier[RuntimeException] identifier[cause] operator[SEP] { Keyword[if] operator[SEP] identifier[obj1] operator[!=] identifier[obj2] operator[SEP] { Keyword[throw] identifier[cause] operator[SEP] } }
public void start() throws AppiumServerHasNotBeenStartedLocallyException { lock.lock(); try { if (isRunning()) { return; } try { process = new CommandLine(this.nodeJSExec.getCanonicalPath(), nodeJSArgs.toArray(new String[] {})); process.setEnvironmentVariables(nodeJSEnvironment); process.copyOutputTo(stream); process.executeAsync(); ping(startupTimeout, timeUnit); } catch (Throwable e) { destroyProcess(); String msgTxt = "The local appium server has not been started. " + "The given Node.js executable: " + this.nodeJSExec.getAbsolutePath() + " Arguments: " + nodeJSArgs.toString() + " " + "\n"; if (process != null) { String processStream = process.getStdOut(); if (!StringUtils.isBlank(processStream)) { msgTxt = msgTxt + "Process output: " + processStream + "\n"; } } throw new AppiumServerHasNotBeenStartedLocallyException(msgTxt, e); } } finally { lock.unlock(); } }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[]] begin[{] call[lock.lock, parameter[]] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isRunning, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=nodeJSExec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getCanonicalPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), MethodInvocation(arguments=[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=nodeJSArgs, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommandLine, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodeJSEnvironment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setEnvironmentVariables, postfix_operators=[], prefix_operators=[], qualifier=process, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyOutputTo, postfix_operators=[], prefix_operators=[], qualifier=process, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=executeAsync, postfix_operators=[], prefix_operators=[], qualifier=process, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=startupTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeUnit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=ping, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=destroyProcess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The local appium server has not been started. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The given Node.js executable: "), operator=+), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=nodeJSExec, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Arguments: "), operator=+), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=nodeJSArgs, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+), name=msgTxt)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=process, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getStdOut, postfix_operators=[], prefix_operators=[], qualifier=process, selectors=[], type_arguments=None), name=processStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=processStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBlank, postfix_operators=[], prefix_operators=['!'], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=msgTxt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=msgTxt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Process output: "), operator=+), operandr=MemberReference(member=processStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)), label=None)]))])), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msgTxt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=AppiumServerHasNotBeenStartedLocallyException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] Keyword[throws] identifier[AppiumServerHasNotBeenStartedLocallyException] { identifier[lock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[isRunning] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[try] { identifier[process] operator[=] Keyword[new] identifier[CommandLine] operator[SEP] Keyword[this] operator[SEP] identifier[nodeJSExec] operator[SEP] identifier[getCanonicalPath] operator[SEP] operator[SEP] , identifier[nodeJSArgs] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] operator[SEP] { } operator[SEP] operator[SEP] operator[SEP] identifier[process] operator[SEP] identifier[setEnvironmentVariables] operator[SEP] identifier[nodeJSEnvironment] operator[SEP] operator[SEP] identifier[process] operator[SEP] identifier[copyOutputTo] operator[SEP] identifier[stream] operator[SEP] operator[SEP] identifier[process] operator[SEP] identifier[executeAsync] operator[SEP] operator[SEP] operator[SEP] identifier[ping] operator[SEP] identifier[startupTimeout] , identifier[timeUnit] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { identifier[destroyProcess] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[msgTxt] operator[=] literal[String] operator[+] literal[String] operator[+] Keyword[this] operator[SEP] identifier[nodeJSExec] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[nodeJSArgs] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[process] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[processStream] operator[=] identifier[process] operator[SEP] identifier[getStdOut] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StringUtils] operator[SEP] identifier[isBlank] operator[SEP] identifier[processStream] operator[SEP] operator[SEP] { identifier[msgTxt] operator[=] identifier[msgTxt] operator[+] literal[String] operator[+] identifier[processStream] operator[+] literal[String] operator[SEP] } } Keyword[throw] Keyword[new] identifier[AppiumServerHasNotBeenStartedLocallyException] operator[SEP] identifier[msgTxt] , identifier[e] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[lock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public static String expandEnvironmentVariables(final String command) { final Matcher match = ENV_REGEX.matcher(command); final StringBuilder res = new StringBuilder(command.length()); int i = 0; while (match.find()) { final String var = System.getenv(match.group(1)); res.append(command.substring(i, match.start())).append(var == null ? "" : var); i = match.end(); } return res.append(command.substring(i, command.length())).toString(); }
class class_name[name] begin[{] method[expandEnvironmentVariables, return_type[type[String]], modifier[public static], parameter[command]] begin[{] local_variable[type[Matcher], match] local_variable[type[StringBuilder], res] local_variable[type[int], i] while[call[match.find, parameter[]]] begin[{] local_variable[type[String], var] call[res.append, parameter[call[command.substring, parameter[member[.i], call[match.start, parameter[]]]]]] assign[member[.i], call[match.end, parameter[]]] end[}] return[call[res.append, parameter[call[command.substring, parameter[member[.i], call[command.length, parameter[]]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[expandEnvironmentVariables] operator[SEP] Keyword[final] identifier[String] identifier[command] operator[SEP] { Keyword[final] identifier[Matcher] identifier[match] operator[=] identifier[ENV_REGEX] operator[SEP] identifier[matcher] operator[SEP] identifier[command] operator[SEP] operator[SEP] Keyword[final] identifier[StringBuilder] identifier[res] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[command] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[match] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[var] operator[=] identifier[System] operator[SEP] identifier[getenv] operator[SEP] identifier[match] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[res] operator[SEP] identifier[append] operator[SEP] identifier[command] operator[SEP] identifier[substring] operator[SEP] identifier[i] , identifier[match] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[var] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[var] operator[SEP] operator[SEP] identifier[i] operator[=] identifier[match] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[res] operator[SEP] identifier[append] operator[SEP] identifier[command] operator[SEP] identifier[substring] operator[SEP] identifier[i] , identifier[command] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }