code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
protected BufferedImage create_BARGRAPH_LED_Image(final int WIDTH, final int HEIGHT, final ColorDef COLOR, final Color[] CUSTOM_COLORS) { if (WIDTH <= 20 || HEIGHT <= 20) // 20 is needed otherwise the image size could be smaller than 1 { return UTIL.createImage(1, 1, Transparency.TRANSLUCENT); } final int IMAGE_WIDTH; final int IMAGE_HEIGHT; if (getOrientation() == Orientation.VERTICAL) { // Vertical orientation IMAGE_WIDTH = (int) (WIDTH * 0.1214285714); IMAGE_HEIGHT = (int) (HEIGHT * 0.0121359223); } else { // Horizontal orientation IMAGE_HEIGHT = (int) (WIDTH * 0.0121359223); IMAGE_WIDTH = (int) (HEIGHT * 0.1214285714); } final BufferedImage IMAGE = UTIL.createImage(IMAGE_WIDTH, IMAGE_HEIGHT, Transparency.TRANSLUCENT); final Graphics2D G2 = IMAGE.createGraphics(); G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); final Rectangle2D LED = new Rectangle2D.Double(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT); final Point2D CENTER = new Point2D.Double(LED.getCenterX(), LED.getCenterY()); final float[] FRACTIONS = { 0.0f, 1.0f }; final Color[] COLORS; if (CUSTOM_COLORS != null && CUSTOM_COLORS.length == 2) { COLORS = CUSTOM_COLORS; } else { COLORS = new Color[]{ COLOR.LIGHT, COLOR.DARK }; } final float RADIUS; switch (getOrientation()) { case VERTICAL: default: RADIUS = (float) (LED.getWidth() / 2f); break; case HORIZONTAL: RADIUS = (float) (LED.getHeight() / 2f); break; } final RadialGradientPaint GRADIENT = new RadialGradientPaint(CENTER, RADIUS, FRACTIONS, COLORS); G2.setPaint(GRADIENT); G2.fill(LED); G2.dispose(); return IMAGE; }
class class_name[name] begin[{] method[create_BARGRAPH_LED_Image, return_type[type[BufferedImage]], modifier[protected], parameter[WIDTH, HEIGHT, COLOR, CUSTOM_COLORS]] begin[{] if[binary_operation[binary_operation[member[.WIDTH], <=, literal[20]], ||, binary_operation[member[.HEIGHT], <=, literal[20]]]] begin[{] return[call[UTIL.createImage, parameter[literal[1], literal[1], member[Transparency.TRANSLUCENT]]]] else begin[{] None end[}] local_variable[type[int], IMAGE_WIDTH] local_variable[type[int], IMAGE_HEIGHT] if[binary_operation[call[.getOrientation, parameter[]], ==, member[Orientation.VERTICAL]]] begin[{] assign[member[.IMAGE_WIDTH], Cast(expression=BinaryOperation(operandl=MemberReference(member=WIDTH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.1214285714), operator=*), type=BasicType(dimensions=[], name=int))] assign[member[.IMAGE_HEIGHT], Cast(expression=BinaryOperation(operandl=MemberReference(member=HEIGHT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0121359223), operator=*), type=BasicType(dimensions=[], name=int))] else begin[{] assign[member[.IMAGE_HEIGHT], Cast(expression=BinaryOperation(operandl=MemberReference(member=WIDTH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0121359223), operator=*), type=BasicType(dimensions=[], name=int))] assign[member[.IMAGE_WIDTH], Cast(expression=BinaryOperation(operandl=MemberReference(member=HEIGHT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.1214285714), operator=*), type=BasicType(dimensions=[], name=int))] end[}] local_variable[type[BufferedImage], IMAGE] local_variable[type[Graphics2D], G2] call[G2.setRenderingHint, parameter[member[RenderingHints.KEY_ANTIALIASING], member[RenderingHints.VALUE_ANTIALIAS_ON]]] local_variable[type[Rectangle2D], LED] local_variable[type[Point2D], CENTER] local_variable[type[float], FRACTIONS] local_variable[type[Color], COLORS] if[binary_operation[binary_operation[member[.CUSTOM_COLORS], !=, literal[null]], &&, binary_operation[member[CUSTOM_COLORS.length], ==, literal[2]]]] begin[{] assign[member[.COLORS], member[.CUSTOM_COLORS]] else begin[{] assign[member[.COLORS], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=LIGHT, postfix_operators=[], prefix_operators=[], qualifier=COLOR, selectors=[]), MemberReference(member=DARK, postfix_operators=[], prefix_operators=[], qualifier=COLOR, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Color, sub_type=None))] end[}] local_variable[type[float], RADIUS] SwitchStatement(cases=[SwitchStatementCase(case=['VERTICAL'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=RADIUS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=LED, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2f), operator=/), type=BasicType(dimensions=[], name=float))), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['HORIZONTAL'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=RADIUS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=LED, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2f), operator=/), type=BasicType(dimensions=[], name=float))), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getOrientation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None) local_variable[type[RadialGradientPaint], GRADIENT] call[G2.setPaint, parameter[member[.GRADIENT]]] call[G2.fill, parameter[member[.LED]]] call[G2.dispose, parameter[]] return[member[.IMAGE]] end[}] END[}]
Keyword[protected] identifier[BufferedImage] identifier[create_BARGRAPH_LED_Image] operator[SEP] Keyword[final] Keyword[int] identifier[WIDTH] , Keyword[final] Keyword[int] identifier[HEIGHT] , Keyword[final] identifier[ColorDef] identifier[COLOR] , Keyword[final] identifier[Color] operator[SEP] operator[SEP] identifier[CUSTOM_COLORS] operator[SEP] { Keyword[if] operator[SEP] identifier[WIDTH] operator[<=] Other[20] operator[||] identifier[HEIGHT] operator[<=] Other[20] operator[SEP] { Keyword[return] identifier[UTIL] operator[SEP] identifier[createImage] operator[SEP] Other[1] , Other[1] , identifier[Transparency] operator[SEP] identifier[TRANSLUCENT] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[IMAGE_WIDTH] operator[SEP] Keyword[final] Keyword[int] identifier[IMAGE_HEIGHT] operator[SEP] Keyword[if] operator[SEP] identifier[getOrientation] operator[SEP] operator[SEP] operator[==] identifier[Orientation] operator[SEP] identifier[VERTICAL] operator[SEP] { identifier[IMAGE_WIDTH] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[WIDTH] operator[*] literal[Float] operator[SEP] operator[SEP] identifier[IMAGE_HEIGHT] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[HEIGHT] operator[*] literal[Float] operator[SEP] operator[SEP] } Keyword[else] { identifier[IMAGE_HEIGHT] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[WIDTH] operator[*] literal[Float] operator[SEP] operator[SEP] identifier[IMAGE_WIDTH] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[HEIGHT] operator[*] literal[Float] operator[SEP] operator[SEP] } Keyword[final] identifier[BufferedImage] identifier[IMAGE] operator[=] identifier[UTIL] operator[SEP] identifier[createImage] operator[SEP] identifier[IMAGE_WIDTH] , identifier[IMAGE_HEIGHT] , identifier[Transparency] operator[SEP] identifier[TRANSLUCENT] operator[SEP] operator[SEP] Keyword[final] identifier[Graphics2D] identifier[G2] operator[=] identifier[IMAGE] operator[SEP] identifier[createGraphics] operator[SEP] operator[SEP] operator[SEP] identifier[G2] operator[SEP] identifier[setRenderingHint] operator[SEP] identifier[RenderingHints] operator[SEP] identifier[KEY_ANTIALIASING] , identifier[RenderingHints] operator[SEP] identifier[VALUE_ANTIALIAS_ON] operator[SEP] operator[SEP] Keyword[final] identifier[Rectangle2D] identifier[LED] operator[=] Keyword[new] identifier[Rectangle2D] operator[SEP] identifier[Double] operator[SEP] Other[0] , Other[0] , identifier[IMAGE_WIDTH] , identifier[IMAGE_HEIGHT] operator[SEP] operator[SEP] Keyword[final] identifier[Point2D] identifier[CENTER] operator[=] Keyword[new] identifier[Point2D] operator[SEP] identifier[Double] operator[SEP] identifier[LED] operator[SEP] identifier[getCenterX] operator[SEP] operator[SEP] , identifier[LED] operator[SEP] identifier[getCenterY] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[float] operator[SEP] operator[SEP] identifier[FRACTIONS] operator[=] { literal[Float] , literal[Float] } operator[SEP] Keyword[final] identifier[Color] operator[SEP] operator[SEP] identifier[COLORS] operator[SEP] Keyword[if] operator[SEP] identifier[CUSTOM_COLORS] operator[!=] Other[null] operator[&&] identifier[CUSTOM_COLORS] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] { identifier[COLORS] operator[=] identifier[CUSTOM_COLORS] operator[SEP] } Keyword[else] { identifier[COLORS] operator[=] Keyword[new] identifier[Color] operator[SEP] operator[SEP] { identifier[COLOR] operator[SEP] identifier[LIGHT] , identifier[COLOR] operator[SEP] identifier[DARK] } operator[SEP] } Keyword[final] Keyword[float] identifier[RADIUS] operator[SEP] Keyword[switch] operator[SEP] identifier[getOrientation] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[VERTICAL] operator[:] Keyword[default] operator[:] identifier[RADIUS] operator[=] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[LED] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[/] literal[Float] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[HORIZONTAL] operator[:] identifier[RADIUS] operator[=] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[LED] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[/] literal[Float] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[final] identifier[RadialGradientPaint] identifier[GRADIENT] operator[=] Keyword[new] identifier[RadialGradientPaint] operator[SEP] identifier[CENTER] , identifier[RADIUS] , identifier[FRACTIONS] , identifier[COLORS] operator[SEP] operator[SEP] identifier[G2] operator[SEP] identifier[setPaint] operator[SEP] identifier[GRADIENT] operator[SEP] operator[SEP] identifier[G2] operator[SEP] identifier[fill] operator[SEP] identifier[LED] operator[SEP] operator[SEP] identifier[G2] operator[SEP] identifier[dispose] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[IMAGE] operator[SEP] }
@Override public String getValue(String propertyName) { String theValue = null; String theModifiedPropertyName = null; // First pass theValue = super.getValue(propertyName); // Second pass, replace Non-Alphanumeric characters if (theValue == null) { theModifiedPropertyName = replaceNonAlpha(propertyName); theValue = super.getValue(theModifiedPropertyName); } // Third pass, convert to upper case and search if (theValue == null && theModifiedPropertyName != null) { theModifiedPropertyName = theModifiedPropertyName.toUpperCase(); theValue = super.getValue(theModifiedPropertyName); } return theValue; }
class class_name[name] begin[{] method[getValue, return_type[type[String]], modifier[public], parameter[propertyName]] begin[{] local_variable[type[String], theValue] local_variable[type[String], theModifiedPropertyName] assign[member[.theValue], SuperMethodInvocation(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] if[binary_operation[member[.theValue], ==, literal[null]]] begin[{] assign[member[.theModifiedPropertyName], call[.replaceNonAlpha, parameter[member[.propertyName]]]] assign[member[.theValue], SuperMethodInvocation(arguments=[MemberReference(member=theModifiedPropertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] else begin[{] None end[}] if[binary_operation[binary_operation[member[.theValue], ==, literal[null]], &&, binary_operation[member[.theModifiedPropertyName], !=, literal[null]]]] begin[{] assign[member[.theModifiedPropertyName], call[theModifiedPropertyName.toUpperCase, parameter[]]] assign[member[.theValue], SuperMethodInvocation(arguments=[MemberReference(member=theModifiedPropertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] else begin[{] None end[}] return[member[.theValue]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getValue] operator[SEP] identifier[String] identifier[propertyName] operator[SEP] { identifier[String] identifier[theValue] operator[=] Other[null] operator[SEP] identifier[String] identifier[theModifiedPropertyName] operator[=] Other[null] operator[SEP] identifier[theValue] operator[=] Keyword[super] operator[SEP] identifier[getValue] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[theValue] operator[==] Other[null] operator[SEP] { identifier[theModifiedPropertyName] operator[=] identifier[replaceNonAlpha] operator[SEP] identifier[propertyName] operator[SEP] operator[SEP] identifier[theValue] operator[=] Keyword[super] operator[SEP] identifier[getValue] operator[SEP] identifier[theModifiedPropertyName] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[theValue] operator[==] Other[null] operator[&&] identifier[theModifiedPropertyName] operator[!=] Other[null] operator[SEP] { identifier[theModifiedPropertyName] operator[=] identifier[theModifiedPropertyName] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] identifier[theValue] operator[=] Keyword[super] operator[SEP] identifier[getValue] operator[SEP] identifier[theModifiedPropertyName] operator[SEP] operator[SEP] } Keyword[return] identifier[theValue] operator[SEP] }
public Observable<Page<OpenShiftManagedClusterInner>> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<OpenShiftManagedClusterInner>>, Page<OpenShiftManagedClusterInner>>() { @Override public Page<OpenShiftManagedClusterInner> call(ServiceResponse<Page<OpenShiftManagedClusterInner>> 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[OpenShiftManagedClusterInner] 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[OpenShiftManagedClusterInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[OpenShiftManagedClusterInner] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[OpenShiftManagedClusterInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[OpenShiftManagedClusterInner] operator[>] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
@Override public Map<String, Object> getBodyParameters() { HashMap<String, Object> params = new HashMap<String, Object>(); return params; }
class class_name[name] begin[{] method[getBodyParameters, return_type[type[Map]], modifier[public], parameter[]] begin[{] local_variable[type[HashMap], params] return[member[.params]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[getBodyParameters] operator[SEP] operator[SEP] { identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[params] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[params] operator[SEP] }
protected final void write(String string) { JspWriter writer = pageContext.getOut(); try { writer.print(string); } catch (IOException e) { logger.error(Bundle.getString("Tags_WriteException"), e); org.apache.struts.util.RequestUtils.saveException((PageContext) pageContext, e); } }
class class_name[name] begin[{] method[write, return_type[void], modifier[final protected], parameter[string]] begin[{] local_variable[type[JspWriter], writer] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=string, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Tags_WriteException")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=Bundle, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=pageContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=PageContext, sub_type=None)), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=saveException, postfix_operators=[], prefix_operators=[], qualifier=org.apache.struts.util.RequestUtils, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[final] Keyword[void] identifier[write] operator[SEP] identifier[String] identifier[string] operator[SEP] { identifier[JspWriter] identifier[writer] operator[=] identifier[pageContext] operator[SEP] identifier[getOut] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[writer] operator[SEP] identifier[print] operator[SEP] identifier[string] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[Bundle] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[struts] operator[SEP] identifier[util] operator[SEP] identifier[RequestUtils] operator[SEP] identifier[saveException] operator[SEP] operator[SEP] identifier[PageContext] operator[SEP] identifier[pageContext] , identifier[e] operator[SEP] operator[SEP] } }
public static void main(String[] args) { try { MnistDAO.init("/usr/local/Datasets"); // setup data System.out.println("here"); MnistImageDisplayApp mnistImageDisplayApp = new MnistImageDisplayApp(); mnistImageDisplayApp.go(args); } catch (Exception e) { // eat it. } finally { MnistDAO.release(); // release data resources } }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/usr/local/Datasets")], member=init, postfix_operators=[], prefix_operators=[], qualifier=MnistDAO, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="here")], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.out, 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=MnistImageDisplayApp, sub_type=None)), name=mnistImageDisplayApp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MnistImageDisplayApp, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=go, postfix_operators=[], prefix_operators=[], qualifier=mnistImageDisplayApp, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=release, postfix_operators=[], prefix_operators=[], qualifier=MnistDAO, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[try] { identifier[MnistDAO] operator[SEP] identifier[init] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[MnistImageDisplayApp] identifier[mnistImageDisplayApp] operator[=] Keyword[new] identifier[MnistImageDisplayApp] operator[SEP] operator[SEP] operator[SEP] identifier[mnistImageDisplayApp] operator[SEP] identifier[go] operator[SEP] identifier[args] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { } Keyword[finally] { identifier[MnistDAO] operator[SEP] identifier[release] operator[SEP] operator[SEP] operator[SEP] } }
private void addQueryParams(final Request request) { if (minutes != null) { request.addQueryParam("Minutes", minutes.toString()); } if (startDate != null) { request.addQueryParam("StartDate", startDate.toString()); } if (endDate != null) { request.addQueryParam("EndDate", endDate.toString()); } if (taskChannel != null) { request.addQueryParam("TaskChannel", taskChannel); } if (splitByWaitTime != null) { request.addQueryParam("SplitByWaitTime", splitByWaitTime); } }
class class_name[name] begin[{] method[addQueryParams, return_type[void], modifier[private], parameter[request]] begin[{] if[binary_operation[member[.minutes], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["Minutes"], call[minutes.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.startDate], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["StartDate"], call[startDate.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.endDate], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["EndDate"], call[endDate.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.taskChannel], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["TaskChannel"], member[.taskChannel]]] else begin[{] None end[}] if[binary_operation[member[.splitByWaitTime], !=, literal[null]]] begin[{] call[request.addQueryParam, parameter[literal["SplitByWaitTime"], member[.splitByWaitTime]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[addQueryParams] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] { Keyword[if] operator[SEP] identifier[minutes] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[minutes] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[startDate] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[startDate] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[endDate] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[endDate] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[taskChannel] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[taskChannel] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[splitByWaitTime] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addQueryParam] operator[SEP] literal[String] , identifier[splitByWaitTime] operator[SEP] operator[SEP] } }
public Observable<ServiceResponse<Page<OperationInner>>> listOperationsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); } String nextUrl = String.format("%s", nextPageLink); return service.listOperationsNext(nextUrl, this.acceptLanguage(), this.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<OperationInner>>>>() { @Override public Observable<ServiceResponse<Page<OperationInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<OperationInner>> result = listOperationsNextDelegate(response); return Observable.just(new ServiceResponse<Page<OperationInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[listOperationsNextSinglePageAsync, return_type[type[Observable]], modifier[public], parameter[nextPageLink]] begin[{] if[binary_operation[member[.nextPageLink], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter nextPageLink is required and cannot be null.")], 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[String], nextUrl] return[call[service.listOperationsNext, parameter[member[.nextUrl], THIS[call[None.acceptLanguage, parameter[]]], THIS[call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[OperationInner] operator[>] operator[>] operator[>] identifier[listOperationsNextSinglePageAsync] operator[SEP] Keyword[final] identifier[String] identifier[nextPageLink] operator[SEP] { Keyword[if] operator[SEP] identifier[nextPageLink] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[nextUrl] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[nextPageLink] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[listOperationsNext] operator[SEP] identifier[nextUrl] , Keyword[this] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[OperationInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[OperationInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[PageImpl] operator[<] identifier[OperationInner] operator[>] operator[>] identifier[result] operator[=] identifier[listOperationsNextDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] Keyword[new] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[OperationInner] operator[>] operator[>] operator[SEP] identifier[result] operator[SEP] identifier[body] operator[SEP] operator[SEP] , identifier[result] operator[SEP] identifier[response] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public static WebhookCollection all() throws EasyPostException { Map<String, Object> params = new HashMap<String, Object>(); return all(params, null); }
class class_name[name] begin[{] method[all, return_type[type[WebhookCollection]], modifier[public static], parameter[]] begin[{] local_variable[type[Map], params] return[call[.all, parameter[member[.params], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[WebhookCollection] identifier[all] operator[SEP] operator[SEP] Keyword[throws] identifier[EasyPostException] { identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[params] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[all] operator[SEP] identifier[params] , Other[null] operator[SEP] operator[SEP] }
public void trimToSize() { // first balance the tree for best performance balance(); // redimension the node arrays redimNodeArrays(freenode); // ok, compact kv array CharVector kx = new CharVector(); kx.alloc(1); TernaryTree map = new TernaryTree(); compact(kx, map, root); kv = kx; kv.trimToSize(); }
class class_name[name] begin[{] method[trimToSize, return_type[void], modifier[public], parameter[]] begin[{] call[.balance, parameter[]] call[.redimNodeArrays, parameter[member[.freenode]]] local_variable[type[CharVector], kx] call[kx.alloc, parameter[literal[1]]] local_variable[type[TernaryTree], map] call[.compact, parameter[member[.kx], member[.map], member[.root]]] assign[member[.kv], member[.kx]] call[kv.trimToSize, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[trimToSize] operator[SEP] operator[SEP] { identifier[balance] operator[SEP] operator[SEP] operator[SEP] identifier[redimNodeArrays] operator[SEP] identifier[freenode] operator[SEP] operator[SEP] identifier[CharVector] identifier[kx] operator[=] Keyword[new] identifier[CharVector] operator[SEP] operator[SEP] operator[SEP] identifier[kx] operator[SEP] identifier[alloc] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[TernaryTree] identifier[map] operator[=] Keyword[new] identifier[TernaryTree] operator[SEP] operator[SEP] operator[SEP] identifier[compact] operator[SEP] identifier[kx] , identifier[map] , identifier[root] operator[SEP] operator[SEP] identifier[kv] operator[=] identifier[kx] operator[SEP] identifier[kv] operator[SEP] identifier[trimToSize] operator[SEP] operator[SEP] operator[SEP] }
public static String getPrefixInfoMessage(final Object pObject) { StringBuilder buffer = new StringBuilder(); buffer.append(INFO); buffer.append(getTimestamp()); buffer.append(" "); if (pObject == null) { buffer.append("[unknown class]"); } else { if (pObject instanceof String) { buffer.append((String) pObject); } else { buffer.append(getClassName(pObject)); } } buffer.append(": "); return buffer.toString(); }
class class_name[name] begin[{] method[getPrefixInfoMessage, return_type[type[String]], modifier[public static], parameter[pObject]] begin[{] local_variable[type[StringBuilder], buffer] call[buffer.append, parameter[member[.INFO]]] call[buffer.append, parameter[call[.getTimestamp, parameter[]]]] call[buffer.append, parameter[literal[" "]]] if[binary_operation[member[.pObject], ==, literal[null]]] begin[{] call[buffer.append, parameter[literal["[unknown class]"]]] else begin[{] if[binary_operation[member[.pObject], instanceof, type[String]]] begin[{] call[buffer.append, parameter[Cast(expression=MemberReference(member=pObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]] else begin[{] call[buffer.append, parameter[call[.getClassName, parameter[member[.pObject]]]]] end[}] end[}] call[buffer.append, parameter[literal[": "]]] return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getPrefixInfoMessage] operator[SEP] Keyword[final] identifier[Object] identifier[pObject] operator[SEP] { identifier[StringBuilder] identifier[buffer] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[INFO] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[getTimestamp] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pObject] operator[==] Other[null] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[pObject] Keyword[instanceof] identifier[String] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[pObject] operator[SEP] operator[SEP] } Keyword[else] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[getClassName] operator[SEP] identifier[pObject] operator[SEP] operator[SEP] operator[SEP] } } identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public ClientsResult calculateAllNodesResult() { final List<String> childNodePaths = getChildren(electionRootPath, false); _logger.info("Total peers = {} ", childNodePaths.size()); Collections.sort(childNodePaths); int index = childNodePaths.indexOf(clientNodePath.substring(clientNodePath.lastIndexOf('/') + 1)); return new ClientsResult(index, childNodePaths.size()); }
class class_name[name] begin[{] method[calculateAllNodesResult, return_type[type[ClientsResult]], modifier[public], parameter[]] begin[{] local_variable[type[List], childNodePaths] call[_logger.info, parameter[literal["Total peers = {} "], call[childNodePaths.size, parameter[]]]] call[Collections.sort, parameter[member[.childNodePaths]]] local_variable[type[int], index] return[ClassCreator(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=childNodePaths, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClientsResult, sub_type=None))] end[}] END[}]
Keyword[public] identifier[ClientsResult] identifier[calculateAllNodesResult] operator[SEP] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[childNodePaths] operator[=] identifier[getChildren] operator[SEP] identifier[electionRootPath] , literal[boolean] operator[SEP] operator[SEP] identifier[_logger] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[childNodePaths] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[childNodePaths] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[childNodePaths] operator[SEP] identifier[indexOf] operator[SEP] identifier[clientNodePath] operator[SEP] identifier[substring] operator[SEP] identifier[clientNodePath] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ClientsResult] operator[SEP] identifier[index] , identifier[childNodePaths] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public String getPageContent(Page page) { return getWikiStyleRenderer().convertWikiToXHtml(page.toPageContext(), page.getContent()); }
class class_name[name] begin[{] method[getPageContent, return_type[type[String]], modifier[public], parameter[page]] begin[{] return[call[.getWikiStyleRenderer, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getPageContent] operator[SEP] identifier[Page] identifier[page] operator[SEP] { Keyword[return] identifier[getWikiStyleRenderer] operator[SEP] operator[SEP] operator[SEP] identifier[convertWikiToXHtml] operator[SEP] identifier[page] operator[SEP] identifier[toPageContext] operator[SEP] operator[SEP] , identifier[page] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public void renderHead(final Component _component, final IHeaderResponse _response) { super.renderHead(_component, _response); _response.render(new PriorityHeaderItem(new DojoHeaderItem(AbstractDojoBehavior.JS_DOJO, AbstractDojoBehavior.class.getName()))); final String clazz = Configuration.getAttribute(ConfigAttribute.DOJO_CLASS); ResourceReference reference = null; if ("tundra".equals(clazz)) { reference = AbstractDojoBehavior.CSS_TUNDRA; } else if ("claro".equals(clazz)) { reference = AbstractDojoBehavior.CSS_CLARO; } else if ("nihilo".equals(clazz)) { reference = AbstractDojoBehavior.CSS_NIHILO; } else if ("soria".equals(clazz)) { reference = AbstractDojoBehavior.CSS_TUNDRA; } if (reference != null) { _response.render(CssHeaderItem.forReference(reference)); } }
class class_name[name] begin[{] method[renderHead, return_type[void], modifier[public], parameter[_component, _response]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=_component, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=_response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=renderHead, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[_response.render, parameter[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=JS_DOJO, postfix_operators=[], prefix_operators=[], qualifier=AbstractDojoBehavior, selectors=[]), 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=AbstractDojoBehavior, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DojoHeaderItem, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PriorityHeaderItem, sub_type=None))]] local_variable[type[String], clazz] local_variable[type[ResourceReference], reference] if[literal["tundra"]] begin[{] assign[member[.reference], member[AbstractDojoBehavior.CSS_TUNDRA]] else begin[{] if[literal["claro"]] begin[{] assign[member[.reference], member[AbstractDojoBehavior.CSS_CLARO]] else begin[{] if[literal["nihilo"]] begin[{] assign[member[.reference], member[AbstractDojoBehavior.CSS_NIHILO]] else begin[{] if[literal["soria"]] begin[{] assign[member[.reference], member[AbstractDojoBehavior.CSS_TUNDRA]] else begin[{] None end[}] end[}] end[}] end[}] if[binary_operation[member[.reference], !=, literal[null]]] begin[{] call[_response.render, parameter[call[CssHeaderItem.forReference, parameter[member[.reference]]]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[renderHead] operator[SEP] Keyword[final] identifier[Component] identifier[_component] , Keyword[final] identifier[IHeaderResponse] identifier[_response] operator[SEP] { Keyword[super] operator[SEP] identifier[renderHead] operator[SEP] identifier[_component] , identifier[_response] operator[SEP] operator[SEP] identifier[_response] operator[SEP] identifier[render] operator[SEP] Keyword[new] identifier[PriorityHeaderItem] operator[SEP] Keyword[new] identifier[DojoHeaderItem] operator[SEP] identifier[AbstractDojoBehavior] operator[SEP] identifier[JS_DOJO] , identifier[AbstractDojoBehavior] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[clazz] operator[=] identifier[Configuration] operator[SEP] identifier[getAttribute] operator[SEP] identifier[ConfigAttribute] operator[SEP] identifier[DOJO_CLASS] operator[SEP] operator[SEP] identifier[ResourceReference] identifier[reference] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] { identifier[reference] operator[=] identifier[AbstractDojoBehavior] operator[SEP] identifier[CSS_TUNDRA] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] { identifier[reference] operator[=] identifier[AbstractDojoBehavior] operator[SEP] identifier[CSS_CLARO] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] { identifier[reference] operator[=] identifier[AbstractDojoBehavior] operator[SEP] identifier[CSS_NIHILO] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] { identifier[reference] operator[=] identifier[AbstractDojoBehavior] operator[SEP] identifier[CSS_TUNDRA] operator[SEP] } Keyword[if] operator[SEP] identifier[reference] operator[!=] Other[null] operator[SEP] { identifier[_response] operator[SEP] identifier[render] operator[SEP] identifier[CssHeaderItem] operator[SEP] identifier[forReference] operator[SEP] identifier[reference] operator[SEP] operator[SEP] operator[SEP] } }
@Override public CPDefinitionInventory getCPDefinitionInventoryByUuidAndGroupId( String uuid, long groupId) throws PortalException { return cpDefinitionInventoryPersistence.findByUUID_G(uuid, groupId); }
class class_name[name] begin[{] method[getCPDefinitionInventoryByUuidAndGroupId, return_type[type[CPDefinitionInventory]], modifier[public], parameter[uuid, groupId]] begin[{] return[call[cpDefinitionInventoryPersistence.findByUUID_G, parameter[member[.uuid], member[.groupId]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CPDefinitionInventory] identifier[getCPDefinitionInventoryByUuidAndGroupId] operator[SEP] identifier[String] identifier[uuid] , Keyword[long] identifier[groupId] operator[SEP] Keyword[throws] identifier[PortalException] { Keyword[return] identifier[cpDefinitionInventoryPersistence] operator[SEP] identifier[findByUUID_G] operator[SEP] identifier[uuid] , identifier[groupId] operator[SEP] operator[SEP] }
private ColumnFamily collectTimeOrderedData(boolean copyOnHeap) { final ColumnFamily container = ArrayBackedSortedColumns.factory.create(cfs.metadata, filter.filter.isReversed()); List<OnDiskAtomIterator> iterators = new ArrayList<>(); boolean isEmpty = true; Tracing.trace("Acquiring sstable references"); ColumnFamilyStore.ViewFragment view = cfs.select(cfs.viewFilter(filter.key)); try { Tracing.trace("Merging memtable contents"); long mostRecentRowTombstone = Long.MIN_VALUE; for (Memtable memtable : view.memtables) { ColumnFamily cf = memtable.getColumnFamily(filter.key); if (cf != null) { filter.delete(container.deletionInfo(), cf); isEmpty = false; Iterator<Cell> iter = filter.getIterator(cf); while (iter.hasNext()) { Cell cell = iter.next(); if (copyOnHeap) cell = cell.localCopy(cfs.metadata, HeapAllocator.instance); container.addColumn(cell); } } mostRecentRowTombstone = container.deletionInfo().getTopLevelDeletion().markedForDeleteAt; } // avoid changing the filter columns of the original filter // (reduceNameFilter removes columns that are known to be irrelevant) NamesQueryFilter namesFilter = (NamesQueryFilter) filter.filter; TreeSet<CellName> filterColumns = new TreeSet<>(namesFilter.columns); QueryFilter reducedFilter = new QueryFilter(filter.key, filter.cfName, namesFilter.withUpdatedColumns(filterColumns), filter.timestamp); /* add the SSTables on disk */ Collections.sort(view.sstables, SSTableReader.maxTimestampComparator); // read sorted sstables for (SSTableReader sstable : view.sstables) { // if we've already seen a row tombstone with a timestamp greater // than the most recent update to this sstable, we're done, since the rest of the sstables // will also be older if (sstable.getMaxTimestamp() < mostRecentRowTombstone) break; long currentMaxTs = sstable.getMaxTimestamp(); reduceNameFilter(reducedFilter, container, currentMaxTs); if (((NamesQueryFilter) reducedFilter.filter).columns.isEmpty()) break; Tracing.trace("Merging data from sstable {}", sstable.descriptor.generation); sstable.incrementReadCount(); OnDiskAtomIterator iter = reducedFilter.getSSTableColumnIterator(sstable); iterators.add(iter); isEmpty = false; if (iter.getColumnFamily() != null) { container.delete(iter.getColumnFamily()); sstablesIterated++; while (iter.hasNext()) container.addAtom(iter.next()); } mostRecentRowTombstone = container.deletionInfo().getTopLevelDeletion().markedForDeleteAt; } // we need to distinguish between "there is no data at all for this row" (BF will let us rebuild that efficiently) // and "there used to be data, but it's gone now" (we should cache the empty CF so we don't need to rebuild that slower) if (isEmpty) return null; // do a final collate. toCollate is boilerplate required to provide a CloseableIterator ColumnFamily returnCF = container.cloneMeShallow(); Tracing.trace("Collating all results"); filter.collateOnDiskAtom(returnCF, container.iterator(), gcBefore); // "hoist up" the requested data into a more recent sstable if (sstablesIterated > cfs.getMinimumCompactionThreshold() && !cfs.isAutoCompactionDisabled() && cfs.getCompactionStrategy().shouldDefragment()) { // !!WARNING!! if we stop copying our data to a heap-managed object, // we will need to track the lifetime of this mutation as well Tracing.trace("Defragmenting requested data"); final Mutation mutation = new Mutation(cfs.keyspace.getName(), filter.key.getKey(), returnCF.cloneMe()); StageManager.getStage(Stage.MUTATION).execute(new Runnable() { public void run() { // skipping commitlog and index updates is fine since we're just de-fragmenting existing data Keyspace.open(mutation.getKeyspaceName()).apply(mutation, false, false); } }); } // Caller is responsible for final removeDeletedCF. This is important for cacheRow to work correctly: return returnCF; } finally { for (OnDiskAtomIterator iter : iterators) FileUtils.closeQuietly(iter); } }
class class_name[name] begin[{] method[collectTimeOrderedData, return_type[type[ColumnFamily]], modifier[private], parameter[copyOnHeap]] begin[{] local_variable[type[ColumnFamily], container] local_variable[type[List], iterators] local_variable[type[boolean], isEmpty] call[Tracing.trace, parameter[literal["Acquiring sstable references"]]] local_variable[type[ColumnFamilyStore], view] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Merging memtable contents")], member=trace, postfix_operators=[], prefix_operators=[], qualifier=Tracing, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), name=mostRecentRowTombstone)], modifiers=set(), type=BasicType(dimensions=[], name=long)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[])], member=getColumnFamily, postfix_operators=[], prefix_operators=[], qualifier=memtable, selectors=[], type_arguments=None), name=cf)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColumnFamily, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=deletionInfo, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), MemberReference(member=cf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=delete, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=cf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIterator, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), name=iter)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Cell, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), name=cell)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cell, sub_type=None)), IfStatement(condition=MemberReference(member=copyOnHeap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=cell, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=cfs, selectors=[]), MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=HeapAllocator, selectors=[])], member=localCopy, postfix_operators=[], prefix_operators=[], qualifier=cell, selectors=[], type_arguments=None)), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cell, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addColumn, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mostRecentRowTombstone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=deletionInfo, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[MethodInvocation(arguments=[], member=getTopLevelDeletion, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MemberReference(member=markedForDeleteAt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=memtables, postfix_operators=[], prefix_operators=[], qualifier=view, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=memtable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Memtable, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=NamesQueryFilter, sub_type=None)), name=namesFilter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NamesQueryFilter, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=namesFilter, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=TreeSet, sub_type=None)), name=filterColumns)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CellName, sub_type=None))], dimensions=[], name=TreeSet, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[]), MemberReference(member=cfName, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[]), MethodInvocation(arguments=[MemberReference(member=filterColumns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withUpdatedColumns, postfix_operators=[], prefix_operators=[], qualifier=namesFilter, selectors=[], type_arguments=None), MemberReference(member=timestamp, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=QueryFilter, sub_type=None)), name=reducedFilter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=QueryFilter, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=sstables, postfix_operators=[], prefix_operators=[], qualifier=view, selectors=[]), MemberReference(member=maxTimestampComparator, postfix_operators=[], prefix_operators=[], qualifier=SSTableReader, selectors=[])], member=sort, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMaxTimestamp, postfix_operators=[], prefix_operators=[], qualifier=sstable, selectors=[], type_arguments=None), operandr=MemberReference(member=mostRecentRowTombstone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMaxTimestamp, postfix_operators=[], prefix_operators=[], qualifier=sstable, selectors=[], type_arguments=None), name=currentMaxTs)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=reducedFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=currentMaxTs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reduceNameFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=Cast(expression=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=reducedFilter, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=NamesQueryFilter, sub_type=None)), else_statement=None, label=None, then_statement=BreakStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Merging data from sstable {}"), MemberReference(member=generation, postfix_operators=[], prefix_operators=[], qualifier=sstable.descriptor, selectors=[])], member=trace, postfix_operators=[], prefix_operators=[], qualifier=Tracing, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=incrementReadCount, postfix_operators=[], prefix_operators=[], qualifier=sstable, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sstable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSSTableColumnIterator, postfix_operators=[], prefix_operators=[], qualifier=reducedFilter, selectors=[], type_arguments=None), name=iter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OnDiskAtomIterator, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=iterators, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getColumnFamily, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getColumnFamily, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None)], member=delete, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=sstablesIterated, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), WhileStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None)], member=addAtom, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), label=None), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mostRecentRowTombstone, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=deletionInfo, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[MethodInvocation(arguments=[], member=getTopLevelDeletion, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MemberReference(member=markedForDeleteAt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=sstables, postfix_operators=[], prefix_operators=[], qualifier=view, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sstable)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SSTableReader, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=cloneMeShallow, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), name=returnCF)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ColumnFamily, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Collating all results")], member=trace, postfix_operators=[], prefix_operators=[], qualifier=Tracing, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=returnCF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=container, selectors=[], type_arguments=None), MemberReference(member=gcBefore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=collateOnDiskAtom, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=sstablesIterated, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMinimumCompactionThreshold, postfix_operators=[], prefix_operators=[], qualifier=cfs, selectors=[], type_arguments=None), operator=>), operandr=MethodInvocation(arguments=[], member=isAutoCompactionDisabled, postfix_operators=[], prefix_operators=['!'], qualifier=cfs, selectors=[], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[], member=getCompactionStrategy, postfix_operators=[], prefix_operators=[], qualifier=cfs, selectors=[MethodInvocation(arguments=[], member=shouldDefragment, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Defragmenting requested data")], member=trace, postfix_operators=[], prefix_operators=[], qualifier=Tracing, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=cfs.keyspace, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=filter.key, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=cloneMe, postfix_operators=[], prefix_operators=[], qualifier=returnCF, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Mutation, sub_type=None)), name=mutation)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Mutation, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=MUTATION, postfix_operators=[], prefix_operators=[], qualifier=Stage, selectors=[])], member=getStage, postfix_operators=[], prefix_operators=[], qualifier=StageManager, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKeyspaceName, postfix_operators=[], prefix_operators=[], qualifier=mutation, selectors=[], type_arguments=None)], member=open, postfix_operators=[], prefix_operators=[], qualifier=Keyspace, selectors=[MethodInvocation(arguments=[MemberReference(member=mutation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=apply, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)])), ReturnStatement(expression=MemberReference(member=returnCF, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MemberReference(member=iterators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=iter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OnDiskAtomIterator, sub_type=None))), label=None)], label=None, resources=None) end[}] END[}]
Keyword[private] identifier[ColumnFamily] identifier[collectTimeOrderedData] operator[SEP] Keyword[boolean] identifier[copyOnHeap] operator[SEP] { Keyword[final] identifier[ColumnFamily] identifier[container] operator[=] identifier[ArrayBackedSortedColumns] operator[SEP] identifier[factory] operator[SEP] identifier[create] operator[SEP] identifier[cfs] operator[SEP] identifier[metadata] , identifier[filter] operator[SEP] identifier[filter] operator[SEP] identifier[isReversed] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[OnDiskAtomIterator] operator[>] identifier[iterators] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isEmpty] operator[=] literal[boolean] operator[SEP] identifier[Tracing] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ColumnFamilyStore] operator[SEP] identifier[ViewFragment] identifier[view] operator[=] identifier[cfs] operator[SEP] identifier[select] operator[SEP] identifier[cfs] operator[SEP] identifier[viewFilter] operator[SEP] identifier[filter] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Tracing] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[long] identifier[mostRecentRowTombstone] operator[=] identifier[Long] operator[SEP] identifier[MIN_VALUE] operator[SEP] Keyword[for] operator[SEP] identifier[Memtable] identifier[memtable] operator[:] identifier[view] operator[SEP] identifier[memtables] operator[SEP] { identifier[ColumnFamily] identifier[cf] operator[=] identifier[memtable] operator[SEP] identifier[getColumnFamily] operator[SEP] identifier[filter] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cf] operator[!=] Other[null] operator[SEP] { identifier[filter] operator[SEP] identifier[delete] operator[SEP] identifier[container] operator[SEP] identifier[deletionInfo] operator[SEP] operator[SEP] , identifier[cf] operator[SEP] operator[SEP] identifier[isEmpty] operator[=] literal[boolean] operator[SEP] identifier[Iterator] operator[<] identifier[Cell] operator[>] identifier[iter] operator[=] identifier[filter] operator[SEP] identifier[getIterator] operator[SEP] identifier[cf] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Cell] identifier[cell] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[copyOnHeap] operator[SEP] identifier[cell] operator[=] identifier[cell] operator[SEP] identifier[localCopy] operator[SEP] identifier[cfs] operator[SEP] identifier[metadata] , identifier[HeapAllocator] operator[SEP] identifier[instance] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[addColumn] operator[SEP] identifier[cell] operator[SEP] operator[SEP] } } identifier[mostRecentRowTombstone] operator[=] identifier[container] operator[SEP] identifier[deletionInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getTopLevelDeletion] operator[SEP] operator[SEP] operator[SEP] identifier[markedForDeleteAt] operator[SEP] } identifier[NamesQueryFilter] identifier[namesFilter] operator[=] operator[SEP] identifier[NamesQueryFilter] operator[SEP] identifier[filter] operator[SEP] identifier[filter] operator[SEP] identifier[TreeSet] operator[<] identifier[CellName] operator[>] identifier[filterColumns] operator[=] Keyword[new] identifier[TreeSet] operator[<] operator[>] operator[SEP] identifier[namesFilter] operator[SEP] identifier[columns] operator[SEP] operator[SEP] identifier[QueryFilter] identifier[reducedFilter] operator[=] Keyword[new] identifier[QueryFilter] operator[SEP] identifier[filter] operator[SEP] identifier[key] , identifier[filter] operator[SEP] identifier[cfName] , identifier[namesFilter] operator[SEP] identifier[withUpdatedColumns] operator[SEP] identifier[filterColumns] operator[SEP] , identifier[filter] operator[SEP] identifier[timestamp] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[sort] operator[SEP] identifier[view] operator[SEP] identifier[sstables] , identifier[SSTableReader] operator[SEP] identifier[maxTimestampComparator] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SSTableReader] identifier[sstable] operator[:] identifier[view] operator[SEP] identifier[sstables] operator[SEP] { Keyword[if] operator[SEP] identifier[sstable] operator[SEP] identifier[getMaxTimestamp] operator[SEP] operator[SEP] operator[<] identifier[mostRecentRowTombstone] operator[SEP] Keyword[break] operator[SEP] Keyword[long] identifier[currentMaxTs] operator[=] identifier[sstable] operator[SEP] identifier[getMaxTimestamp] operator[SEP] operator[SEP] operator[SEP] identifier[reduceNameFilter] operator[SEP] identifier[reducedFilter] , identifier[container] , identifier[currentMaxTs] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[NamesQueryFilter] operator[SEP] identifier[reducedFilter] operator[SEP] identifier[filter] operator[SEP] operator[SEP] identifier[columns] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] identifier[Tracing] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[sstable] operator[SEP] identifier[descriptor] operator[SEP] identifier[generation] operator[SEP] operator[SEP] identifier[sstable] operator[SEP] identifier[incrementReadCount] operator[SEP] operator[SEP] operator[SEP] identifier[OnDiskAtomIterator] identifier[iter] operator[=] identifier[reducedFilter] operator[SEP] identifier[getSSTableColumnIterator] operator[SEP] identifier[sstable] operator[SEP] operator[SEP] identifier[iterators] operator[SEP] identifier[add] operator[SEP] identifier[iter] operator[SEP] operator[SEP] identifier[isEmpty] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[iter] operator[SEP] identifier[getColumnFamily] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[container] operator[SEP] identifier[delete] operator[SEP] identifier[iter] operator[SEP] identifier[getColumnFamily] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sstablesIterated] operator[++] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] identifier[container] operator[SEP] identifier[addAtom] operator[SEP] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[mostRecentRowTombstone] operator[=] identifier[container] operator[SEP] identifier[deletionInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getTopLevelDeletion] operator[SEP] operator[SEP] operator[SEP] identifier[markedForDeleteAt] operator[SEP] } Keyword[if] operator[SEP] identifier[isEmpty] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[ColumnFamily] identifier[returnCF] operator[=] identifier[container] operator[SEP] identifier[cloneMeShallow] operator[SEP] operator[SEP] operator[SEP] identifier[Tracing] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[collateOnDiskAtom] operator[SEP] identifier[returnCF] , identifier[container] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] , identifier[gcBefore] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sstablesIterated] operator[>] identifier[cfs] operator[SEP] identifier[getMinimumCompactionThreshold] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[cfs] operator[SEP] identifier[isAutoCompactionDisabled] operator[SEP] operator[SEP] operator[&&] identifier[cfs] operator[SEP] identifier[getCompactionStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[shouldDefragment] operator[SEP] operator[SEP] operator[SEP] { identifier[Tracing] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Mutation] identifier[mutation] operator[=] Keyword[new] identifier[Mutation] operator[SEP] identifier[cfs] operator[SEP] identifier[keyspace] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[filter] operator[SEP] identifier[key] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[returnCF] operator[SEP] identifier[cloneMe] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[StageManager] operator[SEP] identifier[getStage] operator[SEP] identifier[Stage] operator[SEP] identifier[MUTATION] operator[SEP] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[Keyspace] operator[SEP] identifier[open] operator[SEP] identifier[mutation] operator[SEP] identifier[getKeyspaceName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[apply] operator[SEP] identifier[mutation] , literal[boolean] , literal[boolean] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } Keyword[return] identifier[returnCF] operator[SEP] } Keyword[finally] { Keyword[for] operator[SEP] identifier[OnDiskAtomIterator] identifier[iter] operator[:] identifier[iterators] operator[SEP] identifier[FileUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[iter] operator[SEP] operator[SEP] } }
public Boolean checkType(String type) { if (mtasPositionType == null) { return false; } else { return mtasPositionType.equals(type); } }
class class_name[name] begin[{] method[checkType, return_type[type[Boolean]], modifier[public], parameter[type]] begin[{] if[binary_operation[member[.mtasPositionType], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] return[call[mtasPositionType.equals, parameter[member[.type]]]] end[}] end[}] END[}]
Keyword[public] identifier[Boolean] identifier[checkType] operator[SEP] identifier[String] identifier[type] operator[SEP] { Keyword[if] operator[SEP] identifier[mtasPositionType] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] identifier[mtasPositionType] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] operator[SEP] } }
@Override public void debug (final String format, final Object arg) { _log ().debug (_format (format, arg)); }
class class_name[name] begin[{] method[debug, return_type[void], modifier[public], parameter[format, arg]] begin[{] call[._log, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[debug] operator[SEP] Keyword[final] identifier[String] identifier[format] , Keyword[final] identifier[Object] identifier[arg] operator[SEP] { identifier[_log] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] identifier[_format] operator[SEP] identifier[format] , identifier[arg] operator[SEP] operator[SEP] operator[SEP] }
public void set(double a, double b, double c) { this.A = a; this.B = b; this.C = c; }
class class_name[name] begin[{] method[set, return_type[void], modifier[public], parameter[a, b, c]] begin[{] assign[THIS[member[None.A]], member[.a]] assign[THIS[member[None.B]], member[.b]] assign[THIS[member[None.C]], member[.c]] end[}] END[}]
Keyword[public] Keyword[void] identifier[set] operator[SEP] Keyword[double] identifier[a] , Keyword[double] identifier[b] , Keyword[double] identifier[c] operator[SEP] { Keyword[this] operator[SEP] identifier[A] operator[=] identifier[a] operator[SEP] Keyword[this] operator[SEP] identifier[B] operator[=] identifier[b] operator[SEP] Keyword[this] operator[SEP] identifier[C] operator[=] identifier[c] operator[SEP] }
public static void cutStringAsArray(String text, CutStringCritera critera, List<String> output) { cutStringAlgo(text, critera, new CutStringToArray(output)); }
class class_name[name] begin[{] method[cutStringAsArray, return_type[void], modifier[public static], parameter[text, critera, output]] begin[{] call[.cutStringAlgo, parameter[member[.text], member[.critera], ClassCreator(arguments=[MemberReference(member=output, 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=CutStringToArray, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[cutStringAsArray] operator[SEP] identifier[String] identifier[text] , identifier[CutStringCritera] identifier[critera] , identifier[List] operator[<] identifier[String] operator[>] identifier[output] operator[SEP] { identifier[cutStringAlgo] operator[SEP] identifier[text] , identifier[critera] , Keyword[new] identifier[CutStringToArray] operator[SEP] identifier[output] operator[SEP] operator[SEP] operator[SEP] }
protected JCClassDecl enumDeclaration(JCModifiers mods, Comment dc) { int pos = token.pos; accept(ENUM); Name name = ident(); List<JCExpression> implementing = List.nil(); if (token.kind == IMPLEMENTS) { nextToken(); implementing = typeList(); } List<JCTree> defs = enumBody(name); mods.flags |= Flags.ENUM; JCClassDecl result = toP(F.at(pos). ClassDef(mods, name, List.nil(), null, implementing, defs)); attach(result, dc); return result; }
class class_name[name] begin[{] method[enumDeclaration, return_type[type[JCClassDecl]], modifier[protected], parameter[mods, dc]] begin[{] local_variable[type[int], pos] call[.accept, parameter[member[.ENUM]]] local_variable[type[Name], name] local_variable[type[List], implementing] if[binary_operation[member[token.kind], ==, member[.IMPLEMENTS]]] begin[{] call[.nextToken, parameter[]] assign[member[.implementing], call[.typeList, parameter[]]] else begin[{] None end[}] local_variable[type[List], defs] assign[member[mods.flags], member[Flags.ENUM]] local_variable[type[JCClassDecl], result] call[.attach, parameter[member[.result], member[.dc]]] return[member[.result]] end[}] END[}]
Keyword[protected] identifier[JCClassDecl] identifier[enumDeclaration] operator[SEP] identifier[JCModifiers] identifier[mods] , identifier[Comment] identifier[dc] operator[SEP] { Keyword[int] identifier[pos] operator[=] identifier[token] operator[SEP] identifier[pos] operator[SEP] identifier[accept] operator[SEP] identifier[ENUM] operator[SEP] operator[SEP] identifier[Name] identifier[name] operator[=] identifier[ident] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[JCExpression] operator[>] identifier[implementing] operator[=] identifier[List] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[SEP] identifier[kind] operator[==] identifier[IMPLEMENTS] operator[SEP] { identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[implementing] operator[=] identifier[typeList] operator[SEP] operator[SEP] operator[SEP] } identifier[List] operator[<] identifier[JCTree] operator[>] identifier[defs] operator[=] identifier[enumBody] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[mods] operator[SEP] identifier[flags] operator[|=] identifier[Flags] operator[SEP] identifier[ENUM] operator[SEP] identifier[JCClassDecl] identifier[result] operator[=] identifier[toP] operator[SEP] identifier[F] operator[SEP] identifier[at] operator[SEP] identifier[pos] operator[SEP] operator[SEP] identifier[ClassDef] operator[SEP] identifier[mods] , identifier[name] , identifier[List] operator[SEP] identifier[nil] operator[SEP] operator[SEP] , Other[null] , identifier[implementing] , identifier[defs] operator[SEP] operator[SEP] operator[SEP] identifier[attach] operator[SEP] identifier[result] , identifier[dc] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public int moveControlInput(String strSuffix) throws DBException { int iDefaultParamsFound = DBConstants.NO_PARAMS_FOUND; if (!(this.getScreenField() instanceof BasePanel)) { // Regular input field if (this.getScreenField().isInputField()) { String strFieldName = this.getScreenField().getSFieldParam(strSuffix); String strParamValue = this.getSFieldProperty(strFieldName); if (strParamValue != null) { int iErrorCode = this.getScreenField().setSFieldValue(strParamValue, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE); if (iErrorCode != DBConstants.NORMAL_RETURN) { DatabaseException ex = new DatabaseException(iErrorCode); String strError = ex.getMessage(this.getScreenField().getParentScreen().getTask()); String strFieldDesc = null; if (this.getScreenField().getConverter() != null) strFieldDesc = this.getScreenField().getConverter().getFieldDesc(); if ((strFieldDesc == null) || (strFieldDesc.length() == 0)) strFieldDesc = strFieldName; if (strError != null) // Add the field name to the error ex = new DatabaseException(strError + " on " + strFieldDesc + " field"); throw ex; } iDefaultParamsFound = DBConstants.NORMAL_RETURN; } } } else { int iNumCols = ((BasePanel)this.getScreenField()).getSFieldCount(); String strMoveValue = this.getProperty(DBParams.COMMAND); // Display record if (strMoveValue == null) strMoveValue = Constants.BLANK; if ((strMoveValue != null) && (strMoveValue.length() > 0)) // Only move params on submit { // Move the input params to the record fields for (int iIndex = 0; iIndex < iNumCols; iIndex++) { ScreenFieldView vField = ((BasePanel)this.getScreenField()).getSField(iIndex).getScreenFieldView(); if (vField.moveControlInput(strSuffix) == DBConstants.NORMAL_RETURN) iDefaultParamsFound = DBConstants.NORMAL_RETURN; } } } return iDefaultParamsFound; }
class class_name[name] begin[{] method[moveControlInput, return_type[type[int]], modifier[public], parameter[strSuffix]] begin[{] local_variable[type[int], iDefaultParamsFound] if[binary_operation[THIS[call[None.getScreenField, parameter[]]], instanceof, type[BasePanel]]] begin[{] if[THIS[call[None.getScreenField, parameter[]]call[None.isInputField, parameter[]]]] begin[{] local_variable[type[String], strFieldName] local_variable[type[String], strParamValue] if[binary_operation[member[.strParamValue], !=, literal[null]]] begin[{] local_variable[type[int], iErrorCode] if[binary_operation[member[.iErrorCode], !=, member[DBConstants.NORMAL_RETURN]]] begin[{] local_variable[type[DatabaseException], ex] local_variable[type[String], strError] local_variable[type[String], strFieldDesc] if[binary_operation[THIS[call[None.getScreenField, parameter[]]call[None.getConverter, parameter[]]], !=, literal[null]]] begin[{] assign[member[.strFieldDesc], THIS[call[None.getScreenField, parameter[]]call[None.getConverter, parameter[]]call[None.getFieldDesc, parameter[]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.strFieldDesc], ==, literal[null]], ||, binary_operation[call[strFieldDesc.length, parameter[]], ==, literal[0]]]] begin[{] assign[member[.strFieldDesc], member[.strFieldName]] else begin[{] None end[}] if[binary_operation[member[.strError], !=, literal[null]]] begin[{] assign[member[.ex], ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=strError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" on "), operator=+), operandr=MemberReference(member=strFieldDesc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" field"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DatabaseException, sub_type=None))] else begin[{] None end[}] ThrowStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] assign[member[.iDefaultParamsFound], member[DBConstants.NORMAL_RETURN]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] local_variable[type[int], iNumCols] local_variable[type[String], strMoveValue] if[binary_operation[member[.strMoveValue], ==, literal[null]]] begin[{] assign[member[.strMoveValue], member[Constants.BLANK]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.strMoveValue], !=, literal[null]], &&, binary_operation[call[strMoveValue.length, parameter[]], >, literal[0]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getScreenField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=BasePanel, sub_type=None)), name=vField)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ScreenFieldView, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=strSuffix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=moveControlInput, postfix_operators=[], prefix_operators=[], qualifier=vField, selectors=[], type_arguments=None), operandr=MemberReference(member=NORMAL_RETURN, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=iDefaultParamsFound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=NORMAL_RETURN, postfix_operators=[], prefix_operators=[], qualifier=DBConstants, selectors=[])), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=iIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=iNumCols, 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=iIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=iIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] end[}] return[member[.iDefaultParamsFound]] end[}] END[}]
Keyword[public] Keyword[int] identifier[moveControlInput] operator[SEP] identifier[String] identifier[strSuffix] operator[SEP] Keyword[throws] identifier[DBException] { Keyword[int] identifier[iDefaultParamsFound] operator[=] identifier[DBConstants] operator[SEP] identifier[NO_PARAMS_FOUND] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] Keyword[instanceof] identifier[BasePanel] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] identifier[isInputField] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[strFieldName] operator[=] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] identifier[getSFieldParam] operator[SEP] identifier[strSuffix] operator[SEP] operator[SEP] identifier[String] identifier[strParamValue] operator[=] Keyword[this] operator[SEP] identifier[getSFieldProperty] operator[SEP] identifier[strFieldName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strParamValue] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[iErrorCode] operator[=] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] identifier[setSFieldValue] operator[SEP] identifier[strParamValue] , identifier[DBConstants] operator[SEP] identifier[DONT_DISPLAY] , identifier[DBConstants] operator[SEP] identifier[SCREEN_MOVE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iErrorCode] operator[!=] identifier[DBConstants] operator[SEP] identifier[NORMAL_RETURN] operator[SEP] { identifier[DatabaseException] identifier[ex] operator[=] Keyword[new] identifier[DatabaseException] operator[SEP] identifier[iErrorCode] operator[SEP] operator[SEP] identifier[String] identifier[strError] operator[=] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] identifier[getParentScreen] operator[SEP] operator[SEP] operator[SEP] identifier[getTask] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[strFieldDesc] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] identifier[getConverter] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[strFieldDesc] operator[=] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] identifier[getConverter] operator[SEP] operator[SEP] operator[SEP] identifier[getFieldDesc] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[strFieldDesc] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[strFieldDesc] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] identifier[strFieldDesc] operator[=] identifier[strFieldName] operator[SEP] Keyword[if] operator[SEP] identifier[strError] operator[!=] Other[null] operator[SEP] identifier[ex] operator[=] Keyword[new] identifier[DatabaseException] operator[SEP] identifier[strError] operator[+] literal[String] operator[+] identifier[strFieldDesc] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[throw] identifier[ex] operator[SEP] } identifier[iDefaultParamsFound] operator[=] identifier[DBConstants] operator[SEP] identifier[NORMAL_RETURN] operator[SEP] } } } Keyword[else] { Keyword[int] identifier[iNumCols] operator[=] operator[SEP] operator[SEP] identifier[BasePanel] operator[SEP] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getSFieldCount] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[strMoveValue] operator[=] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[DBParams] operator[SEP] identifier[COMMAND] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strMoveValue] operator[==] Other[null] operator[SEP] identifier[strMoveValue] operator[=] identifier[Constants] operator[SEP] identifier[BLANK] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[strMoveValue] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[strMoveValue] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[iIndex] operator[=] Other[0] operator[SEP] identifier[iIndex] operator[<] identifier[iNumCols] operator[SEP] identifier[iIndex] operator[++] operator[SEP] { identifier[ScreenFieldView] identifier[vField] operator[=] operator[SEP] operator[SEP] identifier[BasePanel] operator[SEP] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getSField] operator[SEP] identifier[iIndex] operator[SEP] operator[SEP] identifier[getScreenFieldView] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vField] operator[SEP] identifier[moveControlInput] operator[SEP] identifier[strSuffix] operator[SEP] operator[==] identifier[DBConstants] operator[SEP] identifier[NORMAL_RETURN] operator[SEP] identifier[iDefaultParamsFound] operator[=] identifier[DBConstants] operator[SEP] identifier[NORMAL_RETURN] operator[SEP] } } } Keyword[return] identifier[iDefaultParamsFound] operator[SEP] }
public void pad(int width) throws IOException { int gap = (int)this.nrBits % width; if (gap < 0) { gap += width; } if (gap != 0) { int padding = width - gap; while (padding > 0) { this.zero(); padding -= 1; } } this.out.flush(); }
class class_name[name] begin[{] method[pad, return_type[void], modifier[public], parameter[width]] begin[{] local_variable[type[int], gap] if[binary_operation[member[.gap], <, literal[0]]] begin[{] assign[member[.gap], member[.width]] else begin[{] None end[}] if[binary_operation[member[.gap], !=, literal[0]]] begin[{] local_variable[type[int], padding] while[binary_operation[member[.padding], >, literal[0]]] begin[{] THIS[call[None.zero, parameter[]]] assign[member[.padding], literal[1]] end[}] else begin[{] None end[}] THIS[member[None.out]call[None.flush, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[pad] operator[SEP] Keyword[int] identifier[width] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[gap] operator[=] operator[SEP] Keyword[int] operator[SEP] Keyword[this] operator[SEP] identifier[nrBits] operator[%] identifier[width] operator[SEP] Keyword[if] operator[SEP] identifier[gap] operator[<] Other[0] operator[SEP] { identifier[gap] operator[+=] identifier[width] operator[SEP] } Keyword[if] operator[SEP] identifier[gap] operator[!=] Other[0] operator[SEP] { Keyword[int] identifier[padding] operator[=] identifier[width] operator[-] identifier[gap] operator[SEP] Keyword[while] operator[SEP] identifier[padding] operator[>] Other[0] operator[SEP] { Keyword[this] operator[SEP] identifier[zero] operator[SEP] operator[SEP] operator[SEP] identifier[padding] operator[-=] Other[1] operator[SEP] } } Keyword[this] operator[SEP] identifier[out] operator[SEP] identifier[flush] operator[SEP] operator[SEP] operator[SEP] }
public void trackEvent(String argCategory, String argAction) { trackEvent(argCategory, argAction, null, null); }
class class_name[name] begin[{] method[trackEvent, return_type[void], modifier[public], parameter[argCategory, argAction]] begin[{] call[.trackEvent, parameter[member[.argCategory], member[.argAction], literal[null], literal[null]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[trackEvent] operator[SEP] identifier[String] identifier[argCategory] , identifier[String] identifier[argAction] operator[SEP] { identifier[trackEvent] operator[SEP] identifier[argCategory] , identifier[argAction] , Other[null] , Other[null] operator[SEP] operator[SEP] }
public static byte[] generateTarGz(File sourceDirectory, String pathPrefix, File chaincodeMetaInf) throws IOException { logger.trace(format("generateTarGz: sourceDirectory: %s, pathPrefix: %s, chaincodeMetaInf: %s", sourceDirectory == null ? "null" : sourceDirectory.getAbsolutePath(), pathPrefix, chaincodeMetaInf == null ? "null" : chaincodeMetaInf.getAbsolutePath())); ByteArrayOutputStream bos = new ByteArrayOutputStream(500000); String sourcePath = sourceDirectory.getAbsolutePath(); TarArchiveOutputStream archiveOutputStream = new TarArchiveOutputStream(new GzipCompressorOutputStream(bos)); archiveOutputStream.setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); try { Collection<File> childrenFiles = org.apache.commons.io.FileUtils.listFiles(sourceDirectory, null, true); ArchiveEntry archiveEntry; FileInputStream fileInputStream; for (File childFile : childrenFiles) { String childPath = childFile.getAbsolutePath(); String relativePath = childPath.substring((sourcePath.length() + 1), childPath.length()); if (pathPrefix != null) { relativePath = Utils.combinePaths(pathPrefix, relativePath); } relativePath = FilenameUtils.separatorsToUnix(relativePath); if (TRACE_ENABED) { logger.trace(format("generateTarGz: Adding '%s' entry from source '%s' to archive.", relativePath, childFile.getAbsolutePath())); } archiveEntry = new TarArchiveEntry(childFile, relativePath); fileInputStream = new FileInputStream(childFile); archiveOutputStream.putArchiveEntry(archiveEntry); try { IOUtils.copy(fileInputStream, archiveOutputStream); } finally { IOUtils.closeQuietly(fileInputStream); archiveOutputStream.closeArchiveEntry(); } } if (null != chaincodeMetaInf) { childrenFiles = org.apache.commons.io.FileUtils.listFiles(chaincodeMetaInf, null, true); final URI metabase = chaincodeMetaInf.toURI(); for (File childFile : childrenFiles) { final String relativePath = Paths.get("META-INF", metabase.relativize(childFile.toURI()).getPath()).toString(); if (TRACE_ENABED) { logger.trace(format("generateTarGz: Adding '%s' entry from source '%s' to archive.", relativePath, childFile.getAbsolutePath())); } archiveEntry = new TarArchiveEntry(childFile, relativePath); fileInputStream = new FileInputStream(childFile); archiveOutputStream.putArchiveEntry(archiveEntry); try { IOUtils.copy(fileInputStream, archiveOutputStream); } finally { IOUtils.closeQuietly(fileInputStream); archiveOutputStream.closeArchiveEntry(); } } } } finally { IOUtils.closeQuietly(archiveOutputStream); } return bos.toByteArray(); }
class class_name[name] begin[{] method[generateTarGz, return_type[type[byte]], modifier[public static], parameter[sourceDirectory, pathPrefix, chaincodeMetaInf]] begin[{] call[logger.trace, parameter[call[.format, parameter[literal["generateTarGz: sourceDirectory: %s, pathPrefix: %s, chaincodeMetaInf: %s"], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=sourceDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=sourceDirectory, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null")), member[.pathPrefix], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=chaincodeMetaInf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=chaincodeMetaInf, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null"))]]]] local_variable[type[ByteArrayOutputStream], bos] local_variable[type[String], sourcePath] local_variable[type[TarArchiveOutputStream], archiveOutputStream] call[archiveOutputStream.setLongFileMode, parameter[member[TarArchiveOutputStream.LONGFILE_GNU]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sourceDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=listFiles, postfix_operators=[], prefix_operators=[], qualifier=org.apache.commons.io.FileUtils, selectors=[], type_arguments=None), name=childrenFiles)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))], dimensions=[], name=Collection, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=archiveEntry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ArchiveEntry, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=fileInputStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=childFile, selectors=[], type_arguments=None), name=childPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=sourcePath, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=childPath, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=childPath, selectors=[], type_arguments=None), name=relativePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pathPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=relativePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=pathPrefix, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=relativePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=combinePaths, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=relativePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=relativePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=separatorsToUnix, postfix_operators=[], prefix_operators=[], qualifier=FilenameUtils, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MemberReference(member=TRACE_ENABED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="generateTarGz: Adding '%s' entry from source '%s' to archive."), MemberReference(member=relativePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=childFile, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=archiveEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=childFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=relativePath, 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=TarArchiveEntry, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fileInputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=childFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=archiveEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putArchiveEntry, postfix_operators=[], prefix_operators=[], qualifier=archiveOutputStream, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fileInputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=archiveOutputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fileInputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=closeArchiveEntry, postfix_operators=[], prefix_operators=[], qualifier=archiveOutputStream, selectors=[], type_arguments=None), label=None)], label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=childrenFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=childFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=chaincodeMetaInf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=childrenFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=chaincodeMetaInf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=listFiles, postfix_operators=[], prefix_operators=[], qualifier=org.apache.commons.io.FileUtils, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=chaincodeMetaInf, selectors=[], type_arguments=None), name=metabase)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="META-INF"), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toURI, postfix_operators=[], prefix_operators=[], qualifier=childFile, selectors=[], type_arguments=None)], member=relativize, postfix_operators=[], prefix_operators=[], qualifier=metabase, selectors=[MethodInvocation(arguments=[], member=getPath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=Paths, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=relativePath)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MemberReference(member=TRACE_ENABED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="generateTarGz: Adding '%s' entry from source '%s' to archive."), MemberReference(member=relativePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=childFile, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=trace, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=archiveEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=childFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=relativePath, 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=TarArchiveEntry, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=fileInputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=childFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=archiveEntry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putArchiveEntry, postfix_operators=[], prefix_operators=[], qualifier=archiveOutputStream, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fileInputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=archiveOutputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fileInputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=closeArchiveEntry, postfix_operators=[], prefix_operators=[], qualifier=archiveOutputStream, selectors=[], type_arguments=None), label=None)], label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=childrenFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=childFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=archiveOutputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[call[bos.toByteArray, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[generateTarGz] operator[SEP] identifier[File] identifier[sourceDirectory] , identifier[String] identifier[pathPrefix] , identifier[File] identifier[chaincodeMetaInf] operator[SEP] Keyword[throws] identifier[IOException] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[sourceDirectory] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[sourceDirectory] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] , identifier[pathPrefix] , identifier[chaincodeMetaInf] operator[==] Other[null] operator[?] literal[String] operator[:] identifier[chaincodeMetaInf] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ByteArrayOutputStream] identifier[bos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] Other[500000] operator[SEP] operator[SEP] identifier[String] identifier[sourcePath] operator[=] identifier[sourceDirectory] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[TarArchiveOutputStream] identifier[archiveOutputStream] operator[=] Keyword[new] identifier[TarArchiveOutputStream] operator[SEP] Keyword[new] identifier[GzipCompressorOutputStream] operator[SEP] identifier[bos] operator[SEP] operator[SEP] operator[SEP] identifier[archiveOutputStream] operator[SEP] identifier[setLongFileMode] operator[SEP] identifier[TarArchiveOutputStream] operator[SEP] identifier[LONGFILE_GNU] operator[SEP] operator[SEP] Keyword[try] { identifier[Collection] operator[<] identifier[File] operator[>] identifier[childrenFiles] operator[=] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[commons] operator[SEP] identifier[io] operator[SEP] identifier[FileUtils] operator[SEP] identifier[listFiles] operator[SEP] identifier[sourceDirectory] , Other[null] , literal[boolean] operator[SEP] operator[SEP] identifier[ArchiveEntry] identifier[archiveEntry] operator[SEP] identifier[FileInputStream] identifier[fileInputStream] operator[SEP] Keyword[for] operator[SEP] identifier[File] identifier[childFile] operator[:] identifier[childrenFiles] operator[SEP] { identifier[String] identifier[childPath] operator[=] identifier[childFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[relativePath] operator[=] identifier[childPath] operator[SEP] identifier[substring] operator[SEP] operator[SEP] identifier[sourcePath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] , identifier[childPath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pathPrefix] operator[!=] Other[null] operator[SEP] { identifier[relativePath] operator[=] identifier[Utils] operator[SEP] identifier[combinePaths] operator[SEP] identifier[pathPrefix] , identifier[relativePath] operator[SEP] operator[SEP] } identifier[relativePath] operator[=] identifier[FilenameUtils] operator[SEP] identifier[separatorsToUnix] operator[SEP] identifier[relativePath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TRACE_ENABED] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[relativePath] , identifier[childFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[archiveEntry] operator[=] Keyword[new] identifier[TarArchiveEntry] operator[SEP] identifier[childFile] , identifier[relativePath] operator[SEP] operator[SEP] identifier[fileInputStream] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[childFile] operator[SEP] operator[SEP] identifier[archiveOutputStream] operator[SEP] identifier[putArchiveEntry] operator[SEP] identifier[archiveEntry] operator[SEP] operator[SEP] Keyword[try] { identifier[IOUtils] operator[SEP] identifier[copy] operator[SEP] identifier[fileInputStream] , identifier[archiveOutputStream] operator[SEP] operator[SEP] } Keyword[finally] { identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[fileInputStream] operator[SEP] operator[SEP] identifier[archiveOutputStream] operator[SEP] identifier[closeArchiveEntry] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] Other[null] operator[!=] identifier[chaincodeMetaInf] operator[SEP] { identifier[childrenFiles] operator[=] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[commons] operator[SEP] identifier[io] operator[SEP] identifier[FileUtils] operator[SEP] identifier[listFiles] operator[SEP] identifier[chaincodeMetaInf] , Other[null] , literal[boolean] operator[SEP] operator[SEP] Keyword[final] identifier[URI] identifier[metabase] operator[=] identifier[chaincodeMetaInf] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[File] identifier[childFile] operator[:] identifier[childrenFiles] operator[SEP] { Keyword[final] identifier[String] identifier[relativePath] operator[=] identifier[Paths] operator[SEP] identifier[get] operator[SEP] literal[String] , identifier[metabase] operator[SEP] identifier[relativize] operator[SEP] identifier[childFile] operator[SEP] identifier[toURI] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TRACE_ENABED] operator[SEP] { identifier[logger] operator[SEP] identifier[trace] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[relativePath] , identifier[childFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[archiveEntry] operator[=] Keyword[new] identifier[TarArchiveEntry] operator[SEP] identifier[childFile] , identifier[relativePath] operator[SEP] operator[SEP] identifier[fileInputStream] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[childFile] operator[SEP] operator[SEP] identifier[archiveOutputStream] operator[SEP] identifier[putArchiveEntry] operator[SEP] identifier[archiveEntry] operator[SEP] operator[SEP] Keyword[try] { identifier[IOUtils] operator[SEP] identifier[copy] operator[SEP] identifier[fileInputStream] , identifier[archiveOutputStream] operator[SEP] operator[SEP] } Keyword[finally] { identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[fileInputStream] operator[SEP] operator[SEP] identifier[archiveOutputStream] operator[SEP] identifier[closeArchiveEntry] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[finally] { identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[archiveOutputStream] operator[SEP] operator[SEP] } Keyword[return] identifier[bos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] }
static Matcher convertRepeatedAnyCharSeqToIndexOf(Matcher matcher) { if (matcher instanceof ZeroOrMoreMatcher) { ZeroOrMoreMatcher zm1 = matcher.as(); Matcher prefix = PatternUtils.getPrefix(zm1.next()); if (zm1.repeated() instanceof AnyMatcher && prefix instanceof CharSeqMatcher) { String pattern = prefix.<CharSeqMatcher>as().pattern(); Matcher suffix = PatternUtils.getSuffix(zm1.next()); return new IndexOfMatcher(pattern, suffix); } } return matcher; }
class class_name[name] begin[{] method[convertRepeatedAnyCharSeqToIndexOf, return_type[type[Matcher]], modifier[static], parameter[matcher]] begin[{] if[binary_operation[member[.matcher], instanceof, type[ZeroOrMoreMatcher]]] begin[{] local_variable[type[ZeroOrMoreMatcher], zm1] local_variable[type[Matcher], prefix] if[binary_operation[binary_operation[call[zm1.repeated, parameter[]], instanceof, type[AnyMatcher]], &&, binary_operation[member[.prefix], instanceof, type[CharSeqMatcher]]]] begin[{] local_variable[type[String], pattern] local_variable[type[Matcher], suffix] return[ClassCreator(arguments=[MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=suffix, 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=IndexOfMatcher, sub_type=None))] else begin[{] None end[}] else begin[{] None end[}] return[member[.matcher]] end[}] END[}]
Keyword[static] identifier[Matcher] identifier[convertRepeatedAnyCharSeqToIndexOf] operator[SEP] identifier[Matcher] identifier[matcher] operator[SEP] { Keyword[if] operator[SEP] identifier[matcher] Keyword[instanceof] identifier[ZeroOrMoreMatcher] operator[SEP] { identifier[ZeroOrMoreMatcher] identifier[zm1] operator[=] identifier[matcher] operator[SEP] identifier[as] operator[SEP] operator[SEP] operator[SEP] identifier[Matcher] identifier[prefix] operator[=] identifier[PatternUtils] operator[SEP] identifier[getPrefix] operator[SEP] identifier[zm1] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[zm1] operator[SEP] identifier[repeated] operator[SEP] operator[SEP] Keyword[instanceof] identifier[AnyMatcher] operator[&&] identifier[prefix] Keyword[instanceof] identifier[CharSeqMatcher] operator[SEP] { identifier[String] identifier[pattern] operator[=] identifier[prefix] operator[SEP] operator[<] identifier[CharSeqMatcher] operator[>] identifier[as] operator[SEP] operator[SEP] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] operator[SEP] identifier[Matcher] identifier[suffix] operator[=] identifier[PatternUtils] operator[SEP] identifier[getSuffix] operator[SEP] identifier[zm1] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[IndexOfMatcher] operator[SEP] identifier[pattern] , identifier[suffix] operator[SEP] operator[SEP] } } Keyword[return] identifier[matcher] operator[SEP] }
public Retina getLanguage (String body) throws ApiException { // verify required params are set if(body == null ) { throw new ApiException(400, "missing required params"); } // create path and map variables String path = "/text/detect_language".replaceAll("\\{format\\}","json"); // query params Map<String, String> queryParams = new HashMap<String, String>(); Map<String, String> headerParams = new HashMap<String, String>(); String contentType = "application/json"; try { Object response = apiInvoker.invokeAPI(basePath, path, "POST", queryParams , body, headerParams, contentType); if(response != null) { if (response instanceof String) { @SuppressWarnings("unchecked") Retina result = (Retina) ApiInvoker.deserialize( (String) response, "" , Retina.class, null);return result; } else if (response instanceof java.io.ByteArrayInputStream) { @SuppressWarnings("unchecked") Retina result = (Retina) response;return result; } } else { return null; } } catch (ApiException ex) { if(ex.getCode() == 404) { return null; } else { throw ex; } } return null;}
class class_name[name] begin[{] method[getLanguage, return_type[type[Retina]], modifier[public], parameter[body]] begin[{] if[binary_operation[member[.body], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=400), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="missing required params")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ApiException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[String], path] local_variable[type[Map], queryParams] local_variable[type[Map], headerParams] local_variable[type[String], contentType] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=basePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="POST"), MemberReference(member=queryParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=body, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=headerParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invokeAPI, postfix_operators=[], prefix_operators=[], qualifier=apiInvoker, selectors=[], type_arguments=None), name=response)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=io, sub_type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None))), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Retina, sub_type=None)), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Retina, sub_type=None)), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=response, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Retina, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=deserialize, postfix_operators=[], prefix_operators=[], qualifier=ApiInvoker, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Retina, sub_type=None)), name=result)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Retina, sub_type=None)), ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]))], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getCode, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=404), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['ApiException']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[Retina] identifier[getLanguage] operator[SEP] identifier[String] identifier[body] operator[SEP] Keyword[throws] identifier[ApiException] { Keyword[if] operator[SEP] identifier[body] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ApiException] operator[SEP] Other[400] , literal[String] operator[SEP] operator[SEP] } identifier[String] identifier[path] operator[=] literal[String] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[queryParams] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[headerParams] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[contentType] operator[=] literal[String] operator[SEP] Keyword[try] { identifier[Object] identifier[response] operator[=] identifier[apiInvoker] operator[SEP] identifier[invokeAPI] operator[SEP] identifier[basePath] , identifier[path] , literal[String] , identifier[queryParams] , identifier[body] , identifier[headerParams] , identifier[contentType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[response] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[response] Keyword[instanceof] identifier[String] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Retina] identifier[result] operator[=] operator[SEP] identifier[Retina] operator[SEP] identifier[ApiInvoker] operator[SEP] identifier[deserialize] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[response] , literal[String] , identifier[Retina] operator[SEP] Keyword[class] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[response] Keyword[instanceof] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[ByteArrayInputStream] operator[SEP] { annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Retina] identifier[result] operator[=] operator[SEP] identifier[Retina] operator[SEP] identifier[response] operator[SEP] Keyword[return] identifier[result] operator[SEP] } } Keyword[else] { Keyword[return] Other[null] operator[SEP] } } Keyword[catch] operator[SEP] identifier[ApiException] identifier[ex] operator[SEP] { Keyword[if] operator[SEP] identifier[ex] operator[SEP] identifier[getCode] operator[SEP] operator[SEP] operator[==] Other[404] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[throw] identifier[ex] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public static Keyword newKeyword(String prefix, String name) { return newKeyword(newSymbol(prefix, name)); }
class class_name[name] begin[{] method[newKeyword, return_type[type[Keyword]], modifier[public static], parameter[prefix, name]] begin[{] return[call[.newKeyword, parameter[call[.newSymbol, parameter[member[.prefix], member[.name]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Keyword] identifier[newKeyword] operator[SEP] identifier[String] identifier[prefix] , identifier[String] identifier[name] operator[SEP] { Keyword[return] identifier[newKeyword] operator[SEP] identifier[newSymbol] operator[SEP] identifier[prefix] , identifier[name] operator[SEP] operator[SEP] operator[SEP] }
@PostConstruct public final void init() { this.cleanUpTimer = Executors.newScheduledThreadPool(1, timerTask -> { final Thread thread = new Thread(timerTask, "Clean up old job records"); thread.setDaemon(true); return thread; }); this.cleanUpTimer.scheduleAtFixedRate(this::cleanup, this.cleanupInterval, this.cleanupInterval, TimeUnit.SECONDS); }
class class_name[name] begin[{] method[init, return_type[void], modifier[final public], parameter[]] begin[{] assign[THIS[member[None.cleanUpTimer]], call[Executors.newScheduledThreadPool, parameter[literal[1], LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=timerTask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Clean up old job records")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Thread, sub_type=None)), name=thread)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Thread, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setDaemon, postfix_operators=[], prefix_operators=[], qualifier=thread, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=thread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], parameters=[MemberReference(member=timerTask, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]] THIS[member[None.cleanUpTimer]call[None.scheduleAtFixedRate, parameter[MethodReference(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), method=MemberReference(member=cleanup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), THIS[member[None.cleanupInterval]], THIS[member[None.cleanupInterval]], member[TimeUnit.SECONDS]]]] end[}] END[}]
annotation[@] identifier[PostConstruct] Keyword[public] Keyword[final] Keyword[void] identifier[init] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[cleanUpTimer] operator[=] identifier[Executors] operator[SEP] identifier[newScheduledThreadPool] operator[SEP] Other[1] , identifier[timerTask] operator[->] { Keyword[final] identifier[Thread] identifier[thread] operator[=] Keyword[new] identifier[Thread] operator[SEP] identifier[timerTask] , literal[String] operator[SEP] operator[SEP] identifier[thread] operator[SEP] identifier[setDaemon] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[thread] operator[SEP] } operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[cleanUpTimer] operator[SEP] identifier[scheduleAtFixedRate] operator[SEP] Keyword[this] operator[::] identifier[cleanup] , Keyword[this] operator[SEP] identifier[cleanupInterval] , Keyword[this] operator[SEP] identifier[cleanupInterval] , identifier[TimeUnit] operator[SEP] identifier[SECONDS] operator[SEP] operator[SEP] }
public void loadArgArray() { push(argumentTypes.length); newArray(OBJECT_TYPE); for (int i = 0; i < argumentTypes.length; i++) { dup(); push(i); loadArg(i); box(argumentTypes[i]); arrayStore(OBJECT_TYPE); } }
class class_name[name] begin[{] method[loadArgArray, return_type[void], modifier[public], parameter[]] begin[{] call[.push, parameter[member[argumentTypes.length]]] call[.newArray, parameter[member[.OBJECT_TYPE]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=dup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadArg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=argumentTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=box, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=OBJECT_TYPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arrayStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=argumentTypes, 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) end[}] END[}]
Keyword[public] Keyword[void] identifier[loadArgArray] operator[SEP] operator[SEP] { identifier[push] operator[SEP] identifier[argumentTypes] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[newArray] operator[SEP] identifier[OBJECT_TYPE] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[argumentTypes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[dup] operator[SEP] operator[SEP] operator[SEP] identifier[push] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[loadArg] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[box] operator[SEP] identifier[argumentTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[arrayStore] operator[SEP] identifier[OBJECT_TYPE] operator[SEP] operator[SEP] } }
public java.util.List<String> getStackIds() { if (stackIds == null) { stackIds = new com.amazonaws.internal.SdkInternalList<String>(); } return stackIds; }
class class_name[name] begin[{] method[getStackIds, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.stackIds], ==, literal[null]]] begin[{] assign[member[.stackIds], 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[.stackIds]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[getStackIds] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[stackIds] operator[==] Other[null] operator[SEP] { identifier[stackIds] 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[stackIds] operator[SEP] }
protected void insertCode(int offset, int count) { if (_jumps == null) analyzeJumps(); // XXX: revisits the new code if (offset <= _offset) { _offset += count; } for (int i = 0; i < _jumps.size(); i++) { Jump jump = _jumps.get(i); jump.insert(this, offset, count); } ArrayList<CodeAttribute.ExceptionItem> exns = getExceptions(); for (int i = 0; i < exns.size(); i++) { CodeAttribute.ExceptionItem exn = exns.get(i); if (offset <= exn.getStart()) exn.setStart(exn.getStart() + count); if (offset <= exn.getEnd()) exn.setEnd(exn.getEnd() + count); if (offset <= exn.getHandler()) exn.setHandler(exn.getHandler() + count); } if (_pendingTargets != null) { for (int i = _pendingTargets.size() - 1; i >= 0; i--) { int target = _pendingTargets.get(i); if (offset <= target) _pendingTargets.set(i, target + count); } for (int i = _completedTargets.size() - 1; i >= 0; i--) { int target = _completedTargets.get(i); if (offset <= target) _completedTargets.set(i, target + count); } } for (int i = 0; i < _switches.size(); i++) { Branch branch = _switches.get(i); branch.insert(this, offset, count); } for (int i = 0; i < count; i++) _code.add(offset, 0); for (int i = 0; i < _switches.size(); i++) { Switch branch = _switches.get(i); branch.insertPad(this, offset, count); } }
class class_name[name] begin[{] method[insertCode, return_type[void], modifier[protected], parameter[offset, count]] begin[{] if[binary_operation[member[._jumps], ==, literal[null]]] begin[{] call[.analyzeJumps, parameter[]] else begin[{] None end[}] if[binary_operation[member[.offset], <=, member[._offset]]] begin[{] assign[member[._offset], member[.count]] else begin[{] None end[}] 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=_jumps, selectors=[], type_arguments=None), name=jump)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Jump, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=jump, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_jumps, 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[ArrayList], exns] 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=exns, selectors=[], type_arguments=None), name=exn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CodeAttribute, sub_type=ReferenceType(arguments=None, dimensions=None, name=ExceptionItem, sub_type=None))), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=exn, selectors=[], type_arguments=None), operator=<=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=exn, selectors=[], type_arguments=None), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=setStart, postfix_operators=[], prefix_operators=[], qualifier=exn, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=exn, selectors=[], type_arguments=None), operator=<=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEnd, postfix_operators=[], prefix_operators=[], qualifier=exn, selectors=[], type_arguments=None), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=setEnd, postfix_operators=[], prefix_operators=[], qualifier=exn, selectors=[], type_arguments=None), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getHandler, postfix_operators=[], prefix_operators=[], qualifier=exn, selectors=[], type_arguments=None), operator=<=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHandler, postfix_operators=[], prefix_operators=[], qualifier=exn, selectors=[], type_arguments=None), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=setHandler, postfix_operators=[], prefix_operators=[], qualifier=exn, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=exns, 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) if[binary_operation[member[._pendingTargets], !=, literal[null]]] begin[{] 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=_pendingTargets, selectors=[], type_arguments=None), name=target)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=set, postfix_operators=[], prefix_operators=[], qualifier=_pendingTargets, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_pendingTargets, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) 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=_completedTargets, selectors=[], type_arguments=None), name=target)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=set, postfix_operators=[], prefix_operators=[], qualifier=_completedTargets, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_completedTargets, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] 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=_switches, selectors=[], type_arguments=None), name=branch)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Branch, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insert, postfix_operators=[], prefix_operators=[], qualifier=branch, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_switches, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=add, postfix_operators=[], prefix_operators=[], qualifier=_code, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, 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) 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=_switches, selectors=[], type_arguments=None), name=branch)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Switch, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=insertPad, postfix_operators=[], prefix_operators=[], qualifier=branch, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=_switches, 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[protected] Keyword[void] identifier[insertCode] operator[SEP] Keyword[int] identifier[offset] , Keyword[int] identifier[count] operator[SEP] { Keyword[if] operator[SEP] identifier[_jumps] operator[==] Other[null] operator[SEP] identifier[analyzeJumps] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[offset] operator[<=] identifier[_offset] operator[SEP] { identifier[_offset] operator[+=] identifier[count] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_jumps] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Jump] identifier[jump] operator[=] identifier[_jumps] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[jump] operator[SEP] identifier[insert] operator[SEP] Keyword[this] , identifier[offset] , identifier[count] operator[SEP] operator[SEP] } identifier[ArrayList] operator[<] identifier[CodeAttribute] operator[SEP] identifier[ExceptionItem] operator[>] identifier[exns] operator[=] identifier[getExceptions] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[exns] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[CodeAttribute] operator[SEP] identifier[ExceptionItem] identifier[exn] operator[=] identifier[exns] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[offset] operator[<=] identifier[exn] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[exn] operator[SEP] identifier[setStart] operator[SEP] identifier[exn] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[+] identifier[count] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[offset] operator[<=] identifier[exn] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[SEP] identifier[exn] operator[SEP] identifier[setEnd] operator[SEP] identifier[exn] operator[SEP] identifier[getEnd] operator[SEP] operator[SEP] operator[+] identifier[count] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[offset] operator[<=] identifier[exn] operator[SEP] identifier[getHandler] operator[SEP] operator[SEP] operator[SEP] identifier[exn] operator[SEP] identifier[setHandler] operator[SEP] identifier[exn] operator[SEP] identifier[getHandler] operator[SEP] operator[SEP] operator[+] identifier[count] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[_pendingTargets] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[_pendingTargets] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] { Keyword[int] identifier[target] operator[=] identifier[_pendingTargets] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[offset] operator[<=] identifier[target] operator[SEP] identifier[_pendingTargets] operator[SEP] identifier[set] operator[SEP] identifier[i] , identifier[target] operator[+] identifier[count] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[_completedTargets] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] { Keyword[int] identifier[target] operator[=] identifier[_completedTargets] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[offset] operator[<=] identifier[target] operator[SEP] identifier[_completedTargets] operator[SEP] identifier[set] operator[SEP] identifier[i] , identifier[target] operator[+] identifier[count] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_switches] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Branch] identifier[branch] operator[=] identifier[_switches] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[branch] operator[SEP] identifier[insert] operator[SEP] Keyword[this] , identifier[offset] , identifier[count] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] identifier[_code] operator[SEP] identifier[add] operator[SEP] identifier[offset] , Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[_switches] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Switch] identifier[branch] operator[=] identifier[_switches] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[branch] operator[SEP] identifier[insertPad] operator[SEP] Keyword[this] , identifier[offset] , identifier[count] operator[SEP] operator[SEP] } }
public void setPackageFragment(boolean newPackageFragment) { boolean oldPackageFragment = packageFragment; packageFragment = newPackageFragment; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, XbasePackage.XMEMBER_FEATURE_CALL__PACKAGE_FRAGMENT, oldPackageFragment, packageFragment)); }
class class_name[name] begin[{] method[setPackageFragment, return_type[void], modifier[public], parameter[newPackageFragment]] begin[{] local_variable[type[boolean], oldPackageFragment] assign[member[.packageFragment], member[.newPackageFragment]] if[call[.eNotificationRequired, parameter[]]] begin[{] call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=XMEMBER_FEATURE_CALL__PACKAGE_FRAGMENT, postfix_operators=[], prefix_operators=[], qualifier=XbasePackage, selectors=[]), MemberReference(member=oldPackageFragment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=packageFragment, 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=ENotificationImpl, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setPackageFragment] operator[SEP] Keyword[boolean] identifier[newPackageFragment] operator[SEP] { Keyword[boolean] identifier[oldPackageFragment] operator[=] identifier[packageFragment] operator[SEP] identifier[packageFragment] operator[=] identifier[newPackageFragment] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[XbasePackage] operator[SEP] identifier[XMEMBER_FEATURE_CALL__PACKAGE_FRAGMENT] , identifier[oldPackageFragment] , identifier[packageFragment] operator[SEP] operator[SEP] operator[SEP] }
public <T> T[] validIndex(final T[] array, final int index) { return validIndex(array, index, DEFAULT_VALID_INDEX_ARRAY_EX_MESSAGE, index); }
class class_name[name] begin[{] method[validIndex, return_type[type[T]], modifier[public], parameter[array, index]] begin[{] return[call[.validIndex, parameter[member[.array], member[.index], member[.DEFAULT_VALID_INDEX_ARRAY_EX_MESSAGE], member[.index]]]] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[validIndex] operator[SEP] Keyword[final] identifier[T] operator[SEP] operator[SEP] identifier[array] , Keyword[final] Keyword[int] identifier[index] operator[SEP] { Keyword[return] identifier[validIndex] operator[SEP] identifier[array] , identifier[index] , identifier[DEFAULT_VALID_INDEX_ARRAY_EX_MESSAGE] , identifier[index] operator[SEP] operator[SEP] }
public ServiceFuture<LuisApp> exportAsync(UUID appId, String versionId, final ServiceCallback<LuisApp> serviceCallback) { return ServiceFuture.fromResponse(exportWithServiceResponseAsync(appId, versionId), serviceCallback); }
class class_name[name] begin[{] method[exportAsync, return_type[type[ServiceFuture]], modifier[public], parameter[appId, versionId, serviceCallback]] begin[{] return[call[ServiceFuture.fromResponse, parameter[call[.exportWithServiceResponseAsync, parameter[member[.appId], member[.versionId]]], member[.serviceCallback]]]] end[}] END[}]
Keyword[public] identifier[ServiceFuture] operator[<] identifier[LuisApp] operator[>] identifier[exportAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[LuisApp] operator[>] identifier[serviceCallback] operator[SEP] { Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[exportWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[versionId] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP] }
public static Bitmap cropBitmap(Bitmap sourceBitmap, int left, int top, int width, int height) { if (sourceBitmap == null) { return null; } try { return Bitmap.createBitmap(sourceBitmap, left, top, width, height); } catch (IllegalArgumentException ex) { // Can throw exception if cropping arguments are out of bounds. LogUtils.log(ScreenshotUtils.class, Log.ERROR, Log.getStackTraceString(ex)); return null; } }
class class_name[name] begin[{] method[cropBitmap, return_type[type[Bitmap]], modifier[public static], parameter[sourceBitmap, left, top, width, height]] begin[{] if[binary_operation[member[.sourceBitmap], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=sourceBitmap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=top, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createBitmap, postfix_operators=[], prefix_operators=[], qualifier=Bitmap, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ScreenshotUtils, sub_type=None)), MemberReference(member=ERROR, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[]), MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStackTraceString, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None)], member=log, postfix_operators=[], prefix_operators=[], qualifier=LogUtils, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Bitmap] identifier[cropBitmap] operator[SEP] identifier[Bitmap] identifier[sourceBitmap] , Keyword[int] identifier[left] , Keyword[int] identifier[top] , Keyword[int] identifier[width] , Keyword[int] identifier[height] operator[SEP] { Keyword[if] operator[SEP] identifier[sourceBitmap] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[try] { Keyword[return] identifier[Bitmap] operator[SEP] identifier[createBitmap] operator[SEP] identifier[sourceBitmap] , identifier[left] , identifier[top] , identifier[width] , identifier[height] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[ex] operator[SEP] { identifier[LogUtils] operator[SEP] identifier[log] operator[SEP] identifier[ScreenshotUtils] operator[SEP] Keyword[class] , identifier[Log] operator[SEP] identifier[ERROR] , identifier[Log] operator[SEP] identifier[getStackTraceString] operator[SEP] identifier[ex] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
@Override public HttpResponse encode(Supplier<HttpResponse> factory, Response response) { int status = response.getStatus() == ErrorCodes.SUCCESS ? HTTP_OK : HTTP_INTERNAL_ERROR; byte[] data = json.toJson(getValueToEncode(response)).getBytes(UTF_8); HttpResponse httpResponse = factory.get(); httpResponse.setStatus(status); httpResponse.setHeader(CACHE_CONTROL, "no-cache"); httpResponse.setHeader(EXPIRES, "Thu, 01 Jan 1970 00:00:00 GMT"); httpResponse.setHeader(CONTENT_LENGTH, String.valueOf(data.length)); httpResponse.setHeader(CONTENT_TYPE, JSON_UTF_8.toString()); httpResponse.setContent(data); return httpResponse; }
class class_name[name] begin[{] method[encode, return_type[type[HttpResponse]], modifier[public], parameter[factory, response]] begin[{] local_variable[type[int], status] local_variable[type[byte], data] local_variable[type[HttpResponse], httpResponse] call[httpResponse.setStatus, parameter[member[.status]]] call[httpResponse.setHeader, parameter[member[.CACHE_CONTROL], literal["no-cache"]]] call[httpResponse.setHeader, parameter[member[.EXPIRES], literal["Thu, 01 Jan 1970 00:00:00 GMT"]]] call[httpResponse.setHeader, parameter[member[.CONTENT_LENGTH], call[String.valueOf, parameter[member[data.length]]]]] call[httpResponse.setHeader, parameter[member[.CONTENT_TYPE], call[JSON_UTF_8.toString, parameter[]]]] call[httpResponse.setContent, parameter[member[.data]]] return[member[.httpResponse]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[HttpResponse] identifier[encode] operator[SEP] identifier[Supplier] operator[<] identifier[HttpResponse] operator[>] identifier[factory] , identifier[Response] identifier[response] operator[SEP] { Keyword[int] identifier[status] operator[=] identifier[response] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[==] identifier[ErrorCodes] operator[SEP] identifier[SUCCESS] operator[?] identifier[HTTP_OK] operator[:] identifier[HTTP_INTERNAL_ERROR] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] identifier[json] operator[SEP] identifier[toJson] operator[SEP] identifier[getValueToEncode] operator[SEP] identifier[response] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] identifier[HttpResponse] identifier[httpResponse] operator[=] identifier[factory] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[httpResponse] operator[SEP] identifier[setStatus] operator[SEP] identifier[status] operator[SEP] operator[SEP] identifier[httpResponse] operator[SEP] identifier[setHeader] operator[SEP] identifier[CACHE_CONTROL] , literal[String] operator[SEP] operator[SEP] identifier[httpResponse] operator[SEP] identifier[setHeader] operator[SEP] identifier[EXPIRES] , literal[String] operator[SEP] operator[SEP] identifier[httpResponse] operator[SEP] identifier[setHeader] operator[SEP] identifier[CONTENT_LENGTH] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[httpResponse] operator[SEP] identifier[setHeader] operator[SEP] identifier[CONTENT_TYPE] , identifier[JSON_UTF_8] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[httpResponse] operator[SEP] identifier[setContent] operator[SEP] identifier[data] operator[SEP] operator[SEP] Keyword[return] identifier[httpResponse] operator[SEP] }
public Serializer writeBoolean(Boolean value) throws IOException { if (null == value) return writeNull(); writeRawString(value.toString()); return this; }
class class_name[name] begin[{] method[writeBoolean, return_type[type[Serializer]], modifier[public], parameter[value]] begin[{] if[binary_operation[literal[null], ==, member[.value]]] begin[{] return[call[.writeNull, parameter[]]] else begin[{] None end[}] call[.writeRawString, parameter[call[value.toString, parameter[]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Serializer] identifier[writeBoolean] operator[SEP] identifier[Boolean] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[value] operator[SEP] Keyword[return] identifier[writeNull] operator[SEP] operator[SEP] operator[SEP] identifier[writeRawString] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private static CmsRelationType valueOfInternal(String name) { if (name != null) { String valueUp = name.toUpperCase(); for (int i = 0; i < VALUE_ARRAY.length; i++) { if (valueUp.equals(VALUE_ARRAY[i].m_name)) { return VALUE_ARRAY[i]; } } // deprecated types if (valueUp.equals("REFERENCE") || valueUp.equals("XML_REFERENCE")) { return XML_WEAK; } else if (valueUp.equals("ATTACHMENT") || valueUp.equals("XML_ATTACHMENT")) { return XML_STRONG; } // user defined for (int i = 0; i < getAllUserDefined().size(); i++) { CmsRelationType type = getAllUserDefined().get(i); if (valueUp.equals(type.m_name)) { return type; } } } return null; }
class class_name[name] begin[{] method[valueOfInternal, return_type[type[CmsRelationType]], modifier[private static], parameter[name]] begin[{] if[binary_operation[member[.name], !=, literal[null]]] begin[{] local_variable[type[String], valueUp] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=VALUE_ARRAY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=m_name, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=valueUp, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=VALUE_ARRAY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=VALUE_ARRAY, 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[call[valueUp.equals, parameter[literal["REFERENCE"]]], ||, call[valueUp.equals, parameter[literal["XML_REFERENCE"]]]]] begin[{] return[member[.XML_WEAK]] else begin[{] if[binary_operation[call[valueUp.equals, parameter[literal["ATTACHMENT"]]], ||, call[valueUp.equals, parameter[literal["XML_ATTACHMENT"]]]]] begin[{] return[member[.XML_STRONG]] else begin[{] None end[}] end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAllUserDefined, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=type)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsRelationType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=m_name, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=valueUp, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=type, 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=getAllUserDefined, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[private] Keyword[static] identifier[CmsRelationType] identifier[valueOfInternal] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[valueUp] operator[=] identifier[name] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[VALUE_ARRAY] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[valueUp] operator[SEP] identifier[equals] operator[SEP] identifier[VALUE_ARRAY] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[m_name] operator[SEP] operator[SEP] { Keyword[return] identifier[VALUE_ARRAY] operator[SEP] identifier[i] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[valueUp] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[valueUp] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[XML_WEAK] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[valueUp] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[valueUp] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] identifier[XML_STRONG] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[getAllUserDefined] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[CmsRelationType] identifier[type] operator[=] identifier[getAllUserDefined] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[valueUp] operator[SEP] identifier[equals] operator[SEP] identifier[type] operator[SEP] identifier[m_name] operator[SEP] operator[SEP] { Keyword[return] identifier[type] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
@Override public void setValue(String value, java.util.Locale locale) { _cpDefinitionSpecificationOptionValue.setValue(value, locale); }
class class_name[name] begin[{] method[setValue, return_type[void], modifier[public], parameter[value, locale]] begin[{] call[_cpDefinitionSpecificationOptionValue.setValue, parameter[member[.value], member[.locale]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setValue] operator[SEP] identifier[String] identifier[value] , identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Locale] identifier[locale] operator[SEP] { identifier[_cpDefinitionSpecificationOptionValue] operator[SEP] identifier[setValue] operator[SEP] identifier[value] , identifier[locale] operator[SEP] operator[SEP] }
public List<V> topologicalSort() { Map<V, Integer> degree = inDegree(); // determine all vertices with zero in-degree Stack<V> zeroVertices = new Stack<>(); // stack as good as any here for (V v : degree.keySet()) { if (degree.get(v) == 0) { zeroVertices.push(v); } } // determine the topological order List<V> result = new ArrayList<>(); while (!zeroVertices.isEmpty()) { V vertex = zeroVertices.pop(); // choose a vertex with zero in-degree result.add(vertex); // vertex 'v' is next in topological order // "remove" vertex 'v' by updating its neighbors for (V neighbor : neighbors.get(vertex)) { degree.put(neighbor, degree.get(neighbor) - 1); // remember any vertices that now have zero in-degree if (degree.get(neighbor) == 0) { zeroVertices.push(neighbor); } } } // check that we have used the entire graph (if not, there was a cycle) if (result.size() != neighbors.size()) { return null; } return result; }
class class_name[name] begin[{] method[topologicalSort, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[Map], degree] local_variable[type[Stack], zeroVertices] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=degree, 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=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=zeroVertices, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=degree, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=v)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))), label=None) local_variable[type[List], result] while[call[zeroVertices.isEmpty, parameter[]]] begin[{] local_variable[type[V], vertex] call[result.add, parameter[member[.vertex]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=neighbor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=neighbor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=degree, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=put, postfix_operators=[], prefix_operators=[], qualifier=degree, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=neighbor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=degree, 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=neighbor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=zeroVertices, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=vertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=neighbors, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=neighbor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))), label=None) end[}] if[binary_operation[call[result.size, parameter[]], !=, call[neighbors.size, parameter[]]]] begin[{] return[literal[null]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[V] operator[>] identifier[topologicalSort] operator[SEP] operator[SEP] { identifier[Map] operator[<] identifier[V] , identifier[Integer] operator[>] identifier[degree] operator[=] identifier[inDegree] operator[SEP] operator[SEP] operator[SEP] identifier[Stack] operator[<] identifier[V] operator[>] identifier[zeroVertices] operator[=] Keyword[new] identifier[Stack] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[V] identifier[v] operator[:] identifier[degree] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[degree] operator[SEP] identifier[get] operator[SEP] identifier[v] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[zeroVertices] operator[SEP] identifier[push] operator[SEP] identifier[v] operator[SEP] operator[SEP] } } identifier[List] operator[<] identifier[V] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[zeroVertices] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[V] identifier[vertex] operator[=] identifier[zeroVertices] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] identifier[vertex] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[V] identifier[neighbor] operator[:] identifier[neighbors] operator[SEP] identifier[get] operator[SEP] identifier[vertex] operator[SEP] operator[SEP] { identifier[degree] operator[SEP] identifier[put] operator[SEP] identifier[neighbor] , identifier[degree] operator[SEP] identifier[get] operator[SEP] identifier[neighbor] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[degree] operator[SEP] identifier[get] operator[SEP] identifier[neighbor] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[zeroVertices] operator[SEP] identifier[push] operator[SEP] identifier[neighbor] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[neighbors] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
@Override public void destroy() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Destroying ISC: " + this); } // 291714 - clean up the statemap getVC().getStateMap().remove(CallbackIDs.CALLBACK_HTTPISC); getVC().getStateMap().remove(HTTP_ERROR_IDENTIFIER); this.myLink = null; super.destroy(); }
class class_name[name] begin[{] method[destroy, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[literal["Destroying ISC: "], +, THIS[]]]] else begin[{] None end[}] call[.getVC, parameter[]] call[.getVC, parameter[]] assign[THIS[member[None.myLink]], literal[null]] SuperMethodInvocation(arguments=[], member=destroy, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[destroy] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] Keyword[this] operator[SEP] operator[SEP] } identifier[getVC] operator[SEP] operator[SEP] operator[SEP] identifier[getStateMap] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[CallbackIDs] operator[SEP] identifier[CALLBACK_HTTPISC] operator[SEP] operator[SEP] identifier[getVC] operator[SEP] operator[SEP] operator[SEP] identifier[getStateMap] operator[SEP] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[HTTP_ERROR_IDENTIFIER] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[myLink] operator[=] Other[null] operator[SEP] Keyword[super] operator[SEP] identifier[destroy] operator[SEP] operator[SEP] operator[SEP] }
public static <I extends Iterable<E>, E> Iterator<E> flatten(Iterable<I> iterables) { dbc.precondition(iterables != null, "cannot flatten a null iterable"); final Iterator<I> iterator = iterables.iterator(); return new ChainIterator<>(new TransformingIterator<>(iterator, Iterable::iterator)); }
class class_name[name] begin[{] method[flatten, return_type[type[Iterator]], modifier[public static], parameter[iterables]] begin[{] call[dbc.precondition, parameter[binary_operation[member[.iterables], !=, literal[null]], literal["cannot flatten a null iterable"]]] local_variable[type[Iterator], iterator] return[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=iterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodReference(expression=MemberReference(member=Iterable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=iterator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=TransformingIterator, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ChainIterator, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[I] Keyword[extends] identifier[Iterable] operator[<] identifier[E] operator[>] , identifier[E] operator[>] identifier[Iterator] operator[<] identifier[E] operator[>] identifier[flatten] operator[SEP] identifier[Iterable] operator[<] identifier[I] operator[>] identifier[iterables] operator[SEP] { identifier[dbc] operator[SEP] identifier[precondition] operator[SEP] identifier[iterables] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[Iterator] operator[<] identifier[I] operator[>] identifier[iterator] operator[=] identifier[iterables] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ChainIterator] operator[<] operator[>] operator[SEP] Keyword[new] identifier[TransformingIterator] operator[<] operator[>] operator[SEP] identifier[iterator] , identifier[Iterable] operator[::] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] }
public static void write(final String fileName, final Formula formula, boolean alignLiterals) throws IOException { write(new File(fileName.endsWith(".dot") ? fileName : fileName + ".dot"), formula, alignLiterals); }
class class_name[name] begin[{] method[write, return_type[void], modifier[public static], parameter[fileName, formula, alignLiterals]] begin[{] call[.write, parameter[ClassCreator(arguments=[TernaryExpression(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".dot")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=fileName, selectors=[], type_arguments=None), if_false=BinaryOperation(operandl=MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".dot"), operator=+), if_true=MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), member[.formula], member[.alignLiterals]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[write] operator[SEP] Keyword[final] identifier[String] identifier[fileName] , Keyword[final] identifier[Formula] identifier[formula] , Keyword[boolean] identifier[alignLiterals] operator[SEP] Keyword[throws] identifier[IOException] { identifier[write] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[fileName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[?] identifier[fileName] operator[:] identifier[fileName] operator[+] literal[String] operator[SEP] , identifier[formula] , identifier[alignLiterals] operator[SEP] operator[SEP] }
private boolean selfAssignDeviceNumber() { final long now = System.currentTimeMillis(); final long started = DeviceFinder.getInstance().getFirstDeviceTime(); if (now - started < SELF_ASSIGNMENT_WATCH_PERIOD) { try { Thread.sleep(SELF_ASSIGNMENT_WATCH_PERIOD - (now - started)); // Sleep until we hit the right time } catch (InterruptedException e) { logger.warn("Interrupted waiting to self-assign device number, giving up."); return false; } } Set<Integer> numbersUsed = new HashSet<Integer>(); for (DeviceAnnouncement device : DeviceFinder.getInstance().getCurrentDevices()) { numbersUsed.add(device.getNumber()); } // Try all player numbers less than mixers use, only including the real player range if we are configured to. final int startingNumber = (getUseStandardPlayerNumber() ? 1 : 5); for (int result = startingNumber; result < 16; result++) { if (!numbersUsed.contains(result)) { // We found one that is not used, so we can use it setDeviceNumber((byte) result); if (getUseStandardPlayerNumber() && (result > 4)) { logger.warn("Unable to self-assign a standard player number, all are in use. Using number " + result + "."); } return true; } } logger.warn("Found no unused device numbers between " + startingNumber + " and 15, giving up."); return false; }
class class_name[name] begin[{] method[selfAssignDeviceNumber, return_type[type[boolean]], modifier[private], parameter[]] begin[{] local_variable[type[long], now] local_variable[type[long], started] if[binary_operation[binary_operation[member[.now], -, member[.started]], <, member[.SELF_ASSIGNMENT_WATCH_PERIOD]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=SELF_ASSIGNMENT_WATCH_PERIOD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=started, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operator=-)], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Interrupted waiting to self-assign device number, giving up.")], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] local_variable[type[Set], numbersUsed] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNumber, postfix_operators=[], prefix_operators=[], qualifier=device, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=numbersUsed, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=DeviceFinder, selectors=[MethodInvocation(arguments=[], member=getCurrentDevices, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=device)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DeviceAnnouncement, sub_type=None))), label=None) local_variable[type[int], startingNumber] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=numbersUsed, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte))], member=setDeviceNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getUseStandardPlayerNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=>), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to self-assign a standard player number, all are in use. Using number "), operandr=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=startingNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=result)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=result, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[logger.warn, parameter[binary_operation[binary_operation[literal["Found no unused device numbers between "], +, member[.startingNumber]], +, literal[" and 15, giving up."]]]] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[selfAssignDeviceNumber] operator[SEP] operator[SEP] { Keyword[final] Keyword[long] identifier[now] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[started] operator[=] identifier[DeviceFinder] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getFirstDeviceTime] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[now] operator[-] identifier[started] operator[<] identifier[SELF_ASSIGNMENT_WATCH_PERIOD] operator[SEP] { Keyword[try] { identifier[Thread] operator[SEP] identifier[sleep] operator[SEP] identifier[SELF_ASSIGNMENT_WATCH_PERIOD] operator[-] operator[SEP] identifier[now] operator[-] identifier[started] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } } identifier[Set] operator[<] identifier[Integer] operator[>] identifier[numbersUsed] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Integer] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DeviceAnnouncement] identifier[device] operator[:] identifier[DeviceFinder] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getCurrentDevices] operator[SEP] operator[SEP] operator[SEP] { identifier[numbersUsed] operator[SEP] identifier[add] operator[SEP] identifier[device] operator[SEP] identifier[getNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[startingNumber] operator[=] operator[SEP] identifier[getUseStandardPlayerNumber] operator[SEP] operator[SEP] operator[?] Other[1] operator[:] Other[5] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[result] operator[=] identifier[startingNumber] operator[SEP] identifier[result] operator[<] Other[16] operator[SEP] identifier[result] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[numbersUsed] operator[SEP] identifier[contains] operator[SEP] identifier[result] operator[SEP] operator[SEP] { identifier[setDeviceNumber] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] identifier[result] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getUseStandardPlayerNumber] operator[SEP] operator[SEP] operator[&&] operator[SEP] identifier[result] operator[>] Other[4] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[result] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } } identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[startingNumber] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public String printColumnTypes(FixedWidthReadOptions options) throws IOException { Table structure = read(options, true).structure(); return getTypeString(structure); }
class class_name[name] begin[{] method[printColumnTypes, return_type[type[String]], modifier[public], parameter[options]] begin[{] local_variable[type[Table], structure] return[call[.getTypeString, parameter[member[.structure]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[printColumnTypes] operator[SEP] identifier[FixedWidthReadOptions] identifier[options] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Table] identifier[structure] operator[=] identifier[read] operator[SEP] identifier[options] , literal[boolean] operator[SEP] operator[SEP] identifier[structure] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getTypeString] operator[SEP] identifier[structure] operator[SEP] operator[SEP] }
public static void assertTrue(boolean condition, String message, Object... args) { verify(condition, message, args); }
class class_name[name] begin[{] method[assertTrue, return_type[void], modifier[public static], parameter[condition, message, args]] begin[{] call[.verify, parameter[member[.condition], member[.message], member[.args]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[assertTrue] operator[SEP] Keyword[boolean] identifier[condition] , identifier[String] identifier[message] , identifier[Object] operator[...] identifier[args] operator[SEP] { identifier[verify] operator[SEP] identifier[condition] , identifier[message] , identifier[args] operator[SEP] operator[SEP] }
public static Reflections collect(final String packagePrefix, final Predicate<String> resourceNameFilter, @Nullable Serializer... optionalSerializer) { Serializer serializer = optionalSerializer != null && optionalSerializer.length == 1 ? optionalSerializer[0] : new XmlSerializer(); Collection<URL> urls = ClasspathHelper.forPackage(packagePrefix); if (urls.isEmpty()) return null; long start = System.currentTimeMillis(); final Reflections reflections = new Reflections(); Iterable<Vfs.File> files = Vfs.findFiles(urls, packagePrefix, resourceNameFilter); for (final Vfs.File file : files) { InputStream inputStream = null; try { inputStream = file.openInputStream(); reflections.merge(serializer.read(inputStream)); } catch (IOException e) { throw new ReflectionsException("could not merge " + file, e); } finally { close(inputStream); } } if (log != null) { Store store = reflections.getStore(); int keys = 0; int values = 0; for (String index : store.keySet()) { keys += store.get(index).keySet().size(); values += store.get(index).size(); } log.info(format("Reflections took %d ms to collect %d url%s, producing %d keys and %d values [%s]", System.currentTimeMillis() - start, urls.size(), urls.size() > 1 ? "s" : "", keys, values, Joiner.on(", ").join(urls))); } return reflections; }
class class_name[name] begin[{] method[collect, return_type[type[Reflections]], modifier[public static], parameter[packagePrefix, resourceNameFilter, optionalSerializer]] begin[{] local_variable[type[Serializer], serializer] local_variable[type[Collection], urls] if[call[urls.isEmpty, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[long], start] local_variable[type[Reflections], reflections] local_variable[type[Iterable], files] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=inputStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openInputStream, postfix_operators=[], prefix_operators=[], qualifier=file, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=serializer, selectors=[], type_arguments=None)], member=merge, postfix_operators=[], prefix_operators=[], qualifier=reflections, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="could not merge "), operandr=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ReflectionsException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=file)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Vfs, sub_type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)))), label=None) if[binary_operation[member[.log], !=, literal[null]]] begin[{] local_variable[type[Store], store] local_variable[type[int], keys] local_variable[type[int], values] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=store, selectors=[MethodInvocation(arguments=[], member=keySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=store, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=store, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=index)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) call[log.info, parameter[call[.format, parameter[literal["Reflections took %d ms to collect %d url%s, producing %d keys and %d values [%s]"], binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.start]], call[urls.size, parameter[]], TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=urls, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="s")), member[.keys], member[.values], call[Joiner.on, parameter[literal[", "]]]]]]] else begin[{] None end[}] return[member[.reflections]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Reflections] identifier[collect] operator[SEP] Keyword[final] identifier[String] identifier[packagePrefix] , Keyword[final] identifier[Predicate] operator[<] identifier[String] operator[>] identifier[resourceNameFilter] , annotation[@] identifier[Nullable] identifier[Serializer] operator[...] identifier[optionalSerializer] operator[SEP] { identifier[Serializer] identifier[serializer] operator[=] identifier[optionalSerializer] operator[!=] Other[null] operator[&&] identifier[optionalSerializer] operator[SEP] identifier[length] operator[==] Other[1] operator[?] identifier[optionalSerializer] operator[SEP] Other[0] operator[SEP] operator[:] Keyword[new] identifier[XmlSerializer] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[URL] operator[>] identifier[urls] operator[=] identifier[ClasspathHelper] operator[SEP] identifier[forPackage] operator[SEP] identifier[packagePrefix] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[urls] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[long] identifier[start] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Reflections] identifier[reflections] operator[=] Keyword[new] identifier[Reflections] operator[SEP] operator[SEP] operator[SEP] identifier[Iterable] operator[<] identifier[Vfs] operator[SEP] identifier[File] operator[>] identifier[files] operator[=] identifier[Vfs] operator[SEP] identifier[findFiles] operator[SEP] identifier[urls] , identifier[packagePrefix] , identifier[resourceNameFilter] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Vfs] operator[SEP] identifier[File] identifier[file] operator[:] identifier[files] operator[SEP] { identifier[InputStream] identifier[inputStream] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[inputStream] operator[=] identifier[file] operator[SEP] identifier[openInputStream] operator[SEP] operator[SEP] operator[SEP] identifier[reflections] operator[SEP] identifier[merge] operator[SEP] identifier[serializer] operator[SEP] identifier[read] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ReflectionsException] operator[SEP] literal[String] operator[+] identifier[file] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[close] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[log] operator[!=] Other[null] operator[SEP] { identifier[Store] identifier[store] operator[=] identifier[reflections] operator[SEP] identifier[getStore] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[keys] operator[=] Other[0] operator[SEP] Keyword[int] identifier[values] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[index] operator[:] identifier[store] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[keys] operator[+=] identifier[store] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[+=] identifier[store] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } identifier[log] operator[SEP] identifier[info] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[start] , identifier[urls] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[urls] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[?] literal[String] operator[:] literal[String] , identifier[keys] , identifier[values] , identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[urls] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[reflections] operator[SEP] }
public Map<String, Set<String>> queriesForIds(Collection<String> ids) { Set<String> idsWithParents = getIdsForIdsWithAncestors(ids); Map<String, Set<String>> queries = new HashMap<String, Set<String>>(); for (String id : idsWithParents) { queries.put(id, getIdsForIdWithDescendants(id)); } return queries; }
class class_name[name] begin[{] method[queriesForIds, return_type[type[Map]], modifier[public], parameter[ids]] begin[{] local_variable[type[Set], idsWithParents] local_variable[type[Map], queries] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getIdsForIdWithDescendants, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=queries, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=idsWithParents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[member[.queries]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[queriesForIds] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[ids] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[idsWithParents] operator[=] identifier[getIdsForIdsWithAncestors] operator[SEP] identifier[ids] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] identifier[queries] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Set] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[id] operator[:] identifier[idsWithParents] operator[SEP] { identifier[queries] operator[SEP] identifier[put] operator[SEP] identifier[id] , identifier[getIdsForIdWithDescendants] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[queries] operator[SEP] }
public boolean add(int vertex) { if (!vertexToEdges.containsKey(vertex)) { vertexToEdges.put(vertex, new SparseWeightedDirectedTypedEdgeSet<T>(vertex)); return true; } return false; }
class class_name[name] begin[{] method[add, return_type[type[boolean]], modifier[public], parameter[vertex]] begin[{] if[call[vertexToEdges.containsKey, parameter[member[.vertex]]]] begin[{] call[vertexToEdges.put, parameter[member[.vertex], ClassCreator(arguments=[MemberReference(member=vertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=SparseWeightedDirectedTypedEdgeSet, sub_type=None))]] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[add] operator[SEP] Keyword[int] identifier[vertex] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[vertexToEdges] operator[SEP] identifier[containsKey] operator[SEP] identifier[vertex] operator[SEP] operator[SEP] { identifier[vertexToEdges] operator[SEP] identifier[put] operator[SEP] identifier[vertex] , Keyword[new] identifier[SparseWeightedDirectedTypedEdgeSet] operator[<] identifier[T] operator[>] operator[SEP] identifier[vertex] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public void run(ZoneTransferHandler handler) throws IOException, ZoneTransferException { this.handler = handler; try { openConnection(); doxfr(); } finally { closeConnection(); } }
class class_name[name] begin[{] method[run, return_type[void], modifier[public], parameter[handler]] begin[{] assign[THIS[member[None.handler]], member[.handler]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=openConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=doxfr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=closeConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[run] operator[SEP] identifier[ZoneTransferHandler] identifier[handler] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ZoneTransferException] { Keyword[this] operator[SEP] identifier[handler] operator[=] identifier[handler] operator[SEP] Keyword[try] { identifier[openConnection] operator[SEP] operator[SEP] operator[SEP] identifier[doxfr] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeConnection] operator[SEP] operator[SEP] operator[SEP] } }
@TargetApi(Build.VERSION_CODES.FROYO) public static boolean hasLocationFeature(PackageManager manager) { return manager.hasSystemFeature(PackageManager.FEATURE_LOCATION); }
class class_name[name] begin[{] method[hasLocationFeature, return_type[type[boolean]], modifier[public static], parameter[manager]] begin[{] return[call[manager.hasSystemFeature, parameter[member[PackageManager.FEATURE_LOCATION]]]] end[}] END[}]
annotation[@] identifier[TargetApi] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[FROYO] operator[SEP] Keyword[public] Keyword[static] Keyword[boolean] identifier[hasLocationFeature] operator[SEP] identifier[PackageManager] identifier[manager] operator[SEP] { Keyword[return] identifier[manager] operator[SEP] identifier[hasSystemFeature] operator[SEP] identifier[PackageManager] operator[SEP] identifier[FEATURE_LOCATION] operator[SEP] operator[SEP] }
public int getIndexForColor(int rgb) { int red = (rgb >> 16) & 0xff; int green = (rgb >> 8) & 0xff; int blue = rgb & 0xff; OctTreeNode node = root; for (int level = 0; level <= MAX_LEVEL; level++) { OctTreeNode child; int bit = 0x80 >> level; int index = 0; if ((red & bit) != 0) index += 4; if ((green & bit) != 0) index += 2; if ((blue & bit) != 0) index += 1; child = node.leaf[index]; if (child == null) return node.index; else if (child.isLeaf) return child.index; else node = child; } System.out.println("getIndexForColor failed"); return 0; }
class class_name[name] begin[{] method[getIndexForColor, return_type[type[int]], modifier[public], parameter[rgb]] begin[{] local_variable[type[int], red] local_variable[type[int], green] local_variable[type[int], blue] local_variable[type[OctTreeNode], node] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OctTreeNode, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x80), operandr=MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>>), name=bit)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=red, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)), label=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=green, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=blue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=bit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=leaf, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=MemberReference(member=isLeaf, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[]), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), label=None, then_statement=ReturnStatement(expression=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=child, selectors=[]), label=None)), label=None, then_statement=ReturnStatement(expression=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[]), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_LEVEL, 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=level)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=level, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) call[System.out.println, parameter[literal["getIndexForColor failed"]]] return[literal[0]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getIndexForColor] operator[SEP] Keyword[int] identifier[rgb] operator[SEP] { Keyword[int] identifier[red] operator[=] operator[SEP] identifier[rgb] operator[>] operator[>] Other[16] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[int] identifier[green] operator[=] operator[SEP] identifier[rgb] operator[>] operator[>] Other[8] operator[SEP] operator[&] literal[Integer] operator[SEP] Keyword[int] identifier[blue] operator[=] identifier[rgb] operator[&] literal[Integer] operator[SEP] identifier[OctTreeNode] identifier[node] operator[=] identifier[root] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[level] operator[=] Other[0] operator[SEP] identifier[level] operator[<=] identifier[MAX_LEVEL] operator[SEP] identifier[level] operator[++] operator[SEP] { identifier[OctTreeNode] identifier[child] operator[SEP] Keyword[int] identifier[bit] operator[=] literal[Integer] operator[>] operator[>] identifier[level] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[red] operator[&] identifier[bit] operator[SEP] operator[!=] Other[0] operator[SEP] identifier[index] operator[+=] Other[4] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[green] operator[&] identifier[bit] operator[SEP] operator[!=] Other[0] operator[SEP] identifier[index] operator[+=] Other[2] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[blue] operator[&] identifier[bit] operator[SEP] operator[!=] Other[0] operator[SEP] identifier[index] operator[+=] Other[1] operator[SEP] identifier[child] operator[=] identifier[node] operator[SEP] identifier[leaf] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[child] operator[==] Other[null] operator[SEP] Keyword[return] identifier[node] operator[SEP] identifier[index] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[child] operator[SEP] identifier[isLeaf] operator[SEP] Keyword[return] identifier[child] operator[SEP] identifier[index] operator[SEP] Keyword[else] identifier[node] operator[=] identifier[child] operator[SEP] } identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[0] operator[SEP] }
@Override public final Optional<RedirectionAction> redirect(final WebContext context) { init(); // it's an AJAX request -> appropriate action if (ajaxRequestResolver.isAjax(context)) { final HttpAction httpAction = ajaxRequestResolver.buildAjaxResponse(context, redirectionActionBuilder); logger.debug("AJAX request detected -> returning " + httpAction + " for " + context.getFullRequestURL()); cleanRequestedUrl(context); throw httpAction; } // authentication has already been tried -> unauthorized final Optional<String> attemptedAuth = (Optional<String>) context.getSessionStore() .get(context, getName() + ATTEMPTED_AUTHENTICATION_SUFFIX); if (attemptedAuth.isPresent() && !"".equals(attemptedAuth.get())) { cleanAttemptedAuthentication(context); cleanRequestedUrl(context); throw UnauthorizedAction.INSTANCE; } return redirectionActionBuilder.redirect(context); }
class class_name[name] begin[{] method[redirect, return_type[type[Optional]], modifier[final public], parameter[context]] begin[{] call[.init, parameter[]] if[call[ajaxRequestResolver.isAjax, parameter[member[.context]]]] begin[{] local_variable[type[HttpAction], httpAction] call[logger.debug, parameter[binary_operation[binary_operation[binary_operation[literal["AJAX request detected -> returning "], +, member[.httpAction]], +, literal[" for "]], +, call[context.getFullRequestURL, parameter[]]]]] call[.cleanRequestedUrl, parameter[member[.context]]] ThrowStatement(expression=MemberReference(member=httpAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) else begin[{] None end[}] local_variable[type[Optional], attemptedAuth] if[binary_operation[call[attemptedAuth.isPresent, parameter[]], &&, literal[""]]] begin[{] call[.cleanAttemptedAuthentication, parameter[member[.context]]] call[.cleanRequestedUrl, parameter[member[.context]]] ThrowStatement(expression=MemberReference(member=INSTANCE, postfix_operators=[], prefix_operators=[], qualifier=UnauthorizedAction, selectors=[]), label=None) else begin[{] None end[}] return[call[redirectionActionBuilder.redirect, parameter[member[.context]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] identifier[Optional] operator[<] identifier[RedirectionAction] operator[>] identifier[redirect] operator[SEP] Keyword[final] identifier[WebContext] identifier[context] operator[SEP] { identifier[init] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ajaxRequestResolver] operator[SEP] identifier[isAjax] operator[SEP] identifier[context] operator[SEP] operator[SEP] { Keyword[final] identifier[HttpAction] identifier[httpAction] operator[=] identifier[ajaxRequestResolver] operator[SEP] identifier[buildAjaxResponse] operator[SEP] identifier[context] , identifier[redirectionActionBuilder] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[httpAction] operator[+] literal[String] operator[+] identifier[context] operator[SEP] identifier[getFullRequestURL] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cleanRequestedUrl] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[throw] identifier[httpAction] operator[SEP] } Keyword[final] identifier[Optional] operator[<] identifier[String] operator[>] identifier[attemptedAuth] operator[=] operator[SEP] identifier[Optional] operator[<] identifier[String] operator[>] operator[SEP] identifier[context] operator[SEP] identifier[getSessionStore] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[context] , identifier[getName] operator[SEP] operator[SEP] operator[+] identifier[ATTEMPTED_AUTHENTICATION_SUFFIX] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attemptedAuth] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[&&] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[attemptedAuth] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[cleanAttemptedAuthentication] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[cleanRequestedUrl] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[throw] identifier[UnauthorizedAction] operator[SEP] identifier[INSTANCE] operator[SEP] } Keyword[return] identifier[redirectionActionBuilder] operator[SEP] identifier[redirect] operator[SEP] identifier[context] operator[SEP] operator[SEP] }
public void marshall(ListPlaybackConfigurationsRequest listPlaybackConfigurationsRequest, ProtocolMarshaller protocolMarshaller) { if (listPlaybackConfigurationsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listPlaybackConfigurationsRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(listPlaybackConfigurationsRequest.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[listPlaybackConfigurationsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.listPlaybackConfigurationsRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMaxResults, postfix_operators=[], prefix_operators=[], qualifier=listPlaybackConfigurationsRequest, 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=listPlaybackConfigurationsRequest, 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[ListPlaybackConfigurationsRequest] identifier[listPlaybackConfigurationsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[listPlaybackConfigurationsRequest] 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[listPlaybackConfigurationsRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listPlaybackConfigurationsRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void query(String sql, Map map, @ClosureParams(value=SimpleType.class, options="java.sql.ResultSet") Closure closure) throws SQLException { query(sql, singletonList(map), closure); }
class class_name[name] begin[{] method[query, return_type[void], modifier[public], parameter[sql, map, closure]] begin[{] call[.query, parameter[member[.sql], call[.singletonList, parameter[member[.map]]], member[.closure]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[query] operator[SEP] identifier[String] identifier[sql] , identifier[Map] identifier[map] , annotation[@] identifier[ClosureParams] operator[SEP] identifier[value] operator[=] identifier[SimpleType] operator[SEP] Keyword[class] , identifier[options] operator[=] literal[String] operator[SEP] identifier[Closure] identifier[closure] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[query] operator[SEP] identifier[sql] , identifier[singletonList] operator[SEP] identifier[map] operator[SEP] , identifier[closure] operator[SEP] operator[SEP] }
private void register( final Bundle bundle ) { LOG.debug( "Scanning bundle [" + bundle.getSymbolicName() + "]" ); final List<T> resources = m_scanner.scan( bundle ); m_mappings.put( bundle, resources ); if( resources != null && resources.size() > 0 ) { LOG.debug( "Found resources " + resources ); for( final BundleObserver<T> observer : m_observers ) { try { //here the executor service completes the job in an extra thread. executorService.submit(new Runnable() { public void run() { try { observer.addingEntries( bundle, Collections.unmodifiableList( resources ) ); } catch (Throwable t) { LOG.error( "Exception in executor thread", t ); } } }); } catch( Throwable ignore ) { LOG.error( "Ignored exception during register", ignore ); } } } }
class class_name[name] begin[{] method[register, return_type[void], modifier[private], parameter[bundle]] begin[{] call[LOG.debug, parameter[binary_operation[binary_operation[literal["Scanning bundle ["], +, call[bundle.getSymbolicName, parameter[]]], +, literal["]"]]]] local_variable[type[List], resources] call[m_mappings.put, parameter[member[.bundle], member[.resources]]] if[binary_operation[binary_operation[member[.resources], !=, literal[null]], &&, binary_operation[call[resources.size, parameter[]], >, literal[0]]]] begin[{] call[LOG.debug, parameter[binary_operation[literal["Found resources "], +, member[.resources]]]] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bundle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unmodifiableList, postfix_operators=[], prefix_operators=[], qualifier=Collections, selectors=[], type_arguments=None)], member=addingEntries, postfix_operators=[], prefix_operators=[], qualifier=observer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Exception in executor thread"), MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))], member=submit, postfix_operators=[], prefix_operators=[], qualifier=executorService, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Ignored exception during register"), MemberReference(member=ignore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['Throwable']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=m_observers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=observer)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=BundleObserver, sub_type=None))), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[register] operator[SEP] Keyword[final] identifier[Bundle] identifier[bundle] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[bundle] operator[SEP] identifier[getSymbolicName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[T] operator[>] identifier[resources] operator[=] identifier[m_scanner] operator[SEP] identifier[scan] operator[SEP] identifier[bundle] operator[SEP] operator[SEP] identifier[m_mappings] operator[SEP] identifier[put] operator[SEP] identifier[bundle] , identifier[resources] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resources] operator[!=] Other[null] operator[&&] identifier[resources] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[resources] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[BundleObserver] operator[<] identifier[T] operator[>] identifier[observer] operator[:] identifier[m_observers] operator[SEP] { Keyword[try] { identifier[executorService] operator[SEP] identifier[submit] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { Keyword[try] { identifier[observer] operator[SEP] identifier[addingEntries] operator[SEP] identifier[bundle] , identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[resources] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[ignore] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[ignore] operator[SEP] operator[SEP] } } } }
protected PreparedStatement prepareStatement(Connection conn, OutputHandler outputHandler, String sql, boolean getGeneratedKeys) throws SQLException { PreparedStatement result = null; String[] overrideGeneratedKeysArr = null; Integer resultSetType = null; Integer resultSetConcurrency = null; if (outputHandler instanceof LazyScrollOutputHandler) { if (overrider.hasOverride(MjdbcConstants.OVERRIDE_LAZY_SCROLL_CHANGE_SENSITIVE) == true) { // read value overrider.getOverride(MjdbcConstants.OVERRIDE_LAZY_SCROLL_CHANGE_SENSITIVE); resultSetType = ResultSet.TYPE_SCROLL_SENSITIVE; } else { resultSetType = ResultSet.TYPE_SCROLL_INSENSITIVE; } } if (outputHandler instanceof LazyUpdateOutputHandler) { resultSetConcurrency = ResultSet.CONCUR_UPDATABLE; } if (getGeneratedKeys == true || this.overrider.hasOverride(MjdbcConstants.OVERRIDE_INT_GET_GENERATED_KEYS) == true) { // if generated values should be returned - it cannot be updateable/scrollable if (outputHandler instanceof LazyUpdateOutputHandler || outputHandler instanceof LazyScrollOutputHandler) { throw new MjdbcSQLException("You are requesting generated values be handled by lazy scrollable and/or updateable handler. " + "Generated values does not support that action. Please use cached output handler or non updateable/scrollable lazy handler."); } if (this.overrider.hasOverride(MjdbcConstants.OVERRIDE_GENERATED_COLUMN_NAMES) == true) { overrideGeneratedKeysArr = (String[]) this.overrider.getOverride(MjdbcConstants.OVERRIDE_GENERATED_COLUMN_NAMES); result = conn.prepareStatement(sql, overrideGeneratedKeysArr); } else { result = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS); } if (this.overrider.hasOverride(MjdbcConstants.OVERRIDE_INT_GET_GENERATED_KEYS) == false) { this.overrider.overrideOnce(MjdbcConstants.OVERRIDE_INT_GET_GENERATED_KEYS, true); } } else { if (resultSetType == null && resultSetConcurrency == null) { result = conn.prepareStatement(sql); } else { resultSetType = (resultSetType == null ? ResultSet.TYPE_FORWARD_ONLY : resultSetType); resultSetConcurrency = (resultSetConcurrency == null ? ResultSet.CONCUR_READ_ONLY : resultSetConcurrency); result = conn.prepareStatement(sql, resultSetType, resultSetConcurrency); } } return result; }
class class_name[name] begin[{] method[prepareStatement, return_type[type[PreparedStatement]], modifier[protected], parameter[conn, outputHandler, sql, getGeneratedKeys]] begin[{] local_variable[type[PreparedStatement], result] local_variable[type[String], overrideGeneratedKeysArr] local_variable[type[Integer], resultSetType] local_variable[type[Integer], resultSetConcurrency] if[binary_operation[member[.outputHandler], instanceof, type[LazyScrollOutputHandler]]] begin[{] if[binary_operation[call[overrider.hasOverride, parameter[member[MjdbcConstants.OVERRIDE_LAZY_SCROLL_CHANGE_SENSITIVE]]], ==, literal[true]]] begin[{] call[overrider.getOverride, parameter[member[MjdbcConstants.OVERRIDE_LAZY_SCROLL_CHANGE_SENSITIVE]]] assign[member[.resultSetType], member[ResultSet.TYPE_SCROLL_SENSITIVE]] else begin[{] assign[member[.resultSetType], member[ResultSet.TYPE_SCROLL_INSENSITIVE]] end[}] else begin[{] None end[}] if[binary_operation[member[.outputHandler], instanceof, type[LazyUpdateOutputHandler]]] begin[{] assign[member[.resultSetConcurrency], member[ResultSet.CONCUR_UPDATABLE]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.getGeneratedKeys], ==, literal[true]], ||, binary_operation[THIS[member[None.overrider]call[None.hasOverride, parameter[member[MjdbcConstants.OVERRIDE_INT_GET_GENERATED_KEYS]]]], ==, literal[true]]]] begin[{] if[binary_operation[binary_operation[member[.outputHandler], instanceof, type[LazyUpdateOutputHandler]], ||, binary_operation[member[.outputHandler], instanceof, type[LazyScrollOutputHandler]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="You are requesting generated values be handled by lazy scrollable and/or updateable handler. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Generated values does not support that action. Please use cached output handler or non updateable/scrollable lazy handler."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MjdbcSQLException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.overrider]call[None.hasOverride, parameter[member[MjdbcConstants.OVERRIDE_GENERATED_COLUMN_NAMES]]]], ==, literal[true]]] begin[{] assign[member[.overrideGeneratedKeysArr], Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=overrider, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=OVERRIDE_GENERATED_COLUMN_NAMES, postfix_operators=[], prefix_operators=[], qualifier=MjdbcConstants, selectors=[])], member=getOverride, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None))] assign[member[.result], call[conn.prepareStatement, parameter[member[.sql], member[.overrideGeneratedKeysArr]]]] else begin[{] assign[member[.result], call[conn.prepareStatement, parameter[member[.sql], member[Statement.RETURN_GENERATED_KEYS]]]] end[}] if[binary_operation[THIS[member[None.overrider]call[None.hasOverride, parameter[member[MjdbcConstants.OVERRIDE_INT_GET_GENERATED_KEYS]]]], ==, literal[false]]] begin[{] THIS[member[None.overrider]call[None.overrideOnce, parameter[member[MjdbcConstants.OVERRIDE_INT_GET_GENERATED_KEYS], literal[true]]]] else begin[{] None end[}] else begin[{] if[binary_operation[binary_operation[member[.resultSetType], ==, literal[null]], &&, binary_operation[member[.resultSetConcurrency], ==, literal[null]]]] begin[{] assign[member[.result], call[conn.prepareStatement, parameter[member[.sql]]]] else begin[{] assign[member[.resultSetType], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=resultSetType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=resultSetType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=TYPE_FORWARD_ONLY, postfix_operators=[], prefix_operators=[], qualifier=ResultSet, selectors=[]))] assign[member[.resultSetConcurrency], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=resultSetConcurrency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=resultSetConcurrency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=CONCUR_READ_ONLY, postfix_operators=[], prefix_operators=[], qualifier=ResultSet, selectors=[]))] assign[member[.result], call[conn.prepareStatement, parameter[member[.sql], member[.resultSetType], member[.resultSetConcurrency]]]] end[}] end[}] return[member[.result]] end[}] END[}]
Keyword[protected] identifier[PreparedStatement] identifier[prepareStatement] operator[SEP] identifier[Connection] identifier[conn] , identifier[OutputHandler] identifier[outputHandler] , identifier[String] identifier[sql] , Keyword[boolean] identifier[getGeneratedKeys] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[PreparedStatement] identifier[result] operator[=] Other[null] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[overrideGeneratedKeysArr] operator[=] Other[null] operator[SEP] identifier[Integer] identifier[resultSetType] operator[=] Other[null] operator[SEP] identifier[Integer] identifier[resultSetConcurrency] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[outputHandler] Keyword[instanceof] identifier[LazyScrollOutputHandler] operator[SEP] { Keyword[if] operator[SEP] identifier[overrider] operator[SEP] identifier[hasOverride] operator[SEP] identifier[MjdbcConstants] operator[SEP] identifier[OVERRIDE_LAZY_SCROLL_CHANGE_SENSITIVE] operator[SEP] operator[==] literal[boolean] operator[SEP] { identifier[overrider] operator[SEP] identifier[getOverride] operator[SEP] identifier[MjdbcConstants] operator[SEP] identifier[OVERRIDE_LAZY_SCROLL_CHANGE_SENSITIVE] operator[SEP] operator[SEP] identifier[resultSetType] operator[=] identifier[ResultSet] operator[SEP] identifier[TYPE_SCROLL_SENSITIVE] operator[SEP] } Keyword[else] { identifier[resultSetType] operator[=] identifier[ResultSet] operator[SEP] identifier[TYPE_SCROLL_INSENSITIVE] operator[SEP] } } Keyword[if] operator[SEP] identifier[outputHandler] Keyword[instanceof] identifier[LazyUpdateOutputHandler] operator[SEP] { identifier[resultSetConcurrency] operator[=] identifier[ResultSet] operator[SEP] identifier[CONCUR_UPDATABLE] operator[SEP] } Keyword[if] operator[SEP] identifier[getGeneratedKeys] operator[==] literal[boolean] operator[||] Keyword[this] operator[SEP] identifier[overrider] operator[SEP] identifier[hasOverride] operator[SEP] identifier[MjdbcConstants] operator[SEP] identifier[OVERRIDE_INT_GET_GENERATED_KEYS] operator[SEP] operator[==] literal[boolean] operator[SEP] { Keyword[if] operator[SEP] identifier[outputHandler] Keyword[instanceof] identifier[LazyUpdateOutputHandler] operator[||] identifier[outputHandler] Keyword[instanceof] identifier[LazyScrollOutputHandler] operator[SEP] { Keyword[throw] Keyword[new] identifier[MjdbcSQLException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[overrider] operator[SEP] identifier[hasOverride] operator[SEP] identifier[MjdbcConstants] operator[SEP] identifier[OVERRIDE_GENERATED_COLUMN_NAMES] operator[SEP] operator[==] literal[boolean] operator[SEP] { identifier[overrideGeneratedKeysArr] operator[=] operator[SEP] identifier[String] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[overrider] operator[SEP] identifier[getOverride] operator[SEP] identifier[MjdbcConstants] operator[SEP] identifier[OVERRIDE_GENERATED_COLUMN_NAMES] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[sql] , identifier[overrideGeneratedKeysArr] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[=] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[sql] , identifier[Statement] operator[SEP] identifier[RETURN_GENERATED_KEYS] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[overrider] operator[SEP] identifier[hasOverride] operator[SEP] identifier[MjdbcConstants] operator[SEP] identifier[OVERRIDE_INT_GET_GENERATED_KEYS] operator[SEP] operator[==] literal[boolean] operator[SEP] { Keyword[this] operator[SEP] identifier[overrider] operator[SEP] identifier[overrideOnce] operator[SEP] identifier[MjdbcConstants] operator[SEP] identifier[OVERRIDE_INT_GET_GENERATED_KEYS] , literal[boolean] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[resultSetType] operator[==] Other[null] operator[&&] identifier[resultSetConcurrency] operator[==] Other[null] operator[SEP] { identifier[result] operator[=] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[sql] operator[SEP] operator[SEP] } Keyword[else] { identifier[resultSetType] operator[=] operator[SEP] identifier[resultSetType] operator[==] Other[null] operator[?] identifier[ResultSet] operator[SEP] identifier[TYPE_FORWARD_ONLY] operator[:] identifier[resultSetType] operator[SEP] operator[SEP] identifier[resultSetConcurrency] operator[=] operator[SEP] identifier[resultSetConcurrency] operator[==] Other[null] operator[?] identifier[ResultSet] operator[SEP] identifier[CONCUR_READ_ONLY] operator[:] identifier[resultSetConcurrency] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] identifier[sql] , identifier[resultSetType] , identifier[resultSetConcurrency] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public void updated(final UUID lastupdatedByEntityId) { if (this.entityId == null) { throw new IllegalStateException("The entity has not yet been created : entityId == null"); } Assert.notNull(lastupdatedByEntityId, "lastupdatedByEntityId is required"); entityVersion++; updatedByEntityId = lastupdatedByEntityId; entityUpdatedOn = System.currentTimeMillis(); }
class class_name[name] begin[{] method[updated, return_type[void], modifier[public], parameter[lastupdatedByEntityId]] begin[{] if[binary_operation[THIS[member[None.entityId]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The entity has not yet been created : entityId == null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] call[Assert.notNull, parameter[member[.lastupdatedByEntityId], literal["lastupdatedByEntityId is required"]]] member[.entityVersion] assign[member[.updatedByEntityId], member[.lastupdatedByEntityId]] assign[member[.entityUpdatedOn], call[System.currentTimeMillis, parameter[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[updated] operator[SEP] Keyword[final] identifier[UUID] identifier[lastupdatedByEntityId] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[entityId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[lastupdatedByEntityId] , literal[String] operator[SEP] operator[SEP] identifier[entityVersion] operator[++] operator[SEP] identifier[updatedByEntityId] operator[=] identifier[lastupdatedByEntityId] operator[SEP] identifier[entityUpdatedOn] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] }
DocumentExtractor get(UUID queryId) { DocumentExtractor extractor = queries.get(queryId); if (extractor == null) { throw new IllegalStateException("Query not found: " + queryId); } return extractor; }
class class_name[name] begin[{] method[get, return_type[type[DocumentExtractor]], modifier[default], parameter[queryId]] begin[{] local_variable[type[DocumentExtractor], extractor] if[binary_operation[member[.extractor], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Query not found: "), operandr=MemberReference(member=queryId, 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=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.extractor]] end[}] END[}]
identifier[DocumentExtractor] identifier[get] operator[SEP] identifier[UUID] identifier[queryId] operator[SEP] { identifier[DocumentExtractor] identifier[extractor] operator[=] identifier[queries] operator[SEP] identifier[get] operator[SEP] identifier[queryId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[extractor] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[queryId] operator[SEP] operator[SEP] } Keyword[return] identifier[extractor] operator[SEP] }
public static Map<Range, ConcurrentHashMap<Locator, Points>> getEligibleData() { if (locatorToTimestampToPoint.size() <= RANGE_BUFFER) { log.debug("Range buffer still not exceeded. Returning null data to rollup generator"); return null; } else { Object[] sortedKeySet = locatorToTimestampToPoint.keySet().toArray(); Range cuttingPoint = (Range) sortedKeySet[sortedKeySet.length - RANGE_BUFFER - 1]; log.info("Found completed ranges up to the threshold range of {}", cuttingPoint); completedRangesReturned.mark(); return locatorToTimestampToPoint.headMap(cuttingPoint, true); } }
class class_name[name] begin[{] method[getEligibleData, return_type[type[Map]], modifier[public static], parameter[]] begin[{] if[binary_operation[call[locatorToTimestampToPoint.size, parameter[]], <=, member[.RANGE_BUFFER]]] begin[{] call[log.debug, parameter[literal["Range buffer still not exceeded. Returning null data to rollup generator"]]] return[literal[null]] else begin[{] local_variable[type[Object], sortedKeySet] local_variable[type[Range], cuttingPoint] call[log.info, parameter[literal["Found completed ranges up to the threshold range of {}"], member[.cuttingPoint]]] call[completedRangesReturned.mark, parameter[]] return[call[locatorToTimestampToPoint.headMap, parameter[member[.cuttingPoint], literal[true]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[Range] , identifier[ConcurrentHashMap] operator[<] identifier[Locator] , identifier[Points] operator[>] operator[>] identifier[getEligibleData] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[locatorToTimestampToPoint] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<=] identifier[RANGE_BUFFER] operator[SEP] { identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[else] { identifier[Object] operator[SEP] operator[SEP] identifier[sortedKeySet] operator[=] identifier[locatorToTimestampToPoint] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] operator[SEP] operator[SEP] identifier[Range] identifier[cuttingPoint] operator[=] operator[SEP] identifier[Range] operator[SEP] identifier[sortedKeySet] operator[SEP] identifier[sortedKeySet] operator[SEP] identifier[length] operator[-] identifier[RANGE_BUFFER] operator[-] Other[1] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[cuttingPoint] operator[SEP] operator[SEP] identifier[completedRangesReturned] operator[SEP] identifier[mark] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[locatorToTimestampToPoint] operator[SEP] identifier[headMap] operator[SEP] identifier[cuttingPoint] , literal[boolean] operator[SEP] operator[SEP] } }
public void addActionSourceListener( ActionSourceListener l) { if (!eventType.equals(l.getEventTypeName())) throw new IllegalArgumentException("ActionCoordinator: tried to add ActionSourceListener for wrong kind of Action "+ eventType+ " != "+ l.getEventTypeName()); lm.addListener(l); l.addActionValueListener(this); }
class class_name[name] begin[{] method[addActionSourceListener, return_type[void], modifier[public], parameter[l]] begin[{] if[call[eventType.equals, parameter[call[l.getEventTypeName, parameter[]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ActionCoordinator: tried to add ActionSourceListener for wrong kind of Action "), operandr=MemberReference(member=eventType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" != "), operator=+), operandr=MethodInvocation(arguments=[], member=getEventTypeName, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[lm.addListener, parameter[member[.l]]] call[l.addActionValueListener, parameter[THIS[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addActionSourceListener] operator[SEP] identifier[ActionSourceListener] identifier[l] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[eventType] operator[SEP] identifier[equals] operator[SEP] identifier[l] operator[SEP] identifier[getEventTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[eventType] operator[+] literal[String] operator[+] identifier[l] operator[SEP] identifier[getEventTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[lm] operator[SEP] identifier[addListener] operator[SEP] identifier[l] operator[SEP] operator[SEP] identifier[l] operator[SEP] identifier[addActionValueListener] operator[SEP] Keyword[this] operator[SEP] operator[SEP] }
@Bind(id = "importDeclarations", specification = ImportDeclaration.class, aggregate = true, optional = true) void bindImportDeclaration(ServiceReference<ImportDeclaration> importDeclarationSRef) { synchronized (lock) { declarationsManager.add(importDeclarationSRef); if (!declarationsManager.matched(importDeclarationSRef)) { LOG.debug("No service matching was found, ignoring service reference."); return; } LOG.debug(linkerName + " : Bind the ImportDeclaration " + declarationsManager.getDeclaration(importDeclarationSRef)); declarationsManager.createLinks(importDeclarationSRef); } }
class class_name[name] begin[{] method[bindImportDeclaration, return_type[void], modifier[default], parameter[importDeclarationSRef]] begin[{] SYNCHRONIZED[member[.lock]] BEGIN[{] call[declarationsManager.add, parameter[member[.importDeclarationSRef]]] if[call[declarationsManager.matched, parameter[member[.importDeclarationSRef]]]] begin[{] call[LOG.debug, parameter[literal["No service matching was found, ignoring service reference."]]] return[None] else begin[{] None end[}] call[LOG.debug, parameter[binary_operation[binary_operation[member[.linkerName], +, literal[" : Bind the ImportDeclaration "]], +, call[declarationsManager.getDeclaration, parameter[member[.importDeclarationSRef]]]]]] call[declarationsManager.createLinks, parameter[member[.importDeclarationSRef]]] END[}] end[}] END[}]
annotation[@] identifier[Bind] operator[SEP] identifier[id] operator[=] literal[String] , identifier[specification] operator[=] identifier[ImportDeclaration] operator[SEP] Keyword[class] , identifier[aggregate] operator[=] literal[boolean] , identifier[optional] operator[=] literal[boolean] operator[SEP] Keyword[void] identifier[bindImportDeclaration] operator[SEP] identifier[ServiceReference] operator[<] identifier[ImportDeclaration] operator[>] identifier[importDeclarationSRef] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { identifier[declarationsManager] operator[SEP] identifier[add] operator[SEP] identifier[importDeclarationSRef] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[declarationsManager] operator[SEP] identifier[matched] operator[SEP] identifier[importDeclarationSRef] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[linkerName] operator[+] literal[String] operator[+] identifier[declarationsManager] operator[SEP] identifier[getDeclaration] operator[SEP] identifier[importDeclarationSRef] operator[SEP] operator[SEP] operator[SEP] identifier[declarationsManager] operator[SEP] identifier[createLinks] operator[SEP] identifier[importDeclarationSRef] operator[SEP] operator[SEP] } }
private SimpleEntry<String, String> parseEncryptionData(String jsonEncryptionData) throws SnowflakeSQLException { ObjectMapper mapper = ObjectMapperFactory.getObjectMapper(); JsonFactory factory = mapper.getJsonFactory(); try { JsonParser parser = factory.createJsonParser(jsonEncryptionData); JsonNode encryptionDataNode = mapper.readTree(parser); String iv = encryptionDataNode.get("ContentEncryptionIV").asText(); String key = encryptionDataNode.get("WrappedContentKey").get("EncryptedKey").asText(); return new SimpleEntry<String, String>(key, iv); } catch (Exception ex) { throw new SnowflakeSQLException(ex, SqlState.SYSTEM_ERROR, ErrorCode.IO_ERROR.getMessageCode(), "Error parsing encryption data as json" + ": " + ex.getMessage()); } }
class class_name[name] begin[{] method[parseEncryptionData, return_type[type[SimpleEntry]], modifier[private], parameter[jsonEncryptionData]] begin[{] local_variable[type[ObjectMapper], mapper] local_variable[type[JsonFactory], factory] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=jsonEncryptionData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createJsonParser, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None), name=parser)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonParser, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=parser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readTree, postfix_operators=[], prefix_operators=[], qualifier=mapper, selectors=[], type_arguments=None), name=encryptionDataNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonNode, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ContentEncryptionIV")], member=get, postfix_operators=[], prefix_operators=[], qualifier=encryptionDataNode, selectors=[MethodInvocation(arguments=[], member=asText, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=iv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="WrappedContentKey")], member=get, postfix_operators=[], prefix_operators=[], qualifier=encryptionDataNode, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="EncryptedKey")], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=asText, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iv, 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=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=SimpleEntry, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=SYSTEM_ERROR, postfix_operators=[], prefix_operators=[], qualifier=SqlState, selectors=[]), MethodInvocation(arguments=[], member=getMessageCode, postfix_operators=[], prefix_operators=[], qualifier=ErrorCode.IO_ERROR, selectors=[], type_arguments=None), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error parsing encryption data as json"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, 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=SnowflakeSQLException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] identifier[SimpleEntry] operator[<] identifier[String] , identifier[String] operator[>] identifier[parseEncryptionData] operator[SEP] identifier[String] identifier[jsonEncryptionData] operator[SEP] Keyword[throws] identifier[SnowflakeSQLException] { identifier[ObjectMapper] identifier[mapper] operator[=] identifier[ObjectMapperFactory] operator[SEP] identifier[getObjectMapper] operator[SEP] operator[SEP] operator[SEP] identifier[JsonFactory] identifier[factory] operator[=] identifier[mapper] operator[SEP] identifier[getJsonFactory] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[JsonParser] identifier[parser] operator[=] identifier[factory] operator[SEP] identifier[createJsonParser] operator[SEP] identifier[jsonEncryptionData] operator[SEP] operator[SEP] identifier[JsonNode] identifier[encryptionDataNode] operator[=] identifier[mapper] operator[SEP] identifier[readTree] operator[SEP] identifier[parser] operator[SEP] operator[SEP] identifier[String] identifier[iv] operator[=] identifier[encryptionDataNode] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[asText] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[key] operator[=] identifier[encryptionDataNode] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[asText] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[SimpleEntry] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] identifier[key] , identifier[iv] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[SnowflakeSQLException] operator[SEP] identifier[ex] , identifier[SqlState] operator[SEP] identifier[SYSTEM_ERROR] , identifier[ErrorCode] operator[SEP] identifier[IO_ERROR] operator[SEP] identifier[getMessageCode] operator[SEP] operator[SEP] , literal[String] operator[+] literal[String] operator[+] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public void updateType(String id, String type) { Process entity = getProcessById(id); entity.setType(type); access().updateProcessType(id, type); cache(entity); }
class class_name[name] begin[{] method[updateType, return_type[void], modifier[public], parameter[id, type]] begin[{] local_variable[type[Process], entity] call[entity.setType, parameter[member[.type]]] call[.access, parameter[]] call[.cache, parameter[member[.entity]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[updateType] operator[SEP] identifier[String] identifier[id] , identifier[String] identifier[type] operator[SEP] { identifier[Process] identifier[entity] operator[=] identifier[getProcessById] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[entity] operator[SEP] identifier[setType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[access] operator[SEP] operator[SEP] operator[SEP] identifier[updateProcessType] operator[SEP] identifier[id] , identifier[type] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[entity] operator[SEP] operator[SEP] }
public void addTangoArchiveListener(ITangoArchiveListener listener, String attrName, String[] filters) throws DevFailed { addTangoArchiveListener(listener, attrName, filters, false); }
class class_name[name] begin[{] method[addTangoArchiveListener, return_type[void], modifier[public], parameter[listener, attrName, filters]] begin[{] call[.addTangoArchiveListener, parameter[member[.listener], member[.attrName], member[.filters], literal[false]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addTangoArchiveListener] operator[SEP] identifier[ITangoArchiveListener] identifier[listener] , identifier[String] identifier[attrName] , identifier[String] operator[SEP] operator[SEP] identifier[filters] operator[SEP] Keyword[throws] identifier[DevFailed] { identifier[addTangoArchiveListener] operator[SEP] identifier[listener] , identifier[attrName] , identifier[filters] , literal[boolean] operator[SEP] operator[SEP] }
@Override public RecordWriter<NullWritable, WARCWritable> getRecordWriter(TaskAttemptContext context) throws IOException, InterruptedException { return new WARCWriter(context); }
class class_name[name] begin[{] method[getRecordWriter, return_type[type[RecordWriter]], modifier[public], parameter[context]] begin[{] return[ClassCreator(arguments=[MemberReference(member=context, 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=WARCWriter, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[RecordWriter] operator[<] identifier[NullWritable] , identifier[WARCWritable] operator[>] identifier[getRecordWriter] operator[SEP] identifier[TaskAttemptContext] identifier[context] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] { Keyword[return] Keyword[new] identifier[WARCWriter] operator[SEP] identifier[context] operator[SEP] operator[SEP] }
private static final <T extends Appendable> void encodeRun(T buffer, byte value, int length, byte[] state) { if (length < 4) { for (int j=0; j<length; ++j) { if (value == ESCAPE_BYTE) appendEncodedByte(buffer, ESCAPE_BYTE, state); appendEncodedByte(buffer, value, state); } } else { if ((byte)length == ESCAPE_BYTE) { if (value == ESCAPE_BYTE) appendEncodedByte(buffer, ESCAPE_BYTE, state); appendEncodedByte(buffer, value, state); --length; } appendEncodedByte(buffer, ESCAPE_BYTE, state); appendEncodedByte(buffer, (byte)length, state); appendEncodedByte(buffer, value, state); // Don't need to escape this value } }
class class_name[name] begin[{] method[encodeRun, return_type[void], modifier[final private static], parameter[buffer, value, length, state]] begin[{] if[binary_operation[member[.length], <, literal[4]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ESCAPE_BYTE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ESCAPE_BYTE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendEncodedByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendEncodedByte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), 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=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) else begin[{] if[binary_operation[Cast(expression=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte)), ==, member[.ESCAPE_BYTE]]] begin[{] if[binary_operation[member[.value], ==, member[.ESCAPE_BYTE]]] begin[{] call[.appendEncodedByte, parameter[member[.buffer], member[.ESCAPE_BYTE], member[.state]]] else begin[{] None end[}] call[.appendEncodedByte, parameter[member[.buffer], member[.value], member[.state]]] member[.length] else begin[{] None end[}] call[.appendEncodedByte, parameter[member[.buffer], member[.ESCAPE_BYTE], member[.state]]] call[.appendEncodedByte, parameter[member[.buffer], Cast(expression=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=byte)), member[.state]]] call[.appendEncodedByte, parameter[member[.buffer], member[.value], member[.state]]] end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[final] operator[<] identifier[T] Keyword[extends] identifier[Appendable] operator[>] Keyword[void] identifier[encodeRun] operator[SEP] identifier[T] identifier[buffer] , Keyword[byte] identifier[value] , Keyword[int] identifier[length] , Keyword[byte] operator[SEP] operator[SEP] identifier[state] operator[SEP] { Keyword[if] operator[SEP] identifier[length] operator[<] Other[4] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[length] operator[SEP] operator[++] identifier[j] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] identifier[ESCAPE_BYTE] operator[SEP] identifier[appendEncodedByte] operator[SEP] identifier[buffer] , identifier[ESCAPE_BYTE] , identifier[state] operator[SEP] operator[SEP] identifier[appendEncodedByte] operator[SEP] identifier[buffer] , identifier[value] , identifier[state] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] identifier[length] operator[==] identifier[ESCAPE_BYTE] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] identifier[ESCAPE_BYTE] operator[SEP] identifier[appendEncodedByte] operator[SEP] identifier[buffer] , identifier[ESCAPE_BYTE] , identifier[state] operator[SEP] operator[SEP] identifier[appendEncodedByte] operator[SEP] identifier[buffer] , identifier[value] , identifier[state] operator[SEP] operator[SEP] operator[--] identifier[length] operator[SEP] } identifier[appendEncodedByte] operator[SEP] identifier[buffer] , identifier[ESCAPE_BYTE] , identifier[state] operator[SEP] operator[SEP] identifier[appendEncodedByte] operator[SEP] identifier[buffer] , operator[SEP] Keyword[byte] operator[SEP] identifier[length] , identifier[state] operator[SEP] operator[SEP] identifier[appendEncodedByte] operator[SEP] identifier[buffer] , identifier[value] , identifier[state] operator[SEP] operator[SEP] } }
public void setMaxFrame(final int maxFrame) { if (composition == null) { lazyCompositionTasks.add(new LazyCompositionTask() { @Override public void run(LottieComposition composition) { setMaxFrame(maxFrame); } }); return; } animator.setMaxFrame(maxFrame + 0.99f); }
class class_name[name] begin[{] method[setMaxFrame, return_type[void], modifier[public], parameter[maxFrame]] begin[{] if[binary_operation[member[.composition], ==, literal[null]]] begin[{] call[lazyCompositionTasks.add, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=maxFrame, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setMaxFrame, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[FormalParameter(annotations=[], modifiers=set(), name=composition, type=ReferenceType(arguments=None, dimensions=[], name=LottieComposition, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LazyCompositionTask, sub_type=None))]] return[None] else begin[{] None end[}] call[animator.setMaxFrame, parameter[binary_operation[member[.maxFrame], +, literal[0.99f]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setMaxFrame] operator[SEP] Keyword[final] Keyword[int] identifier[maxFrame] operator[SEP] { Keyword[if] operator[SEP] identifier[composition] operator[==] Other[null] operator[SEP] { identifier[lazyCompositionTasks] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[LazyCompositionTask] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] identifier[LottieComposition] identifier[composition] operator[SEP] { identifier[setMaxFrame] operator[SEP] identifier[maxFrame] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[animator] operator[SEP] identifier[setMaxFrame] operator[SEP] identifier[maxFrame] operator[+] literal[Float] operator[SEP] operator[SEP] }
private void scanTwoDigitSpecial() { if (mInput == '=' && (mType == TokenType.COMP || mType == TokenType.EQ || mType == TokenType.N_EQ)) { mOutput.append(mInput); mPos++; } else if (mInput == '/' && (mType == TokenType.SLASH)) { mOutput.append(mInput); mType = TokenType.DESC_STEP; mPos++; } else if (mInput == '.' && (mType == TokenType.POINT)) { mOutput.append(mInput); mType = TokenType.PARENT; mPos++; } else if (mInput == '<' && mOutput.toString().equals("<")) { mOutput.append(mInput); mType = TokenType.L_SHIFT; mPos++; } else if (mInput == '>' && mOutput.toString().equals(">")) { mOutput.append(mInput); mType = TokenType.R_SHIFT; mPos++; } else if (mInput == ':' && mType == TokenType.OPEN_BR) { // could be start of a comment mOutput = new StringBuilder(); mType = TokenType.COMMENT; mCommentCount++; mState = State.COMMENT; mPos++; } else { mFinnished = true; } }
class class_name[name] begin[{] method[scanTwoDigitSpecial, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[binary_operation[member[.mInput], ==, literal['=']], &&, binary_operation[binary_operation[binary_operation[member[.mType], ==, member[TokenType.COMP]], ||, binary_operation[member[.mType], ==, member[TokenType.EQ]]], ||, binary_operation[member[.mType], ==, member[TokenType.N_EQ]]]]] begin[{] call[mOutput.append, parameter[member[.mInput]]] member[.mPos] else begin[{] if[binary_operation[binary_operation[member[.mInput], ==, literal['/']], &&, binary_operation[member[.mType], ==, member[TokenType.SLASH]]]] begin[{] call[mOutput.append, parameter[member[.mInput]]] assign[member[.mType], member[TokenType.DESC_STEP]] member[.mPos] else begin[{] if[binary_operation[binary_operation[member[.mInput], ==, literal['.']], &&, binary_operation[member[.mType], ==, member[TokenType.POINT]]]] begin[{] call[mOutput.append, parameter[member[.mInput]]] assign[member[.mType], member[TokenType.PARENT]] member[.mPos] else begin[{] if[binary_operation[binary_operation[member[.mInput], ==, literal['<']], &&, call[mOutput.toString, parameter[]]]] begin[{] call[mOutput.append, parameter[member[.mInput]]] assign[member[.mType], member[TokenType.L_SHIFT]] member[.mPos] else begin[{] if[binary_operation[binary_operation[member[.mInput], ==, literal['>']], &&, call[mOutput.toString, parameter[]]]] begin[{] call[mOutput.append, parameter[member[.mInput]]] assign[member[.mType], member[TokenType.R_SHIFT]] member[.mPos] else begin[{] if[binary_operation[binary_operation[member[.mInput], ==, literal[':']], &&, binary_operation[member[.mType], ==, member[TokenType.OPEN_BR]]]] begin[{] assign[member[.mOutput], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))] assign[member[.mType], member[TokenType.COMMENT]] member[.mCommentCount] assign[member[.mState], member[State.COMMENT]] member[.mPos] else begin[{] assign[member[.mFinnished], literal[true]] end[}] end[}] end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[scanTwoDigitSpecial] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[mInput] operator[==] literal[String] operator[&&] operator[SEP] identifier[mType] operator[==] identifier[TokenType] operator[SEP] identifier[COMP] operator[||] identifier[mType] operator[==] identifier[TokenType] operator[SEP] identifier[EQ] operator[||] identifier[mType] operator[==] identifier[TokenType] operator[SEP] identifier[N_EQ] operator[SEP] operator[SEP] { identifier[mOutput] operator[SEP] identifier[append] operator[SEP] identifier[mInput] operator[SEP] operator[SEP] identifier[mPos] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[mInput] operator[==] literal[String] operator[&&] operator[SEP] identifier[mType] operator[==] identifier[TokenType] operator[SEP] identifier[SLASH] operator[SEP] operator[SEP] { identifier[mOutput] operator[SEP] identifier[append] operator[SEP] identifier[mInput] operator[SEP] operator[SEP] identifier[mType] operator[=] identifier[TokenType] operator[SEP] identifier[DESC_STEP] operator[SEP] identifier[mPos] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[mInput] operator[==] literal[String] operator[&&] operator[SEP] identifier[mType] operator[==] identifier[TokenType] operator[SEP] identifier[POINT] operator[SEP] operator[SEP] { identifier[mOutput] operator[SEP] identifier[append] operator[SEP] identifier[mInput] operator[SEP] operator[SEP] identifier[mType] operator[=] identifier[TokenType] operator[SEP] identifier[PARENT] operator[SEP] identifier[mPos] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[mInput] operator[==] literal[String] operator[&&] identifier[mOutput] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[mOutput] operator[SEP] identifier[append] operator[SEP] identifier[mInput] operator[SEP] operator[SEP] identifier[mType] operator[=] identifier[TokenType] operator[SEP] identifier[L_SHIFT] operator[SEP] identifier[mPos] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[mInput] operator[==] literal[String] operator[&&] identifier[mOutput] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[mOutput] operator[SEP] identifier[append] operator[SEP] identifier[mInput] operator[SEP] operator[SEP] identifier[mType] operator[=] identifier[TokenType] operator[SEP] identifier[R_SHIFT] operator[SEP] identifier[mPos] operator[++] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[mInput] operator[==] literal[String] operator[&&] identifier[mType] operator[==] identifier[TokenType] operator[SEP] identifier[OPEN_BR] operator[SEP] { identifier[mOutput] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[mType] operator[=] identifier[TokenType] operator[SEP] identifier[COMMENT] operator[SEP] identifier[mCommentCount] operator[++] operator[SEP] identifier[mState] operator[=] identifier[State] operator[SEP] identifier[COMMENT] operator[SEP] identifier[mPos] operator[++] operator[SEP] } Keyword[else] { identifier[mFinnished] operator[=] literal[boolean] operator[SEP] } }
@Override public String toSource() { return runInCompilerThread( () -> { Tracer tracer = newTracer("toSource"); try { CodeBuilder cb = new CodeBuilder(); if (jsRoot != null) { int i = 0; if (options.shouldPrintExterns()) { for (Node scriptNode = externsRoot.getFirstChild(); scriptNode != null; scriptNode = scriptNode.getNext()) { toSource(cb, i++, scriptNode); } } for (Node scriptNode = jsRoot.getFirstChild(); scriptNode != null; scriptNode = scriptNode.getNext()) { toSource(cb, i++, scriptNode); } } return cb.toString(); } finally { stopTracer(tracer, "toSource"); } }); }
class class_name[name] begin[{] method[toSource, return_type[type[String]], modifier[public], parameter[]] begin[{] return[call[.runInCompilerThread, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="toSource")], member=newTracer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=tracer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Tracer, sub_type=None)), TryStatement(block=[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=CodeBuilder, sub_type=None)), name=cb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CodeBuilder, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=jsRoot, 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=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=MethodInvocation(arguments=[], member=shouldPrintExterns, postfix_operators=[], prefix_operators=[], qualifier=options, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scriptNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=scriptNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getFirstChild, postfix_operators=[], prefix_operators=[], qualifier=externsRoot, selectors=[], type_arguments=None), name=scriptNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=scriptNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getNext, postfix_operators=[], prefix_operators=[], qualifier=scriptNode, selectors=[], type_arguments=None))]), label=None)])), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scriptNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=scriptNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getFirstChild, postfix_operators=[], prefix_operators=[], qualifier=jsRoot, selectors=[], type_arguments=None), name=scriptNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=scriptNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getNext, postfix_operators=[], prefix_operators=[], qualifier=scriptNode, selectors=[], type_arguments=None))]), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=cb, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tracer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="toSource")], member=stopTracer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], parameters=[])]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toSource] operator[SEP] operator[SEP] { Keyword[return] identifier[runInCompilerThread] operator[SEP] operator[SEP] operator[SEP] operator[->] { identifier[Tracer] identifier[tracer] operator[=] identifier[newTracer] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[CodeBuilder] identifier[cb] operator[=] Keyword[new] identifier[CodeBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jsRoot] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[shouldPrintExterns] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Node] identifier[scriptNode] operator[=] identifier[externsRoot] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[scriptNode] operator[!=] Other[null] operator[SEP] identifier[scriptNode] operator[=] identifier[scriptNode] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] { identifier[toSource] operator[SEP] identifier[cb] , identifier[i] operator[++] , identifier[scriptNode] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] identifier[Node] identifier[scriptNode] operator[=] identifier[jsRoot] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[scriptNode] operator[!=] Other[null] operator[SEP] identifier[scriptNode] operator[=] identifier[scriptNode] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] { identifier[toSource] operator[SEP] identifier[cb] , identifier[i] operator[++] , identifier[scriptNode] operator[SEP] operator[SEP] } } Keyword[return] identifier[cb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { identifier[stopTracer] operator[SEP] identifier[tracer] , literal[String] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public void smoothOpenMenu(int position, @DirectionMode int direction, int duration) { if (mOldSwipedLayout != null) { if (mOldSwipedLayout.isMenuOpen()) { mOldSwipedLayout.smoothCloseMenu(); } } position += getHeaderCount(); ViewHolder vh = findViewHolderForAdapterPosition(position); if (vh != null) { View itemView = getSwipeMenuView(vh.itemView); if (itemView instanceof SwipeMenuLayout) { mOldSwipedLayout = (SwipeMenuLayout)itemView; if (direction == RIGHT_DIRECTION) { mOldTouchedPosition = position; mOldSwipedLayout.smoothOpenRightMenu(duration); } else if (direction == LEFT_DIRECTION) { mOldTouchedPosition = position; mOldSwipedLayout.smoothOpenLeftMenu(duration); } } } }
class class_name[name] begin[{] method[smoothOpenMenu, return_type[void], modifier[public], parameter[position, direction, duration]] begin[{] if[binary_operation[member[.mOldSwipedLayout], !=, literal[null]]] begin[{] if[call[mOldSwipedLayout.isMenuOpen, parameter[]]] begin[{] call[mOldSwipedLayout.smoothCloseMenu, parameter[]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.position], call[.getHeaderCount, parameter[]]] local_variable[type[ViewHolder], vh] if[binary_operation[member[.vh], !=, literal[null]]] begin[{] local_variable[type[View], itemView] if[binary_operation[member[.itemView], instanceof, type[SwipeMenuLayout]]] begin[{] assign[member[.mOldSwipedLayout], Cast(expression=MemberReference(member=itemView, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SwipeMenuLayout, sub_type=None))] if[binary_operation[member[.direction], ==, member[.RIGHT_DIRECTION]]] begin[{] assign[member[.mOldTouchedPosition], member[.position]] call[mOldSwipedLayout.smoothOpenRightMenu, parameter[member[.duration]]] else begin[{] if[binary_operation[member[.direction], ==, member[.LEFT_DIRECTION]]] begin[{] assign[member[.mOldTouchedPosition], member[.position]] call[mOldSwipedLayout.smoothOpenLeftMenu, parameter[member[.duration]]] else begin[{] None end[}] end[}] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[smoothOpenMenu] operator[SEP] Keyword[int] identifier[position] , annotation[@] identifier[DirectionMode] Keyword[int] identifier[direction] , Keyword[int] identifier[duration] operator[SEP] { Keyword[if] operator[SEP] identifier[mOldSwipedLayout] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[mOldSwipedLayout] operator[SEP] identifier[isMenuOpen] operator[SEP] operator[SEP] operator[SEP] { identifier[mOldSwipedLayout] operator[SEP] identifier[smoothCloseMenu] operator[SEP] operator[SEP] operator[SEP] } } identifier[position] operator[+=] identifier[getHeaderCount] operator[SEP] operator[SEP] operator[SEP] identifier[ViewHolder] identifier[vh] operator[=] identifier[findViewHolderForAdapterPosition] operator[SEP] identifier[position] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vh] operator[!=] Other[null] operator[SEP] { identifier[View] identifier[itemView] operator[=] identifier[getSwipeMenuView] operator[SEP] identifier[vh] operator[SEP] identifier[itemView] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[itemView] Keyword[instanceof] identifier[SwipeMenuLayout] operator[SEP] { identifier[mOldSwipedLayout] operator[=] operator[SEP] identifier[SwipeMenuLayout] operator[SEP] identifier[itemView] operator[SEP] Keyword[if] operator[SEP] identifier[direction] operator[==] identifier[RIGHT_DIRECTION] operator[SEP] { identifier[mOldTouchedPosition] operator[=] identifier[position] operator[SEP] identifier[mOldSwipedLayout] operator[SEP] identifier[smoothOpenRightMenu] operator[SEP] identifier[duration] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[direction] operator[==] identifier[LEFT_DIRECTION] operator[SEP] { identifier[mOldTouchedPosition] operator[=] identifier[position] operator[SEP] identifier[mOldSwipedLayout] operator[SEP] identifier[smoothOpenLeftMenu] operator[SEP] identifier[duration] operator[SEP] operator[SEP] } } } }
public static File toJsonFile(String jsonString, File returnJsonFile) { try { jsonMapper.writeValue(returnJsonFile, jsonString); return returnJsonFile; } catch (Exception e) { return JMExceptionManager.handleExceptionAndReturnNull(log, e, "toJsonFile", jsonString); } }
class class_name[name] begin[{] method[toJsonFile, return_type[type[File]], modifier[public static], parameter[jsonString, returnJsonFile]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=returnJsonFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=jsonString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeValue, postfix_operators=[], prefix_operators=[], qualifier=jsonMapper, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=returnJsonFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="toJsonFile"), MemberReference(member=jsonString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleExceptionAndReturnNull, postfix_operators=[], prefix_operators=[], qualifier=JMExceptionManager, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[File] identifier[toJsonFile] operator[SEP] identifier[String] identifier[jsonString] , identifier[File] identifier[returnJsonFile] operator[SEP] { Keyword[try] { identifier[jsonMapper] operator[SEP] identifier[writeValue] operator[SEP] identifier[returnJsonFile] , identifier[jsonString] operator[SEP] operator[SEP] Keyword[return] identifier[returnJsonFile] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] identifier[JMExceptionManager] operator[SEP] identifier[handleExceptionAndReturnNull] operator[SEP] identifier[log] , identifier[e] , literal[String] , identifier[jsonString] operator[SEP] operator[SEP] } }
public static void zip(File source, File target) throws IOException { zip(source, target, null); }
class class_name[name] begin[{] method[zip, return_type[void], modifier[public static], parameter[source, target]] begin[{] call[.zip, parameter[member[.source], member[.target], literal[null]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[zip] operator[SEP] identifier[File] identifier[source] , identifier[File] identifier[target] operator[SEP] Keyword[throws] identifier[IOException] { identifier[zip] operator[SEP] identifier[source] , identifier[target] , Other[null] operator[SEP] operator[SEP] }
public OvhVolume project_serviceName_volume_POST(String serviceName, String description, String imageId, String name, String region, Long size, String snapshotId, OvhVolumeTypeEnum type) throws IOException { String qPath = "/cloud/project/{serviceName}/volume"; StringBuilder sb = path(qPath, serviceName); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "description", description); addBody(o, "imageId", imageId); addBody(o, "name", name); addBody(o, "region", region); addBody(o, "size", size); addBody(o, "snapshotId", snapshotId); addBody(o, "type", type); String resp = exec(qPath, "POST", sb.toString(), o); return convertTo(resp, OvhVolume.class); }
class class_name[name] begin[{] method[project_serviceName_volume_POST, return_type[type[OvhVolume]], modifier[public], parameter[serviceName, description, imageId, name, region, size, snapshotId, type]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[HashMap], o] call[.addBody, parameter[member[.o], literal["description"], member[.description]]] call[.addBody, parameter[member[.o], literal["imageId"], member[.imageId]]] call[.addBody, parameter[member[.o], literal["name"], member[.name]]] call[.addBody, parameter[member[.o], literal["region"], member[.region]]] call[.addBody, parameter[member[.o], literal["size"], member[.size]]] call[.addBody, parameter[member[.o], literal["snapshotId"], member[.snapshotId]]] call[.addBody, parameter[member[.o], literal["type"], member[.type]]] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhVolume, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[OvhVolume] identifier[project_serviceName_volume_POST] operator[SEP] identifier[String] identifier[serviceName] , identifier[String] identifier[description] , identifier[String] identifier[imageId] , identifier[String] identifier[name] , identifier[String] identifier[region] , identifier[Long] identifier[size] , identifier[String] identifier[snapshotId] , identifier[OvhVolumeTypeEnum] identifier[type] operator[SEP] Keyword[throws] identifier[IOException] { identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[serviceName] operator[SEP] operator[SEP] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] identifier[o] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[description] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[imageId] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[region] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[size] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[snapshotId] operator[SEP] operator[SEP] identifier[addBody] operator[SEP] identifier[o] , literal[String] , identifier[type] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[o] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhVolume] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
private boolean scopeContainsInstances(GraqlCompute query, ConceptId... ids) { for (ConceptId id : ids) { Thing thing = tx.getConcept(id); if (thing == null || !scopeTypeLabels(query).contains(thing.type().label())) return false; } return true; }
class class_name[name] begin[{] method[scopeContainsInstances, return_type[type[boolean]], modifier[private], parameter[query, ids]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getConcept, postfix_operators=[], prefix_operators=[], qualifier=tx, selectors=[], type_arguments=None), name=thing)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Thing, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=thing, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=scopeTypeLabels, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=thing, selectors=[MethodInvocation(arguments=[], member=label, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ConceptId, sub_type=None))), label=None) return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[scopeContainsInstances] operator[SEP] identifier[GraqlCompute] identifier[query] , identifier[ConceptId] operator[...] identifier[ids] operator[SEP] { Keyword[for] operator[SEP] identifier[ConceptId] identifier[id] operator[:] identifier[ids] operator[SEP] { identifier[Thing] identifier[thing] operator[=] identifier[tx] operator[SEP] identifier[getConcept] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[thing] operator[==] Other[null] operator[||] operator[!] identifier[scopeTypeLabels] operator[SEP] identifier[query] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[thing] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[label] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private void setExceptions(ProjectCalendar mpxjCalendar, Calendars gpCalendar) { List<net.sf.mpxj.ganttproject.schema.Date> dates = gpCalendar.getDate(); for (net.sf.mpxj.ganttproject.schema.Date date : dates) { addException(mpxjCalendar, date); } }
class class_name[name] begin[{] method[setExceptions, return_type[void], modifier[private], parameter[mpxjCalendar, gpCalendar]] begin[{] local_variable[type[List], dates] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=mpxjCalendar, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=dates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=date)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=net, sub_type=ReferenceType(arguments=None, dimensions=None, name=sf, sub_type=ReferenceType(arguments=None, dimensions=None, name=mpxj, sub_type=ReferenceType(arguments=None, dimensions=None, name=ganttproject, sub_type=ReferenceType(arguments=None, dimensions=None, name=schema, sub_type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None)))))))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[setExceptions] operator[SEP] identifier[ProjectCalendar] identifier[mpxjCalendar] , identifier[Calendars] identifier[gpCalendar] operator[SEP] { identifier[List] operator[<] identifier[net] operator[SEP] identifier[sf] operator[SEP] identifier[mpxj] operator[SEP] identifier[ganttproject] operator[SEP] identifier[schema] operator[SEP] identifier[Date] operator[>] identifier[dates] operator[=] identifier[gpCalendar] operator[SEP] identifier[getDate] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[net] operator[SEP] identifier[sf] operator[SEP] identifier[mpxj] operator[SEP] identifier[ganttproject] operator[SEP] identifier[schema] operator[SEP] identifier[Date] identifier[date] operator[:] identifier[dates] operator[SEP] { identifier[addException] operator[SEP] identifier[mpxjCalendar] , identifier[date] operator[SEP] operator[SEP] } }
private void addSnapshotDataObject( String key, Snapshot snapshot, long clock, List<DataObject> dataObjectList ) { dataObjectList.add( toDataObject( key, ".min", snapshot.getMin(), clock ) ); dataObjectList.add( toDataObject( key, ".max", snapshot.getMax(), clock ) ); dataObjectList.add( toDataObject( key, ".mean", snapshot.getMean(), clock ) ); dataObjectList.add( toDataObject( key, ".stddev", snapshot.getStdDev(), clock ) ); dataObjectList.add( toDataObject( key, ".median", snapshot.getMedian(), clock ) ); dataObjectList.add( toDataObject( key, ".75th", snapshot.get75thPercentile(), clock ) ); dataObjectList.add( toDataObject( key, ".95th", snapshot.get95thPercentile(), clock ) ); dataObjectList.add( toDataObject( key, ".98th", snapshot.get98thPercentile(), clock ) ); dataObjectList.add( toDataObject( key, ".99th", snapshot.get99thPercentile(), clock ) ); dataObjectList.add( toDataObject( key, ".99.9th", snapshot.get999thPercentile(), clock ) ); }
class class_name[name] begin[{] method[addSnapshotDataObject, return_type[void], modifier[private], parameter[key, snapshot, clock, dataObjectList]] begin[{] call[dataObjectList.add, parameter[call[.toDataObject, parameter[member[.key], literal[".min"], call[snapshot.getMin, parameter[]], member[.clock]]]]] call[dataObjectList.add, parameter[call[.toDataObject, parameter[member[.key], literal[".max"], call[snapshot.getMax, parameter[]], member[.clock]]]]] call[dataObjectList.add, parameter[call[.toDataObject, parameter[member[.key], literal[".mean"], call[snapshot.getMean, parameter[]], member[.clock]]]]] call[dataObjectList.add, parameter[call[.toDataObject, parameter[member[.key], literal[".stddev"], call[snapshot.getStdDev, parameter[]], member[.clock]]]]] call[dataObjectList.add, parameter[call[.toDataObject, parameter[member[.key], literal[".median"], call[snapshot.getMedian, parameter[]], member[.clock]]]]] call[dataObjectList.add, parameter[call[.toDataObject, parameter[member[.key], literal[".75th"], call[snapshot.get75thPercentile, parameter[]], member[.clock]]]]] call[dataObjectList.add, parameter[call[.toDataObject, parameter[member[.key], literal[".95th"], call[snapshot.get95thPercentile, parameter[]], member[.clock]]]]] call[dataObjectList.add, parameter[call[.toDataObject, parameter[member[.key], literal[".98th"], call[snapshot.get98thPercentile, parameter[]], member[.clock]]]]] call[dataObjectList.add, parameter[call[.toDataObject, parameter[member[.key], literal[".99th"], call[snapshot.get99thPercentile, parameter[]], member[.clock]]]]] call[dataObjectList.add, parameter[call[.toDataObject, parameter[member[.key], literal[".99.9th"], call[snapshot.get999thPercentile, parameter[]], member[.clock]]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[addSnapshotDataObject] operator[SEP] identifier[String] identifier[key] , identifier[Snapshot] identifier[snapshot] , Keyword[long] identifier[clock] , identifier[List] operator[<] identifier[DataObject] operator[>] identifier[dataObjectList] operator[SEP] { identifier[dataObjectList] operator[SEP] identifier[add] operator[SEP] identifier[toDataObject] operator[SEP] identifier[key] , literal[String] , identifier[snapshot] operator[SEP] identifier[getMin] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] operator[SEP] operator[SEP] identifier[dataObjectList] operator[SEP] identifier[add] operator[SEP] identifier[toDataObject] operator[SEP] identifier[key] , literal[String] , identifier[snapshot] operator[SEP] identifier[getMax] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] operator[SEP] operator[SEP] identifier[dataObjectList] operator[SEP] identifier[add] operator[SEP] identifier[toDataObject] operator[SEP] identifier[key] , literal[String] , identifier[snapshot] operator[SEP] identifier[getMean] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] operator[SEP] operator[SEP] identifier[dataObjectList] operator[SEP] identifier[add] operator[SEP] identifier[toDataObject] operator[SEP] identifier[key] , literal[String] , identifier[snapshot] operator[SEP] identifier[getStdDev] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] operator[SEP] operator[SEP] identifier[dataObjectList] operator[SEP] identifier[add] operator[SEP] identifier[toDataObject] operator[SEP] identifier[key] , literal[String] , identifier[snapshot] operator[SEP] identifier[getMedian] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] operator[SEP] operator[SEP] identifier[dataObjectList] operator[SEP] identifier[add] operator[SEP] identifier[toDataObject] operator[SEP] identifier[key] , literal[String] , identifier[snapshot] operator[SEP] identifier[get75thPercentile] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] operator[SEP] operator[SEP] identifier[dataObjectList] operator[SEP] identifier[add] operator[SEP] identifier[toDataObject] operator[SEP] identifier[key] , literal[String] , identifier[snapshot] operator[SEP] identifier[get95thPercentile] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] operator[SEP] operator[SEP] identifier[dataObjectList] operator[SEP] identifier[add] operator[SEP] identifier[toDataObject] operator[SEP] identifier[key] , literal[String] , identifier[snapshot] operator[SEP] identifier[get98thPercentile] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] operator[SEP] operator[SEP] identifier[dataObjectList] operator[SEP] identifier[add] operator[SEP] identifier[toDataObject] operator[SEP] identifier[key] , literal[String] , identifier[snapshot] operator[SEP] identifier[get99thPercentile] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] operator[SEP] operator[SEP] identifier[dataObjectList] operator[SEP] identifier[add] operator[SEP] identifier[toDataObject] operator[SEP] identifier[key] , literal[String] , identifier[snapshot] operator[SEP] identifier[get999thPercentile] operator[SEP] operator[SEP] , identifier[clock] operator[SEP] operator[SEP] operator[SEP] }
protected CliEnvironment createMainEnvironment(final AtomicReference<InputReader> dynamicInputReaderRef, final AtomicReference<History> dynamicHistoryAtomicReference) { final Map<String, ?> data = new HashMap<String, Object>(); return new CliEnv() { @Override public History history() { return dynamicHistoryAtomicReference.get(); } @Override public InputReader reader() { return dynamicInputReaderRef.get(); } @Override public Map<String, ?> userData() { return data; } }; }
class class_name[name] begin[{] method[createMainEnvironment, return_type[type[CliEnvironment]], modifier[protected], parameter[dynamicInputReaderRef, dynamicHistoryAtomicReference]] begin[{] local_variable[type[Map], data] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=dynamicHistoryAtomicReference, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=history, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=History, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=dynamicInputReaderRef, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=reader, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=InputReader, sub_type=None), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=userData, parameters=[], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Map, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CliEnv, sub_type=None))] end[}] END[}]
Keyword[protected] identifier[CliEnvironment] identifier[createMainEnvironment] operator[SEP] Keyword[final] identifier[AtomicReference] operator[<] identifier[InputReader] operator[>] identifier[dynamicInputReaderRef] , Keyword[final] identifier[AtomicReference] operator[<] identifier[History] operator[>] identifier[dynamicHistoryAtomicReference] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[String] , operator[?] operator[>] identifier[data] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[CliEnv] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[History] identifier[history] operator[SEP] operator[SEP] { Keyword[return] identifier[dynamicHistoryAtomicReference] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[InputReader] identifier[reader] operator[SEP] operator[SEP] { Keyword[return] identifier[dynamicInputReaderRef] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[Map] operator[<] identifier[String] , operator[?] operator[>] identifier[userData] operator[SEP] operator[SEP] { Keyword[return] identifier[data] operator[SEP] } } operator[SEP] }
protected String getMessage(String contextId, String fieldPath, String[] faceDescriptorProperty) { String[] keys = getMessageKeys(contextId, fieldPath, faceDescriptorProperty); return getMessageSourceAccessor().getMessage(new DefaultMessageSourceResolvable(keys, null, keys[0])); }
class class_name[name] begin[{] method[getMessage, return_type[type[String]], modifier[protected], parameter[contextId, fieldPath, faceDescriptorProperty]] begin[{] local_variable[type[String], keys] return[call[.getMessageSourceAccessor, parameter[]]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getMessage] operator[SEP] identifier[String] identifier[contextId] , identifier[String] identifier[fieldPath] , identifier[String] operator[SEP] operator[SEP] identifier[faceDescriptorProperty] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[keys] operator[=] identifier[getMessageKeys] operator[SEP] identifier[contextId] , identifier[fieldPath] , identifier[faceDescriptorProperty] operator[SEP] operator[SEP] Keyword[return] identifier[getMessageSourceAccessor] operator[SEP] operator[SEP] operator[SEP] identifier[getMessage] operator[SEP] Keyword[new] identifier[DefaultMessageSourceResolvable] operator[SEP] identifier[keys] , Other[null] , identifier[keys] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public final void shutdown(final Status status) { synchronized (lock) { if (shutdownStatus != null) { return; } shutdownStatus = status; syncContext.executeLater(new Runnable() { @Override public void run() { listener.transportShutdown(status); } }); if (!hasPendingStreams() && reportTransportTerminated != null) { syncContext.executeLater(reportTransportTerminated); reportTransportTerminated = null; } } syncContext.drain(); }
class class_name[name] begin[{] method[shutdown, return_type[void], modifier[final public], parameter[status]] begin[{] SYNCHRONIZED[member[.lock]] BEGIN[{] if[binary_operation[member[.shutdownStatus], !=, literal[null]]] begin[{] return[None] else begin[{] None end[}] assign[member[.shutdownStatus], member[.status]] call[syncContext.executeLater, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transportShutdown, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))]] if[binary_operation[call[.hasPendingStreams, parameter[]], &&, binary_operation[member[.reportTransportTerminated], !=, literal[null]]]] begin[{] call[syncContext.executeLater, parameter[member[.reportTransportTerminated]]] assign[member[.reportTransportTerminated], literal[null]] else begin[{] None end[}] END[}] call[syncContext.drain, parameter[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[shutdown] operator[SEP] Keyword[final] identifier[Status] identifier[status] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[lock] operator[SEP] { Keyword[if] operator[SEP] identifier[shutdownStatus] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] } identifier[shutdownStatus] operator[=] identifier[status] operator[SEP] identifier[syncContext] operator[SEP] identifier[executeLater] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[listener] operator[SEP] identifier[transportShutdown] operator[SEP] identifier[status] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[hasPendingStreams] operator[SEP] operator[SEP] operator[&&] identifier[reportTransportTerminated] operator[!=] Other[null] operator[SEP] { identifier[syncContext] operator[SEP] identifier[executeLater] operator[SEP] identifier[reportTransportTerminated] operator[SEP] operator[SEP] identifier[reportTransportTerminated] operator[=] Other[null] operator[SEP] } } identifier[syncContext] operator[SEP] identifier[drain] operator[SEP] operator[SEP] operator[SEP] }
public static void getAnnotationCMCLockAccessTimeout(long[] timeouts, Method[] ejbMethods, long defaultTimeout, boolean metadataComplete) throws EJBConfigurationException // F743-1752CodRev { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) { Tr.entry(tc, "getAnnotationCMCLockAccessTimeout: " + " methods = " + Arrays.toString(ejbMethods)); //F743-7027.1 } // For each of the business methods, determine the access timeout // value to use if not already set by the ejb-jar.xml processing. for (int i = 0; i < ejbMethods.length; i++) { Method beanMethod = ejbMethods[i]; // Only use the value from annotations if it is not already set // from value in ejb-jar.xml (e.g. obtained via WCCM). if (timeouts[i] == -2) { // ejb-jar.xml did not contain the lock type for this method. // Only change if metadata complete is false. // EJB 2.1 remove method (null) has no annotation. F743-22642 if (metadataComplete == false && beanMethod != null) { // metadata complete is false, so see if there is a @AccessTimeout // annotation on this method. AccessTimeout annotation = beanMethod.getAnnotation(AccessTimeout.class); if (annotation == null) { // No @AccessTimeout annotation on method, see if there is one at class level of // the class that declared this method object. Class<?> c = beanMethod.getDeclaringClass(); annotation = c.getAnnotation(AccessTimeout.class); if (isTraceOn && tc.isDebugEnabled() && annotation != null) { Tr.debug(tc, beanMethod.getName() + " from class " + c.getName()); } } // Did we find a @AccessTimeout annotation at method or class level? if (annotation != null) { // F743-1752CodRev start // Use value from @AccessTimeout annotation provided it is // a valid value (must be -1 or greater). long value = annotation.value(); // F743-7027 TimeUnit unit = annotation.unit(); // F743-7027 if (value < -1 || value == Long.MAX_VALUE) // F743-7027 { // CNTR0192E: The access timeout value {0} is not valid for the enterprise // bean {1} method of the {2} class. The value must be -1 or greater and // less than java.lang.Long.MAX_VALUE (9223372036854775807). Tr.error(tc, "SINGLETON_INVALID_ACCESS_TIMEOUT_CNTR0192E" , new Object[] { value, beanMethod.getName(), beanMethod.getDeclaringClass().getName() }); throw new EJBConfigurationException("CNTR0192E: @AccessTimeout annotation value " + value + " is not valid for the enterprise bean " + beanMethod.getName() + " method of the " + beanMethod.getDeclaringClass().getName() + " class. The value must be -1 or greater and less than" + " java.lang.Long.MAX_VALUE (9223372036854775807)."); } else if (value > 0) { // Valid value, convert to milli-seconds if necessary. if (unit == TimeUnit.MILLISECONDS) // F743-7027 { timeouts[i] = value; } else { timeouts[i] = TimeUnit.MILLISECONDS.convert(value, unit); // F743-6605.1 // Throw exception if conversion resulted in an overflow. The assumption // is pre-conditions are honored by caller of this method. // begin F743-6605.1 if (timeouts[i] == Long.MAX_VALUE || timeouts[i] == Long.MIN_VALUE) { // CNTR0196E: The conversion of access timeout value {0} from {1} time // unit to // milli-seconds time unit resulted in an overflow. Tr.error(tc, "SINGLETON_ACCESS_TIMEOUT_OVERFLOW_CNTR0196E", new Object[] { value, unit }); if (isTraceOn && tc.isEntryEnabled()) { Tr.exit(tc, "convertToMilliSeconds: " + value + unit + " overflow"); } throw new EJBConfigurationException("Conversion of access timeout value of " + value + " " + unit + " to milliseconds resulted in overflow."); } // end F743-6605.1 } } // F743-1752CodRev end else { timeouts[i] = value; // special value -1 or 0 F743-21028.5 } } else { timeouts[i] = defaultTimeout; // set default F743-21028.5 F743-22462 } } // if !metadataComplete else { timeouts[i] = defaultTimeout; // set default F743-21028.5 F743-22462 } } } if (isTraceOn && tc.isEntryEnabled()) { Tr.exit(tc, "getAnnotationCMCLockAccessTimeout", Arrays.toString(timeouts)); } }
class class_name[name] begin[{] method[getAnnotationCMCLockAccessTimeout, return_type[void], modifier[public static], parameter[timeouts, ejbMethods, defaultTimeout, metadataComplete]] begin[{] local_variable[type[boolean], isTraceOn] if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], binary_operation[binary_operation[literal["getAnnotationCMCLockAccessTimeout: "], +, literal[" methods = "]], +, call[Arrays.toString, parameter[member[.ejbMethods]]]]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=ejbMethods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=beanMethod)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=timeouts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=2), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=metadataComplete, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), operandr=BinaryOperation(operandl=MemberReference(member=beanMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=timeouts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=defaultTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AccessTimeout, sub_type=None))], member=getAnnotation, postfix_operators=[], prefix_operators=[], qualifier=beanMethod, selectors=[], type_arguments=None), name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AccessTimeout, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDeclaringClass, postfix_operators=[], prefix_operators=[], qualifier=beanMethod, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AccessTimeout, sub_type=None))], member=getAnnotation, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=beanMethod, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" from class "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=timeouts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=defaultTimeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=long)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=unit, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), name=unit)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TimeUnit, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), operator===), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=timeouts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MILLISECONDS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=timeouts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit.MILLISECONDS, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=timeouts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=timeouts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SINGLETON_ACCESS_TIMEOUT_OVERFLOW_CNTR0196E"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=error, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isTraceOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="convertToMilliSeconds: "), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" overflow"), operator=+)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Conversion of access timeout value of "), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MemberReference(member=unit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to milliseconds resulted in overflow."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EJBConfigurationException, sub_type=None)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=timeouts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="SINGLETON_INVALID_ACCESS_TIMEOUT_CNTR0192E"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=beanMethod, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getDeclaringClass, postfix_operators=[], prefix_operators=[], qualifier=beanMethod, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))], member=error, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="CNTR0192E: @AccessTimeout annotation value "), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not valid for the enterprise bean "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=beanMethod, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" method of the "), operator=+), operandr=MethodInvocation(arguments=[], member=getDeclaringClass, postfix_operators=[], prefix_operators=[], qualifier=beanMethod, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" class. The value must be -1 or greater and less than"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" java.lang.Long.MAX_VALUE (9223372036854775807)."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EJBConfigurationException, sub_type=None)), label=None)]))]))]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ejbMethods, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[member[.isTraceOn], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], literal["getAnnotationCMCLockAccessTimeout"], call[Arrays.toString, parameter[member[.timeouts]]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[getAnnotationCMCLockAccessTimeout] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[timeouts] , identifier[Method] operator[SEP] operator[SEP] identifier[ejbMethods] , Keyword[long] identifier[defaultTimeout] , Keyword[boolean] identifier[metadataComplete] operator[SEP] Keyword[throws] identifier[EJBConfigurationException] { Keyword[final] Keyword[boolean] identifier[isTraceOn] operator[=] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[ejbMethods] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ejbMethods] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Method] identifier[beanMethod] operator[=] identifier[ejbMethods] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timeouts] operator[SEP] identifier[i] operator[SEP] operator[==] operator[-] Other[2] operator[SEP] { Keyword[if] operator[SEP] identifier[metadataComplete] operator[==] literal[boolean] operator[&&] identifier[beanMethod] operator[!=] Other[null] operator[SEP] { identifier[AccessTimeout] identifier[annotation] operator[=] identifier[beanMethod] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[AccessTimeout] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[annotation] operator[==] Other[null] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[c] operator[=] identifier[beanMethod] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[annotation] operator[=] identifier[c] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[AccessTimeout] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[&&] identifier[annotation] operator[!=] Other[null] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , identifier[beanMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[c] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[annotation] operator[!=] Other[null] operator[SEP] { Keyword[long] identifier[value] operator[=] identifier[annotation] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] identifier[TimeUnit] identifier[unit] operator[=] identifier[annotation] operator[SEP] identifier[unit] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[<] operator[-] Other[1] operator[||] identifier[value] operator[==] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[SEP] { identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[value] , identifier[beanMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[beanMethod] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[EJBConfigurationException] operator[SEP] literal[String] operator[+] identifier[value] operator[+] literal[String] operator[+] identifier[beanMethod] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[beanMethod] operator[SEP] identifier[getDeclaringClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[unit] operator[==] identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] { identifier[timeouts] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[value] operator[SEP] } Keyword[else] { identifier[timeouts] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] identifier[convert] operator[SEP] identifier[value] , identifier[unit] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[timeouts] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[||] identifier[timeouts] operator[SEP] identifier[i] operator[SEP] operator[==] identifier[Long] operator[SEP] identifier[MIN_VALUE] operator[SEP] { identifier[Tr] operator[SEP] identifier[error] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[value] , identifier[unit] } operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[value] operator[+] identifier[unit] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[EJBConfigurationException] operator[SEP] literal[String] operator[+] identifier[value] operator[+] literal[String] operator[+] identifier[unit] operator[+] literal[String] operator[SEP] operator[SEP] } } } Keyword[else] { identifier[timeouts] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[value] operator[SEP] } } Keyword[else] { identifier[timeouts] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[defaultTimeout] operator[SEP] } } Keyword[else] { identifier[timeouts] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[defaultTimeout] operator[SEP] } } } Keyword[if] operator[SEP] identifier[isTraceOn] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[timeouts] operator[SEP] operator[SEP] operator[SEP] } }
@Override public boolean resetSupported() { boolean sup = true; for (val i: iterators) if (!i.resetSupported()) { sup = false; break; } return sup; }
class class_name[name] begin[{] method[resetSupported, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[boolean], sup] ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[], member=resetSupported, postfix_operators=[], prefix_operators=['!'], qualifier=i, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), BreakStatement(goto=None, label=None)])), control=EnhancedForControl(iterable=MemberReference(member=iterators, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=i)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None))), label=None) return[member[.sup]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[resetSupported] operator[SEP] operator[SEP] { Keyword[boolean] identifier[sup] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[val] identifier[i] operator[:] identifier[iterators] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[i] operator[SEP] identifier[resetSupported] operator[SEP] operator[SEP] operator[SEP] { identifier[sup] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } Keyword[return] identifier[sup] operator[SEP] }
int[] toIntArray() { int[] out = new int[size()]; int a = 0, b = out.length; for (int i = -1; (i = ints.nextSetBit(i + 1)) >= 0;) { int n = decode(i); if (n < 0) { out[a++] = n; } else { out[--b] = n; } } //if it contains -3, -1, 0, 1, 2, 4 //then out will be -1, -3, 4, 2, 1, 0 reverse(out, 0, a); reverse(out, a, out.length); return out; }
class class_name[name] begin[{] method[toIntArray, return_type[type[int]], modifier[default], parameter[]] begin[{] local_variable[type[int], out] local_variable[type[int], a] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=n)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=b, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]))]), type==, value=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=a, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=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=nextSetBit, postfix_operators=[], prefix_operators=[], qualifier=ints, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=None), label=None) call[.reverse, parameter[member[.out], literal[0], member[.a]]] call[.reverse, parameter[member[.out], member[.a], member[out.length]]] return[member[.out]] end[}] END[}]
Keyword[int] operator[SEP] operator[SEP] identifier[toIntArray] operator[SEP] operator[SEP] { Keyword[int] operator[SEP] operator[SEP] identifier[out] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[a] operator[=] Other[0] , identifier[b] operator[=] identifier[out] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] operator[-] Other[1] operator[SEP] operator[SEP] identifier[i] operator[=] identifier[ints] operator[SEP] identifier[nextSetBit] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[>=] Other[0] operator[SEP] operator[SEP] { Keyword[int] identifier[n] operator[=] identifier[decode] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[<] Other[0] operator[SEP] { identifier[out] operator[SEP] identifier[a] operator[++] operator[SEP] operator[=] identifier[n] operator[SEP] } Keyword[else] { identifier[out] operator[SEP] operator[--] identifier[b] operator[SEP] operator[=] identifier[n] operator[SEP] } } identifier[reverse] operator[SEP] identifier[out] , Other[0] , identifier[a] operator[SEP] operator[SEP] identifier[reverse] operator[SEP] identifier[out] , identifier[a] , identifier[out] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[out] operator[SEP] }
@Override public boolean retainAll(IntSet c) { if (c == null || c.isEmpty()) { return false; } boolean res = false; for (int i = 0; i < cells.length; i++) { if (cells[i] >= 0 && !c.contains(cells[i])) { cells[i] = REMOVED; res = true; size--; } } if (res) { modCount++; } return res; }
class class_name[name] begin[{] method[retainAll, return_type[type[boolean]], modifier[public], parameter[c]] begin[{] if[binary_operation[binary_operation[member[.c], ==, literal[null]], ||, call[c.isEmpty, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[boolean], res] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cells, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operandr=MethodInvocation(arguments=[MemberReference(member=cells, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=c, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cells, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=REMOVED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), StatementExpression(expression=MemberReference(member=size, 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=cells, 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[member[.res]] begin[{] member[.modCount] else begin[{] None end[}] return[member[.res]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[retainAll] operator[SEP] identifier[IntSet] identifier[c] operator[SEP] { Keyword[if] operator[SEP] identifier[c] operator[==] Other[null] operator[||] identifier[c] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[boolean] identifier[res] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[cells] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[cells] operator[SEP] identifier[i] operator[SEP] operator[>=] Other[0] operator[&&] operator[!] identifier[c] operator[SEP] identifier[contains] operator[SEP] identifier[cells] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { identifier[cells] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[REMOVED] operator[SEP] identifier[res] operator[=] literal[boolean] operator[SEP] identifier[size] operator[--] operator[SEP] } } Keyword[if] operator[SEP] identifier[res] operator[SEP] { identifier[modCount] operator[++] operator[SEP] } Keyword[return] identifier[res] operator[SEP] }
public static Atan2 atan2_x(Number xval) { JcNumber sub = new JcNumber(xval, null, null); return new Atan2(sub); }
class class_name[name] begin[{] method[atan2_x, return_type[type[Atan2]], modifier[public static], parameter[xval]] begin[{] local_variable[type[JcNumber], sub] return[ClassCreator(arguments=[MemberReference(member=sub, 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=Atan2, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Atan2] identifier[atan2_x] operator[SEP] identifier[Number] identifier[xval] operator[SEP] { identifier[JcNumber] identifier[sub] operator[=] Keyword[new] identifier[JcNumber] operator[SEP] identifier[xval] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Atan2] operator[SEP] identifier[sub] operator[SEP] operator[SEP] }
@Override public final CacheKey getCacheKey(HttpServletRequest request, HttpServletResponse response) { final Resource stylesheetResource = this.getStylesheetResource(request); final Serializable stylesheetCacheKey; try { stylesheetCacheKey = this.xmlUtilities.getStylesheetCacheKey(stylesheetResource); } catch (TransformerConfigurationException e) { throw new RuntimeException( "Failed to get Transformer for stylesheet: " + stylesheetResource, e); } catch (IOException e) { throw new RuntimeException("Failed to load stylesheet: " + stylesheetResource, e); } return CacheKey.build(stylesheetResource.getDescription(), stylesheetCacheKey); }
class class_name[name] begin[{] method[getCacheKey, return_type[type[CacheKey]], modifier[final public], parameter[request, response]] begin[{] local_variable[type[Resource], stylesheetResource] local_variable[type[Serializable], stylesheetCacheKey] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stylesheetCacheKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=xmlUtilities, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=stylesheetResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getStylesheetCacheKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to get Transformer for stylesheet: "), operandr=MemberReference(member=stylesheetResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TransformerConfigurationException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to load stylesheet: "), operandr=MemberReference(member=stylesheetResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) return[call[CacheKey.build, parameter[call[stylesheetResource.getDescription, parameter[]], member[.stylesheetCacheKey]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] identifier[CacheKey] identifier[getCacheKey] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[HttpServletResponse] identifier[response] operator[SEP] { Keyword[final] identifier[Resource] identifier[stylesheetResource] operator[=] Keyword[this] operator[SEP] identifier[getStylesheetResource] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[final] identifier[Serializable] identifier[stylesheetCacheKey] operator[SEP] Keyword[try] { identifier[stylesheetCacheKey] operator[=] Keyword[this] operator[SEP] identifier[xmlUtilities] operator[SEP] identifier[getStylesheetCacheKey] operator[SEP] identifier[stylesheetResource] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[TransformerConfigurationException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[stylesheetResource] , identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[stylesheetResource] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[CacheKey] operator[SEP] identifier[build] operator[SEP] identifier[stylesheetResource] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] , identifier[stylesheetCacheKey] operator[SEP] operator[SEP] }
public static String concatEntityCollectionHref( String baseUri, String qualifiedEntityName, String qualifiedIdAttributeName, List<String> entitiesIds) { String ids; ids = entitiesIds.stream().map(Href::encodeIdToRSQL).collect(Collectors.joining(",")); return String.format( "%s/%s?q=%s=in=(%s)", baseUri, encodePathSegment(qualifiedEntityName), encodePathSegment(qualifiedIdAttributeName), ids); }
class class_name[name] begin[{] method[concatEntityCollectionHref, return_type[type[String]], modifier[public static], parameter[baseUri, qualifiedEntityName, qualifiedIdAttributeName, entitiesIds]] begin[{] local_variable[type[String], ids] assign[member[.ids], call[entitiesIds.stream, parameter[]]] return[call[String.format, parameter[literal["%s/%s?q=%s=in=(%s)"], member[.baseUri], call[.encodePathSegment, parameter[member[.qualifiedEntityName]]], call[.encodePathSegment, parameter[member[.qualifiedIdAttributeName]]], member[.ids]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[concatEntityCollectionHref] operator[SEP] identifier[String] identifier[baseUri] , identifier[String] identifier[qualifiedEntityName] , identifier[String] identifier[qualifiedIdAttributeName] , identifier[List] operator[<] identifier[String] operator[>] identifier[entitiesIds] operator[SEP] { identifier[String] identifier[ids] operator[SEP] identifier[ids] operator[=] identifier[entitiesIds] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Href] operator[::] identifier[encodeIdToRSQL] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[joining] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[baseUri] , identifier[encodePathSegment] operator[SEP] identifier[qualifiedEntityName] operator[SEP] , identifier[encodePathSegment] operator[SEP] identifier[qualifiedIdAttributeName] operator[SEP] , identifier[ids] operator[SEP] operator[SEP] }
public MetricValue withCidrs(String... cidrs) { if (this.cidrs == null) { setCidrs(new java.util.ArrayList<String>(cidrs.length)); } for (String ele : cidrs) { this.cidrs.add(ele); } return this; }
class class_name[name] begin[{] method[withCidrs, return_type[type[MetricValue]], modifier[public], parameter[cidrs]] begin[{] if[binary_operation[THIS[member[None.cidrs]], ==, literal[null]]] begin[{] call[.setCidrs, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=cidrs, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=cidrs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=cidrs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[MetricValue] identifier[withCidrs] operator[SEP] identifier[String] operator[...] identifier[cidrs] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[cidrs] operator[==] Other[null] operator[SEP] { identifier[setCidrs] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[cidrs] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[cidrs] operator[SEP] { Keyword[this] operator[SEP] identifier[cidrs] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private NavigationCase getOutcomeNavigationCase (FacesContext facesContext, String fromAction, String outcome) { String implicitViewId = null; boolean includeViewParams = false; int index; boolean isRedirect = false; String queryString = null; NavigationCase result = null; String viewId = facesContext.getViewRoot() != null ? facesContext.getViewRoot().getViewId() : null; //String viewIdToTest = outcome; StringBuilder viewIdToTest = SharedStringBuilder.get(facesContext, OUTCOME_NAVIGATION_SB); viewIdToTest.append(outcome); // If viewIdToTest contains a query string, remove it and set queryString with that value. index = viewIdToTest.indexOf ("?"); if (index != -1) { queryString = viewIdToTest.substring (index + 1); //viewIdToTest = viewIdToTest.substring (0, index); viewIdToTest.setLength(index); // If queryString contains "faces-redirect=true", set isRedirect to true. if (queryString.indexOf ("faces-redirect=true") != -1) { isRedirect = true; } // If queryString contains "includeViewParams=true" or // "faces-include-view-params=true", set includeViewParams to true. if (queryString.indexOf("includeViewParams=true") != -1 || queryString.indexOf("faces-include-view-params=true") != -1) { includeViewParams = true; } } // If viewIdToTest does not have a "file extension", use the one from the current viewId. index = viewIdToTest.indexOf ("."); if (index == -1) { if (viewId != null) { index = viewId.lastIndexOf("."); if (index != -1) { //viewIdToTest += viewId.substring (index); viewIdToTest.append(viewId.substring (index)); } } else { // This case happens when for for example there is a ViewExpiredException, // and a custom ExceptionHandler try to navigate using implicit navigation. // In this case, there is no UIViewRoot set on the FacesContext, so viewId // is null. // In this case, it should try to derive the viewId of the view that was // not able to restore, to get the extension and apply it to // the implicit navigation. String tempViewId = getNavigationHandlerSupport().calculateViewId(facesContext); if (tempViewId != null) { index = tempViewId.lastIndexOf("."); if(index != -1) { viewIdToTest.append(tempViewId.substring (index)); } } } if (log.isLoggable(Level.FINEST)) { log.finest("getOutcomeNavigationCase -> viewIdToTest: " + viewIdToTest); } } // If viewIdToTest does not start with "/", look for the last "/" in viewId. If not found, simply prepend "/". // Otherwise, prepend everything before and including the last "/" in viewId. //if (!viewIdToTest.startsWith ("/") && viewId != null) boolean startWithSlash = false; if (viewIdToTest.length() > 0) { startWithSlash = (viewIdToTest.charAt(0) == '/'); } if (!startWithSlash) { index = -1; if( viewId != null ) { index = viewId.lastIndexOf ("/"); } if (index == -1) { //viewIdToTest = "/" + viewIdToTest; viewIdToTest.insert(0,"/"); } else { //viewIdToTest = viewId.substring (0, index + 1) + viewIdToTest; viewIdToTest.insert(0, viewId, 0, index + 1); } } // Apply normalization String viewIdToTestString = null; boolean applyNormalization = false; for (int i = 0; i < viewIdToTest.length()-1; i++) { if (viewIdToTest.charAt(i) == '.' && viewIdToTest.charAt(i+1) == '/') { applyNormalization = true; break; } } if (applyNormalization) { viewIdToTestString = FilenameUtils.normalize(viewIdToTest.toString(), true); } else { viewIdToTestString = viewIdToTest.toString(); } // Call ViewHandler.deriveViewId() and set the result as implicitViewId. try { implicitViewId = facesContext.getApplication().getViewHandler().deriveViewId ( facesContext, viewIdToTestString); } catch (UnsupportedOperationException e) { // This is the case when a pre-JSF 2.0 ViewHandler is used. // In this case, the default algorithm must be used. // FIXME: I think we're always calling the "default" ViewHandler.deriveViewId() algorithm and we don't // distinguish between pre-JSF 2.0 and JSF 2.0 ViewHandlers. This probably needs to be addressed. } if (implicitViewId != null) { // Append all params from the queryString // (excluding faces-redirect, includeViewParams and faces-include-view-params) Map<String, List<String>> params = null; if (queryString != null && !"".equals(queryString)) { //String[] splitQueryParams = queryString.split("&(amp;)?"); // "&" or "&amp;" String[] splitQueryParams = AMP_PATTERN.split(queryString); // "&" or "&amp;" params = new HashMap<String, List<String>>(splitQueryParams.length, (splitQueryParams.length* 4 + 3) / 3); for (String queryParam : splitQueryParams) { String[] splitParam = StringUtils.splitShortString(queryParam, '='); if (splitParam.length == 2) { // valid parameter - add it to params if ("includeViewParams".equals(splitParam[0]) || "faces-include-view-params".equals(splitParam[0]) || "faces-redirect".equals(splitParam[0])) { // ignore includeViewParams, faces-include-view-params and faces-redirect continue; } List<String> paramValues = params.get(splitParam[0]); if (paramValues == null) { // no value for the given parameter yet paramValues = new ArrayList<String>(); params.put(splitParam[0], paramValues); } paramValues.add(splitParam[1]); } else { // invalid parameter throw new FacesException("Invalid parameter \"" + queryParam + "\" in outcome " + outcome); } } } // Finally, create the NavigationCase. result = new NavigationCase (viewId, fromAction, outcome, null, implicitViewId, params, isRedirect, includeViewParams); } return result; }
class class_name[name] begin[{] method[getOutcomeNavigationCase, return_type[type[NavigationCase]], modifier[private], parameter[facesContext, fromAction, outcome]] begin[{] local_variable[type[String], implicitViewId] local_variable[type[boolean], includeViewParams] local_variable[type[int], index] local_variable[type[boolean], isRedirect] local_variable[type[String], queryString] local_variable[type[NavigationCase], result] local_variable[type[String], viewId] local_variable[type[StringBuilder], viewIdToTest] call[viewIdToTest.append, parameter[member[.outcome]]] assign[member[.index], call[viewIdToTest.indexOf, parameter[literal["?"]]]] if[binary_operation[member[.index], !=, literal[1]]] begin[{] assign[member[.queryString], call[viewIdToTest.substring, parameter[binary_operation[member[.index], +, literal[1]]]]] call[viewIdToTest.setLength, parameter[member[.index]]] if[binary_operation[call[queryString.indexOf, parameter[literal["faces-redirect=true"]]], !=, literal[1]]] begin[{] assign[member[.isRedirect], literal[true]] else begin[{] None end[}] if[binary_operation[binary_operation[call[queryString.indexOf, parameter[literal["includeViewParams=true"]]], !=, literal[1]], ||, binary_operation[call[queryString.indexOf, parameter[literal["faces-include-view-params=true"]]], !=, literal[1]]]] begin[{] assign[member[.includeViewParams], literal[true]] else begin[{] None end[}] else begin[{] None end[}] assign[member[.index], call[viewIdToTest.indexOf, parameter[literal["."]]]] if[binary_operation[member[.index], ==, literal[1]]] begin[{] if[binary_operation[member[.viewId], !=, literal[null]]] begin[{] assign[member[.index], call[viewId.lastIndexOf, parameter[literal["."]]]] if[binary_operation[member[.index], !=, literal[1]]] begin[{] call[viewIdToTest.append, parameter[call[viewId.substring, parameter[member[.index]]]]] else begin[{] None end[}] else begin[{] local_variable[type[String], tempViewId] if[binary_operation[member[.tempViewId], !=, literal[null]]] begin[{] assign[member[.index], call[tempViewId.lastIndexOf, parameter[literal["."]]]] if[binary_operation[member[.index], !=, literal[1]]] begin[{] call[viewIdToTest.append, parameter[call[tempViewId.substring, parameter[member[.index]]]]] else begin[{] None end[}] else begin[{] None end[}] end[}] if[call[log.isLoggable, parameter[member[Level.FINEST]]]] begin[{] call[log.finest, parameter[binary_operation[literal["getOutcomeNavigationCase -> viewIdToTest: "], +, member[.viewIdToTest]]]] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[boolean], startWithSlash] if[binary_operation[call[viewIdToTest.length, parameter[]], >, literal[0]]] begin[{] assign[member[.startWithSlash], binary_operation[call[viewIdToTest.charAt, parameter[literal[0]]], ==, literal['/']]] else begin[{] None end[}] if[member[.startWithSlash]] begin[{] assign[member[.index], literal[1]] if[binary_operation[member[.viewId], !=, literal[null]]] begin[{] assign[member[.index], call[viewId.lastIndexOf, parameter[literal["/"]]]] else begin[{] None end[}] if[binary_operation[member[.index], ==, literal[1]]] begin[{] call[viewIdToTest.insert, parameter[literal[0], literal["/"]]] else begin[{] call[viewIdToTest.insert, parameter[literal[0], member[.viewId], literal[0], binary_operation[member[.index], +, literal[1]]]] end[}] else begin[{] None end[}] local_variable[type[String], viewIdToTestString] local_variable[type[boolean], applyNormalization] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=viewIdToTest, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.'), operator===), operandr=BinaryOperation(operandl=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=charAt, postfix_operators=[], prefix_operators=[], qualifier=viewIdToTest, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=applyNormalization, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=viewIdToTest, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[member[.applyNormalization]] begin[{] assign[member[.viewIdToTestString], call[FilenameUtils.normalize, parameter[call[viewIdToTest.toString, parameter[]], literal[true]]]] else begin[{] assign[member[.viewIdToTestString], call[viewIdToTest.toString, parameter[]]] end[}] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=implicitViewId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getApplication, postfix_operators=[], prefix_operators=[], qualifier=facesContext, selectors=[MethodInvocation(arguments=[], member=getViewHandler, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=facesContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=viewIdToTestString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deriveViewId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedOperationException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.implicitViewId], !=, literal[null]]] begin[{] local_variable[type[Map], params] if[binary_operation[binary_operation[member[.queryString], !=, literal[null]], &&, literal[""]]] begin[{] local_variable[type[String], splitQueryParams] assign[member[.params], ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=splitQueryParams, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=splitQueryParams, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator=/)], 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=queryParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='=')], member=splitShortString, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), name=splitParam)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=splitParam, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid parameter \""), operandr=MemberReference(member=queryParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\" in outcome "), operator=+), operandr=MemberReference(member=outcome, 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=FacesException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=splitParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="includeViewParams"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=splitParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="faces-include-view-params"), operator=||), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=splitParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="faces-redirect"), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=splitParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=get, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), name=paramValues)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=splitParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=paramValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=splitParam, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], member=add, postfix_operators=[], prefix_operators=[], qualifier=paramValues, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=splitQueryParams, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=queryParam)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] assign[member[.result], ClassCreator(arguments=[MemberReference(member=viewId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fromAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=outcome, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=implicitViewId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isRedirect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=includeViewParams, 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=NavigationCase, sub_type=None))] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[private] identifier[NavigationCase] identifier[getOutcomeNavigationCase] operator[SEP] identifier[FacesContext] identifier[facesContext] , identifier[String] identifier[fromAction] , identifier[String] identifier[outcome] operator[SEP] { identifier[String] identifier[implicitViewId] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[includeViewParams] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[index] operator[SEP] Keyword[boolean] identifier[isRedirect] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[queryString] operator[=] Other[null] operator[SEP] identifier[NavigationCase] identifier[result] operator[=] Other[null] operator[SEP] identifier[String] identifier[viewId] operator[=] identifier[facesContext] operator[SEP] identifier[getViewRoot] operator[SEP] operator[SEP] operator[!=] Other[null] operator[?] identifier[facesContext] operator[SEP] identifier[getViewRoot] operator[SEP] operator[SEP] operator[SEP] identifier[getViewId] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] identifier[StringBuilder] identifier[viewIdToTest] operator[=] identifier[SharedStringBuilder] operator[SEP] identifier[get] operator[SEP] identifier[facesContext] , identifier[OUTCOME_NAVIGATION_SB] operator[SEP] operator[SEP] identifier[viewIdToTest] operator[SEP] identifier[append] operator[SEP] identifier[outcome] operator[SEP] operator[SEP] identifier[index] operator[=] identifier[viewIdToTest] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[!=] operator[-] Other[1] operator[SEP] { identifier[queryString] operator[=] identifier[viewIdToTest] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] identifier[viewIdToTest] operator[SEP] identifier[setLength] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[queryString] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[isRedirect] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[queryString] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[!=] operator[-] Other[1] operator[||] identifier[queryString] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] { identifier[includeViewParams] operator[=] literal[boolean] operator[SEP] } } identifier[index] operator[=] identifier[viewIdToTest] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] { Keyword[if] operator[SEP] identifier[viewId] operator[!=] Other[null] operator[SEP] { identifier[index] operator[=] identifier[viewId] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[!=] operator[-] Other[1] operator[SEP] { identifier[viewIdToTest] operator[SEP] identifier[append] operator[SEP] identifier[viewId] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { identifier[String] identifier[tempViewId] operator[=] identifier[getNavigationHandlerSupport] operator[SEP] operator[SEP] operator[SEP] identifier[calculateViewId] operator[SEP] identifier[facesContext] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tempViewId] operator[!=] Other[null] operator[SEP] { identifier[index] operator[=] identifier[tempViewId] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[!=] operator[-] Other[1] operator[SEP] { identifier[viewIdToTest] operator[SEP] identifier[append] operator[SEP] identifier[tempViewId] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINEST] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[finest] operator[SEP] literal[String] operator[+] identifier[viewIdToTest] operator[SEP] operator[SEP] } } Keyword[boolean] identifier[startWithSlash] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[viewIdToTest] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[startWithSlash] operator[=] operator[SEP] identifier[viewIdToTest] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[startWithSlash] operator[SEP] { identifier[index] operator[=] operator[-] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[viewId] operator[!=] Other[null] operator[SEP] { identifier[index] operator[=] identifier[viewId] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] { identifier[viewIdToTest] operator[SEP] identifier[insert] operator[SEP] Other[0] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[viewIdToTest] operator[SEP] identifier[insert] operator[SEP] Other[0] , identifier[viewId] , Other[0] , identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] } } identifier[String] identifier[viewIdToTestString] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[applyNormalization] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[viewIdToTest] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[viewIdToTest] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[==] literal[String] operator[&&] identifier[viewIdToTest] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] { identifier[applyNormalization] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[applyNormalization] operator[SEP] { identifier[viewIdToTestString] operator[=] identifier[FilenameUtils] operator[SEP] identifier[normalize] operator[SEP] identifier[viewIdToTest] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[viewIdToTestString] operator[=] identifier[viewIdToTest] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[implicitViewId] operator[=] identifier[facesContext] operator[SEP] identifier[getApplication] operator[SEP] operator[SEP] operator[SEP] identifier[getViewHandler] operator[SEP] operator[SEP] operator[SEP] identifier[deriveViewId] operator[SEP] identifier[facesContext] , identifier[viewIdToTestString] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedOperationException] identifier[e] operator[SEP] { } Keyword[if] operator[SEP] identifier[implicitViewId] operator[!=] Other[null] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[params] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[queryString] operator[!=] Other[null] operator[&&] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[queryString] operator[SEP] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[splitQueryParams] operator[=] identifier[AMP_PATTERN] operator[SEP] identifier[split] operator[SEP] identifier[queryString] operator[SEP] operator[SEP] identifier[params] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] operator[SEP] identifier[splitQueryParams] operator[SEP] identifier[length] , operator[SEP] identifier[splitQueryParams] operator[SEP] identifier[length] operator[*] Other[4] operator[+] Other[3] operator[SEP] operator[/] Other[3] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[queryParam] operator[:] identifier[splitQueryParams] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[splitParam] operator[=] identifier[StringUtils] operator[SEP] identifier[splitShortString] operator[SEP] identifier[queryParam] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[splitParam] operator[SEP] identifier[length] operator[==] Other[2] operator[SEP] { Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[splitParam] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[splitParam] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[splitParam] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } identifier[List] operator[<] identifier[String] operator[>] identifier[paramValues] operator[=] identifier[params] operator[SEP] identifier[get] operator[SEP] identifier[splitParam] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[paramValues] operator[==] Other[null] operator[SEP] { identifier[paramValues] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] identifier[splitParam] operator[SEP] Other[0] operator[SEP] , identifier[paramValues] operator[SEP] operator[SEP] } identifier[paramValues] operator[SEP] identifier[add] operator[SEP] identifier[splitParam] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[FacesException] operator[SEP] literal[String] operator[+] identifier[queryParam] operator[+] literal[String] operator[+] identifier[outcome] operator[SEP] operator[SEP] } } } identifier[result] operator[=] Keyword[new] identifier[NavigationCase] operator[SEP] identifier[viewId] , identifier[fromAction] , identifier[outcome] , Other[null] , identifier[implicitViewId] , identifier[params] , identifier[isRedirect] , identifier[includeViewParams] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
private void parseAttribute(ParsedScheduleExpression parsedExpr, Attribute attr, String string) { // Reset state. ivAttr = attr; ivString = string; ivPos = 0; if (string == null) { // d660135 - Per CTS, null values must be rejected rather than being // translated to the default attribute value. error(ScheduleExpressionParserException.Error.VALUE); } // Loop for lists: "x, x, ..." for (boolean inList = false;; inList = true) { skipWhitespace(); int value = readSingleValue(); skipWhitespace(); // Ranges: "x-x" if (ivPos < ivString.length() && ivString.charAt(ivPos) == '-') { ivPos++; skipWhitespace(); int maxValue = readSingleValue(); skipWhitespace(); if (value == ENCODED_WILD_CARD || maxValue == ENCODED_WILD_CARD) { error(ScheduleExpressionParserException.Error.RANGE_BOUND); // F743-506 } attr.addRange(parsedExpr, value, maxValue); } // Increments: "x/x" else if (ivPos < ivString.length() && ivString.charAt(ivPos) == '/') { ivPos++; skipWhitespace(); int interval = readSingleValue(); skipWhitespace(); if (interval == ENCODED_WILD_CARD) { error(ScheduleExpressionParserException.Error.INCREMENT_INTERVAL); // F743-506 } if (inList) { error(ScheduleExpressionParserException.Error.LIST_VALUE); // F743-506 } if (!ivAttr.isIncrementable()) { error(ScheduleExpressionParserException.Error.UNINCREMENTABLE); // F743-506 } if (value == ENCODED_WILD_CARD) { value = 0; } if (interval == 0) { // "30/0" is interpreted as the single value "30". attr.add(parsedExpr, value); } else { for (; value <= ivAttr.getMax(); value += interval) { attr.add(parsedExpr, value); } } break; } // Wild cards: "*" else if (value == ENCODED_WILD_CARD) { if (inList) { error(ScheduleExpressionParserException.Error.LIST_VALUE); // F743-506 } attr.setWildCard(parsedExpr); break; } // Single values else { attr.add(parsedExpr, value); } if (ivPos >= ivString.length() || ivString.charAt(ivPos) != ',') { break; } // Skip the comma ivPos++; } skipWhitespace(); if (ivPos < ivString.length()) { error(ScheduleExpressionParserException.Error.VALUE); // F743-506 } }
class class_name[name] begin[{] method[parseAttribute, return_type[void], modifier[private], parameter[parsedExpr, attr, string]] begin[{] assign[member[.ivAttr], member[.attr]] assign[member[.ivString], member[.string]] assign[member[.ivPos], literal[0]] if[binary_operation[member[.string], ==, literal[null]]] begin[{] call[.error, parameter[member[ScheduleExpressionParserException.Error.VALUE]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=skipWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readSingleValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[], member=skipWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ivPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=ivString, selectors=[], type_arguments=None), operator=<), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ivPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=ivString, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='-'), operator===), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ivPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=ivString, selectors=[], type_arguments=None), operator=<), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ivPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=ivString, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='/'), operator===), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ENCODED_WILD_CARD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=parsedExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=inList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LIST_VALUE, postfix_operators=[], prefix_operators=[], qualifier=ScheduleExpressionParserException.Error, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=parsedExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setWildCard, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=ivPos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=skipWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readSingleValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=interval)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[], member=skipWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=interval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ENCODED_WILD_CARD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INCREMENT_INTERVAL, postfix_operators=[], prefix_operators=[], qualifier=ScheduleExpressionParserException.Error, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MemberReference(member=inList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LIST_VALUE, postfix_operators=[], prefix_operators=[], qualifier=ScheduleExpressionParserException.Error, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isIncrementable, postfix_operators=[], prefix_operators=['!'], qualifier=ivAttr, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=UNINCREMENTABLE, postfix_operators=[], prefix_operators=[], qualifier=ScheduleExpressionParserException.Error, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ENCODED_WILD_CARD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=interval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=parsedExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getMax, postfix_operators=[], prefix_operators=[], qualifier=ivAttr, selectors=[], type_arguments=None), operator=<=), init=None, update=[Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=interval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=parsedExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=ivPos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=skipWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readSingleValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=maxValue)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[], member=skipWhitespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ENCODED_WILD_CARD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=maxValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ENCODED_WILD_CARD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=RANGE_BOUND, postfix_operators=[], prefix_operators=[], qualifier=ScheduleExpressionParserException.Error, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=parsedExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addRange, postfix_operators=[], prefix_operators=[], qualifier=attr, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ivPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=ivString, selectors=[], type_arguments=None), operator=>=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=ivPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=ivString, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=','), operator=!=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[BreakStatement(goto=None, label=None)])), StatementExpression(expression=MemberReference(member=ivPos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=ForControl(condition=None, init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=inList)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), update=[Assignment(expressionl=MemberReference(member=inList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true))]), label=None) call[.skipWhitespace, parameter[]] if[binary_operation[member[.ivPos], <, call[ivString.length, parameter[]]]] begin[{] call[.error, parameter[member[ScheduleExpressionParserException.Error.VALUE]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[parseAttribute] operator[SEP] identifier[ParsedScheduleExpression] identifier[parsedExpr] , identifier[Attribute] identifier[attr] , identifier[String] identifier[string] operator[SEP] { identifier[ivAttr] operator[=] identifier[attr] operator[SEP] identifier[ivString] operator[=] identifier[string] operator[SEP] identifier[ivPos] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[string] operator[==] Other[null] operator[SEP] { identifier[error] operator[SEP] identifier[ScheduleExpressionParserException] operator[SEP] identifier[Error] operator[SEP] identifier[VALUE] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[boolean] identifier[inList] operator[=] literal[boolean] operator[SEP] operator[SEP] identifier[inList] operator[=] literal[boolean] operator[SEP] { identifier[skipWhitespace] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[value] operator[=] identifier[readSingleValue] operator[SEP] operator[SEP] operator[SEP] identifier[skipWhitespace] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ivPos] operator[<] identifier[ivString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[&&] identifier[ivString] operator[SEP] identifier[charAt] operator[SEP] identifier[ivPos] operator[SEP] operator[==] literal[String] operator[SEP] { identifier[ivPos] operator[++] operator[SEP] identifier[skipWhitespace] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[maxValue] operator[=] identifier[readSingleValue] operator[SEP] operator[SEP] operator[SEP] identifier[skipWhitespace] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[==] identifier[ENCODED_WILD_CARD] operator[||] identifier[maxValue] operator[==] identifier[ENCODED_WILD_CARD] operator[SEP] { identifier[error] operator[SEP] identifier[ScheduleExpressionParserException] operator[SEP] identifier[Error] operator[SEP] identifier[RANGE_BOUND] operator[SEP] operator[SEP] } identifier[attr] operator[SEP] identifier[addRange] operator[SEP] identifier[parsedExpr] , identifier[value] , identifier[maxValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[ivPos] operator[<] identifier[ivString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[&&] identifier[ivString] operator[SEP] identifier[charAt] operator[SEP] identifier[ivPos] operator[SEP] operator[==] literal[String] operator[SEP] { identifier[ivPos] operator[++] operator[SEP] identifier[skipWhitespace] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[interval] operator[=] identifier[readSingleValue] operator[SEP] operator[SEP] operator[SEP] identifier[skipWhitespace] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[interval] operator[==] identifier[ENCODED_WILD_CARD] operator[SEP] { identifier[error] operator[SEP] identifier[ScheduleExpressionParserException] operator[SEP] identifier[Error] operator[SEP] identifier[INCREMENT_INTERVAL] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[inList] operator[SEP] { identifier[error] operator[SEP] identifier[ScheduleExpressionParserException] operator[SEP] identifier[Error] operator[SEP] identifier[LIST_VALUE] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[ivAttr] operator[SEP] identifier[isIncrementable] operator[SEP] operator[SEP] operator[SEP] { identifier[error] operator[SEP] identifier[ScheduleExpressionParserException] operator[SEP] identifier[Error] operator[SEP] identifier[UNINCREMENTABLE] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[value] operator[==] identifier[ENCODED_WILD_CARD] operator[SEP] { identifier[value] operator[=] Other[0] operator[SEP] } Keyword[if] operator[SEP] identifier[interval] operator[==] Other[0] operator[SEP] { identifier[attr] operator[SEP] identifier[add] operator[SEP] identifier[parsedExpr] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] operator[SEP] identifier[value] operator[<=] identifier[ivAttr] operator[SEP] identifier[getMax] operator[SEP] operator[SEP] operator[SEP] identifier[value] operator[+=] identifier[interval] operator[SEP] { identifier[attr] operator[SEP] identifier[add] operator[SEP] identifier[parsedExpr] , identifier[value] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[==] identifier[ENCODED_WILD_CARD] operator[SEP] { Keyword[if] operator[SEP] identifier[inList] operator[SEP] { identifier[error] operator[SEP] identifier[ScheduleExpressionParserException] operator[SEP] identifier[Error] operator[SEP] identifier[LIST_VALUE] operator[SEP] operator[SEP] } identifier[attr] operator[SEP] identifier[setWildCard] operator[SEP] identifier[parsedExpr] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[else] { identifier[attr] operator[SEP] identifier[add] operator[SEP] identifier[parsedExpr] , identifier[value] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ivPos] operator[>=] identifier[ivString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[||] identifier[ivString] operator[SEP] identifier[charAt] operator[SEP] identifier[ivPos] operator[SEP] operator[!=] literal[String] operator[SEP] { Keyword[break] operator[SEP] } identifier[ivPos] operator[++] operator[SEP] } identifier[skipWhitespace] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ivPos] operator[<] identifier[ivString] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[error] operator[SEP] identifier[ScheduleExpressionParserException] operator[SEP] identifier[Error] operator[SEP] identifier[VALUE] operator[SEP] operator[SEP] } }
protected static void sanityCheck(byte[] buf, int offset, int length) { if(buf == null) throw new NullPointerException("buffer is null"); if(offset + length > buf.length) throw new ArrayIndexOutOfBoundsException("length (" + length + ") + offset (" + offset + ") > buf.length (" + buf.length + ")"); }
class class_name[name] begin[{] method[sanityCheck, return_type[void], modifier[static protected], parameter[buf, offset, length]] begin[{] if[binary_operation[member[.buf], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="buffer 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[{] None end[}] if[binary_operation[binary_operation[member[.offset], +, member[.length]], >, member[buf.length]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="length ("), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") + offset ("), operator=+), operandr=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") > buf.length ("), operator=+), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayIndexOutOfBoundsException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[void] identifier[sanityCheck] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] , Keyword[int] identifier[offset] , Keyword[int] identifier[length] operator[SEP] { Keyword[if] operator[SEP] identifier[buf] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[offset] operator[+] identifier[length] operator[>] identifier[buf] operator[SEP] identifier[length] operator[SEP] Keyword[throw] Keyword[new] identifier[ArrayIndexOutOfBoundsException] operator[SEP] literal[String] operator[+] identifier[length] operator[+] literal[String] operator[+] identifier[offset] operator[+] literal[String] operator[+] identifier[buf] operator[SEP] identifier[length] operator[+] literal[String] operator[SEP] operator[SEP] }
public static DecodedData decode(byte[] bytesIn, int precision, PeaksCompression compression) throws FileParsingException, IOException, DataFormatException { return decode(bytesIn, bytesIn.length, precision, compression); }
class class_name[name] begin[{] method[decode, return_type[type[DecodedData]], modifier[public static], parameter[bytesIn, precision, compression]] begin[{] return[call[.decode, parameter[member[.bytesIn], member[bytesIn.length], member[.precision], member[.compression]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DecodedData] identifier[decode] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytesIn] , Keyword[int] identifier[precision] , identifier[PeaksCompression] identifier[compression] operator[SEP] Keyword[throws] identifier[FileParsingException] , identifier[IOException] , identifier[DataFormatException] { Keyword[return] identifier[decode] operator[SEP] identifier[bytesIn] , identifier[bytesIn] operator[SEP] identifier[length] , identifier[precision] , identifier[compression] operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "gartenflaeche") @XmlJavaTypeAdapter(Adapter7 .class) public JAXBElement<BigDecimal> createGartenflaeche(BigDecimal value) { return new JAXBElement<BigDecimal>(_Gartenflaeche_QNAME, BigDecimal.class, null, value); }
class class_name[name] begin[{] method[createGartenflaeche, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_Gartenflaeche_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), 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=BigDecimal, 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] operator[SEP] annotation[@] identifier[XmlJavaTypeAdapter] operator[SEP] identifier[Adapter7] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[BigDecimal] operator[>] identifier[createGartenflaeche] operator[SEP] identifier[BigDecimal] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[BigDecimal] operator[>] operator[SEP] identifier[_Gartenflaeche_QNAME] , identifier[BigDecimal] operator[SEP] Keyword[class] , Other[null] , identifier[value] operator[SEP] operator[SEP] }
public boolean moveTo(N newParent, OctTreeZone zone) { if (zone != null) { return moveTo(newParent, zone.ordinal()); } return false; }
class class_name[name] begin[{] method[moveTo, return_type[type[boolean]], modifier[public], parameter[newParent, zone]] begin[{] if[binary_operation[member[.zone], !=, literal[null]]] begin[{] return[call[.moveTo, parameter[member[.newParent], call[zone.ordinal, parameter[]]]]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[moveTo] operator[SEP] identifier[N] identifier[newParent] , identifier[OctTreeZone] identifier[zone] operator[SEP] { Keyword[if] operator[SEP] identifier[zone] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[moveTo] operator[SEP] identifier[newParent] , identifier[zone] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public CassandraJavaPairRDD<K, V> toEmptyCassandraRDD() { CassandraRDD<Tuple2<K, V>> newRDD = rdd().toEmptyCassandraRDD(); return wrap(newRDD); }
class class_name[name] begin[{] method[toEmptyCassandraRDD, return_type[type[CassandraJavaPairRDD]], modifier[public], parameter[]] begin[{] local_variable[type[CassandraRDD], newRDD] return[call[.wrap, parameter[member[.newRDD]]]] end[}] END[}]
Keyword[public] identifier[CassandraJavaPairRDD] operator[<] identifier[K] , identifier[V] operator[>] identifier[toEmptyCassandraRDD] operator[SEP] operator[SEP] { identifier[CassandraRDD] operator[<] identifier[Tuple2] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[newRDD] operator[=] identifier[rdd] operator[SEP] operator[SEP] operator[SEP] identifier[toEmptyCassandraRDD] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[wrap] operator[SEP] identifier[newRDD] operator[SEP] operator[SEP] }
protected boolean match(final String path) { final String methodName = "match"; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, methodName, this, path, ignoreCase, wildcard); } if (this.matcher == null) { if (ignoreCase) { if (pattern.equalsIgnoreCase(path)) { return true; } if (wildcard && path.toLowerCase().startsWith(pattern)) { return true; } } else { if (pattern.equals(path)) { return true; } if (wildcard && path.startsWith(pattern)) { return true; } } } else { return this.matcher.matcher(path).matches(); } return false; }
class class_name[name] begin[{] method[match, return_type[type[boolean]], modifier[protected], parameter[path]] begin[{] local_variable[type[String], methodName] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], member[.methodName], THIS[], member[.path], member[.ignoreCase], member[.wildcard]]] else begin[{] None end[}] if[binary_operation[THIS[member[None.matcher]], ==, literal[null]]] begin[{] if[member[.ignoreCase]] begin[{] if[call[pattern.equalsIgnoreCase, parameter[member[.path]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[member[.wildcard], &&, call[path.toLowerCase, parameter[]]]] begin[{] return[literal[true]] else begin[{] None end[}] else begin[{] if[call[pattern.equals, parameter[member[.path]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[member[.wildcard], &&, call[path.startsWith, parameter[member[.pattern]]]]] begin[{] return[literal[true]] else begin[{] None end[}] end[}] else begin[{] return[THIS[member[None.matcher]call[None.matcher, parameter[member[.path]]]call[None.matches, parameter[]]]] end[}] return[literal[false]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[match] operator[SEP] Keyword[final] identifier[String] identifier[path] operator[SEP] { Keyword[final] identifier[String] identifier[methodName] operator[=] literal[String] 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[methodName] , Keyword[this] , identifier[path] , identifier[ignoreCase] , identifier[wildcard] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[matcher] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[ignoreCase] operator[SEP] { Keyword[if] operator[SEP] identifier[pattern] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[path] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[wildcard] operator[&&] identifier[path] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[else] { Keyword[if] operator[SEP] identifier[pattern] operator[SEP] identifier[equals] operator[SEP] identifier[path] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[wildcard] operator[&&] identifier[path] operator[SEP] identifier[startsWith] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[else] { Keyword[return] Keyword[this] operator[SEP] identifier[matcher] operator[SEP] identifier[matcher] operator[SEP] identifier[path] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public Observable<List<VnetRouteInner>> getRouteForVnetAsync(String resourceGroupName, String name, String vnetName, String routeName) { return getRouteForVnetWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName).map(new Func1<ServiceResponse<List<VnetRouteInner>>, List<VnetRouteInner>>() { @Override public List<VnetRouteInner> call(ServiceResponse<List<VnetRouteInner>> response) { return response.body(); } }); }
class class_name[name] begin[{] method[getRouteForVnetAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, name, vnetName, routeName]] begin[{] return[call[.getRouteForVnetWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.name], member[.vnetName], member[.routeName]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[List] operator[<] identifier[VnetRouteInner] operator[>] operator[>] identifier[getRouteForVnetAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[name] , identifier[String] identifier[vnetName] , identifier[String] identifier[routeName] operator[SEP] { Keyword[return] identifier[getRouteForVnetWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[name] , identifier[vnetName] , identifier[routeName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[VnetRouteInner] operator[>] operator[>] , identifier[List] operator[<] identifier[VnetRouteInner] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[VnetRouteInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[VnetRouteInner] operator[>] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
public static boolean compareCursors(Cursor c1, Cursor c2) { if (c1 == null || c2 == null) { return false; } int numColumns = c1.getColumnCount(); if (numColumns != c2.getColumnCount()) { return false; } if (c1.getCount() != c2.getCount()) { return false; } c1.moveToPosition(-1); c2.moveToPosition(-1); while (c1.moveToNext() && c2.moveToNext()) { for (int i = 0; i < numColumns; i++) { if (!TextUtils.equals(c1.getString(i), c2.getString(i))) { return false; } } } return true; }
class class_name[name] begin[{] method[compareCursors, return_type[type[boolean]], modifier[public static], parameter[c1, c2]] begin[{] if[binary_operation[binary_operation[member[.c1], ==, literal[null]], ||, binary_operation[member[.c2], ==, literal[null]]]] begin[{] return[literal[false]] else begin[{] None end[}] local_variable[type[int], numColumns] if[binary_operation[member[.numColumns], !=, call[c2.getColumnCount, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[binary_operation[call[c1.getCount, parameter[]], !=, call[c2.getCount, parameter[]]]] begin[{] return[literal[false]] else begin[{] None end[}] call[c1.moveToPosition, parameter[literal[1]]] call[c2.moveToPosition, parameter[literal[1]]] while[binary_operation[call[c1.moveToNext, parameter[]], &&, call[c2.moveToNext, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=c1, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=c2, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=TextUtils, 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=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numColumns, 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) end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[compareCursors] operator[SEP] identifier[Cursor] identifier[c1] , identifier[Cursor] identifier[c2] operator[SEP] { Keyword[if] operator[SEP] identifier[c1] operator[==] Other[null] operator[||] identifier[c2] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[int] identifier[numColumns] operator[=] identifier[c1] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[numColumns] operator[!=] identifier[c2] operator[SEP] identifier[getColumnCount] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[c1] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[!=] identifier[c2] operator[SEP] identifier[getCount] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[c1] operator[SEP] identifier[moveToPosition] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[c2] operator[SEP] identifier[moveToPosition] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[c1] operator[SEP] identifier[moveToNext] operator[SEP] operator[SEP] operator[&&] identifier[c2] operator[SEP] identifier[moveToNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numColumns] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[TextUtils] operator[SEP] identifier[equals] operator[SEP] identifier[c1] operator[SEP] identifier[getString] operator[SEP] identifier[i] operator[SEP] , identifier[c2] operator[SEP] identifier[getString] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
@SuppressWarnings("null") private void initFromConstraints(String encodedConstraints) { StringTokenizer tokenizer = new StringTokenizer(encodedConstraints, " ,"); int argCount = tokenizer.countTokens(); checkArgument(argCount == 2 || argCount == 4 || argCount == 6, "You must provide 2, 4 or 6 arguments."); Integer nextInt = decodeInt(tokenizer.nextToken()); checkArgument(nextInt != null, "First cell constraint element must be a number."); gridX = nextInt.intValue(); checkArgument(gridX > 0, "The grid x must be a positive number."); nextInt = decodeInt(tokenizer.nextToken()); checkArgument(nextInt != null, "Second cell constraint element must be a number."); gridY = nextInt.intValue(); checkArgument(gridY > 0, "The grid y must be a positive number."); if (!tokenizer.hasMoreTokens()) { return; } String token = tokenizer.nextToken(); nextInt = decodeInt(token); if (nextInt != null) { // Case: "x, y, w, h" or // "x, y, w, h, hAlign, vAlign" gridWidth = nextInt.intValue(); if (gridWidth <= 0) { throw new IndexOutOfBoundsException( "The grid width must be a positive number."); } nextInt = decodeInt(tokenizer.nextToken()); if (nextInt == null) { throw new IllegalArgumentException( "Fourth cell constraint element must be like third."); } gridHeight = nextInt.intValue(); if (gridHeight <= 0) { throw new IndexOutOfBoundsException( "The grid height must be a positive number."); } if (!tokenizer.hasMoreTokens()) { return; } token = tokenizer.nextToken(); } hAlign = decodeAlignment(token); vAlign = decodeAlignment(tokenizer.nextToken()); ensureValidOrientations(hAlign, vAlign); }
class class_name[name] begin[{] method[initFromConstraints, return_type[void], modifier[private], parameter[encodedConstraints]] begin[{] local_variable[type[StringTokenizer], tokenizer] local_variable[type[int], argCount] call[.checkArgument, parameter[binary_operation[binary_operation[binary_operation[member[.argCount], ==, literal[2]], ||, binary_operation[member[.argCount], ==, literal[4]]], ||, binary_operation[member[.argCount], ==, literal[6]]], literal["You must provide 2, 4 or 6 arguments."]]] local_variable[type[Integer], nextInt] call[.checkArgument, parameter[binary_operation[member[.nextInt], !=, literal[null]], literal["First cell constraint element must be a number."]]] assign[member[.gridX], call[nextInt.intValue, parameter[]]] call[.checkArgument, parameter[binary_operation[member[.gridX], >, literal[0]], literal["The grid x must be a positive number."]]] assign[member[.nextInt], call[.decodeInt, parameter[call[tokenizer.nextToken, parameter[]]]]] call[.checkArgument, parameter[binary_operation[member[.nextInt], !=, literal[null]], literal["Second cell constraint element must be a number."]]] assign[member[.gridY], call[nextInt.intValue, parameter[]]] call[.checkArgument, parameter[binary_operation[member[.gridY], >, literal[0]], literal["The grid y must be a positive number."]]] if[call[tokenizer.hasMoreTokens, parameter[]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[String], token] assign[member[.nextInt], call[.decodeInt, parameter[member[.token]]]] if[binary_operation[member[.nextInt], !=, literal[null]]] begin[{] assign[member[.gridWidth], call[nextInt.intValue, parameter[]]] if[binary_operation[member[.gridWidth], <=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The grid width must be a positive number.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.nextInt], call[.decodeInt, parameter[call[tokenizer.nextToken, parameter[]]]]] if[binary_operation[member[.nextInt], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Fourth cell constraint element must be like third.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.gridHeight], call[nextInt.intValue, parameter[]]] if[binary_operation[member[.gridHeight], <=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The grid height must be a positive number.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IndexOutOfBoundsException, sub_type=None)), label=None) else begin[{] None end[}] if[call[tokenizer.hasMoreTokens, parameter[]]] begin[{] return[None] else begin[{] None end[}] assign[member[.token], call[tokenizer.nextToken, parameter[]]] else begin[{] None end[}] assign[member[.hAlign], call[.decodeAlignment, parameter[member[.token]]]] assign[member[.vAlign], call[.decodeAlignment, parameter[call[tokenizer.nextToken, parameter[]]]]] call[.ensureValidOrientations, parameter[member[.hAlign], member[.vAlign]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[initFromConstraints] operator[SEP] identifier[String] identifier[encodedConstraints] operator[SEP] { identifier[StringTokenizer] identifier[tokenizer] operator[=] Keyword[new] identifier[StringTokenizer] operator[SEP] identifier[encodedConstraints] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[argCount] operator[=] identifier[tokenizer] operator[SEP] identifier[countTokens] operator[SEP] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[argCount] operator[==] Other[2] operator[||] identifier[argCount] operator[==] Other[4] operator[||] identifier[argCount] operator[==] Other[6] , literal[String] operator[SEP] operator[SEP] identifier[Integer] identifier[nextInt] operator[=] identifier[decodeInt] operator[SEP] identifier[tokenizer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[nextInt] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[gridX] operator[=] identifier[nextInt] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[gridX] operator[>] Other[0] , literal[String] operator[SEP] operator[SEP] identifier[nextInt] operator[=] identifier[decodeInt] operator[SEP] identifier[tokenizer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[nextInt] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[gridY] operator[=] identifier[nextInt] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[gridY] operator[>] Other[0] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[tokenizer] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[String] identifier[token] operator[=] identifier[tokenizer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] identifier[nextInt] operator[=] identifier[decodeInt] operator[SEP] identifier[token] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextInt] operator[!=] Other[null] operator[SEP] { identifier[gridWidth] operator[=] identifier[nextInt] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gridWidth] operator[<=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[nextInt] operator[=] identifier[decodeInt] operator[SEP] identifier[tokenizer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextInt] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[gridHeight] operator[=] identifier[nextInt] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[gridHeight] operator[<=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IndexOutOfBoundsException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[tokenizer] operator[SEP] identifier[hasMoreTokens] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[token] operator[=] identifier[tokenizer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] } identifier[hAlign] operator[=] identifier[decodeAlignment] operator[SEP] identifier[token] operator[SEP] operator[SEP] identifier[vAlign] operator[=] identifier[decodeAlignment] operator[SEP] identifier[tokenizer] operator[SEP] identifier[nextToken] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ensureValidOrientations] operator[SEP] identifier[hAlign] , identifier[vAlign] operator[SEP] operator[SEP] }