code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public Matrix4x3d rotateYXZ(Vector3d angles) { return rotateYXZ(angles.y, angles.x, angles.z); }
class class_name[name] begin[{] method[rotateYXZ, return_type[type[Matrix4x3d]], modifier[public], parameter[angles]] begin[{] return[call[.rotateYXZ, parameter[member[angles.y], member[angles.x], member[angles.z]]]] end[}] END[}]
Keyword[public] identifier[Matrix4x3d] identifier[rotateYXZ] operator[SEP] identifier[Vector3d] identifier[angles] operator[SEP] { Keyword[return] identifier[rotateYXZ] operator[SEP] identifier[angles] operator[SEP] identifier[y] , identifier[angles] operator[SEP] identifier[x] , identifier[angles] operator[SEP] identifier[z] operator[SEP] operator[SEP] }
protected String findValidHeaderValue(Set<CharSequence> paramValues) { String selectedValue = null; if (paramValues != null && !paramValues.isEmpty()) { CharSequence value = paramValues.iterator().next(); if (!(value instanceof QueryParameterValue)) { selectedValue = value.toString(); } } return selectedValue; }
class class_name[name] begin[{] method[findValidHeaderValue, return_type[type[String]], modifier[protected], parameter[paramValues]] begin[{] local_variable[type[String], selectedValue] if[binary_operation[binary_operation[member[.paramValues], !=, literal[null]], &&, call[paramValues.isEmpty, parameter[]]]] begin[{] local_variable[type[CharSequence], value] if[binary_operation[member[.value], instanceof, type[QueryParameterValue]]] begin[{] assign[member[.selectedValue], call[value.toString, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.selectedValue]] end[}] END[}]
Keyword[protected] identifier[String] identifier[findValidHeaderValue] operator[SEP] identifier[Set] operator[<] identifier[CharSequence] operator[>] identifier[paramValues] operator[SEP] { identifier[String] identifier[selectedValue] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[paramValues] operator[!=] Other[null] operator[&&] operator[!] identifier[paramValues] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[CharSequence] identifier[value] operator[=] identifier[paramValues] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[value] Keyword[instanceof] identifier[QueryParameterValue] operator[SEP] operator[SEP] { identifier[selectedValue] operator[=] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[selectedValue] operator[SEP] }
public static <M> Subscription destroyOnClose(final Window window, final AbstractViewController<M> viewBinder) { Assert.requireNonNull(window, "window"); Assert.requireNonNull(viewBinder, "viewBinder"); final EventHandler<WindowEvent> handler = e -> viewBinder.destroy(); window.addEventFilter(WindowEvent.WINDOW_HIDDEN, handler); return () -> window.removeEventFilter(WindowEvent.WINDOW_HIDDEN, handler); }
class class_name[name] begin[{] method[destroyOnClose, return_type[type[Subscription]], modifier[public static], parameter[window, viewBinder]] begin[{] call[Assert.requireNonNull, parameter[member[.window], literal["window"]]] call[Assert.requireNonNull, parameter[member[.viewBinder], literal["viewBinder"]]] local_variable[type[EventHandler], handler] call[window.addEventFilter, parameter[member[WindowEvent.WINDOW_HIDDEN], member[.handler]]] return[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=WINDOW_HIDDEN, postfix_operators=[], prefix_operators=[], qualifier=WindowEvent, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeEventFilter, postfix_operators=[], prefix_operators=[], qualifier=window, selectors=[], type_arguments=None), parameters=[])] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[M] operator[>] identifier[Subscription] identifier[destroyOnClose] operator[SEP] Keyword[final] identifier[Window] identifier[window] , Keyword[final] identifier[AbstractViewController] operator[<] identifier[M] operator[>] identifier[viewBinder] operator[SEP] { identifier[Assert] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[window] , literal[String] operator[SEP] operator[SEP] identifier[Assert] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[viewBinder] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[EventHandler] operator[<] identifier[WindowEvent] operator[>] identifier[handler] operator[=] identifier[e] operator[->] identifier[viewBinder] operator[SEP] identifier[destroy] operator[SEP] operator[SEP] operator[SEP] identifier[window] operator[SEP] identifier[addEventFilter] operator[SEP] identifier[WindowEvent] operator[SEP] identifier[WINDOW_HIDDEN] , identifier[handler] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] operator[->] identifier[window] operator[SEP] identifier[removeEventFilter] operator[SEP] identifier[WindowEvent] operator[SEP] identifier[WINDOW_HIDDEN] , identifier[handler] operator[SEP] operator[SEP] }
public static boolean matches(String pattern, String value) { Pattern p = Pattern.compile(pattern); Matcher m = p.matcher(value); return m.matches(); }
class class_name[name] begin[{] method[matches, return_type[type[boolean]], modifier[public static], parameter[pattern, value]] begin[{] local_variable[type[Pattern], p] local_variable[type[Matcher], m] return[call[m.matches, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[matches] operator[SEP] identifier[String] identifier[pattern] , identifier[String] identifier[value] operator[SEP] { identifier[Pattern] identifier[p] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] identifier[Matcher] identifier[m] operator[=] identifier[p] operator[SEP] identifier[matcher] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[return] identifier[m] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] }
public S3URI getParent() { if (key == null) { return null; } int lastDelimPos = key.lastIndexOf(S3_DELIMITER); if (lastDelimPos == -1) { return new S3URI(bucket, null); } else { return new S3URI(bucket, key.substring(0, lastDelimPos)); } }
class class_name[name] begin[{] method[getParent, return_type[type[S3URI]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.key], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[int], lastDelimPos] if[binary_operation[member[.lastDelimPos], ==, literal[1]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=S3URI, sub_type=None))] else begin[{] return[ClassCreator(arguments=[MemberReference(member=bucket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=lastDelimPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=S3URI, sub_type=None))] end[}] end[}] END[}]
Keyword[public] identifier[S3URI] identifier[getParent] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[key] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[int] identifier[lastDelimPos] operator[=] identifier[key] operator[SEP] identifier[lastIndexOf] operator[SEP] identifier[S3_DELIMITER] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lastDelimPos] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] Keyword[new] identifier[S3URI] operator[SEP] identifier[bucket] , Other[null] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[S3URI] operator[SEP] identifier[bucket] , identifier[key] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[lastDelimPos] operator[SEP] operator[SEP] operator[SEP] } }
public Object getJsonPath(String json, String jsonPath) { if (!JsonPath.isPathDefinite(jsonPath)) { throw new RuntimeException(jsonPath + " returns a list of results, not a single."); } return parseJson(json).read(jsonPath); }
class class_name[name] begin[{] method[getJsonPath, return_type[type[Object]], modifier[public], parameter[json, jsonPath]] begin[{] if[call[JsonPath.isPathDefinite, parameter[member[.jsonPath]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=jsonPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" returns a list of results, not a single."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None) else begin[{] None end[}] return[call[.parseJson, parameter[member[.json]]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[getJsonPath] operator[SEP] identifier[String] identifier[json] , identifier[String] identifier[jsonPath] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[JsonPath] operator[SEP] identifier[isPathDefinite] operator[SEP] identifier[jsonPath] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[jsonPath] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[parseJson] operator[SEP] identifier[json] operator[SEP] operator[SEP] identifier[read] operator[SEP] identifier[jsonPath] operator[SEP] operator[SEP] }
private static Object checkComponentType(Object array, Class<?> expectedComponentType) { Class<?> actualComponentType = array.getClass().getComponentType(); if (!expectedComponentType.isAssignableFrom(actualComponentType)) { throw new ArrayStoreException( String.format("The expected component type %s is not assignable from the actual type %s", expectedComponentType.getCanonicalName(), actualComponentType.getCanonicalName())); } return array; }
class class_name[name] begin[{] method[checkComponentType, return_type[type[Object]], modifier[private static], parameter[array, expectedComponentType]] begin[{] local_variable[type[Class], actualComponentType] if[call[expectedComponentType.isAssignableFrom, parameter[member[.actualComponentType]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The expected component type %s is not assignable from the actual type %s"), MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=expectedComponentType, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=[], prefix_operators=[], qualifier=actualComponentType, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayStoreException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.array]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Object] identifier[checkComponentType] operator[SEP] identifier[Object] identifier[array] , identifier[Class] operator[<] operator[?] operator[>] identifier[expectedComponentType] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[actualComponentType] operator[=] identifier[array] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[expectedComponentType] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[actualComponentType] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ArrayStoreException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[expectedComponentType] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] , identifier[actualComponentType] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[array] operator[SEP] }
public Enumeration<String> getElements() { AttributeNameEnumeration elements = new AttributeNameEnumeration(); elements.addElement(SKIP_CERTS); return (elements.elements()); }
class class_name[name] begin[{] method[getElements, return_type[type[Enumeration]], modifier[public], parameter[]] begin[{] local_variable[type[AttributeNameEnumeration], elements] call[elements.addElement, parameter[member[.SKIP_CERTS]]] return[call[elements.elements, parameter[]]] end[}] END[}]
Keyword[public] identifier[Enumeration] operator[<] identifier[String] operator[>] identifier[getElements] operator[SEP] operator[SEP] { identifier[AttributeNameEnumeration] identifier[elements] operator[=] Keyword[new] identifier[AttributeNameEnumeration] operator[SEP] operator[SEP] operator[SEP] identifier[elements] operator[SEP] identifier[addElement] operator[SEP] identifier[SKIP_CERTS] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[elements] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void setUpgradeRequestHeaders(ChannelHandlerContext ctx, HttpRequest request) { // Set the UPGRADE header on the request. request.headers().set(HttpHeaderNames.UPGRADE, upgradeCodec.protocol()); // Add all protocol-specific headers to the request. Set<CharSequence> connectionParts = new LinkedHashSet<CharSequence>(2); connectionParts.addAll(upgradeCodec.setUpgradeHeaders(ctx, request)); // Set the CONNECTION header from the set of all protocol-specific headers that were added. StringBuilder builder = new StringBuilder(); for (CharSequence part : connectionParts) { builder.append(part); builder.append(','); } builder.append(HttpHeaderValues.UPGRADE); request.headers().add(HttpHeaderNames.CONNECTION, builder.toString()); }
class class_name[name] begin[{] method[setUpgradeRequestHeaders, return_type[void], modifier[private], parameter[ctx, request]] begin[{] call[request.headers, parameter[]] local_variable[type[Set], connectionParts] call[connectionParts.addAll, parameter[call[upgradeCodec.setUpgradeHeaders, parameter[member[.ctx], member[.request]]]]] local_variable[type[StringBuilder], builder] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=part, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=connectionParts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=part)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CharSequence, sub_type=None))), label=None) call[builder.append, parameter[member[HttpHeaderValues.UPGRADE]]] call[request.headers, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[setUpgradeRequestHeaders] operator[SEP] identifier[ChannelHandlerContext] identifier[ctx] , identifier[HttpRequest] identifier[request] operator[SEP] { identifier[request] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[UPGRADE] , identifier[upgradeCodec] operator[SEP] identifier[protocol] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[CharSequence] operator[>] identifier[connectionParts] operator[=] Keyword[new] identifier[LinkedHashSet] operator[<] identifier[CharSequence] operator[>] operator[SEP] Other[2] operator[SEP] operator[SEP] identifier[connectionParts] operator[SEP] identifier[addAll] operator[SEP] identifier[upgradeCodec] operator[SEP] identifier[setUpgradeHeaders] operator[SEP] identifier[ctx] , identifier[request] operator[SEP] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CharSequence] identifier[part] operator[:] identifier[connectionParts] operator[SEP] { identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[part] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[HttpHeaderValues] operator[SEP] identifier[UPGRADE] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[HttpHeaderNames] operator[SEP] identifier[CONNECTION] , identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void deleteMergeRequestAwardEmoji(Object projectIdOrPath, Integer mergeRequestIid, Integer awardId) throws GitLabApiException { delete(Response.Status.NO_CONTENT, null, "projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "award_emoji", awardId); }
class class_name[name] begin[{] method[deleteMergeRequestAwardEmoji, return_type[void], modifier[public], parameter[projectIdOrPath, mergeRequestIid, awardId]] begin[{] call[.delete, parameter[member[Response.Status.NO_CONTENT], literal[null], literal["projects"], call[.getProjectIdOrPath, parameter[member[.projectIdOrPath]]], literal["merge_requests"], member[.mergeRequestIid], literal["award_emoji"], member[.awardId]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[deleteMergeRequestAwardEmoji] operator[SEP] identifier[Object] identifier[projectIdOrPath] , identifier[Integer] identifier[mergeRequestIid] , identifier[Integer] identifier[awardId] operator[SEP] Keyword[throws] identifier[GitLabApiException] { identifier[delete] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[NO_CONTENT] , Other[null] , literal[String] , identifier[getProjectIdOrPath] operator[SEP] identifier[projectIdOrPath] operator[SEP] , literal[String] , identifier[mergeRequestIid] , literal[String] , identifier[awardId] operator[SEP] operator[SEP] }
public static Catalog crawlDatabase(final Connection connection, final InclusionRule schemaRule, final InclusionRule tableRule) throws SchemaCrawlerException { final SchemaCrawlerOptions options = SchemaCrawlerOptionsBuilder.builder() .withSchemaInfoLevel(SchemaInfoLevelBuilder.standard().setRetrieveIndexes(false)) .routineTypes(Arrays.asList(RoutineType.procedure, RoutineType.unknown)) .includeSchemas(schemaRule == null ? new IncludeAll() : schemaRule) .includeTables(tableRule == null ? new IncludeAll() : tableRule) .toOptions(); try { return SchemaCrawlerUtility.getCatalog(connection, options); } catch (SchemaCrawlerException e) { LOG.error("Schema crawling failed with exception", e); throw e; } }
class class_name[name] begin[{] method[crawlDatabase, return_type[type[Catalog]], modifier[public static], parameter[connection, schemaRule, tableRule]] begin[{] local_variable[type[SchemaCrawlerOptions], options] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCatalog, postfix_operators=[], prefix_operators=[], qualifier=SchemaCrawlerUtility, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Schema crawling failed with exception"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SchemaCrawlerException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Catalog] identifier[crawlDatabase] operator[SEP] Keyword[final] identifier[Connection] identifier[connection] , Keyword[final] identifier[InclusionRule] identifier[schemaRule] , Keyword[final] identifier[InclusionRule] identifier[tableRule] operator[SEP] Keyword[throws] identifier[SchemaCrawlerException] { Keyword[final] identifier[SchemaCrawlerOptions] identifier[options] operator[=] identifier[SchemaCrawlerOptionsBuilder] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[withSchemaInfoLevel] operator[SEP] identifier[SchemaInfoLevelBuilder] operator[SEP] identifier[standard] operator[SEP] operator[SEP] operator[SEP] identifier[setRetrieveIndexes] operator[SEP] literal[boolean] operator[SEP] operator[SEP] operator[SEP] identifier[routineTypes] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[RoutineType] operator[SEP] identifier[procedure] , identifier[RoutineType] operator[SEP] identifier[unknown] operator[SEP] operator[SEP] operator[SEP] identifier[includeSchemas] operator[SEP] identifier[schemaRule] operator[==] Other[null] operator[?] Keyword[new] identifier[IncludeAll] operator[SEP] operator[SEP] operator[:] identifier[schemaRule] operator[SEP] operator[SEP] identifier[includeTables] operator[SEP] identifier[tableRule] operator[==] Other[null] operator[?] Keyword[new] identifier[IncludeAll] operator[SEP] operator[SEP] operator[:] identifier[tableRule] operator[SEP] operator[SEP] identifier[toOptions] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[SchemaCrawlerUtility] operator[SEP] identifier[getCatalog] operator[SEP] identifier[connection] , identifier[options] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SchemaCrawlerException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } }
@Override public void configureConstraintWeight(Rule rule, BendableScore constraintWeight) { super.configureConstraintWeight(rule, constraintWeight); BiConsumer<RuleContext, Integer> matchExecutor; if (constraintWeight.equals(BendableScore.zero(hardScores.length, softScores.length))) { matchExecutor = (RuleContext kcontext, Integer matchWeight) -> {}; } else { Integer singleLevel = null; Integer singleLevelWeight = null; for (int i = 0; i < constraintWeight.getLevelsSize(); i++) { int levelWeight = constraintWeight.getHardOrSoftScore(i); if (levelWeight != 0) { if (singleLevel != null) { singleLevel = null; singleLevelWeight = null; break; } singleLevel = i; singleLevelWeight = levelWeight; } } if (singleLevel != null) { int levelWeight = singleLevelWeight; if (singleLevel < constraintWeight.getHardLevelsSize()) { int level = singleLevel; matchExecutor = (RuleContext kcontext, Integer matchWeight) -> addHardConstraintMatch(kcontext, level, levelWeight * matchWeight); } else { int level = singleLevel - constraintWeight.getHardLevelsSize(); matchExecutor = (RuleContext kcontext, Integer matchWeight) -> addSoftConstraintMatch(kcontext, level, levelWeight * matchWeight); } } else { matchExecutor = (RuleContext kcontext, Integer matchWeight)-> { int[] hardWeights = new int[hardScores.length]; int[] softWeights = new int[softScores.length]; for (int i = 0; i < hardWeights.length; i++) { hardWeights[i] = constraintWeight.getHardScore(i) * matchWeight; } for (int i = 0; i < softWeights.length; i++) { softWeights[i] = constraintWeight.getSoftScore(i) * matchWeight; } addMultiConstraintMatch(kcontext, hardWeights, softWeights); }; } } matchExecutorByNumberMap.put(rule, matchExecutor); matchExecutorByScoreMap.put(rule, (RuleContext kcontext, BendableScore weightMultiplier) -> { int[] hardWeights = new int[hardScores.length]; int[] softWeights = new int[softScores.length]; for (int i = 0; i < hardWeights.length; i++) { hardWeights[i] = constraintWeight.getHardScore(i) * weightMultiplier.getHardScore(i); } for (int i = 0; i < softWeights.length; i++) { softWeights[i] = constraintWeight.getSoftScore(i) * weightMultiplier.getSoftScore(i); } addMultiConstraintMatch(kcontext, hardWeights, softWeights); }); }
class class_name[name] begin[{] method[configureConstraintWeight, return_type[void], modifier[public], parameter[rule, constraintWeight]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=rule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=constraintWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=configureConstraintWeight, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) local_variable[type[BiConsumer], matchExecutor] if[call[constraintWeight.equals, parameter[call[BendableScore.zero, parameter[member[hardScores.length], member[softScores.length]]]]]] begin[{] assign[member[.matchExecutor], LambdaExpression(body=[], parameters=[FormalParameter(annotations=[], modifiers=set(), name=kcontext, type=ReferenceType(arguments=None, dimensions=[], name=RuleContext, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=matchWeight, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None), varargs=False)])] else begin[{] local_variable[type[Integer], singleLevel] local_variable[type[Integer], singleLevelWeight] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getHardOrSoftScore, postfix_operators=[], prefix_operators=[], qualifier=constraintWeight, selectors=[], type_arguments=None), name=levelWeight)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=levelWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=singleLevel, 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=singleLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=singleLevelWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=singleLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=singleLevelWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=levelWeight, 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=getLevelsSize, postfix_operators=[], prefix_operators=[], qualifier=constraintWeight, 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[.singleLevel], !=, literal[null]]] begin[{] local_variable[type[int], levelWeight] if[binary_operation[member[.singleLevel], <, call[constraintWeight.getHardLevelsSize, parameter[]]]] begin[{] local_variable[type[int], level] assign[member[.matchExecutor], LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=kcontext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=levelWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=matchWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=addHardConstraintMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[FormalParameter(annotations=[], modifiers=set(), name=kcontext, type=ReferenceType(arguments=None, dimensions=[], name=RuleContext, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=matchWeight, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None), varargs=False)])] else begin[{] local_variable[type[int], level] assign[member[.matchExecutor], LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=kcontext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=levelWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=matchWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)], member=addSoftConstraintMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[FormalParameter(annotations=[], modifiers=set(), name=kcontext, type=ReferenceType(arguments=None, dimensions=[], name=RuleContext, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=matchWeight, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None), varargs=False)])] end[}] else begin[{] assign[member[.matchExecutor], LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=hardScores, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), name=hardWeights)], modifiers=set(), type=BasicType(dimensions=[None], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=softScores, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), name=softWeights)], modifiers=set(), type=BasicType(dimensions=[None], name=int)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hardWeights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getHardScore, postfix_operators=[], prefix_operators=[], qualifier=constraintWeight, selectors=[], type_arguments=None), operandr=MemberReference(member=matchWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=hardWeights, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=softWeights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSoftScore, postfix_operators=[], prefix_operators=[], qualifier=constraintWeight, selectors=[], type_arguments=None), operandr=MemberReference(member=matchWeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=softWeights, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kcontext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hardWeights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=softWeights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addMultiConstraintMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], parameters=[FormalParameter(annotations=[], modifiers=set(), name=kcontext, type=ReferenceType(arguments=None, dimensions=[], name=RuleContext, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=matchWeight, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None), varargs=False)])] end[}] end[}] call[matchExecutorByNumberMap.put, parameter[member[.rule], member[.matchExecutor]]] call[matchExecutorByScoreMap.put, parameter[member[.rule], LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=hardScores, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), name=hardWeights)], modifiers=set(), type=BasicType(dimensions=[None], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=softScores, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), name=softWeights)], modifiers=set(), type=BasicType(dimensions=[None], name=int)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=hardWeights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getHardScore, postfix_operators=[], prefix_operators=[], qualifier=constraintWeight, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getHardScore, postfix_operators=[], prefix_operators=[], qualifier=weightMultiplier, selectors=[], type_arguments=None), operator=*)), 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=hardWeights, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=softWeights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSoftScore, postfix_operators=[], prefix_operators=[], qualifier=constraintWeight, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSoftScore, postfix_operators=[], prefix_operators=[], qualifier=weightMultiplier, selectors=[], type_arguments=None), operator=*)), 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=softWeights, 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), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=kcontext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=hardWeights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=softWeights, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addMultiConstraintMatch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], parameters=[FormalParameter(annotations=[], modifiers=set(), name=kcontext, type=ReferenceType(arguments=None, dimensions=[], name=RuleContext, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=weightMultiplier, type=ReferenceType(arguments=None, dimensions=[], name=BendableScore, sub_type=None), varargs=False)])]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[configureConstraintWeight] operator[SEP] identifier[Rule] identifier[rule] , identifier[BendableScore] identifier[constraintWeight] operator[SEP] { Keyword[super] operator[SEP] identifier[configureConstraintWeight] operator[SEP] identifier[rule] , identifier[constraintWeight] operator[SEP] operator[SEP] identifier[BiConsumer] operator[<] identifier[RuleContext] , identifier[Integer] operator[>] identifier[matchExecutor] operator[SEP] Keyword[if] operator[SEP] identifier[constraintWeight] operator[SEP] identifier[equals] operator[SEP] identifier[BendableScore] operator[SEP] identifier[zero] operator[SEP] identifier[hardScores] operator[SEP] identifier[length] , identifier[softScores] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { identifier[matchExecutor] operator[=] operator[SEP] identifier[RuleContext] identifier[kcontext] , identifier[Integer] identifier[matchWeight] operator[SEP] operator[->] { } operator[SEP] } Keyword[else] { identifier[Integer] identifier[singleLevel] operator[=] Other[null] operator[SEP] identifier[Integer] identifier[singleLevelWeight] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[constraintWeight] operator[SEP] identifier[getLevelsSize] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[int] identifier[levelWeight] operator[=] identifier[constraintWeight] operator[SEP] identifier[getHardOrSoftScore] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[levelWeight] operator[!=] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[singleLevel] operator[!=] Other[null] operator[SEP] { identifier[singleLevel] operator[=] Other[null] operator[SEP] identifier[singleLevelWeight] operator[=] Other[null] operator[SEP] Keyword[break] operator[SEP] } identifier[singleLevel] operator[=] identifier[i] operator[SEP] identifier[singleLevelWeight] operator[=] identifier[levelWeight] operator[SEP] } } Keyword[if] operator[SEP] identifier[singleLevel] operator[!=] Other[null] operator[SEP] { Keyword[int] identifier[levelWeight] operator[=] identifier[singleLevelWeight] operator[SEP] Keyword[if] operator[SEP] identifier[singleLevel] operator[<] identifier[constraintWeight] operator[SEP] identifier[getHardLevelsSize] operator[SEP] operator[SEP] operator[SEP] { Keyword[int] identifier[level] operator[=] identifier[singleLevel] operator[SEP] identifier[matchExecutor] operator[=] operator[SEP] identifier[RuleContext] identifier[kcontext] , identifier[Integer] identifier[matchWeight] operator[SEP] operator[->] identifier[addHardConstraintMatch] operator[SEP] identifier[kcontext] , identifier[level] , identifier[levelWeight] operator[*] identifier[matchWeight] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] identifier[level] operator[=] identifier[singleLevel] operator[-] identifier[constraintWeight] operator[SEP] identifier[getHardLevelsSize] operator[SEP] operator[SEP] operator[SEP] identifier[matchExecutor] operator[=] operator[SEP] identifier[RuleContext] identifier[kcontext] , identifier[Integer] identifier[matchWeight] operator[SEP] operator[->] identifier[addSoftConstraintMatch] operator[SEP] identifier[kcontext] , identifier[level] , identifier[levelWeight] operator[*] identifier[matchWeight] operator[SEP] operator[SEP] } } Keyword[else] { identifier[matchExecutor] operator[=] operator[SEP] identifier[RuleContext] identifier[kcontext] , identifier[Integer] identifier[matchWeight] operator[SEP] operator[->] { Keyword[int] operator[SEP] operator[SEP] identifier[hardWeights] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[hardScores] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[softWeights] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[softScores] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[hardWeights] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[hardWeights] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[constraintWeight] operator[SEP] identifier[getHardScore] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[matchWeight] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[softWeights] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[softWeights] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[constraintWeight] operator[SEP] identifier[getSoftScore] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[matchWeight] operator[SEP] } identifier[addMultiConstraintMatch] operator[SEP] identifier[kcontext] , identifier[hardWeights] , identifier[softWeights] operator[SEP] operator[SEP] } operator[SEP] } } identifier[matchExecutorByNumberMap] operator[SEP] identifier[put] operator[SEP] identifier[rule] , identifier[matchExecutor] operator[SEP] operator[SEP] identifier[matchExecutorByScoreMap] operator[SEP] identifier[put] operator[SEP] identifier[rule] , operator[SEP] identifier[RuleContext] identifier[kcontext] , identifier[BendableScore] identifier[weightMultiplier] operator[SEP] operator[->] { Keyword[int] operator[SEP] operator[SEP] identifier[hardWeights] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[hardScores] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[softWeights] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[softScores] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[hardWeights] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[hardWeights] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[constraintWeight] operator[SEP] identifier[getHardScore] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[weightMultiplier] operator[SEP] identifier[getHardScore] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[softWeights] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[softWeights] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[constraintWeight] operator[SEP] identifier[getSoftScore] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[weightMultiplier] operator[SEP] identifier[getSoftScore] operator[SEP] identifier[i] operator[SEP] operator[SEP] } identifier[addMultiConstraintMatch] operator[SEP] identifier[kcontext] , identifier[hardWeights] , identifier[softWeights] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] }
public void setEnabled(boolean enabled) { super.setEnabled(enabled); for (Iterator members = getMemberList().iterator(); members.hasNext();) { GroupMember groupMember = (GroupMember)members.next(); groupMember.setEnabled(enabled); } }
class class_name[name] begin[{] method[setEnabled, return_type[void], modifier[public], parameter[enabled]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setEnabled, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=members, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=GroupMember, sub_type=None)), name=groupMember)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=GroupMember, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=enabled, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setEnabled, postfix_operators=[], prefix_operators=[], qualifier=groupMember, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=members, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getMemberList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=members)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setEnabled] operator[SEP] Keyword[boolean] identifier[enabled] operator[SEP] { Keyword[super] operator[SEP] identifier[setEnabled] operator[SEP] identifier[enabled] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] identifier[members] operator[=] identifier[getMemberList] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[members] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[GroupMember] identifier[groupMember] operator[=] operator[SEP] identifier[GroupMember] operator[SEP] identifier[members] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[groupMember] operator[SEP] identifier[setEnabled] operator[SEP] identifier[enabled] operator[SEP] operator[SEP] } }
public int getFieldSeq(String fieldName) { for (int i = 0; i < this.getFieldCount(); i++) { if (fieldName.equals(this.getField(i).getFieldName())) return i; } return -1; }
class class_name[name] begin[{] method[getFieldSeq, return_type[type[int]], modifier[public], parameter[fieldName]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getFieldName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=fieldName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getFieldCount, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=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) return[literal[1]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getFieldSeq] operator[SEP] identifier[String] identifier[fieldName] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[getFieldCount] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[fieldName] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getFieldName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[i] operator[SEP] } Keyword[return] operator[-] Other[1] operator[SEP] }
private boolean createPageAnchor(ServletRequest req, TagRenderingBase trb) { // create the fragment identifier. If the _linkName starts with // '#' then we treat it as if it was fully qualified. Otherwise we // need to qualify it before we add the '#'. _linkName = _linkName.trim(); if (_linkName.charAt(0) != '#') { _state.href = "#" + getIdForTagId(_linkName); } else { _state.href = _linkName; } // if the tagId was set then rewrite it and output it. if (_state.id != null) { //_state.id = getIdForTagId(_state.id); _state.name = _state.id; renderNameAndId((HttpServletRequest) req, _state,null); //renderDefaultNameAndId((HttpServletRequest) req, _state, _state.id, _state.id); } // write out the tag. WriteRenderAppender writer = new WriteRenderAppender(pageContext); trb = TagRenderingBase.Factory.getRendering(TagRenderingBase.ANCHOR_TAG, req); trb.doStartTag(writer, _state); return !hasErrors(); }
class class_name[name] begin[{] method[createPageAnchor, return_type[type[boolean]], modifier[private], parameter[req, trb]] begin[{] assign[member[._linkName], call[_linkName.trim, parameter[]]] if[binary_operation[call[_linkName.charAt, parameter[literal[0]]], !=, literal['#']]] begin[{] assign[member[_state.href], binary_operation[literal["#"], +, call[.getIdForTagId, parameter[member[._linkName]]]]] else begin[{] assign[member[_state.href], member[._linkName]] end[}] if[binary_operation[member[_state.id], !=, literal[null]]] begin[{] assign[member[_state.name], member[_state.id]] call[.renderNameAndId, parameter[Cast(expression=MemberReference(member=req, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=HttpServletRequest, sub_type=None)), member[._state], literal[null]]] else begin[{] None end[}] local_variable[type[WriteRenderAppender], writer] assign[member[.trb], call[TagRenderingBase.Factory.getRendering, parameter[member[TagRenderingBase.ANCHOR_TAG], member[.req]]]] call[trb.doStartTag, parameter[member[.writer], member[._state]]] return[call[.hasErrors, parameter[]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[createPageAnchor] operator[SEP] identifier[ServletRequest] identifier[req] , identifier[TagRenderingBase] identifier[trb] operator[SEP] { identifier[_linkName] operator[=] identifier[_linkName] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[_linkName] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[!=] literal[String] operator[SEP] { identifier[_state] operator[SEP] identifier[href] operator[=] literal[String] operator[+] identifier[getIdForTagId] operator[SEP] identifier[_linkName] operator[SEP] operator[SEP] } Keyword[else] { identifier[_state] operator[SEP] identifier[href] operator[=] identifier[_linkName] operator[SEP] } Keyword[if] operator[SEP] identifier[_state] operator[SEP] identifier[id] operator[!=] Other[null] operator[SEP] { identifier[_state] operator[SEP] identifier[name] operator[=] identifier[_state] operator[SEP] identifier[id] operator[SEP] identifier[renderNameAndId] operator[SEP] operator[SEP] identifier[HttpServletRequest] operator[SEP] identifier[req] , identifier[_state] , Other[null] operator[SEP] operator[SEP] } identifier[WriteRenderAppender] identifier[writer] operator[=] Keyword[new] identifier[WriteRenderAppender] operator[SEP] identifier[pageContext] operator[SEP] operator[SEP] identifier[trb] operator[=] identifier[TagRenderingBase] operator[SEP] identifier[Factory] operator[SEP] identifier[getRendering] operator[SEP] identifier[TagRenderingBase] operator[SEP] identifier[ANCHOR_TAG] , identifier[req] operator[SEP] operator[SEP] identifier[trb] operator[SEP] identifier[doStartTag] operator[SEP] identifier[writer] , identifier[_state] operator[SEP] operator[SEP] Keyword[return] operator[!] identifier[hasErrors] operator[SEP] operator[SEP] operator[SEP] }
public static BEValue bdecode(ByteBuffer data) throws IOException { return BDecoder.bdecode(new ByteArrayInputStream(data.array())); }
class class_name[name] begin[{] method[bdecode, return_type[type[BEValue]], modifier[public static], parameter[data]] begin[{] return[call[BDecoder.bdecode, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=array, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None))]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BEValue] identifier[bdecode] operator[SEP] identifier[ByteBuffer] identifier[data] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[BDecoder] operator[SEP] identifier[bdecode] operator[SEP] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[data] operator[SEP] identifier[array] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private SimpleRelation buildSimpleManyToOneOneToVirtualOne(Entity entity, final Attribute fromAttribute, Entity targetEntity, Attribute targetAttribute) { Namer targetNamer = relationUtil.getManyToOneNamer(fromAttribute, targetEntity.getModel()); Namer inverseNamer = relationUtil.getOneToManyNamer(fromAttribute.getColumnConfig(), entity.getModel()); SimpleRelation m2o = new SimpleManyToOne(inverseNamer, targetNamer, fromAttribute, entity, targetEntity, targetAttribute) { @Override protected AbstractRelation buildInverse() { AbstractRelation o2vo = new SimpleOneToVirtualOne(getTo(), getFrom(), getToAttribute(), getToEntity(), getFromEntity(), getFromAttribute()); OneToManyConfig o2voConfig = fromAttribute.getColumnConfig().getOneToManyConfig(); setLabelSingular(o2voConfig, o2vo); configureActions(o2vo, cfg().getDefaultOneToManyConfig(), o2voConfig); return o2vo; } }; ManyToOneConfig m2oConfig = fromAttribute.getColumnConfig().getManyToOneConfig(); setLabelSingular(m2oConfig, m2o); configureActions(m2o, cfg().getDefaultManyToOneConfig(), m2oConfig); return m2o; }
class class_name[name] begin[{] method[buildSimpleManyToOneOneToVirtualOne, return_type[type[SimpleRelation]], modifier[private], parameter[entity, fromAttribute, targetEntity, targetAttribute]] begin[{] local_variable[type[Namer], targetNamer] local_variable[type[Namer], inverseNamer] local_variable[type[SimpleRelation], m2o] local_variable[type[ManyToOneConfig], m2oConfig] call[.setLabelSingular, parameter[member[.m2oConfig], member[.m2o]]] call[.configureActions, parameter[member[.m2o], call[.cfg, parameter[]], member[.m2oConfig]]] return[member[.m2o]] end[}] END[}]
Keyword[private] identifier[SimpleRelation] identifier[buildSimpleManyToOneOneToVirtualOne] operator[SEP] identifier[Entity] identifier[entity] , Keyword[final] identifier[Attribute] identifier[fromAttribute] , identifier[Entity] identifier[targetEntity] , identifier[Attribute] identifier[targetAttribute] operator[SEP] { identifier[Namer] identifier[targetNamer] operator[=] identifier[relationUtil] operator[SEP] identifier[getManyToOneNamer] operator[SEP] identifier[fromAttribute] , identifier[targetEntity] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Namer] identifier[inverseNamer] operator[=] identifier[relationUtil] operator[SEP] identifier[getOneToManyNamer] operator[SEP] identifier[fromAttribute] operator[SEP] identifier[getColumnConfig] operator[SEP] operator[SEP] , identifier[entity] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SimpleRelation] identifier[m2o] operator[=] Keyword[new] identifier[SimpleManyToOne] operator[SEP] identifier[inverseNamer] , identifier[targetNamer] , identifier[fromAttribute] , identifier[entity] , identifier[targetEntity] , identifier[targetAttribute] operator[SEP] { annotation[@] identifier[Override] Keyword[protected] identifier[AbstractRelation] identifier[buildInverse] operator[SEP] operator[SEP] { identifier[AbstractRelation] identifier[o2vo] operator[=] Keyword[new] identifier[SimpleOneToVirtualOne] operator[SEP] identifier[getTo] operator[SEP] operator[SEP] , identifier[getFrom] operator[SEP] operator[SEP] , identifier[getToAttribute] operator[SEP] operator[SEP] , identifier[getToEntity] operator[SEP] operator[SEP] , identifier[getFromEntity] operator[SEP] operator[SEP] , identifier[getFromAttribute] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[OneToManyConfig] identifier[o2voConfig] operator[=] identifier[fromAttribute] operator[SEP] identifier[getColumnConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getOneToManyConfig] operator[SEP] operator[SEP] operator[SEP] identifier[setLabelSingular] operator[SEP] identifier[o2voConfig] , identifier[o2vo] operator[SEP] operator[SEP] identifier[configureActions] operator[SEP] identifier[o2vo] , identifier[cfg] operator[SEP] operator[SEP] operator[SEP] identifier[getDefaultOneToManyConfig] operator[SEP] operator[SEP] , identifier[o2voConfig] operator[SEP] operator[SEP] Keyword[return] identifier[o2vo] operator[SEP] } } operator[SEP] identifier[ManyToOneConfig] identifier[m2oConfig] operator[=] identifier[fromAttribute] operator[SEP] identifier[getColumnConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getManyToOneConfig] operator[SEP] operator[SEP] operator[SEP] identifier[setLabelSingular] operator[SEP] identifier[m2oConfig] , identifier[m2o] operator[SEP] operator[SEP] identifier[configureActions] operator[SEP] identifier[m2o] , identifier[cfg] operator[SEP] operator[SEP] operator[SEP] identifier[getDefaultManyToOneConfig] operator[SEP] operator[SEP] , identifier[m2oConfig] operator[SEP] operator[SEP] Keyword[return] identifier[m2o] operator[SEP] }
public String getRealPath(final String path) { if (path == null) return null; if (isContextPathSet && path.startsWith(contextPath)) return webappPath + path.substring(contextPath.length()); return webappPath + path; }
class class_name[name] begin[{] method[getRealPath, return_type[type[String]], modifier[public], parameter[path]] begin[{] if[binary_operation[member[.path], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[binary_operation[member[.isContextPathSet], &&, call[path.startsWith, parameter[member[.contextPath]]]]] begin[{] return[binary_operation[member[.webappPath], +, call[path.substring, parameter[call[contextPath.length, parameter[]]]]]] else begin[{] None end[}] return[binary_operation[member[.webappPath], +, member[.path]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getRealPath] operator[SEP] Keyword[final] identifier[String] identifier[path] operator[SEP] { Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[isContextPathSet] operator[&&] identifier[path] operator[SEP] identifier[startsWith] operator[SEP] identifier[contextPath] operator[SEP] operator[SEP] Keyword[return] identifier[webappPath] operator[+] identifier[path] operator[SEP] identifier[substring] operator[SEP] identifier[contextPath] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[webappPath] operator[+] identifier[path] operator[SEP] }
public Iterable<ListBlobItem> listLogBlobs(StorageService service) throws URISyntaxException, StorageException { return this.listLogBlobs(service, null /* startTime */, null /* endTime */, null /* operations */, null /* details */, null /* options */, null /* operationContext */); }
class class_name[name] begin[{] method[listLogBlobs, return_type[type[Iterable]], modifier[public], parameter[service]] begin[{] return[THIS[call[None.listLogBlobs, parameter[member[.service], literal[null], literal[null], literal[null], literal[null], literal[null], literal[null]]]]] end[}] END[}]
Keyword[public] identifier[Iterable] operator[<] identifier[ListBlobItem] operator[>] identifier[listLogBlobs] operator[SEP] identifier[StorageService] identifier[service] operator[SEP] Keyword[throws] identifier[URISyntaxException] , identifier[StorageException] { Keyword[return] Keyword[this] operator[SEP] identifier[listLogBlobs] operator[SEP] identifier[service] , Other[null] , Other[null] , Other[null] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP] }
@Override public void parseHeader(String header, S sequence) { sequence.setOriginalHeader(header); sequence.setAccession(new AccessionID(accession, DataSource.GENBANK, version, identifier)); sequence.setDescription(description); sequence.setComments(comments); sequence.setReferences(references); }
class class_name[name] begin[{] method[parseHeader, return_type[void], modifier[public], parameter[header, sequence]] begin[{] call[sequence.setOriginalHeader, parameter[member[.header]]] call[sequence.setAccession, parameter[ClassCreator(arguments=[MemberReference(member=accession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=GENBANK, postfix_operators=[], prefix_operators=[], qualifier=DataSource, selectors=[]), MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=identifier, 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=AccessionID, sub_type=None))]] call[sequence.setDescription, parameter[member[.description]]] call[sequence.setComments, parameter[member[.comments]]] call[sequence.setReferences, parameter[member[.references]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[parseHeader] operator[SEP] identifier[String] identifier[header] , identifier[S] identifier[sequence] operator[SEP] { identifier[sequence] operator[SEP] identifier[setOriginalHeader] operator[SEP] identifier[header] operator[SEP] operator[SEP] identifier[sequence] operator[SEP] identifier[setAccession] operator[SEP] Keyword[new] identifier[AccessionID] operator[SEP] identifier[accession] , identifier[DataSource] operator[SEP] identifier[GENBANK] , identifier[version] , identifier[identifier] operator[SEP] operator[SEP] operator[SEP] identifier[sequence] operator[SEP] identifier[setDescription] operator[SEP] identifier[description] operator[SEP] operator[SEP] identifier[sequence] operator[SEP] identifier[setComments] operator[SEP] identifier[comments] operator[SEP] operator[SEP] identifier[sequence] operator[SEP] identifier[setReferences] operator[SEP] identifier[references] operator[SEP] operator[SEP] }
private void requirePending() { if (pending != null) { return; } long exclusionComparable = Long.MIN_VALUE; while (nInclusionsRemaining != 0 && !queue.isEmpty()) { //find a candidate that is not excluded HeapElement inclusion = null; do { HeapElement candidate = queue.poll(); if (candidate.inclusion) { if (exclusionComparable != candidate.comparable()) { inclusion = candidate; break; } } else { exclusionComparable = candidate.comparable(); } reattach(candidate); if (nInclusionsRemaining == 0) { return; } } while (!queue.isEmpty()); if (inclusion == null) { return; } long inclusionComparable = inclusion.comparable(); /* * Check for any following exclusions and for duplicates. We could * change the sort order so that exclusions always preceded * inclusions, but that would be less efficient and would make the * ordering different than the comparable value. */ boolean excluded = exclusionComparable == inclusionComparable; while (!queue.isEmpty() && queue.peek().comparable() == inclusionComparable) { HeapElement match = queue.poll(); excluded |= !match.inclusion; reattach(match); if (nInclusionsRemaining == 0) { return; } } if (!excluded) { pending = inclusion; return; } reattach(inclusion); } }
class class_name[name] begin[{] method[requirePending, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[member[.pending], !=, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[long], exclusionComparable] while[binary_operation[binary_operation[member[.nInclusionsRemaining], !=, literal[0]], &&, call[queue.isEmpty, parameter[]]]] begin[{] local_variable[type[HeapElement], inclusion] do[call[queue.isEmpty, parameter[]]] begin[{] local_variable[type[HeapElement], candidate] if[member[candidate.inclusion]] begin[{] if[binary_operation[member[.exclusionComparable], !=, call[candidate.comparable, parameter[]]]] begin[{] assign[member[.inclusion], member[.candidate]] BreakStatement(goto=None, label=None) else begin[{] None end[}] else begin[{] assign[member[.exclusionComparable], call[candidate.comparable, parameter[]]] end[}] call[.reattach, parameter[member[.candidate]]] if[binary_operation[member[.nInclusionsRemaining], ==, literal[0]]] begin[{] return[None] else begin[{] None end[}] end[}] if[binary_operation[member[.inclusion], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[long], inclusionComparable] local_variable[type[boolean], excluded] while[binary_operation[call[queue.isEmpty, parameter[]], &&, binary_operation[call[queue.peek, parameter[]], ==, member[.inclusionComparable]]]] begin[{] local_variable[type[HeapElement], match] assign[member[.excluded], member[match.inclusion]] call[.reattach, parameter[member[.match]]] if[binary_operation[member[.nInclusionsRemaining], ==, literal[0]]] begin[{] return[None] else begin[{] None end[}] end[}] if[member[.excluded]] begin[{] assign[member[.pending], member[.inclusion]] return[None] else begin[{] None end[}] call[.reattach, parameter[member[.inclusion]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[requirePending] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[pending] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[long] identifier[exclusionComparable] operator[=] identifier[Long] operator[SEP] identifier[MIN_VALUE] operator[SEP] Keyword[while] operator[SEP] identifier[nInclusionsRemaining] operator[!=] Other[0] operator[&&] operator[!] identifier[queue] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[HeapElement] identifier[inclusion] operator[=] Other[null] operator[SEP] Keyword[do] { identifier[HeapElement] identifier[candidate] operator[=] identifier[queue] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[candidate] operator[SEP] identifier[inclusion] operator[SEP] { Keyword[if] operator[SEP] identifier[exclusionComparable] operator[!=] identifier[candidate] operator[SEP] identifier[comparable] operator[SEP] operator[SEP] operator[SEP] { identifier[inclusion] operator[=] identifier[candidate] operator[SEP] Keyword[break] operator[SEP] } } Keyword[else] { identifier[exclusionComparable] operator[=] identifier[candidate] operator[SEP] identifier[comparable] operator[SEP] operator[SEP] operator[SEP] } identifier[reattach] operator[SEP] identifier[candidate] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nInclusionsRemaining] operator[==] Other[0] operator[SEP] { Keyword[return] operator[SEP] } } Keyword[while] operator[SEP] operator[!] identifier[queue] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inclusion] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[long] identifier[inclusionComparable] operator[=] identifier[inclusion] operator[SEP] identifier[comparable] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[excluded] operator[=] identifier[exclusionComparable] operator[==] identifier[inclusionComparable] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[queue] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[queue] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP] identifier[comparable] operator[SEP] operator[SEP] operator[==] identifier[inclusionComparable] operator[SEP] { identifier[HeapElement] identifier[match] operator[=] identifier[queue] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] identifier[excluded] operator[|=] operator[!] identifier[match] operator[SEP] identifier[inclusion] operator[SEP] identifier[reattach] operator[SEP] identifier[match] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nInclusionsRemaining] operator[==] Other[0] operator[SEP] { Keyword[return] operator[SEP] } } Keyword[if] operator[SEP] operator[!] identifier[excluded] operator[SEP] { identifier[pending] operator[=] identifier[inclusion] operator[SEP] Keyword[return] operator[SEP] } identifier[reattach] operator[SEP] identifier[inclusion] operator[SEP] operator[SEP] } }
public static Function<? super ReactiveSeq<Integer>, ? extends ReactiveSeq<Integer>> concatInts( ReactiveSeq<Integer> b){ return a->ReactiveSeq.fromSpliterator(IntStream.concat(a.mapToInt(i->i),b.mapToInt(i->i)).spliterator()); }
class class_name[name] begin[{] method[concatInts, return_type[type[Function]], modifier[public static], parameter[b]] begin[{] return[LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[LambdaExpression(body=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), parameters=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=mapToInt, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[], type_arguments=None), MethodInvocation(arguments=[LambdaExpression(body=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), parameters=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=mapToInt, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None)], member=concat, postfix_operators=[], prefix_operators=[], qualifier=IntStream, selectors=[MethodInvocation(arguments=[], member=spliterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=fromSpliterator, postfix_operators=[], prefix_operators=[], qualifier=ReactiveSeq, selectors=[], type_arguments=None), parameters=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])] end[}] END[}]
Keyword[public] Keyword[static] identifier[Function] operator[<] operator[?] Keyword[super] identifier[ReactiveSeq] operator[<] identifier[Integer] operator[>] , operator[?] Keyword[extends] identifier[ReactiveSeq] operator[<] identifier[Integer] operator[>] operator[>] identifier[concatInts] operator[SEP] identifier[ReactiveSeq] operator[<] identifier[Integer] operator[>] identifier[b] operator[SEP] { Keyword[return] identifier[a] operator[->] identifier[ReactiveSeq] operator[SEP] identifier[fromSpliterator] operator[SEP] identifier[IntStream] operator[SEP] identifier[concat] operator[SEP] identifier[a] operator[SEP] identifier[mapToInt] operator[SEP] identifier[i] operator[->] identifier[i] operator[SEP] , identifier[b] operator[SEP] identifier[mapToInt] operator[SEP] identifier[i] operator[->] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[spliterator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static Result badRequest(JsonNode content, JsonEncoding encoding) { return status(BAD_REQUEST, content, encoding); }
class class_name[name] begin[{] method[badRequest, return_type[type[Result]], modifier[public static], parameter[content, encoding]] begin[{] return[call[.status, parameter[member[.BAD_REQUEST], member[.content], member[.encoding]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Result] identifier[badRequest] operator[SEP] identifier[JsonNode] identifier[content] , identifier[JsonEncoding] identifier[encoding] operator[SEP] { Keyword[return] identifier[status] operator[SEP] identifier[BAD_REQUEST] , identifier[content] , identifier[encoding] operator[SEP] operator[SEP] }
@Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case AfplibPackage.EDI__INDX_NAME: return getIndxName(); case AfplibPackage.EDI__TRIPLETS: return getTriplets(); } return super.eGet(featureID, resolve, coreType); }
class class_name[name] begin[{] method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=EDI__INDX_NAME, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getIndxName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=EDI__TRIPLETS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getTriplets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[EDI__INDX_NAME] operator[:] Keyword[return] identifier[getIndxName] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[EDI__TRIPLETS] operator[:] Keyword[return] identifier[getTriplets] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP] }
private static boolean isKnownLeafClassLoader(final ClassLoader classLoader) { if (classLoader == null) { return false; } if (!isKnownClassLoaderAccessibleFrom(classClassLoader, classLoader)) { // We cannot access the class class loader from the specified class loader, so this is not a leaf return false; } // Now we know there is a way to reach the class class loader from the argument class loader, so we should // base or results on whether there is a way to reach the system class loader from the class class loader. return systemClassLoaderAccessibleFromClassClassLoader; }
class class_name[name] begin[{] method[isKnownLeafClassLoader, return_type[type[boolean]], modifier[private static], parameter[classLoader]] begin[{] if[binary_operation[member[.classLoader], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[.isKnownClassLoaderAccessibleFrom, parameter[member[.classClassLoader], member[.classLoader]]]] begin[{] return[literal[false]] else begin[{] None end[}] return[member[.systemClassLoaderAccessibleFromClassClassLoader]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[isKnownLeafClassLoader] operator[SEP] Keyword[final] identifier[ClassLoader] identifier[classLoader] operator[SEP] { Keyword[if] operator[SEP] identifier[classLoader] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isKnownClassLoaderAccessibleFrom] operator[SEP] identifier[classClassLoader] , identifier[classLoader] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] identifier[systemClassLoaderAccessibleFromClassClassLoader] operator[SEP] }
public ResourcePendingMaintenanceActions withPendingMaintenanceActionDetails(PendingMaintenanceAction... pendingMaintenanceActionDetails) { if (this.pendingMaintenanceActionDetails == null) { setPendingMaintenanceActionDetails(new java.util.ArrayList<PendingMaintenanceAction>(pendingMaintenanceActionDetails.length)); } for (PendingMaintenanceAction ele : pendingMaintenanceActionDetails) { this.pendingMaintenanceActionDetails.add(ele); } return this; }
class class_name[name] begin[{] method[withPendingMaintenanceActionDetails, return_type[type[ResourcePendingMaintenanceActions]], modifier[public], parameter[pendingMaintenanceActionDetails]] begin[{] if[binary_operation[THIS[member[None.pendingMaintenanceActionDetails]], ==, literal[null]]] begin[{] call[.setPendingMaintenanceActionDetails, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=pendingMaintenanceActionDetails, 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=PendingMaintenanceAction, 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=pendingMaintenanceActionDetails, 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=pendingMaintenanceActionDetails, 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=PendingMaintenanceAction, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ResourcePendingMaintenanceActions] identifier[withPendingMaintenanceActionDetails] operator[SEP] identifier[PendingMaintenanceAction] operator[...] identifier[pendingMaintenanceActionDetails] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[pendingMaintenanceActionDetails] operator[==] Other[null] operator[SEP] { identifier[setPendingMaintenanceActionDetails] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[PendingMaintenanceAction] operator[>] operator[SEP] identifier[pendingMaintenanceActionDetails] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[PendingMaintenanceAction] identifier[ele] operator[:] identifier[pendingMaintenanceActionDetails] operator[SEP] { Keyword[this] operator[SEP] identifier[pendingMaintenanceActionDetails] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public static double median (double[] vector) { final double[] sorted = vector.clone(); Arrays.sort(sorted); if (vector.length % 2 == 1) { return sorted[vector.length / 2]; } return (sorted[vector.length / 2 - 1] + sorted[vector.length / 2]) / 2; }
class class_name[name] begin[{] method[median, return_type[type[double]], modifier[public static], parameter[vector]] begin[{] local_variable[type[double], sorted] call[Arrays.sort, parameter[member[.sorted]]] if[binary_operation[binary_operation[member[vector.length], %, literal[2]], ==, literal[1]]] begin[{] return[member[.sorted]] else begin[{] None end[}] return[binary_operation[binary_operation[member[.sorted], +, member[.sorted]], /, literal[2]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[median] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[vector] operator[SEP] { Keyword[final] Keyword[double] operator[SEP] operator[SEP] identifier[sorted] operator[=] identifier[vector] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[sorted] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[vector] operator[SEP] identifier[length] operator[%] Other[2] operator[==] Other[1] operator[SEP] { Keyword[return] identifier[sorted] operator[SEP] identifier[vector] operator[SEP] identifier[length] operator[/] Other[2] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[sorted] operator[SEP] identifier[vector] operator[SEP] identifier[length] operator[/] Other[2] operator[-] Other[1] operator[SEP] operator[+] identifier[sorted] operator[SEP] identifier[vector] operator[SEP] identifier[length] operator[/] Other[2] operator[SEP] operator[SEP] operator[/] Other[2] operator[SEP] }
public static File getJavaTools() throws MalformedURLException { File javaToolsFile = null; String javaHome = System.getProperty("java.home"); //if the tools.jar can't be found under the java home, then goto java home's parent and try again. //this case would happen when user set the jre as the java home. if (null != javaHome && !javaHome.isEmpty()) { File javaHomeFile = new File(javaHome); javaToolsFile = buildJavaToolsFile(javaHomeFile); if (null == javaToolsFile) { javaToolsFile = buildJavaToolsFile(javaHomeFile.getParentFile()); } } return javaToolsFile; }
class class_name[name] begin[{] method[getJavaTools, return_type[type[File]], modifier[public static], parameter[]] begin[{] local_variable[type[File], javaToolsFile] local_variable[type[String], javaHome] if[binary_operation[binary_operation[literal[null], !=, member[.javaHome]], &&, call[javaHome.isEmpty, parameter[]]]] begin[{] local_variable[type[File], javaHomeFile] assign[member[.javaToolsFile], call[.buildJavaToolsFile, parameter[member[.javaHomeFile]]]] if[binary_operation[literal[null], ==, member[.javaToolsFile]]] begin[{] assign[member[.javaToolsFile], call[.buildJavaToolsFile, parameter[call[javaHomeFile.getParentFile, parameter[]]]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.javaToolsFile]] end[}] END[}]
Keyword[public] Keyword[static] identifier[File] identifier[getJavaTools] operator[SEP] operator[SEP] Keyword[throws] identifier[MalformedURLException] { identifier[File] identifier[javaToolsFile] operator[=] Other[null] operator[SEP] identifier[String] identifier[javaHome] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[javaHome] operator[&&] operator[!] identifier[javaHome] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[File] identifier[javaHomeFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[javaHome] operator[SEP] operator[SEP] identifier[javaToolsFile] operator[=] identifier[buildJavaToolsFile] operator[SEP] identifier[javaHomeFile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[javaToolsFile] operator[SEP] { identifier[javaToolsFile] operator[=] identifier[buildJavaToolsFile] operator[SEP] identifier[javaHomeFile] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[javaToolsFile] operator[SEP] }
public void activate(ComponentContext compcontext) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Activating " + this.getClass().getName()); } INSTANCE.set(this); }
class class_name[name] begin[{] method[activate, return_type[void], modifier[public], parameter[compcontext]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[literal["Activating "], +, THIS[call[None.getClass, parameter[]]call[None.getName, parameter[]]]]]] else begin[{] None end[}] call[INSTANCE.set, parameter[THIS[]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[activate] operator[SEP] identifier[ComponentContext] identifier[compcontext] 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] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[INSTANCE] operator[SEP] identifier[set] operator[SEP] Keyword[this] operator[SEP] operator[SEP] }
public void processDocument(BufferedReader document) throws IOException { // Iterate over all of the parseable dependency parsed sentences in the // document. for (DependencyTreeNode[] nodes = null; (nodes = extractor.readNextTree(document)) != null; ) { // Skip empty documents. if (nodes.length == 0) continue; // Examine the paths for each word in the sentence. for (int wordIndex = 0; wordIndex < nodes.length; ++wordIndex) { String focusWord = nodes[wordIndex].word(); // Acquire the semantic vector for the focus word. SparseDoubleVector focusMeaning = getSemanticVector(focusWord); // Get all the valid paths starting from this word. The // acceptor will filter out any paths that don't contain the // semantic connections we're looking for. Iterator<DependencyPath> paths = new FilteredDependencyIterator( nodes[wordIndex], acceptor, pathLength); // For each of the paths rooted at the focus word, update the // co-occurrences of the focus word in the dimension that the // BasisFunction states. while (paths.hasNext()) { DependencyPath path = paths.next(); // Get the dimension associated with the relation and/or // words in the path from the basis function. The basis // function creates a specific dimension for the syntactic // context in order to meaningfully comparable vectors. int dimension = basisMapping.getDimension(path); // Then calculate the weight for the feature presence in the // dimension. For example, the weighter might score paths // inversely proportional to their length. double weight = weighter.scorePath(path); // Last, update the focus word's semantic vector based on // the dimension and weight synchronized(focusMeaning) { focusMeaning.add(dimension, weight); } } } } document.close(); }
class class_name[name] begin[{] method[processDocument, return_type[void], modifier[public], parameter[document]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=nodes, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=wordIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=word, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=focusWord)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=focusWord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSemanticVector, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=focusMeaning)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SparseDoubleVector, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=wordIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), MemberReference(member=acceptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pathLength, 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=FilteredDependencyIterator, sub_type=None)), name=paths)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DependencyPath, 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=paths, selectors=[], type_arguments=None), name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DependencyPath, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDimension, postfix_operators=[], prefix_operators=[], qualifier=basisMapping, selectors=[], type_arguments=None), name=dimension)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=scorePath, postfix_operators=[], prefix_operators=[], qualifier=weighter, selectors=[], type_arguments=None), name=weight)], modifiers=set(), type=BasicType(dimensions=[], name=double)), SynchronizedStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dimension, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=weight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=focusMeaning, selectors=[], type_arguments=None), label=None)], label=None, lock=MemberReference(member=focusMeaning, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=paths, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=wordIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=nodes, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=wordIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=wordIndex, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=nodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=document, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readNextTree, postfix_operators=[], prefix_operators=[], qualifier=extractor, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=nodes)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=DependencyTreeNode, sub_type=None)), update=None), label=None) call[document.close, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[processDocument] operator[SEP] identifier[BufferedReader] identifier[document] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[for] operator[SEP] identifier[DependencyTreeNode] operator[SEP] operator[SEP] identifier[nodes] operator[=] Other[null] operator[SEP] operator[SEP] identifier[nodes] operator[=] identifier[extractor] operator[SEP] identifier[readNextTree] operator[SEP] identifier[document] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[nodes] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[continue] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[wordIndex] operator[=] Other[0] operator[SEP] identifier[wordIndex] operator[<] identifier[nodes] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[wordIndex] operator[SEP] { identifier[String] identifier[focusWord] operator[=] identifier[nodes] operator[SEP] identifier[wordIndex] operator[SEP] operator[SEP] identifier[word] operator[SEP] operator[SEP] operator[SEP] identifier[SparseDoubleVector] identifier[focusMeaning] operator[=] identifier[getSemanticVector] operator[SEP] identifier[focusWord] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[DependencyPath] operator[>] identifier[paths] operator[=] Keyword[new] identifier[FilteredDependencyIterator] operator[SEP] identifier[nodes] operator[SEP] identifier[wordIndex] operator[SEP] , identifier[acceptor] , identifier[pathLength] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[paths] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[DependencyPath] identifier[path] operator[=] identifier[paths] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[dimension] operator[=] identifier[basisMapping] operator[SEP] identifier[getDimension] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[double] identifier[weight] operator[=] identifier[weighter] operator[SEP] identifier[scorePath] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[focusMeaning] operator[SEP] { identifier[focusMeaning] operator[SEP] identifier[add] operator[SEP] identifier[dimension] , identifier[weight] operator[SEP] operator[SEP] } } } } identifier[document] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] }
public static final <T> Function<T,List<T>> intoSingletonListOf(final Type<T> type) { return new IntoSingletonList<T>(); }
class class_name[name] begin[{] method[intoSingletonListOf, return_type[type[Function]], modifier[final public static], parameter[type]] begin[{] return[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=T, sub_type=None))], dimensions=None, name=IntoSingletonList, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] operator[<] identifier[T] operator[>] identifier[Function] operator[<] identifier[T] , identifier[List] operator[<] identifier[T] operator[>] operator[>] identifier[intoSingletonListOf] operator[SEP] Keyword[final] identifier[Type] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] { Keyword[return] Keyword[new] identifier[IntoSingletonList] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] }
static Integer parseTimeConstraint(Instance instance, String constraint, ConnectionManager cm) throws KnowledgeSourceReadException { Integer constraintValue = null; if (instance != null && constraint != null) { constraintValue = (Integer) cm.getOwnSlotValue(instance, cm.getSlot(constraint)); } return constraintValue; }
class class_name[name] begin[{] method[parseTimeConstraint, return_type[type[Integer]], modifier[static], parameter[instance, constraint, cm]] begin[{] local_variable[type[Integer], constraintValue] if[binary_operation[binary_operation[member[.instance], !=, literal[null]], &&, binary_operation[member[.constraint], !=, literal[null]]]] begin[{] assign[member[.constraintValue], Cast(expression=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=constraint, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSlot, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[], type_arguments=None)], member=getOwnSlotValue, postfix_operators=[], prefix_operators=[], qualifier=cm, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))] else begin[{] None end[}] return[member[.constraintValue]] end[}] END[}]
Keyword[static] identifier[Integer] identifier[parseTimeConstraint] operator[SEP] identifier[Instance] identifier[instance] , identifier[String] identifier[constraint] , identifier[ConnectionManager] identifier[cm] operator[SEP] Keyword[throws] identifier[KnowledgeSourceReadException] { identifier[Integer] identifier[constraintValue] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[instance] operator[!=] Other[null] operator[&&] identifier[constraint] operator[!=] Other[null] operator[SEP] { identifier[constraintValue] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[cm] operator[SEP] identifier[getOwnSlotValue] operator[SEP] identifier[instance] , identifier[cm] operator[SEP] identifier[getSlot] operator[SEP] identifier[constraint] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[constraintValue] operator[SEP] }
private ByteArrayInputStream generateThumbImageByPercent(InputStream inputStream, ThumbImage thumbImage) throws IOException { LOGGER.debug("根据传入比例生成缩略图"); // 在内存当中生成缩略图 ByteArrayOutputStream out = new ByteArrayOutputStream(); //@formatter:off Thumbnails .of(inputStream) .scale(thumbImage.getPercent()) .toOutputStream(out); //@formatter:on return new ByteArrayInputStream(out.toByteArray()); }
class class_name[name] begin[{] method[generateThumbImageByPercent, return_type[type[ByteArrayInputStream]], modifier[private], parameter[inputStream, thumbImage]] begin[{] call[LOGGER.debug, parameter[literal["根据传入比例生成缩略图"]]] local_variable[type[ByteArrayOutputStream], out] call[Thumbnails.of, parameter[member[.inputStream]]] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ByteArrayInputStream, sub_type=None))] end[}] END[}]
Keyword[private] identifier[ByteArrayInputStream] identifier[generateThumbImageByPercent] operator[SEP] identifier[InputStream] identifier[inputStream] , identifier[ThumbImage] identifier[thumbImage] operator[SEP] Keyword[throws] identifier[IOException] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[ByteArrayOutputStream] identifier[out] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[Thumbnails] operator[SEP] identifier[of] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] identifier[scale] operator[SEP] identifier[thumbImage] operator[SEP] identifier[getPercent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[toOutputStream] operator[SEP] identifier[out] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[out] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void parseBodyMultipart() { if (undecodedChunk == null || undecodedChunk.readableBytes() == 0) { // nothing to decode return; } InterfaceHttpData data = decodeMultipart(currentStatus); while (data != null) { addHttpData(data); if (currentStatus == MultiPartStatus.PREEPILOGUE || currentStatus == MultiPartStatus.EPILOGUE) { break; } data = decodeMultipart(currentStatus); } }
class class_name[name] begin[{] method[parseBodyMultipart, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[binary_operation[member[.undecodedChunk], ==, literal[null]], ||, binary_operation[call[undecodedChunk.readableBytes, parameter[]], ==, literal[0]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[InterfaceHttpData], data] while[binary_operation[member[.data], !=, literal[null]]] begin[{] call[.addHttpData, parameter[member[.data]]] if[binary_operation[binary_operation[member[.currentStatus], ==, member[MultiPartStatus.PREEPILOGUE]], ||, binary_operation[member[.currentStatus], ==, member[MultiPartStatus.EPILOGUE]]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] assign[member[.data], call[.decodeMultipart, parameter[member[.currentStatus]]]] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[parseBodyMultipart] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[undecodedChunk] operator[==] Other[null] operator[||] identifier[undecodedChunk] operator[SEP] identifier[readableBytes] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] operator[SEP] } identifier[InterfaceHttpData] identifier[data] operator[=] identifier[decodeMultipart] operator[SEP] identifier[currentStatus] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[data] operator[!=] Other[null] operator[SEP] { identifier[addHttpData] operator[SEP] identifier[data] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentStatus] operator[==] identifier[MultiPartStatus] operator[SEP] identifier[PREEPILOGUE] operator[||] identifier[currentStatus] operator[==] identifier[MultiPartStatus] operator[SEP] identifier[EPILOGUE] operator[SEP] { Keyword[break] operator[SEP] } identifier[data] operator[=] identifier[decodeMultipart] operator[SEP] identifier[currentStatus] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") public <T> T proxy(final Object delegate, Class<?> [] interfaces) { return (T)Proxy.newProxyInstance (delegate.getClass().getClassLoader(), interfaces, new ProxyInvocationHandler(delegate)); }
class class_name[name] begin[{] method[proxy, return_type[type[T]], modifier[public], parameter[delegate, interfaces]] begin[{] return[Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=delegate, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=interfaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=delegate, 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=ProxyInvocationHandler, sub_type=None))], member=newProxyInstance, postfix_operators=[], prefix_operators=[], qualifier=Proxy, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[T] operator[>] identifier[T] identifier[proxy] operator[SEP] Keyword[final] identifier[Object] identifier[delegate] , identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[interfaces] operator[SEP] { Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[Proxy] operator[SEP] identifier[newProxyInstance] operator[SEP] identifier[delegate] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] , identifier[interfaces] , Keyword[new] identifier[ProxyInvocationHandler] operator[SEP] identifier[delegate] operator[SEP] operator[SEP] operator[SEP] }
public void updateChain(ChainData inputChain) { String chainname = inputChain.getName(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "updateChain: " + chainname); } // Find the chain in the group. for (int i = 0; i < this.chainArray.length; i++) { if (chainname.equals(this.chainArray[i].getName())) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Updating chain " + chainname + " in group " + getName()); } // Found the chain. Update the array with the new data. this.chainArray[i] = inputChain; break; } } }
class class_name[name] begin[{] method[updateChain, return_type[void], modifier[public], parameter[inputChain]] begin[{] local_variable[type[String], chainname] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[literal["updateChain: "], +, member[.chainname]]]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=chainArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=chainname, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=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="Updating chain "), operandr=MemberReference(member=chainname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" in group "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=chainArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=inputChain, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=chainArray, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=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[public] Keyword[void] identifier[updateChain] operator[SEP] identifier[ChainData] identifier[inputChain] operator[SEP] { identifier[String] identifier[chainname] operator[=] identifier[inputChain] operator[SEP] identifier[getName] operator[SEP] 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[+] identifier[chainname] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[chainArray] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[chainname] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[chainArray] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] 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[+] identifier[chainname] operator[+] literal[String] operator[+] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[chainArray] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[inputChain] operator[SEP] Keyword[break] operator[SEP] } } }
public List<Classification> listAll(String classificationName) { assertArgumentNotNull("classificationName", classificationName); return findClassificationMeta(classificationName, () -> { return "listAll('" + classificationName + "')"; }).listAll(); }
class class_name[name] begin[{] method[listAll, return_type[type[List]], modifier[public], parameter[classificationName]] begin[{] call[.assertArgumentNotNull, parameter[literal["classificationName"], member[.classificationName]]] return[call[.findClassificationMeta, parameter[member[.classificationName], LambdaExpression(body=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="listAll('"), operandr=MemberReference(member=classificationName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="')"), operator=+), label=None)], parameters=[])]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Classification] operator[>] identifier[listAll] operator[SEP] identifier[String] identifier[classificationName] operator[SEP] { identifier[assertArgumentNotNull] operator[SEP] literal[String] , identifier[classificationName] operator[SEP] operator[SEP] Keyword[return] identifier[findClassificationMeta] operator[SEP] identifier[classificationName] , operator[SEP] operator[SEP] operator[->] { Keyword[return] literal[String] operator[+] identifier[classificationName] operator[+] literal[String] operator[SEP] } operator[SEP] operator[SEP] identifier[listAll] operator[SEP] operator[SEP] operator[SEP] }
public static String OSX_DOCK_ICON(MinecraftDirectory minecraftDir, Version version) throws IOException { Set<Asset> assetIndex = Versions.resolveAssets(minecraftDir, version); if (assetIndex == null) return null; return OSX_DOCK_ICON(minecraftDir, assetIndex); }
class class_name[name] begin[{] method[OSX_DOCK_ICON, return_type[type[String]], modifier[public static], parameter[minecraftDir, version]] begin[{] local_variable[type[Set], assetIndex] if[binary_operation[member[.assetIndex], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[.OSX_DOCK_ICON, parameter[member[.minecraftDir], member[.assetIndex]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[OSX_DOCK_ICON] operator[SEP] identifier[MinecraftDirectory] identifier[minecraftDir] , identifier[Version] identifier[version] operator[SEP] Keyword[throws] identifier[IOException] { identifier[Set] operator[<] identifier[Asset] operator[>] identifier[assetIndex] operator[=] identifier[Versions] operator[SEP] identifier[resolveAssets] operator[SEP] identifier[minecraftDir] , identifier[version] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[assetIndex] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] identifier[OSX_DOCK_ICON] operator[SEP] identifier[minecraftDir] , identifier[assetIndex] operator[SEP] operator[SEP] }
void handleGet( Object value, MatchSpaceKey msg, EvalCache cache, Object contextValue, SearchResults result) throws MatchingException, BadMessageFormatMatchingException { if (tc.isEntryEnabled()) tc.entry(this,cclass, "handleGet", new Object[] {value,msg,cache,contextValue,result} ); handleEqualityGet(value, msg, cache, contextValue, result); if (tc.isEntryEnabled()) tc.exit(this,cclass, "handleGet"); }
class class_name[name] begin[{] method[handleGet, return_type[void], modifier[default], parameter[value, msg, cache, contextValue, result]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[tc.entry, parameter[THIS[], member[.cclass], literal["handleGet"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=cache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contextValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] call[.handleEqualityGet, parameter[member[.value], member[.msg], member[.cache], member[.contextValue], member[.result]]] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[tc.exit, parameter[THIS[], member[.cclass], literal["handleGet"]]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[handleGet] operator[SEP] identifier[Object] identifier[value] , identifier[MatchSpaceKey] identifier[msg] , identifier[EvalCache] identifier[cache] , identifier[Object] identifier[contextValue] , identifier[SearchResults] identifier[result] operator[SEP] Keyword[throws] identifier[MatchingException] , identifier[BadMessageFormatMatchingException] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[tc] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[value] , identifier[msg] , identifier[cache] , identifier[contextValue] , identifier[result] } operator[SEP] operator[SEP] identifier[handleEqualityGet] operator[SEP] identifier[value] , identifier[msg] , identifier[cache] , identifier[contextValue] , identifier[result] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[tc] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] operator[SEP] operator[SEP] }
public void marshall(BatchCheckLayerAvailabilityRequest batchCheckLayerAvailabilityRequest, ProtocolMarshaller protocolMarshaller) { if (batchCheckLayerAvailabilityRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(batchCheckLayerAvailabilityRequest.getRegistryId(), REGISTRYID_BINDING); protocolMarshaller.marshall(batchCheckLayerAvailabilityRequest.getRepositoryName(), REPOSITORYNAME_BINDING); protocolMarshaller.marshall(batchCheckLayerAvailabilityRequest.getLayerDigests(), LAYERDIGESTS_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[batchCheckLayerAvailabilityRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.batchCheckLayerAvailabilityRequest], ==, 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=getRegistryId, postfix_operators=[], prefix_operators=[], qualifier=batchCheckLayerAvailabilityRequest, selectors=[], type_arguments=None), MemberReference(member=REGISTRYID_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=getRepositoryName, postfix_operators=[], prefix_operators=[], qualifier=batchCheckLayerAvailabilityRequest, selectors=[], type_arguments=None), MemberReference(member=REPOSITORYNAME_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=getLayerDigests, postfix_operators=[], prefix_operators=[], qualifier=batchCheckLayerAvailabilityRequest, selectors=[], type_arguments=None), MemberReference(member=LAYERDIGESTS_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[BatchCheckLayerAvailabilityRequest] identifier[batchCheckLayerAvailabilityRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[batchCheckLayerAvailabilityRequest] 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[batchCheckLayerAvailabilityRequest] operator[SEP] identifier[getRegistryId] operator[SEP] operator[SEP] , identifier[REGISTRYID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[batchCheckLayerAvailabilityRequest] operator[SEP] identifier[getRepositoryName] operator[SEP] operator[SEP] , identifier[REPOSITORYNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[batchCheckLayerAvailabilityRequest] operator[SEP] identifier[getLayerDigests] operator[SEP] operator[SEP] , identifier[LAYERDIGESTS_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 Oneof getOneof(String name) { for (Oneof oneof : getOneofs()) { if (name.equals(oneof.getName())) { return oneof; } } return null; }
class class_name[name] begin[{] method[getOneof, return_type[type[Oneof]], modifier[public], parameter[name]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=oneof, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=oneof, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getOneofs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=oneof)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Oneof, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[Oneof] identifier[getOneof] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[for] operator[SEP] identifier[Oneof] identifier[oneof] operator[:] identifier[getOneofs] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[oneof] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[oneof] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public List<PDefinition> getDefinitions(PPattern rp, PType ptype, NameScope scope) { PDefinitionSet set = af.createPDefinitionSet(); set.addAll(af.createPPatternAssistant().getAllDefinitions(rp, ptype, scope)); List<PDefinition> result = new Vector<PDefinition>(set); return result; }
class class_name[name] begin[{] method[getDefinitions, return_type[type[List]], modifier[public], parameter[rp, ptype, scope]] begin[{] local_variable[type[PDefinitionSet], set] call[set.addAll, parameter[call[af.createPPatternAssistant, parameter[]]]] local_variable[type[List], result] return[member[.result]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[PDefinition] operator[>] identifier[getDefinitions] operator[SEP] identifier[PPattern] identifier[rp] , identifier[PType] identifier[ptype] , identifier[NameScope] identifier[scope] operator[SEP] { identifier[PDefinitionSet] identifier[set] operator[=] identifier[af] operator[SEP] identifier[createPDefinitionSet] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[addAll] operator[SEP] identifier[af] operator[SEP] identifier[createPPatternAssistant] operator[SEP] operator[SEP] operator[SEP] identifier[getAllDefinitions] operator[SEP] identifier[rp] , identifier[ptype] , identifier[scope] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[PDefinition] operator[>] identifier[result] operator[=] Keyword[new] identifier[Vector] operator[<] identifier[PDefinition] operator[>] operator[SEP] identifier[set] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public boolean revert() { try { setWrongValueMessage(null); setValue(propInfo.getPropertyValue(target)); updateValue(); return true; } catch (Exception e) { setWrongValueException(e); return false; } }
class class_name[name] begin[{] method[revert, return_type[type[boolean]], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setWrongValueMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPropertyValue, postfix_operators=[], prefix_operators=[], qualifier=propInfo, selectors=[], type_arguments=None)], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=updateValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setWrongValueException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[boolean] identifier[revert] operator[SEP] operator[SEP] { Keyword[try] { identifier[setWrongValueMessage] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[setValue] operator[SEP] identifier[propInfo] operator[SEP] identifier[getPropertyValue] operator[SEP] identifier[target] operator[SEP] operator[SEP] operator[SEP] identifier[updateValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[setWrongValueException] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } }
@Override public void initialize(double[] initial, int numberOfParameters, double minimumFunctionValue) { super.initialize(initial, numberOfParameters,minimumFunctionValue); y.reshape(numberOfParameters,1); xPrevious.reshape(numberOfParameters,1); x.reshape(numberOfParameters,1); // set the previous gradient to zero gradientPrevious.reshape(numberOfParameters,1); gradientPrevious.zero(); firstIteration = true; }
class class_name[name] begin[{] method[initialize, return_type[void], modifier[public], parameter[initial, numberOfParameters, minimumFunctionValue]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=initial, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numberOfParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=minimumFunctionValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=initialize, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[y.reshape, parameter[member[.numberOfParameters], literal[1]]] call[xPrevious.reshape, parameter[member[.numberOfParameters], literal[1]]] call[x.reshape, parameter[member[.numberOfParameters], literal[1]]] call[gradientPrevious.reshape, parameter[member[.numberOfParameters], literal[1]]] call[gradientPrevious.zero, parameter[]] assign[member[.firstIteration], literal[true]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[initialize] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[initial] , Keyword[int] identifier[numberOfParameters] , Keyword[double] identifier[minimumFunctionValue] operator[SEP] { Keyword[super] operator[SEP] identifier[initialize] operator[SEP] identifier[initial] , identifier[numberOfParameters] , identifier[minimumFunctionValue] operator[SEP] operator[SEP] identifier[y] operator[SEP] identifier[reshape] operator[SEP] identifier[numberOfParameters] , Other[1] operator[SEP] operator[SEP] identifier[xPrevious] operator[SEP] identifier[reshape] operator[SEP] identifier[numberOfParameters] , Other[1] operator[SEP] operator[SEP] identifier[x] operator[SEP] identifier[reshape] operator[SEP] identifier[numberOfParameters] , Other[1] operator[SEP] operator[SEP] identifier[gradientPrevious] operator[SEP] identifier[reshape] operator[SEP] identifier[numberOfParameters] , Other[1] operator[SEP] operator[SEP] identifier[gradientPrevious] operator[SEP] identifier[zero] operator[SEP] operator[SEP] operator[SEP] identifier[firstIteration] operator[=] literal[boolean] operator[SEP] }
public static String quote(String s) { StringBuilder buf = new StringBuilder(); for (int i = 0; i < s.length(); i++) { buf.append(quote(s.charAt(i))); } return buf.toString(); }
class class_name[name] begin[{] method[quote, return_type[type[String]], modifier[public static], parameter[s]] begin[{] local_variable[type[StringBuilder], buf] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)], member=quote, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[buf.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[quote] operator[SEP] identifier[String] identifier[s] operator[SEP] { identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[quote] operator[SEP] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
@Override public Set<Method> getMethods(MethodFilter methodFilter) { return MethodUtils.getMethods(target, methodFilter); }
class class_name[name] begin[{] method[getMethods, return_type[type[Set]], modifier[public], parameter[methodFilter]] begin[{] return[call[MethodUtils.getMethods, parameter[member[.target], member[.methodFilter]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Set] operator[<] identifier[Method] operator[>] identifier[getMethods] operator[SEP] identifier[MethodFilter] identifier[methodFilter] operator[SEP] { Keyword[return] identifier[MethodUtils] operator[SEP] identifier[getMethods] operator[SEP] identifier[target] , identifier[methodFilter] operator[SEP] operator[SEP] }
public List<ChallengeHandler> lookup(String location) { List<ChallengeHandler> result = Collections.emptyList(); if (location != null) { Node<ChallengeHandler, UriElement> resultNode = findBestMatchingNode(location); if (resultNode != null) { return resultNode.getValues(); } } return result; }
class class_name[name] begin[{] method[lookup, return_type[type[List]], modifier[public], parameter[location]] begin[{] local_variable[type[List], result] if[binary_operation[member[.location], !=, literal[null]]] begin[{] local_variable[type[Node], resultNode] if[binary_operation[member[.resultNode], !=, literal[null]]] begin[{] return[call[resultNode.getValues, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[ChallengeHandler] operator[>] identifier[lookup] operator[SEP] identifier[String] identifier[location] operator[SEP] { identifier[List] operator[<] identifier[ChallengeHandler] operator[>] identifier[result] operator[=] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[location] operator[!=] Other[null] operator[SEP] { identifier[Node] operator[<] identifier[ChallengeHandler] , identifier[UriElement] operator[>] identifier[resultNode] operator[=] identifier[findBestMatchingNode] operator[SEP] identifier[location] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resultNode] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[resultNode] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public String putTempStream(Context context, InputStream in) throws ServerException { return worker.putTempStream(context, in); }
class class_name[name] begin[{] method[putTempStream, return_type[type[String]], modifier[public], parameter[context, in]] begin[{] return[call[worker.putTempStream, parameter[member[.context], member[.in]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[putTempStream] operator[SEP] identifier[Context] identifier[context] , identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[ServerException] { Keyword[return] identifier[worker] operator[SEP] identifier[putTempStream] operator[SEP] identifier[context] , identifier[in] operator[SEP] operator[SEP] }
@BetaApi public final ListSslPoliciesPagedResponse listSslPolicies(String project) { ListSslPoliciesHttpRequest request = ListSslPoliciesHttpRequest.newBuilder().setProject(project).build(); return listSslPolicies(request); }
class class_name[name] begin[{] method[listSslPolicies, return_type[type[ListSslPoliciesPagedResponse]], modifier[final public], parameter[project]] begin[{] local_variable[type[ListSslPoliciesHttpRequest], request] return[call[.listSslPolicies, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[ListSslPoliciesPagedResponse] identifier[listSslPolicies] operator[SEP] identifier[String] identifier[project] operator[SEP] { identifier[ListSslPoliciesHttpRequest] identifier[request] operator[=] identifier[ListSslPoliciesHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setProject] operator[SEP] identifier[project] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[listSslPolicies] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public synchronized void lock() { if (tc.isEntryEnabled()) SibTr.entry(tc, "lock", this); boolean interrupted = false; // Attempt to get a lock on the mutex. // if we fail, then that is because the lock // must be held exclusively. while (!tryLock()) try { // Wait for 1 second then try again. if (tc.isDebugEnabled()) SibTr.debug(tc, "Waiting for lock"); wait(1000); } catch (InterruptedException e) { // No FFDC code needed interrupted = true; } if (interrupted) Thread.currentThread().interrupt(); if (tc.isEntryEnabled()) SibTr.exit(tc, "lock"); }
class class_name[name] begin[{] method[lock, return_type[void], modifier[synchronized public], parameter[]] begin[{] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["lock"], THIS[]]] else begin[{] None end[}] local_variable[type[boolean], interrupted] while[call[.tryLock, parameter[]]] begin[{] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Waiting for lock")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=SibTr, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000)], member=wait, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=interrupted, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) end[}] if[member[.interrupted]] begin[{] call[Thread.currentThread, parameter[]] else begin[{] None end[}] if[call[tc.isEntryEnabled, parameter[]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["lock"]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[lock] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[boolean] identifier[interrupted] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[tryLock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[wait] operator[SEP] Other[1000] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[interrupted] operator[=] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[interrupted] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] }
public <T> Graph<K, VV, EV> joinWithEdges(DataSet<Tuple3<K, K, T>> inputDataSet, final EdgeJoinFunction<EV, T> edgeJoinFunction) { DataSet<Edge<K, EV>> resultedEdges = this.getEdges() .coGroup(inputDataSet).where(0, 1).equalTo(0, 1) .with(new ApplyCoGroupToEdgeValues<>(edgeJoinFunction)) .name("Join with edges"); return new Graph<>(this.vertices, resultedEdges, this.context); }
class class_name[name] begin[{] method[joinWithEdges, return_type[type[Graph]], modifier[public], parameter[inputDataSet, edgeJoinFunction]] begin[{] local_variable[type[DataSet], resultedEdges] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=vertices, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=resultedEdges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=context, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Graph, sub_type=None))] end[}] END[}]
Keyword[public] operator[<] identifier[T] operator[>] identifier[Graph] operator[<] identifier[K] , identifier[VV] , identifier[EV] operator[>] identifier[joinWithEdges] operator[SEP] identifier[DataSet] operator[<] identifier[Tuple3] operator[<] identifier[K] , identifier[K] , identifier[T] operator[>] operator[>] identifier[inputDataSet] , Keyword[final] identifier[EdgeJoinFunction] operator[<] identifier[EV] , identifier[T] operator[>] identifier[edgeJoinFunction] operator[SEP] { identifier[DataSet] operator[<] identifier[Edge] operator[<] identifier[K] , identifier[EV] operator[>] operator[>] identifier[resultedEdges] operator[=] Keyword[this] operator[SEP] identifier[getEdges] operator[SEP] operator[SEP] operator[SEP] identifier[coGroup] operator[SEP] identifier[inputDataSet] operator[SEP] operator[SEP] identifier[where] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[equalTo] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[with] operator[SEP] Keyword[new] identifier[ApplyCoGroupToEdgeValues] operator[<] operator[>] operator[SEP] identifier[edgeJoinFunction] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Graph] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[vertices] , identifier[resultedEdges] , Keyword[this] operator[SEP] identifier[context] operator[SEP] operator[SEP] }
static Given given(String text) { reset(); final Given given = new Given(text); sRoot = given; return given; }
class class_name[name] begin[{] method[given, return_type[type[Given]], modifier[static], parameter[text]] begin[{] call[.reset, parameter[]] local_variable[type[Given], given] assign[member[.sRoot], member[.given]] return[member[.given]] end[}] END[}]
Keyword[static] identifier[Given] identifier[given] operator[SEP] identifier[String] identifier[text] operator[SEP] { identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Given] identifier[given] operator[=] Keyword[new] identifier[Given] operator[SEP] identifier[text] operator[SEP] operator[SEP] identifier[sRoot] operator[=] identifier[given] operator[SEP] Keyword[return] identifier[given] operator[SEP] }
protected boolean checkHandler(ZoneHandlerClass handler, ApiZone apiZone) { return apiZone.getName().startsWith(handler.getZoneName()); }
class class_name[name] begin[{] method[checkHandler, return_type[type[boolean]], modifier[protected], parameter[handler, apiZone]] begin[{] return[call[apiZone.getName, parameter[]]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[checkHandler] operator[SEP] identifier[ZoneHandlerClass] identifier[handler] , identifier[ApiZone] identifier[apiZone] operator[SEP] { Keyword[return] identifier[apiZone] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] identifier[handler] operator[SEP] identifier[getZoneName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static List<List<CDKRMap>> getIsomorphMaps(IAtomContainer sourceGraph, IAtomContainer targetGraph, boolean shouldMatchBonds) throws CDKException { return search(sourceGraph, targetGraph, getBitSet(sourceGraph), getBitSet(targetGraph), true, true, shouldMatchBonds); }
class class_name[name] begin[{] method[getIsomorphMaps, return_type[type[List]], modifier[public static], parameter[sourceGraph, targetGraph, shouldMatchBonds]] begin[{] return[call[.search, parameter[member[.sourceGraph], member[.targetGraph], call[.getBitSet, parameter[member[.sourceGraph]]], call[.getBitSet, parameter[member[.targetGraph]]], literal[true], literal[true], member[.shouldMatchBonds]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[List] operator[<] identifier[CDKRMap] operator[>] operator[>] identifier[getIsomorphMaps] operator[SEP] identifier[IAtomContainer] identifier[sourceGraph] , identifier[IAtomContainer] identifier[targetGraph] , Keyword[boolean] identifier[shouldMatchBonds] operator[SEP] Keyword[throws] identifier[CDKException] { Keyword[return] identifier[search] operator[SEP] identifier[sourceGraph] , identifier[targetGraph] , identifier[getBitSet] operator[SEP] identifier[sourceGraph] operator[SEP] , identifier[getBitSet] operator[SEP] identifier[targetGraph] operator[SEP] , literal[boolean] , literal[boolean] , identifier[shouldMatchBonds] operator[SEP] operator[SEP] }
@Nullable private ServerHolder assignPrimary( final DruidCoordinatorRuntimeParams params, final DataSegment segment ) { ServerHolder topCandidate = null; for (final Object2IntMap.Entry<String> entry : targetReplicants.object2IntEntrySet()) { final int targetReplicantsInTier = entry.getIntValue(); // sanity check: target number of replicants should be more than zero. if (targetReplicantsInTier <= 0) { continue; } final String tier = entry.getKey(); String noAvailability = StringUtils.format( "No available [%s] servers or node capacity to assign primary segment[%s]! Expected Replicants[%d]", tier, segment.getId(), targetReplicantsInTier ); final List<ServerHolder> holders = getFilteredHolders( tier, params.getDruidCluster(), createLoadQueueSizeLimitingPredicate(params) ); // no holders satisfy the predicate if (holders.isEmpty()) { log.warn(noAvailability); continue; } final ServerHolder candidate = params.getBalancerStrategy().findNewSegmentHomeReplicator(segment, holders); if (candidate == null) { log.warn(noAvailability); } else { // cache the result for later use. strategyCache.put(tier, candidate); if (topCandidate == null || candidate.getServer().getPriority() > topCandidate.getServer().getPriority()) { topCandidate = candidate; } } } if (topCandidate != null) { // remove tier for primary replica strategyCache.remove(topCandidate.getServer().getTier()); log.info( "Assigning 'primary' for segment [%s] to server [%s] in tier [%s]", segment.getId(), topCandidate.getServer().getName(), topCandidate.getServer().getTier() ); topCandidate.getPeon().loadSegment(segment, null); } return topCandidate; }
class class_name[name] begin[{] method[assignPrimary, return_type[type[ServerHolder]], modifier[private], parameter[params, segment]] begin[{] local_variable[type[ServerHolder], topCandidate] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getIntValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=targetReplicantsInTier)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=targetReplicantsInTier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=tier)], modifiers={'final'}, 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="No available [%s] servers or node capacity to assign primary segment[%s]! Expected Replicants[%d]"), MemberReference(member=tier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=segment, selectors=[], type_arguments=None), MemberReference(member=targetReplicantsInTier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), name=noAvailability)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=tier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getDruidCluster, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=params, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createLoadQueueSizeLimitingPredicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getFilteredHolders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=holders)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ServerHolder, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=holders, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=noAvailability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getBalancerStrategy, postfix_operators=[], prefix_operators=[], qualifier=params, selectors=[MethodInvocation(arguments=[MemberReference(member=segment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=holders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findNewSegmentHomeReplicator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=candidate)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ServerHolder, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=strategyCache, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=topCandidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getServer, postfix_operators=[], prefix_operators=[], qualifier=candidate, selectors=[MethodInvocation(arguments=[], member=getPriority, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getServer, postfix_operators=[], prefix_operators=[], qualifier=topCandidate, selectors=[MethodInvocation(arguments=[], member=getPriority, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=>), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=topCandidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=noAvailability, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=object2IntEntrySet, postfix_operators=[], prefix_operators=[], qualifier=targetReplicants, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Object2IntMap, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) if[binary_operation[member[.topCandidate], !=, literal[null]]] begin[{] call[strategyCache.remove, parameter[call[topCandidate.getServer, parameter[]]]] call[log.info, parameter[literal["Assigning 'primary' for segment [%s] to server [%s] in tier [%s]"], call[segment.getId, parameter[]], call[topCandidate.getServer, parameter[]], call[topCandidate.getServer, parameter[]]]] call[topCandidate.getPeon, parameter[]] else begin[{] None end[}] return[member[.topCandidate]] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[private] identifier[ServerHolder] identifier[assignPrimary] operator[SEP] Keyword[final] identifier[DruidCoordinatorRuntimeParams] identifier[params] , Keyword[final] identifier[DataSegment] identifier[segment] operator[SEP] { identifier[ServerHolder] identifier[topCandidate] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Object2IntMap] operator[SEP] identifier[Entry] operator[<] identifier[String] operator[>] identifier[entry] operator[:] identifier[targetReplicants] operator[SEP] identifier[object2IntEntrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[int] identifier[targetReplicantsInTier] operator[=] identifier[entry] operator[SEP] identifier[getIntValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[targetReplicantsInTier] operator[<=] Other[0] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[final] identifier[String] identifier[tier] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[noAvailability] operator[=] identifier[StringUtils] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[tier] , identifier[segment] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[targetReplicantsInTier] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[ServerHolder] operator[>] identifier[holders] operator[=] identifier[getFilteredHolders] operator[SEP] identifier[tier] , identifier[params] operator[SEP] identifier[getDruidCluster] operator[SEP] operator[SEP] , identifier[createLoadQueueSizeLimitingPredicate] operator[SEP] identifier[params] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[holders] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] identifier[noAvailability] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[final] identifier[ServerHolder] identifier[candidate] operator[=] identifier[params] operator[SEP] identifier[getBalancerStrategy] operator[SEP] operator[SEP] operator[SEP] identifier[findNewSegmentHomeReplicator] operator[SEP] identifier[segment] , identifier[holders] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[candidate] operator[==] Other[null] operator[SEP] { identifier[log] operator[SEP] identifier[warn] operator[SEP] identifier[noAvailability] operator[SEP] operator[SEP] } Keyword[else] { identifier[strategyCache] operator[SEP] identifier[put] operator[SEP] identifier[tier] , identifier[candidate] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[topCandidate] operator[==] Other[null] operator[||] identifier[candidate] operator[SEP] identifier[getServer] operator[SEP] operator[SEP] operator[SEP] identifier[getPriority] operator[SEP] operator[SEP] operator[>] identifier[topCandidate] operator[SEP] identifier[getServer] operator[SEP] operator[SEP] operator[SEP] identifier[getPriority] operator[SEP] operator[SEP] operator[SEP] { identifier[topCandidate] operator[=] identifier[candidate] operator[SEP] } } } Keyword[if] operator[SEP] identifier[topCandidate] operator[!=] Other[null] operator[SEP] { identifier[strategyCache] operator[SEP] identifier[remove] operator[SEP] identifier[topCandidate] operator[SEP] identifier[getServer] operator[SEP] operator[SEP] operator[SEP] identifier[getTier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[segment] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[topCandidate] operator[SEP] identifier[getServer] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[topCandidate] operator[SEP] identifier[getServer] operator[SEP] operator[SEP] operator[SEP] identifier[getTier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[topCandidate] operator[SEP] identifier[getPeon] operator[SEP] operator[SEP] operator[SEP] identifier[loadSegment] operator[SEP] identifier[segment] , Other[null] operator[SEP] operator[SEP] } Keyword[return] identifier[topCandidate] operator[SEP] }
@Override public void truncateFile(String groupName, String path, long truncatedFileSize) { StorageNodeInfo client = trackerClient.getUpdateStorage(groupName, path); StorageTruncateCommand command = new StorageTruncateCommand(path, truncatedFileSize); connectionManager.executeFdfsCmd(client.getInetSocketAddress(), command); }
class class_name[name] begin[{] method[truncateFile, return_type[void], modifier[public], parameter[groupName, path, truncatedFileSize]] begin[{] local_variable[type[StorageNodeInfo], client] local_variable[type[StorageTruncateCommand], command] call[connectionManager.executeFdfsCmd, parameter[call[client.getInetSocketAddress, parameter[]], member[.command]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[truncateFile] operator[SEP] identifier[String] identifier[groupName] , identifier[String] identifier[path] , Keyword[long] identifier[truncatedFileSize] operator[SEP] { identifier[StorageNodeInfo] identifier[client] operator[=] identifier[trackerClient] operator[SEP] identifier[getUpdateStorage] operator[SEP] identifier[groupName] , identifier[path] operator[SEP] operator[SEP] identifier[StorageTruncateCommand] identifier[command] operator[=] Keyword[new] identifier[StorageTruncateCommand] operator[SEP] identifier[path] , identifier[truncatedFileSize] operator[SEP] operator[SEP] identifier[connectionManager] operator[SEP] identifier[executeFdfsCmd] operator[SEP] identifier[client] operator[SEP] identifier[getInetSocketAddress] operator[SEP] operator[SEP] , identifier[command] operator[SEP] operator[SEP] }
public static Long attemptUUIDParseHigh(BufferedString str) { final byte[] buf = str.getBuffer(); int i=str.getOffset(); if ( i== -1 ) return markBad(str); long hi=0; if( buf[i++]!='-' ) return markBad(str); hi = get2(hi,buf,(i+=2)-2); hi = get2(hi,buf,(i+=2)-2); if( buf[i++]!='-' ) return markBad(str); hi = get2(hi,buf,(i+=2)-2); hi = get2(hi,buf,(i+=2)-2); hi = get2(hi,buf,(i+=2)-2); hi = get2(hi,buf,(i+=2)-2); hi = get2(hi,buf,(i+=2)-2); return attemptUUIDParseEnd(str, hi, buf, i); }
class class_name[name] begin[{] method[attemptUUIDParseHigh, return_type[type[Long]], modifier[public static], parameter[str]] begin[{] local_variable[type[byte], buf] local_variable[type[int], i] if[binary_operation[member[.i], ==, literal[1]]] begin[{] return[call[.markBad, parameter[member[.str]]]] else begin[{] None end[}] local_variable[type[long], hi] if[binary_operation[member[.buf], !=, literal['-']]] begin[{] return[call[.markBad, parameter[member[.str]]]] else begin[{] None end[}] assign[member[.hi], call[.get2, parameter[member[.hi], member[.buf], binary_operation[assign[member[.i], literal[2]], -, literal[2]]]]] assign[member[.hi], call[.get2, parameter[member[.hi], member[.buf], binary_operation[assign[member[.i], literal[2]], -, literal[2]]]]] if[binary_operation[member[.buf], !=, literal['-']]] begin[{] return[call[.markBad, parameter[member[.str]]]] else begin[{] None end[}] assign[member[.hi], call[.get2, parameter[member[.hi], member[.buf], binary_operation[assign[member[.i], literal[2]], -, literal[2]]]]] assign[member[.hi], call[.get2, parameter[member[.hi], member[.buf], binary_operation[assign[member[.i], literal[2]], -, literal[2]]]]] assign[member[.hi], call[.get2, parameter[member[.hi], member[.buf], binary_operation[assign[member[.i], literal[2]], -, literal[2]]]]] assign[member[.hi], call[.get2, parameter[member[.hi], member[.buf], binary_operation[assign[member[.i], literal[2]], -, literal[2]]]]] assign[member[.hi], call[.get2, parameter[member[.hi], member[.buf], binary_operation[assign[member[.i], literal[2]], -, literal[2]]]]] return[call[.attemptUUIDParseEnd, parameter[member[.str], member[.hi], member[.buf], member[.i]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Long] identifier[attemptUUIDParseHigh] operator[SEP] identifier[BufferedString] identifier[str] operator[SEP] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] identifier[str] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[str] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] operator[-] Other[1] operator[SEP] Keyword[return] identifier[markBad] operator[SEP] identifier[str] operator[SEP] operator[SEP] Keyword[long] identifier[hi] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[buf] operator[SEP] identifier[i] operator[++] operator[SEP] operator[!=] literal[String] operator[SEP] Keyword[return] identifier[markBad] operator[SEP] identifier[str] operator[SEP] operator[SEP] identifier[hi] operator[=] identifier[get2] operator[SEP] identifier[hi] , identifier[buf] , operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] operator[-] Other[2] operator[SEP] operator[SEP] identifier[hi] operator[=] identifier[get2] operator[SEP] identifier[hi] , identifier[buf] , operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] operator[-] Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[buf] operator[SEP] identifier[i] operator[++] operator[SEP] operator[!=] literal[String] operator[SEP] Keyword[return] identifier[markBad] operator[SEP] identifier[str] operator[SEP] operator[SEP] identifier[hi] operator[=] identifier[get2] operator[SEP] identifier[hi] , identifier[buf] , operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] operator[-] Other[2] operator[SEP] operator[SEP] identifier[hi] operator[=] identifier[get2] operator[SEP] identifier[hi] , identifier[buf] , operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] operator[-] Other[2] operator[SEP] operator[SEP] identifier[hi] operator[=] identifier[get2] operator[SEP] identifier[hi] , identifier[buf] , operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] operator[-] Other[2] operator[SEP] operator[SEP] identifier[hi] operator[=] identifier[get2] operator[SEP] identifier[hi] , identifier[buf] , operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] operator[-] Other[2] operator[SEP] operator[SEP] identifier[hi] operator[=] identifier[get2] operator[SEP] identifier[hi] , identifier[buf] , operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] operator[-] Other[2] operator[SEP] operator[SEP] Keyword[return] identifier[attemptUUIDParseEnd] operator[SEP] identifier[str] , identifier[hi] , identifier[buf] , identifier[i] operator[SEP] operator[SEP] }
public Observable<Page<VirtualNetworkTapInner>> listByResourceGroupAsync(final String resourceGroupName) { return listByResourceGroupWithServiceResponseAsync(resourceGroupName) .map(new Func1<ServiceResponse<Page<VirtualNetworkTapInner>>, Page<VirtualNetworkTapInner>>() { @Override public Page<VirtualNetworkTapInner> call(ServiceResponse<Page<VirtualNetworkTapInner>> response) { return response.body(); } }); }
class class_name[name] begin[{] method[listByResourceGroupAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName]] begin[{] return[call[.listByResourceGroupWithServiceResponseAsync, parameter[member[.resourceGroupName]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Page] operator[<] identifier[VirtualNetworkTapInner] operator[>] operator[>] identifier[listByResourceGroupAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] operator[SEP] { Keyword[return] identifier[listByResourceGroupWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[VirtualNetworkTapInner] operator[>] operator[>] , identifier[Page] operator[<] identifier[VirtualNetworkTapInner] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[VirtualNetworkTapInner] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[VirtualNetworkTapInner] operator[>] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
protected void appendSARLElementType(XtendTypeDeclaration source, JvmDeclaredType target) { addAnnotationSafe(target, SarlElementType.class, source.eClass().getClassifierID()); }
class class_name[name] begin[{] method[appendSARLElementType, return_type[void], modifier[protected], parameter[source, target]] begin[{] call[.addAnnotationSafe, parameter[member[.target], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SarlElementType, sub_type=None)), call[source.eClass, parameter[]]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[appendSARLElementType] operator[SEP] identifier[XtendTypeDeclaration] identifier[source] , identifier[JvmDeclaredType] identifier[target] operator[SEP] { identifier[addAnnotationSafe] operator[SEP] identifier[target] , identifier[SarlElementType] operator[SEP] Keyword[class] , identifier[source] operator[SEP] identifier[eClass] operator[SEP] operator[SEP] operator[SEP] identifier[getClassifierID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public final AnalyzeEntitySentimentResponse analyzeEntitySentiment(Document document) { AnalyzeEntitySentimentRequest request = AnalyzeEntitySentimentRequest.newBuilder().setDocument(document).build(); return analyzeEntitySentiment(request); }
class class_name[name] begin[{] method[analyzeEntitySentiment, return_type[type[AnalyzeEntitySentimentResponse]], modifier[final public], parameter[document]] begin[{] local_variable[type[AnalyzeEntitySentimentRequest], request] return[call[.analyzeEntitySentiment, parameter[member[.request]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[AnalyzeEntitySentimentResponse] identifier[analyzeEntitySentiment] operator[SEP] identifier[Document] identifier[document] operator[SEP] { identifier[AnalyzeEntitySentimentRequest] identifier[request] operator[=] identifier[AnalyzeEntitySentimentRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setDocument] operator[SEP] identifier[document] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[analyzeEntitySentiment] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public static void construct(BaseMessageEndpointFactory factory, MessageEndpointBase messageEndpointBase, int recoveryId, EJSContainer container, BeanMetaData beanMetaData, EJBPMICollaborator pmiBean, WrapperManager wrapperManager, boolean rrsTransactional) //d219252x { // Initialize superclass with the wrapper information. messageEndpointBase.container = container; messageEndpointBase.wrapperManager = wrapperManager; messageEndpointBase.beanId = new BeanId(factory, null, false); messageEndpointBase.bmd = beanMetaData; messageEndpointBase.ivPmiBean = pmiBean; messageEndpointBase.isolationAttrs = null; messageEndpointBase.ivCommon = null; // Not a cached wrapper. d174057.2 messageEndpointBase.isManagedWrapper = false; // Not a managed wrapper. d174057.2 messageEndpointBase.methodInfos = messageEndpointBase.bmd.localMethodInfos; messageEndpointBase.methodNames = messageEndpointBase.bmd.localMethodNames; messageEndpointBase.ivInterface = WrapperInterface.MESSAGE_LISTENER; // d366807 // Initialize this objects instance variables. messageEndpointBase.ivRecoveryId = recoveryId; messageEndpointBase.ivMessageEndpointFactory = factory; messageEndpointBase.ivTransactionManager = EmbeddableTransactionManagerFactory.getTransactionManager(); messageEndpointBase.ivRRSTransactional = rrsTransactional; //d456256 start // If there is only 1 method in the EJBMethodInfo for the // message listener interface, then set ivSingleMethodInterface // to true. if (messageEndpointBase.methodInfos.length == 1) { messageEndpointBase.ivSingleMethodInterface = true; } // d456256 end }
class class_name[name] begin[{] method[construct, return_type[void], modifier[public static], parameter[factory, messageEndpointBase, recoveryId, container, beanMetaData, pmiBean, wrapperManager, rrsTransactional]] begin[{] assign[member[messageEndpointBase.container], member[.container]] assign[member[messageEndpointBase.wrapperManager], member[.wrapperManager]] assign[member[messageEndpointBase.beanId], ClassCreator(arguments=[MemberReference(member=factory, 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=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BeanId, sub_type=None))] assign[member[messageEndpointBase.bmd], member[.beanMetaData]] assign[member[messageEndpointBase.ivPmiBean], member[.pmiBean]] assign[member[messageEndpointBase.isolationAttrs], literal[null]] assign[member[messageEndpointBase.ivCommon], literal[null]] assign[member[messageEndpointBase.isManagedWrapper], literal[false]] assign[member[messageEndpointBase.methodInfos], member[messageEndpointBase.bmd.localMethodInfos]] assign[member[messageEndpointBase.methodNames], member[messageEndpointBase.bmd.localMethodNames]] assign[member[messageEndpointBase.ivInterface], member[WrapperInterface.MESSAGE_LISTENER]] assign[member[messageEndpointBase.ivRecoveryId], member[.recoveryId]] assign[member[messageEndpointBase.ivMessageEndpointFactory], member[.factory]] assign[member[messageEndpointBase.ivTransactionManager], call[EmbeddableTransactionManagerFactory.getTransactionManager, parameter[]]] assign[member[messageEndpointBase.ivRRSTransactional], member[.rrsTransactional]] if[binary_operation[member[messageEndpointBase.methodInfos.length], ==, literal[1]]] begin[{] assign[member[messageEndpointBase.ivSingleMethodInterface], literal[true]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[construct] operator[SEP] identifier[BaseMessageEndpointFactory] identifier[factory] , identifier[MessageEndpointBase] identifier[messageEndpointBase] , Keyword[int] identifier[recoveryId] , identifier[EJSContainer] identifier[container] , identifier[BeanMetaData] identifier[beanMetaData] , identifier[EJBPMICollaborator] identifier[pmiBean] , identifier[WrapperManager] identifier[wrapperManager] , Keyword[boolean] identifier[rrsTransactional] operator[SEP] { identifier[messageEndpointBase] operator[SEP] identifier[container] operator[=] identifier[container] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[wrapperManager] operator[=] identifier[wrapperManager] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[beanId] operator[=] Keyword[new] identifier[BeanId] operator[SEP] identifier[factory] , Other[null] , literal[boolean] operator[SEP] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[bmd] operator[=] identifier[beanMetaData] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[ivPmiBean] operator[=] identifier[pmiBean] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[isolationAttrs] operator[=] Other[null] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[ivCommon] operator[=] Other[null] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[isManagedWrapper] operator[=] literal[boolean] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[methodInfos] operator[=] identifier[messageEndpointBase] operator[SEP] identifier[bmd] operator[SEP] identifier[localMethodInfos] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[methodNames] operator[=] identifier[messageEndpointBase] operator[SEP] identifier[bmd] operator[SEP] identifier[localMethodNames] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[ivInterface] operator[=] identifier[WrapperInterface] operator[SEP] identifier[MESSAGE_LISTENER] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[ivRecoveryId] operator[=] identifier[recoveryId] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[ivMessageEndpointFactory] operator[=] identifier[factory] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[ivTransactionManager] operator[=] identifier[EmbeddableTransactionManagerFactory] operator[SEP] identifier[getTransactionManager] operator[SEP] operator[SEP] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[ivRRSTransactional] operator[=] identifier[rrsTransactional] operator[SEP] Keyword[if] operator[SEP] identifier[messageEndpointBase] operator[SEP] identifier[methodInfos] operator[SEP] identifier[length] operator[==] Other[1] operator[SEP] { identifier[messageEndpointBase] operator[SEP] identifier[ivSingleMethodInterface] operator[=] literal[boolean] operator[SEP] } }
@Override public boolean exists() { ClassLoader loader = Thread.currentThread().getContextClassLoader(); return loader.getResource(getTrimPath()) != null; }
class class_name[name] begin[{] method[exists, return_type[type[boolean]], modifier[public], parameter[]] begin[{] local_variable[type[ClassLoader], loader] return[binary_operation[call[loader.getResource, parameter[call[.getTrimPath, parameter[]]]], !=, literal[null]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[exists] operator[SEP] operator[SEP] { identifier[ClassLoader] identifier[loader] operator[=] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[getContextClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[loader] operator[SEP] identifier[getResource] operator[SEP] identifier[getTrimPath] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] }
public InstagramSubscription callback(String callback) { Preconditions.checkValidUrl(callback, "Invalid Callback Url"); this.params.put(Constants.CALLBACK_URL, callback); return this; }
class class_name[name] begin[{] method[callback, return_type[type[InstagramSubscription]], modifier[public], parameter[callback]] begin[{] call[Preconditions.checkValidUrl, parameter[member[.callback], literal["Invalid Callback Url"]]] THIS[member[None.params]call[None.put, parameter[member[Constants.CALLBACK_URL], member[.callback]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[InstagramSubscription] identifier[callback] operator[SEP] identifier[String] identifier[callback] operator[SEP] { identifier[Preconditions] operator[SEP] identifier[checkValidUrl] operator[SEP] identifier[callback] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] identifier[Constants] operator[SEP] identifier[CALLBACK_URL] , identifier[callback] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private Object getScriptResult(String script, ScriptEngine engine) throws ScriptException { String scriptToExecute = script.substring(script.indexOf(":") + 1); return engine.eval(scriptToExecute); }
class class_name[name] begin[{] method[getScriptResult, return_type[type[Object]], modifier[private], parameter[script, engine]] begin[{] local_variable[type[String], scriptToExecute] return[call[engine.eval, parameter[member[.scriptToExecute]]]] end[}] END[}]
Keyword[private] identifier[Object] identifier[getScriptResult] operator[SEP] identifier[String] identifier[script] , identifier[ScriptEngine] identifier[engine] operator[SEP] Keyword[throws] identifier[ScriptException] { identifier[String] identifier[scriptToExecute] operator[=] identifier[script] operator[SEP] identifier[substring] operator[SEP] identifier[script] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[return] identifier[engine] operator[SEP] identifier[eval] operator[SEP] identifier[scriptToExecute] operator[SEP] operator[SEP] }
@Override public String loadDataFromNetwork() throws Exception { try { Ln.d("Call web service " + url); return IOUtils.toString(new InputStreamReader(new URL(url).openStream(), CharEncoding.UTF_8)); } catch (final MalformedURLException e) { Ln.e(e, "Unable to create URL"); throw e; } catch (final IOException e) { Ln.e(e, "Unable to download content"); throw e; } }
class class_name[name] begin[{] method[loadDataFromNetwork, return_type[type[String]], modifier[public], parameter[]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Call web service "), operandr=MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=d, postfix_operators=[], prefix_operators=[], qualifier=Ln, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=openStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None)), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=CharEncoding, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None))], member=toString, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to create URL")], member=e, postfix_operators=[], prefix_operators=[], qualifier=Ln, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MalformedURLException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to download content")], member=e, postfix_operators=[], prefix_operators=[], qualifier=Ln, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[loadDataFromNetwork] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[try] { identifier[Ln] operator[SEP] identifier[d] operator[SEP] literal[String] operator[+] identifier[url] operator[SEP] operator[SEP] Keyword[return] identifier[IOUtils] operator[SEP] identifier[toString] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] Keyword[new] identifier[URL] operator[SEP] identifier[url] operator[SEP] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] , identifier[CharEncoding] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[MalformedURLException] identifier[e] operator[SEP] { identifier[Ln] operator[SEP] identifier[e] operator[SEP] identifier[e] , literal[String] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { identifier[Ln] operator[SEP] identifier[e] operator[SEP] identifier[e] , literal[String] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] } }
public static PrintWriter newPrintWriter(Path self, String charset) throws IOException { return new GroovyPrintWriter(newWriter(self, charset)); }
class class_name[name] begin[{] method[newPrintWriter, return_type[type[PrintWriter]], modifier[public static], parameter[self, charset]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=self, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=charset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newWriter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GroovyPrintWriter, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[PrintWriter] identifier[newPrintWriter] operator[SEP] identifier[Path] identifier[self] , identifier[String] identifier[charset] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] Keyword[new] identifier[GroovyPrintWriter] operator[SEP] identifier[newWriter] operator[SEP] identifier[self] , identifier[charset] operator[SEP] operator[SEP] operator[SEP] }
@Override public void layoutViews(RecyclerView.Recycler recycler, RecyclerView.State state, VirtualLayoutManager.LayoutStateWrapper layoutState, LayoutChunkResult result, LayoutManagerHelper helper) { // reach the end of this layout if (isOutOfRange(layoutState.getCurrentPosition())) { return; } int currentPosition = layoutState.getCurrentPosition(); // find corresponding layout container View view = nextView(recycler, layoutState, helper, result); if (view == null) { return; } final boolean isOverLapMargin = helper.isEnableMarginOverLap(); VirtualLayoutManager.LayoutParams params = (VirtualLayoutManager.LayoutParams) view.getLayoutParams(); final boolean layoutInVertical = helper.getOrientation() == VERTICAL; int startSpace = 0, endSpace = 0, gap = 0; boolean isLayoutEnd = layoutState.getLayoutDirection() == VirtualLayoutManager.LayoutStateWrapper.LAYOUT_END; boolean isStartLine = isLayoutEnd ? currentPosition == getRange().getLower().intValue() : currentPosition == getRange().getUpper().intValue(); boolean isEndLine = isLayoutEnd ? currentPosition == getRange().getUpper().intValue() : currentPosition == getRange().getLower().intValue(); if (isStartLine) { startSpace = computeStartSpace(helper, layoutInVertical, isLayoutEnd, isOverLapMargin); } if (isEndLine) { endSpace = computeEndSpace(helper, layoutInVertical, isLayoutEnd, isOverLapMargin); } if (!isStartLine) { if (!isOverLapMargin) { gap = mLayoutWithAnchor ? 0 : mDividerHeight; } else { //TODO check layout with anchor if (isLayoutEnd) { int marginTop = params.topMargin; View sibling = helper.findViewByPosition(currentPosition - 1); int lastMarginBottom = sibling != null ? ((LayoutParams) sibling.getLayoutParams()).bottomMargin : 0; if (lastMarginBottom >= 0 && marginTop >= 0) { gap = Math.max(lastMarginBottom, marginTop); } else { gap = lastMarginBottom + marginTop; } } else { int marginBottom = params.bottomMargin; View sibling = helper.findViewByPosition(currentPosition + 1); int lastMarginTop = sibling != null ? ((LayoutParams) sibling.getLayoutParams()).topMargin : 0; if (marginBottom >= 0 && lastMarginTop >= 0) { gap = Math.max(marginBottom, lastMarginTop); } else { gap = marginBottom + lastMarginTop; } } } } final int widthSize = helper.getContentWidth() - helper.getPaddingLeft() - helper .getPaddingRight() - getHorizontalMargin() - getHorizontalPadding(); int widthSpec = helper.getChildMeasureSpec(widthSize, params.width, !layoutInVertical); int heightSpec; float viewAspectRatio = params.mAspectRatio; if (!Float.isNaN(viewAspectRatio) && viewAspectRatio > 0) { heightSpec = View.MeasureSpec.makeMeasureSpec((int) (widthSize / viewAspectRatio + 0.5f), View.MeasureSpec.EXACTLY); } else if (!Float.isNaN(mAspectRatio) && mAspectRatio > 0) { heightSpec = View.MeasureSpec.makeMeasureSpec((int) (widthSize / mAspectRatio + 0.5), View.MeasureSpec.EXACTLY); } else { heightSpec = helper.getChildMeasureSpec( helper.getContentHeight() - helper.getPaddingTop() - helper.getPaddingBottom() - getVerticalMargin() - getVerticalPadding(), params.height, layoutInVertical); } if (!isOverLapMargin) { helper.measureChildWithMargins(view, widthSpec, heightSpec); } else { helper.measureChild(view, widthSpec, heightSpec); } OrientationHelperEx orientationHelper = helper.getMainOrientationHelper(); result.mConsumed = orientationHelper.getDecoratedMeasurement(view) + startSpace + endSpace + gap; int left, top, right, bottom; if (helper.getOrientation() == VERTICAL) { // not support RTL now if (helper.isDoLayoutRTL()) { right = helper.getContentWidth() - helper.getPaddingRight() - mMarginRight - mPaddingRight; left = right - orientationHelper.getDecoratedMeasurementInOther(view); } else { left = helper.getPaddingLeft() + mMarginLeft + mPaddingLeft; right = left + orientationHelper.getDecoratedMeasurementInOther(view); } // whether this layout pass is layout to start or to end if (layoutState.getLayoutDirection() == VirtualLayoutManager.LayoutStateWrapper.LAYOUT_START) { // fill start, from bottom to top bottom = layoutState.getOffset() - startSpace - (isStartLine ? 0 : gap); top = bottom - orientationHelper.getDecoratedMeasurement(view); } else { // fill end, from top to bottom top = layoutState.getOffset() + startSpace + (isStartLine ? 0 : gap); bottom = top + orientationHelper.getDecoratedMeasurement(view); } } else { top = helper.getPaddingTop() + mMarginTop + mPaddingTop; bottom = top + orientationHelper.getDecoratedMeasurementInOther(view); if (layoutState.getLayoutDirection() == VirtualLayoutManager.LayoutStateWrapper.LAYOUT_START) { // fill left, from right to left right = layoutState.getOffset() - startSpace - (isStartLine ? 0 : gap); left = right - orientationHelper.getDecoratedMeasurement(view); } else { // fill right, from left to right left = layoutState.getOffset() + startSpace + (isStartLine ? 0 : gap); right = left + orientationHelper.getDecoratedMeasurement(view); } } // We calculate everything with View's bounding box (which includes decor and margins) // To calculate correct layout position, we subtract margins. layoutChildWithMargin(view, left, top, right, bottom, helper); if (DEBUG) { Log.d(TAG, "laid out child at position " + helper.getPosition(view) + ", with l:" + (left + params.leftMargin) + ", t:" + (top + params.topMargin) + ", r:" + (right - params.rightMargin) + ", b:" + (bottom - params.bottomMargin)); } handleStateOnResult(result, view); mLayoutWithAnchor = false; }
class class_name[name] begin[{] method[layoutViews, return_type[void], modifier[public], parameter[recycler, state, layoutState, result, helper]] begin[{] if[call[.isOutOfRange, parameter[call[layoutState.getCurrentPosition, parameter[]]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[int], currentPosition] local_variable[type[View], view] if[binary_operation[member[.view], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[boolean], isOverLapMargin] local_variable[type[VirtualLayoutManager], params] local_variable[type[boolean], layoutInVertical] local_variable[type[int], startSpace] local_variable[type[boolean], isLayoutEnd] local_variable[type[boolean], isStartLine] local_variable[type[boolean], isEndLine] if[member[.isStartLine]] begin[{] assign[member[.startSpace], call[.computeStartSpace, parameter[member[.helper], member[.layoutInVertical], member[.isLayoutEnd], member[.isOverLapMargin]]]] else begin[{] None end[}] if[member[.isEndLine]] begin[{] assign[member[.endSpace], call[.computeEndSpace, parameter[member[.helper], member[.layoutInVertical], member[.isLayoutEnd], member[.isOverLapMargin]]]] else begin[{] None end[}] if[member[.isStartLine]] begin[{] if[member[.isOverLapMargin]] begin[{] assign[member[.gap], TernaryExpression(condition=MemberReference(member=mLayoutWithAnchor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=mDividerHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))] else begin[{] if[member[.isLayoutEnd]] begin[{] local_variable[type[int], marginTop] local_variable[type[View], sibling] local_variable[type[int], lastMarginBottom] if[binary_operation[binary_operation[member[.lastMarginBottom], >=, literal[0]], &&, binary_operation[member[.marginTop], >=, literal[0]]]] begin[{] assign[member[.gap], call[Math.max, parameter[member[.lastMarginBottom], member[.marginTop]]]] else begin[{] assign[member[.gap], binary_operation[member[.lastMarginBottom], +, member[.marginTop]]] end[}] else begin[{] local_variable[type[int], marginBottom] local_variable[type[View], sibling] local_variable[type[int], lastMarginTop] if[binary_operation[binary_operation[member[.marginBottom], >=, literal[0]], &&, binary_operation[member[.lastMarginTop], >=, literal[0]]]] begin[{] assign[member[.gap], call[Math.max, parameter[member[.marginBottom], member[.lastMarginTop]]]] else begin[{] assign[member[.gap], binary_operation[member[.marginBottom], +, member[.lastMarginTop]]] end[}] end[}] end[}] else begin[{] None end[}] local_variable[type[int], widthSize] local_variable[type[int], widthSpec] local_variable[type[int], heightSpec] local_variable[type[float], viewAspectRatio] if[binary_operation[call[Float.isNaN, parameter[member[.viewAspectRatio]]], &&, binary_operation[member[.viewAspectRatio], >, literal[0]]]] begin[{] assign[member[.heightSpec], call[View.MeasureSpec.makeMeasureSpec, parameter[Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=widthSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=viewAspectRatio, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.5f), operator=+), type=BasicType(dimensions=[], name=int)), member[View.MeasureSpec.EXACTLY]]]] else begin[{] if[binary_operation[call[Float.isNaN, parameter[member[.mAspectRatio]]], &&, binary_operation[member[.mAspectRatio], >, literal[0]]]] begin[{] assign[member[.heightSpec], call[View.MeasureSpec.makeMeasureSpec, parameter[Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=widthSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mAspectRatio, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.5), operator=+), type=BasicType(dimensions=[], name=int)), member[View.MeasureSpec.EXACTLY]]]] else begin[{] assign[member[.heightSpec], call[helper.getChildMeasureSpec, parameter[binary_operation[binary_operation[binary_operation[binary_operation[call[helper.getContentHeight, parameter[]], -, call[helper.getPaddingTop, parameter[]]], -, call[helper.getPaddingBottom, parameter[]]], -, call[.getVerticalMargin, parameter[]]], -, call[.getVerticalPadding, parameter[]]], member[params.height], member[.layoutInVertical]]]] end[}] end[}] if[member[.isOverLapMargin]] begin[{] call[helper.measureChildWithMargins, parameter[member[.view], member[.widthSpec], member[.heightSpec]]] else begin[{] call[helper.measureChild, parameter[member[.view], member[.widthSpec], member[.heightSpec]]] end[}] local_variable[type[OrientationHelperEx], orientationHelper] assign[member[result.mConsumed], binary_operation[binary_operation[binary_operation[call[orientationHelper.getDecoratedMeasurement, parameter[member[.view]]], +, member[.startSpace]], +, member[.endSpace]], +, member[.gap]]] local_variable[type[int], left] if[binary_operation[call[helper.getOrientation, parameter[]], ==, member[.VERTICAL]]] begin[{] if[call[helper.isDoLayoutRTL, parameter[]]] begin[{] assign[member[.right], binary_operation[binary_operation[binary_operation[call[helper.getContentWidth, parameter[]], -, call[helper.getPaddingRight, parameter[]]], -, member[.mMarginRight]], -, member[.mPaddingRight]]] assign[member[.left], binary_operation[member[.right], -, call[orientationHelper.getDecoratedMeasurementInOther, parameter[member[.view]]]]] else begin[{] assign[member[.left], binary_operation[binary_operation[call[helper.getPaddingLeft, parameter[]], +, member[.mMarginLeft]], +, member[.mPaddingLeft]]] assign[member[.right], binary_operation[member[.left], +, call[orientationHelper.getDecoratedMeasurementInOther, parameter[member[.view]]]]] end[}] if[binary_operation[call[layoutState.getLayoutDirection, parameter[]], ==, member[VirtualLayoutManager.LayoutStateWrapper.LAYOUT_START]]] begin[{] assign[member[.bottom], binary_operation[binary_operation[call[layoutState.getOffset, parameter[]], -, member[.startSpace]], -, TernaryExpression(condition=MemberReference(member=isStartLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=gap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]] assign[member[.top], binary_operation[member[.bottom], -, call[orientationHelper.getDecoratedMeasurement, parameter[member[.view]]]]] else begin[{] assign[member[.top], binary_operation[binary_operation[call[layoutState.getOffset, parameter[]], +, member[.startSpace]], +, TernaryExpression(condition=MemberReference(member=isStartLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=gap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]] assign[member[.bottom], binary_operation[member[.top], +, call[orientationHelper.getDecoratedMeasurement, parameter[member[.view]]]]] end[}] else begin[{] assign[member[.top], binary_operation[binary_operation[call[helper.getPaddingTop, parameter[]], +, member[.mMarginTop]], +, member[.mPaddingTop]]] assign[member[.bottom], binary_operation[member[.top], +, call[orientationHelper.getDecoratedMeasurementInOther, parameter[member[.view]]]]] if[binary_operation[call[layoutState.getLayoutDirection, parameter[]], ==, member[VirtualLayoutManager.LayoutStateWrapper.LAYOUT_START]]] begin[{] assign[member[.right], binary_operation[binary_operation[call[layoutState.getOffset, parameter[]], -, member[.startSpace]], -, TernaryExpression(condition=MemberReference(member=isStartLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=gap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]] assign[member[.left], binary_operation[member[.right], -, call[orientationHelper.getDecoratedMeasurement, parameter[member[.view]]]]] else begin[{] assign[member[.left], binary_operation[binary_operation[call[layoutState.getOffset, parameter[]], +, member[.startSpace]], +, TernaryExpression(condition=MemberReference(member=isStartLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=gap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]] assign[member[.right], binary_operation[member[.left], +, call[orientationHelper.getDecoratedMeasurement, parameter[member[.view]]]]] end[}] end[}] call[.layoutChildWithMargin, parameter[member[.view], member[.left], member[.top], member[.right], member[.bottom], member[.helper]]] if[member[.DEBUG]] begin[{] call[Log.d, parameter[member[.TAG], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["laid out child at position "], +, call[helper.getPosition, parameter[member[.view]]]], +, literal[", with l:"]], +, binary_operation[member[.left], +, member[params.leftMargin]]], +, literal[", t:"]], +, binary_operation[member[.top], +, member[params.topMargin]]], +, literal[", r:"]], +, binary_operation[member[.right], -, member[params.rightMargin]]], +, literal[", b:"]], +, binary_operation[member[.bottom], -, member[params.bottomMargin]]]]] else begin[{] None end[}] call[.handleStateOnResult, parameter[member[.result], member[.view]]] assign[member[.mLayoutWithAnchor], literal[false]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[layoutViews] operator[SEP] identifier[RecyclerView] operator[SEP] identifier[Recycler] identifier[recycler] , identifier[RecyclerView] operator[SEP] identifier[State] identifier[state] , identifier[VirtualLayoutManager] operator[SEP] identifier[LayoutStateWrapper] identifier[layoutState] , identifier[LayoutChunkResult] identifier[result] , identifier[LayoutManagerHelper] identifier[helper] operator[SEP] { Keyword[if] operator[SEP] identifier[isOutOfRange] operator[SEP] identifier[layoutState] operator[SEP] identifier[getCurrentPosition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[int] identifier[currentPosition] operator[=] identifier[layoutState] operator[SEP] identifier[getCurrentPosition] operator[SEP] operator[SEP] operator[SEP] identifier[View] identifier[view] operator[=] identifier[nextView] operator[SEP] identifier[recycler] , identifier[layoutState] , identifier[helper] , identifier[result] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[view] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[final] Keyword[boolean] identifier[isOverLapMargin] operator[=] identifier[helper] operator[SEP] identifier[isEnableMarginOverLap] operator[SEP] operator[SEP] operator[SEP] identifier[VirtualLayoutManager] operator[SEP] identifier[LayoutParams] identifier[params] operator[=] operator[SEP] identifier[VirtualLayoutManager] operator[SEP] identifier[LayoutParams] operator[SEP] identifier[view] operator[SEP] identifier[getLayoutParams] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[layoutInVertical] operator[=] identifier[helper] operator[SEP] identifier[getOrientation] operator[SEP] operator[SEP] operator[==] identifier[VERTICAL] operator[SEP] Keyword[int] identifier[startSpace] operator[=] Other[0] , identifier[endSpace] operator[=] Other[0] , identifier[gap] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[isLayoutEnd] operator[=] identifier[layoutState] operator[SEP] identifier[getLayoutDirection] operator[SEP] operator[SEP] operator[==] identifier[VirtualLayoutManager] operator[SEP] identifier[LayoutStateWrapper] operator[SEP] identifier[LAYOUT_END] operator[SEP] Keyword[boolean] identifier[isStartLine] operator[=] identifier[isLayoutEnd] operator[?] identifier[currentPosition] operator[==] identifier[getRange] operator[SEP] operator[SEP] operator[SEP] identifier[getLower] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[:] identifier[currentPosition] operator[==] identifier[getRange] operator[SEP] operator[SEP] operator[SEP] identifier[getUpper] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[isEndLine] operator[=] identifier[isLayoutEnd] operator[?] identifier[currentPosition] operator[==] identifier[getRange] operator[SEP] operator[SEP] operator[SEP] identifier[getUpper] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[:] identifier[currentPosition] operator[==] identifier[getRange] operator[SEP] operator[SEP] operator[SEP] identifier[getLower] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isStartLine] operator[SEP] { identifier[startSpace] operator[=] identifier[computeStartSpace] operator[SEP] identifier[helper] , identifier[layoutInVertical] , identifier[isLayoutEnd] , identifier[isOverLapMargin] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isEndLine] operator[SEP] { identifier[endSpace] operator[=] identifier[computeEndSpace] operator[SEP] identifier[helper] , identifier[layoutInVertical] , identifier[isLayoutEnd] , identifier[isOverLapMargin] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isStartLine] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[isOverLapMargin] operator[SEP] { identifier[gap] operator[=] identifier[mLayoutWithAnchor] operator[?] Other[0] operator[:] identifier[mDividerHeight] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[isLayoutEnd] operator[SEP] { Keyword[int] identifier[marginTop] operator[=] identifier[params] operator[SEP] identifier[topMargin] operator[SEP] identifier[View] identifier[sibling] operator[=] identifier[helper] operator[SEP] identifier[findViewByPosition] operator[SEP] identifier[currentPosition] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[lastMarginBottom] operator[=] identifier[sibling] operator[!=] Other[null] operator[?] operator[SEP] operator[SEP] identifier[LayoutParams] operator[SEP] identifier[sibling] operator[SEP] identifier[getLayoutParams] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[bottomMargin] operator[:] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[lastMarginBottom] operator[>=] Other[0] operator[&&] identifier[marginTop] operator[>=] Other[0] operator[SEP] { identifier[gap] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[lastMarginBottom] , identifier[marginTop] operator[SEP] operator[SEP] } Keyword[else] { identifier[gap] operator[=] identifier[lastMarginBottom] operator[+] identifier[marginTop] operator[SEP] } } Keyword[else] { Keyword[int] identifier[marginBottom] operator[=] identifier[params] operator[SEP] identifier[bottomMargin] operator[SEP] identifier[View] identifier[sibling] operator[=] identifier[helper] operator[SEP] identifier[findViewByPosition] operator[SEP] identifier[currentPosition] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[lastMarginTop] operator[=] identifier[sibling] operator[!=] Other[null] operator[?] operator[SEP] operator[SEP] identifier[LayoutParams] operator[SEP] identifier[sibling] operator[SEP] identifier[getLayoutParams] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[topMargin] operator[:] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[marginBottom] operator[>=] Other[0] operator[&&] identifier[lastMarginTop] operator[>=] Other[0] operator[SEP] { identifier[gap] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[marginBottom] , identifier[lastMarginTop] operator[SEP] operator[SEP] } Keyword[else] { identifier[gap] operator[=] identifier[marginBottom] operator[+] identifier[lastMarginTop] operator[SEP] } } } } Keyword[final] Keyword[int] identifier[widthSize] operator[=] identifier[helper] operator[SEP] identifier[getContentWidth] operator[SEP] operator[SEP] operator[-] identifier[helper] operator[SEP] identifier[getPaddingLeft] operator[SEP] operator[SEP] operator[-] identifier[helper] operator[SEP] identifier[getPaddingRight] operator[SEP] operator[SEP] operator[-] identifier[getHorizontalMargin] operator[SEP] operator[SEP] operator[-] identifier[getHorizontalPadding] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[widthSpec] operator[=] identifier[helper] operator[SEP] identifier[getChildMeasureSpec] operator[SEP] identifier[widthSize] , identifier[params] operator[SEP] identifier[width] , operator[!] identifier[layoutInVertical] operator[SEP] operator[SEP] Keyword[int] identifier[heightSpec] operator[SEP] Keyword[float] identifier[viewAspectRatio] operator[=] identifier[params] operator[SEP] identifier[mAspectRatio] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Float] operator[SEP] identifier[isNaN] operator[SEP] identifier[viewAspectRatio] operator[SEP] operator[&&] identifier[viewAspectRatio] operator[>] Other[0] operator[SEP] { identifier[heightSpec] operator[=] identifier[View] operator[SEP] identifier[MeasureSpec] operator[SEP] identifier[makeMeasureSpec] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[widthSize] operator[/] identifier[viewAspectRatio] operator[+] literal[Float] operator[SEP] , identifier[View] operator[SEP] identifier[MeasureSpec] operator[SEP] identifier[EXACTLY] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[Float] operator[SEP] identifier[isNaN] operator[SEP] identifier[mAspectRatio] operator[SEP] operator[&&] identifier[mAspectRatio] operator[>] Other[0] operator[SEP] { identifier[heightSpec] operator[=] identifier[View] operator[SEP] identifier[MeasureSpec] operator[SEP] identifier[makeMeasureSpec] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[widthSize] operator[/] identifier[mAspectRatio] operator[+] literal[Float] operator[SEP] , identifier[View] operator[SEP] identifier[MeasureSpec] operator[SEP] identifier[EXACTLY] operator[SEP] operator[SEP] } Keyword[else] { identifier[heightSpec] operator[=] identifier[helper] operator[SEP] identifier[getChildMeasureSpec] operator[SEP] identifier[helper] operator[SEP] identifier[getContentHeight] operator[SEP] operator[SEP] operator[-] identifier[helper] operator[SEP] identifier[getPaddingTop] operator[SEP] operator[SEP] operator[-] identifier[helper] operator[SEP] identifier[getPaddingBottom] operator[SEP] operator[SEP] operator[-] identifier[getVerticalMargin] operator[SEP] operator[SEP] operator[-] identifier[getVerticalPadding] operator[SEP] operator[SEP] , identifier[params] operator[SEP] identifier[height] , identifier[layoutInVertical] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isOverLapMargin] operator[SEP] { identifier[helper] operator[SEP] identifier[measureChildWithMargins] operator[SEP] identifier[view] , identifier[widthSpec] , identifier[heightSpec] operator[SEP] operator[SEP] } Keyword[else] { identifier[helper] operator[SEP] identifier[measureChild] operator[SEP] identifier[view] , identifier[widthSpec] , identifier[heightSpec] operator[SEP] operator[SEP] } identifier[OrientationHelperEx] identifier[orientationHelper] operator[=] identifier[helper] operator[SEP] identifier[getMainOrientationHelper] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[mConsumed] operator[=] identifier[orientationHelper] operator[SEP] identifier[getDecoratedMeasurement] operator[SEP] identifier[view] operator[SEP] operator[+] identifier[startSpace] operator[+] identifier[endSpace] operator[+] identifier[gap] operator[SEP] Keyword[int] identifier[left] , identifier[top] , identifier[right] , identifier[bottom] operator[SEP] Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[getOrientation] operator[SEP] operator[SEP] operator[==] identifier[VERTICAL] operator[SEP] { Keyword[if] operator[SEP] identifier[helper] operator[SEP] identifier[isDoLayoutRTL] operator[SEP] operator[SEP] operator[SEP] { identifier[right] operator[=] identifier[helper] operator[SEP] identifier[getContentWidth] operator[SEP] operator[SEP] operator[-] identifier[helper] operator[SEP] identifier[getPaddingRight] operator[SEP] operator[SEP] operator[-] identifier[mMarginRight] operator[-] identifier[mPaddingRight] operator[SEP] identifier[left] operator[=] identifier[right] operator[-] identifier[orientationHelper] operator[SEP] identifier[getDecoratedMeasurementInOther] operator[SEP] identifier[view] operator[SEP] operator[SEP] } Keyword[else] { identifier[left] operator[=] identifier[helper] operator[SEP] identifier[getPaddingLeft] operator[SEP] operator[SEP] operator[+] identifier[mMarginLeft] operator[+] identifier[mPaddingLeft] operator[SEP] identifier[right] operator[=] identifier[left] operator[+] identifier[orientationHelper] operator[SEP] identifier[getDecoratedMeasurementInOther] operator[SEP] identifier[view] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[layoutState] operator[SEP] identifier[getLayoutDirection] operator[SEP] operator[SEP] operator[==] identifier[VirtualLayoutManager] operator[SEP] identifier[LayoutStateWrapper] operator[SEP] identifier[LAYOUT_START] operator[SEP] { identifier[bottom] operator[=] identifier[layoutState] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] operator[-] identifier[startSpace] operator[-] operator[SEP] identifier[isStartLine] operator[?] Other[0] operator[:] identifier[gap] operator[SEP] operator[SEP] identifier[top] operator[=] identifier[bottom] operator[-] identifier[orientationHelper] operator[SEP] identifier[getDecoratedMeasurement] operator[SEP] identifier[view] operator[SEP] operator[SEP] } Keyword[else] { identifier[top] operator[=] identifier[layoutState] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] operator[+] identifier[startSpace] operator[+] operator[SEP] identifier[isStartLine] operator[?] Other[0] operator[:] identifier[gap] operator[SEP] operator[SEP] identifier[bottom] operator[=] identifier[top] operator[+] identifier[orientationHelper] operator[SEP] identifier[getDecoratedMeasurement] operator[SEP] identifier[view] operator[SEP] operator[SEP] } } Keyword[else] { identifier[top] operator[=] identifier[helper] operator[SEP] identifier[getPaddingTop] operator[SEP] operator[SEP] operator[+] identifier[mMarginTop] operator[+] identifier[mPaddingTop] operator[SEP] identifier[bottom] operator[=] identifier[top] operator[+] identifier[orientationHelper] operator[SEP] identifier[getDecoratedMeasurementInOther] operator[SEP] identifier[view] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[layoutState] operator[SEP] identifier[getLayoutDirection] operator[SEP] operator[SEP] operator[==] identifier[VirtualLayoutManager] operator[SEP] identifier[LayoutStateWrapper] operator[SEP] identifier[LAYOUT_START] operator[SEP] { identifier[right] operator[=] identifier[layoutState] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] operator[-] identifier[startSpace] operator[-] operator[SEP] identifier[isStartLine] operator[?] Other[0] operator[:] identifier[gap] operator[SEP] operator[SEP] identifier[left] operator[=] identifier[right] operator[-] identifier[orientationHelper] operator[SEP] identifier[getDecoratedMeasurement] operator[SEP] identifier[view] operator[SEP] operator[SEP] } Keyword[else] { identifier[left] operator[=] identifier[layoutState] operator[SEP] identifier[getOffset] operator[SEP] operator[SEP] operator[+] identifier[startSpace] operator[+] operator[SEP] identifier[isStartLine] operator[?] Other[0] operator[:] identifier[gap] operator[SEP] operator[SEP] identifier[right] operator[=] identifier[left] operator[+] identifier[orientationHelper] operator[SEP] identifier[getDecoratedMeasurement] operator[SEP] identifier[view] operator[SEP] operator[SEP] } } identifier[layoutChildWithMargin] operator[SEP] identifier[view] , identifier[left] , identifier[top] , identifier[right] , identifier[bottom] , identifier[helper] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[DEBUG] operator[SEP] { identifier[Log] operator[SEP] identifier[d] operator[SEP] identifier[TAG] , literal[String] operator[+] identifier[helper] operator[SEP] identifier[getPosition] operator[SEP] identifier[view] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[left] operator[+] identifier[params] operator[SEP] identifier[leftMargin] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[top] operator[+] identifier[params] operator[SEP] identifier[topMargin] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[right] operator[-] identifier[params] operator[SEP] identifier[rightMargin] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[bottom] operator[-] identifier[params] operator[SEP] identifier[bottomMargin] operator[SEP] operator[SEP] operator[SEP] } identifier[handleStateOnResult] operator[SEP] identifier[result] , identifier[view] operator[SEP] operator[SEP] identifier[mLayoutWithAnchor] operator[=] literal[boolean] operator[SEP] }
public static BtcFormat getMicroInstance(int scale, int... groups) { return getInstance(MICROCOIN_SCALE, defaultLocale(), scale, boxAsList(groups)); }
class class_name[name] begin[{] method[getMicroInstance, return_type[type[BtcFormat]], modifier[public static], parameter[scale, groups]] begin[{] return[call[.getInstance, parameter[member[.MICROCOIN_SCALE], call[.defaultLocale, parameter[]], member[.scale], call[.boxAsList, parameter[member[.groups]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[BtcFormat] identifier[getMicroInstance] operator[SEP] Keyword[int] identifier[scale] , Keyword[int] operator[...] identifier[groups] operator[SEP] { Keyword[return] identifier[getInstance] operator[SEP] identifier[MICROCOIN_SCALE] , identifier[defaultLocale] operator[SEP] operator[SEP] , identifier[scale] , identifier[boxAsList] operator[SEP] identifier[groups] operator[SEP] operator[SEP] operator[SEP] }
private void handleEvent(PrimitiveEvent event) { log.trace("Received {}", event); Set<Consumer<PrimitiveEvent>> listeners = eventListeners.get(event.type()); if (listeners != null) { listeners.forEach(l -> l.accept(event)); } }
class class_name[name] begin[{] method[handleEvent, return_type[void], modifier[private], parameter[event]] begin[{] call[log.trace, parameter[literal["Received {}"], member[.event]]] local_variable[type[Set], listeners] if[binary_operation[member[.listeners], !=, literal[null]]] begin[{] call[listeners.forEach, parameter[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), parameters=[MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[handleEvent] operator[SEP] identifier[PrimitiveEvent] identifier[event] operator[SEP] { identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[event] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Consumer] operator[<] identifier[PrimitiveEvent] operator[>] operator[>] identifier[listeners] operator[=] identifier[eventListeners] operator[SEP] identifier[get] operator[SEP] identifier[event] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[listeners] operator[!=] Other[null] operator[SEP] { identifier[listeners] operator[SEP] identifier[forEach] operator[SEP] identifier[l] operator[->] identifier[l] operator[SEP] identifier[accept] operator[SEP] identifier[event] operator[SEP] operator[SEP] operator[SEP] } }
private void writeChunk(String spaceId, ChunkInputStream chunk) throws NotFoundException { // Write chunk as a temp file String chunkId = chunk.getChunkId(); File chunkFile = IOUtil.writeStreamToFile(chunk); try { String chunkChecksum = getChunkChecksum(chunkFile); // Write chunk if it is not already in storage (or jumpstart is enabled) if (jumpStart || !chunkInStorage(spaceId, chunkId, chunkChecksum)) { try { createRetrier().execute(new Retriable() { private int attempt = 0; @Override public Object retry() throws Exception { attempt++; try (InputStream chunkStream = new FileInputStream(chunkFile)) { ChunkInputStream chunkFileStream = new ChunkInputStream(chunkId, chunkStream, chunkFile.length(), chunk.md5Preserved()); writeSingle(spaceId, chunkChecksum, chunkFileStream, attempt == getMaxRetries() + 1); } return ""; } }); } catch (Exception e) { String err = "Failed to store chunk with ID " + chunkId + " in space " + spaceId + " after " + getMaxRetries() + " attempts. Last error: " + e.getMessage(); throw new DuraCloudRuntimeException(err, e); } } } finally { if (null != chunkFile && chunkFile.exists()) { FileUtils.deleteQuietly(chunkFile); } } }
class class_name[name] begin[{] method[writeChunk, return_type[void], modifier[private], parameter[spaceId, chunk]] begin[{] local_variable[type[String], chunkId] local_variable[type[File], chunkFile] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=chunkFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChunkChecksum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=chunkChecksum)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=jumpStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=chunkId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=chunkChecksum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=chunkInStorage, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=createRetrier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=attempt)], documentation=None, modifiers={'private'}, type=BasicType(dimensions=[], name=int)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MemberReference(member=attempt, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=chunkId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=chunkStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=chunkFile, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=md5Preserved, postfix_operators=[], prefix_operators=[], qualifier=chunk, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ChunkInputStream, sub_type=None)), name=chunkFileStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ChunkInputStream, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=chunkChecksum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=chunkFileStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=attempt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getMaxRetries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operator===)], member=writeSingle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=chunkStream, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=chunkFile, 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)))]), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), label=None)], documentation=None, modifiers={'public'}, name=retry, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), throws=['Exception'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Retriable, sub_type=None))], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to store chunk with ID "), operandr=MemberReference(member=chunkId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" in space "), operator=+), operandr=MemberReference(member=spaceId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" after "), operator=+), operandr=MethodInvocation(arguments=[], member=getMaxRetries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" attempts. Last error: "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), name=err)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=err, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DuraCloudRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]))], catches=None, finally_block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=chunkFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), operandr=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=chunkFile, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=chunkFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteQuietly, postfix_operators=[], prefix_operators=[], qualifier=FileUtils, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[writeChunk] operator[SEP] identifier[String] identifier[spaceId] , identifier[ChunkInputStream] identifier[chunk] operator[SEP] Keyword[throws] identifier[NotFoundException] { identifier[String] identifier[chunkId] operator[=] identifier[chunk] operator[SEP] identifier[getChunkId] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[chunkFile] operator[=] identifier[IOUtil] operator[SEP] identifier[writeStreamToFile] operator[SEP] identifier[chunk] operator[SEP] operator[SEP] Keyword[try] { identifier[String] identifier[chunkChecksum] operator[=] identifier[getChunkChecksum] operator[SEP] identifier[chunkFile] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jumpStart] operator[||] operator[!] identifier[chunkInStorage] operator[SEP] identifier[spaceId] , identifier[chunkId] , identifier[chunkChecksum] operator[SEP] operator[SEP] { Keyword[try] { identifier[createRetrier] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[Retriable] operator[SEP] operator[SEP] { Keyword[private] Keyword[int] identifier[attempt] operator[=] Other[0] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[retry] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[attempt] operator[++] operator[SEP] Keyword[try] operator[SEP] identifier[InputStream] identifier[chunkStream] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[chunkFile] operator[SEP] operator[SEP] { identifier[ChunkInputStream] identifier[chunkFileStream] operator[=] Keyword[new] identifier[ChunkInputStream] operator[SEP] identifier[chunkId] , identifier[chunkStream] , identifier[chunkFile] operator[SEP] identifier[length] operator[SEP] operator[SEP] , identifier[chunk] operator[SEP] identifier[md5Preserved] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[writeSingle] operator[SEP] identifier[spaceId] , identifier[chunkChecksum] , identifier[chunkFileStream] , identifier[attempt] operator[==] identifier[getMaxRetries] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] } Keyword[return] literal[String] operator[SEP] } } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[String] identifier[err] operator[=] literal[String] operator[+] identifier[chunkId] operator[+] literal[String] operator[+] identifier[spaceId] operator[+] literal[String] operator[+] identifier[getMaxRetries] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DuraCloudRuntimeException] operator[SEP] identifier[err] , identifier[e] operator[SEP] operator[SEP] } } } Keyword[finally] { Keyword[if] operator[SEP] Other[null] operator[!=] identifier[chunkFile] operator[&&] identifier[chunkFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] { identifier[FileUtils] operator[SEP] identifier[deleteQuietly] operator[SEP] identifier[chunkFile] operator[SEP] operator[SEP] } } }
public ArrayList<OvhNetwork> project_serviceName_network_public_GET(String serviceName) throws IOException { String qPath = "/cloud/project/{serviceName}/network/public"; StringBuilder sb = path(qPath, serviceName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t7); }
class class_name[name] begin[{] method[project_serviceName_network_public_GET, return_type[type[ArrayList]], modifier[public], parameter[serviceName]] begin[{] local_variable[type[String], qPath] local_variable[type[StringBuilder], sb] local_variable[type[String], resp] return[call[.convertTo, parameter[member[.resp], member[.t7]]]] end[}] END[}]
Keyword[public] identifier[ArrayList] operator[<] identifier[OvhNetwork] operator[>] identifier[project_serviceName_network_public_GET] operator[SEP] identifier[String] identifier[serviceName] 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[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[t7] operator[SEP] operator[SEP] }
public static double[][] cor(double[][] data, double[] mu) { double[][] sigma = cov(data, mu); int n = data[0].length; double[] sd = new double[n]; for (int i = 0; i < n; i++) { sd[i] = sqrt(sigma[i][i]); } for (int i = 0; i < n; i++) { for (int j = 0; j <= i; j++) { sigma[i][j] /= sd[i] * sd[j]; sigma[j][i] = sigma[i][j]; } } return sigma; }
class class_name[name] begin[{] method[cor, return_type[type[double]], modifier[public static], parameter[data, mu]] begin[{] local_variable[type[double], sigma] local_variable[type[int], n] local_variable[type[double], sd] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=sigma, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=sqrt, 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=n, 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=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sigma, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=/=, value=BinaryOperation(operandl=MemberReference(member=sd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=sd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sigma, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=sigma, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, 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) return[member[.sigma]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cor] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[data] , Keyword[double] operator[SEP] operator[SEP] identifier[mu] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sigma] operator[=] identifier[cov] operator[SEP] identifier[data] , identifier[mu] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[=] identifier[data] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[sd] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[n] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[sd] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[sqrt] operator[SEP] identifier[sigma] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<=] identifier[i] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[sigma] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[/=] identifier[sd] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[sd] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[sigma] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[sigma] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[SEP] } } Keyword[return] identifier[sigma] operator[SEP] }
public void addFilter(String name, String classname, Map<String, String> parameters) { final String[] USER_FACING_URLS = { "*.html", "*.jsp" }; defineFilter(webAppContext, name, classname, parameters, USER_FACING_URLS); final String[] ALL_URLS = { "/*" }; for (Map.Entry<Context, Boolean> e : defaultContexts.entrySet()) { if (e.getValue()) { Context ctx = e.getKey(); defineFilter(ctx, name, classname, parameters, ALL_URLS); LOG.info("Added filter " + name + " (class=" + classname + ") to context " + ctx.getDisplayName()); } } filterNames.add(name); }
class class_name[name] begin[{] method[addFilter, return_type[void], modifier[public], parameter[name, classname, parameters]] begin[{] local_variable[type[String], USER_FACING_URLS] call[.defineFilter, parameter[member[.webAppContext], member[.name], member[.classname], member[.parameters], member[.USER_FACING_URLS]]] local_variable[type[String], ALL_URLS] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=ctx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Context, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=classname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ALL_URLS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=defineFilter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Added filter "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (class="), operator=+), operandr=MemberReference(member=classname, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") to context "), operator=+), operandr=MethodInvocation(arguments=[], member=getDisplayName, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=defaultContexts, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Context, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None) call[filterNames.add, parameter[member[.name]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addFilter] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[classname] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parameters] operator[SEP] { Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[USER_FACING_URLS] operator[=] { literal[String] , literal[String] } operator[SEP] identifier[defineFilter] operator[SEP] identifier[webAppContext] , identifier[name] , identifier[classname] , identifier[parameters] , identifier[USER_FACING_URLS] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[ALL_URLS] operator[=] { literal[String] } operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Context] , identifier[Boolean] operator[>] identifier[e] operator[:] identifier[defaultContexts] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] { identifier[Context] identifier[ctx] operator[=] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[defineFilter] operator[SEP] identifier[ctx] , identifier[name] , identifier[classname] , identifier[parameters] , identifier[ALL_URLS] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[classname] operator[+] literal[String] operator[+] identifier[ctx] operator[SEP] identifier[getDisplayName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } identifier[filterNames] operator[SEP] identifier[add] operator[SEP] identifier[name] operator[SEP] operator[SEP] }
public void okResponse(String responseCode, String message) { untagged(); message(OK); responseCode(responseCode); message(message); end(); }
class class_name[name] begin[{] method[okResponse, return_type[void], modifier[public], parameter[responseCode, message]] begin[{] call[.untagged, parameter[]] call[.message, parameter[member[.OK]]] call[.responseCode, parameter[member[.responseCode]]] call[.message, parameter[member[.message]]] call[.end, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[okResponse] operator[SEP] identifier[String] identifier[responseCode] , identifier[String] identifier[message] operator[SEP] { identifier[untagged] operator[SEP] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[OK] operator[SEP] operator[SEP] identifier[responseCode] operator[SEP] identifier[responseCode] operator[SEP] operator[SEP] identifier[message] operator[SEP] identifier[message] operator[SEP] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] }
public void deleteBulkDocsAsync(List<String> indexList, List<String> typeList, QueryBuilder filterQueryBuilder, ActionListener<BulkResponse> bulkResponseActionListener) { indexList.forEach( index -> typeList.forEach(type -> deleteBulkDocsAsync(index, type, filterQueryBuilder, bulkResponseActionListener))); }
class class_name[name] begin[{] method[deleteBulkDocsAsync, return_type[void], modifier[public], parameter[indexList, typeList, filterQueryBuilder, bulkResponseActionListener]] begin[{] call[indexList.forEach, parameter[LambdaExpression(body=MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=filterQueryBuilder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bulkResponseActionListener, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deleteBulkDocsAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), parameters=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=forEach, postfix_operators=[], prefix_operators=[], qualifier=typeList, selectors=[], type_arguments=None), parameters=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] end[}] END[}]
Keyword[public] Keyword[void] identifier[deleteBulkDocsAsync] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[indexList] , identifier[List] operator[<] identifier[String] operator[>] identifier[typeList] , identifier[QueryBuilder] identifier[filterQueryBuilder] , identifier[ActionListener] operator[<] identifier[BulkResponse] operator[>] identifier[bulkResponseActionListener] operator[SEP] { identifier[indexList] operator[SEP] identifier[forEach] operator[SEP] identifier[index] operator[->] identifier[typeList] operator[SEP] identifier[forEach] operator[SEP] identifier[type] operator[->] identifier[deleteBulkDocsAsync] operator[SEP] identifier[index] , identifier[type] , identifier[filterQueryBuilder] , identifier[bulkResponseActionListener] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public EJSWrapperCommon internalCreateWrapper(BeanId beanId) throws CreateException, RemoteException, CSIException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "internalCreateWrapper : " + beanId); // ----------------------------------------------------------------------- // Creating the wrappers for an EJBFactory is fairly simple; there is // only one remote wrapper, which is really just a wrapper around the // HomeOfHomes. // // A different instance of the wrapper class (EJBFactory) is requred // for every binding, to insure it is associated with the correct // cluster, for proper WLM routing. The 'primary key' of an EJBFactory // is the J2EEName of either the applicaton or module, and is used // to obtain the proper cluster identity. // // A special EJSWrapperCommon constructor is used, that processes // just the one wrapper, and avoids the requirement of passing // BeanMetaData. There really is no BMD for the EJBFactory, as it // just represents the HomeOfHomes. // ----------------------------------------------------------------------- EJBFactoryImpl ejbFactory = new EJBFactoryImpl(ivEJBLinkResolver); J2EEName factoryKey = (J2EEName) beanId.getPrimaryKey(); Object cluster = ivContainer.getEJBRuntime().getClusterIdentity(factoryKey); EJSWrapperCommon wrappers = new EJSWrapperCommon(ejbFactory, beanId, cluster, ivContainer); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "internalCreateWrapper : " + wrappers); return wrappers; }
class class_name[name] begin[{] method[internalCreateWrapper, return_type[type[EJSWrapperCommon]], modifier[public], parameter[beanId]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], binary_operation[literal["internalCreateWrapper : "], +, member[.beanId]]]] else begin[{] None end[}] local_variable[type[EJBFactoryImpl], ejbFactory] local_variable[type[J2EEName], factoryKey] local_variable[type[Object], cluster] local_variable[type[EJSWrapperCommon], wrappers] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], binary_operation[literal["internalCreateWrapper : "], +, member[.wrappers]]]] else begin[{] None end[}] return[member[.wrappers]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EJSWrapperCommon] identifier[internalCreateWrapper] operator[SEP] identifier[BeanId] identifier[beanId] operator[SEP] Keyword[throws] identifier[CreateException] , identifier[RemoteException] , identifier[CSIException] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[beanId] operator[SEP] operator[SEP] identifier[EJBFactoryImpl] identifier[ejbFactory] operator[=] Keyword[new] identifier[EJBFactoryImpl] operator[SEP] identifier[ivEJBLinkResolver] operator[SEP] operator[SEP] identifier[J2EEName] identifier[factoryKey] operator[=] operator[SEP] identifier[J2EEName] operator[SEP] identifier[beanId] operator[SEP] identifier[getPrimaryKey] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[cluster] operator[=] identifier[ivContainer] operator[SEP] identifier[getEJBRuntime] operator[SEP] operator[SEP] operator[SEP] identifier[getClusterIdentity] operator[SEP] identifier[factoryKey] operator[SEP] operator[SEP] identifier[EJSWrapperCommon] identifier[wrappers] operator[=] Keyword[new] identifier[EJSWrapperCommon] operator[SEP] identifier[ejbFactory] , identifier[beanId] , identifier[cluster] , identifier[ivContainer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] 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[wrappers] operator[SEP] operator[SEP] Keyword[return] identifier[wrappers] operator[SEP] }
public String getEffectiveProperty(CmsClientSitemapEntry entry, String name) { CmsClientProperty prop = getEffectivePropertyObject(entry, name); if (prop == null) { return null; } return prop.getEffectiveValue(); }
class class_name[name] begin[{] method[getEffectiveProperty, return_type[type[String]], modifier[public], parameter[entry, name]] begin[{] local_variable[type[CmsClientProperty], prop] if[binary_operation[member[.prop], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[call[prop.getEffectiveValue, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getEffectiveProperty] operator[SEP] identifier[CmsClientSitemapEntry] identifier[entry] , identifier[String] identifier[name] operator[SEP] { identifier[CmsClientProperty] identifier[prop] operator[=] identifier[getEffectivePropertyObject] operator[SEP] identifier[entry] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prop] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[prop] operator[SEP] identifier[getEffectiveValue] operator[SEP] operator[SEP] operator[SEP] }
public Variable slice(int dim, int value) throws InvalidRangeException { if ((dim < 0) || (dim >= shape.length)) throw new InvalidRangeException("Slice dim invalid= " + dim); // ok to make slice of record dimension with length 0 boolean recordSliceOk = false; if ((dim == 0) && (value == 0)) { Dimension d = getDimension(0); recordSliceOk = d.isUnlimited(); } // otherwise check slice in range if (!recordSliceOk) { if ((value < 0) || (value >= shape[dim])) throw new InvalidRangeException("Slice value invalid= " + value + " for dimension " + dim); } // create a copy of this variable with a proxy reader Variable sliceV = copy(); // subclasses must override Section slice = new Section(getShapeAsSection()); slice.replaceRange(dim, new Range(value, value)).makeImmutable(); sliceV.setProxyReader(new SliceReader(this, dim, slice)); sliceV.createNewCache(); // dont share the cache sliceV.setCaching(false); // dont cache // remove that dimension - reduce rank sliceV.dimensions.remove(dim); sliceV.resetShape(); return sliceV; }
class class_name[name] begin[{] method[slice, return_type[type[Variable]], modifier[public], parameter[dim, value]] begin[{] if[binary_operation[binary_operation[member[.dim], <, literal[0]], ||, binary_operation[member[.dim], >=, member[shape.length]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Slice dim invalid= "), operandr=MemberReference(member=dim, 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=InvalidRangeException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[boolean], recordSliceOk] if[binary_operation[binary_operation[member[.dim], ==, literal[0]], &&, binary_operation[member[.value], ==, literal[0]]]] begin[{] local_variable[type[Dimension], d] assign[member[.recordSliceOk], call[d.isUnlimited, parameter[]]] else begin[{] None end[}] if[member[.recordSliceOk]] begin[{] if[binary_operation[binary_operation[member[.value], <, literal[0]], ||, binary_operation[member[.value], >=, member[.shape]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Slice value invalid= "), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for dimension "), operator=+), operandr=MemberReference(member=dim, 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=InvalidRangeException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] None end[}] local_variable[type[Variable], sliceV] local_variable[type[Section], slice] call[slice.replaceRange, parameter[member[.dim], ClassCreator(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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=None, dimensions=None, name=Range, sub_type=None))]] call[sliceV.setProxyReader, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=dim, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=slice, 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=SliceReader, sub_type=None))]] call[sliceV.createNewCache, parameter[]] call[sliceV.setCaching, parameter[literal[false]]] call[sliceV.dimensions.remove, parameter[member[.dim]]] call[sliceV.resetShape, parameter[]] return[member[.sliceV]] end[}] END[}]
Keyword[public] identifier[Variable] identifier[slice] operator[SEP] Keyword[int] identifier[dim] , Keyword[int] identifier[value] operator[SEP] Keyword[throws] identifier[InvalidRangeException] { Keyword[if] operator[SEP] operator[SEP] identifier[dim] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] identifier[dim] operator[>=] identifier[shape] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InvalidRangeException] operator[SEP] literal[String] operator[+] identifier[dim] operator[SEP] operator[SEP] Keyword[boolean] identifier[recordSliceOk] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[dim] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] identifier[value] operator[==] Other[0] operator[SEP] operator[SEP] { identifier[Dimension] identifier[d] operator[=] identifier[getDimension] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[recordSliceOk] operator[=] identifier[d] operator[SEP] identifier[isUnlimited] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[recordSliceOk] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[value] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] identifier[value] operator[>=] identifier[shape] operator[SEP] identifier[dim] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[InvalidRangeException] operator[SEP] literal[String] operator[+] identifier[value] operator[+] literal[String] operator[+] identifier[dim] operator[SEP] operator[SEP] } identifier[Variable] identifier[sliceV] operator[=] identifier[copy] operator[SEP] operator[SEP] operator[SEP] identifier[Section] identifier[slice] operator[=] Keyword[new] identifier[Section] operator[SEP] identifier[getShapeAsSection] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[slice] operator[SEP] identifier[replaceRange] operator[SEP] identifier[dim] , Keyword[new] identifier[Range] operator[SEP] identifier[value] , identifier[value] operator[SEP] operator[SEP] operator[SEP] identifier[makeImmutable] operator[SEP] operator[SEP] operator[SEP] identifier[sliceV] operator[SEP] identifier[setProxyReader] operator[SEP] Keyword[new] identifier[SliceReader] operator[SEP] Keyword[this] , identifier[dim] , identifier[slice] operator[SEP] operator[SEP] operator[SEP] identifier[sliceV] operator[SEP] identifier[createNewCache] operator[SEP] operator[SEP] operator[SEP] identifier[sliceV] operator[SEP] identifier[setCaching] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[sliceV] operator[SEP] identifier[dimensions] operator[SEP] identifier[remove] operator[SEP] identifier[dim] operator[SEP] operator[SEP] identifier[sliceV] operator[SEP] identifier[resetShape] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[sliceV] operator[SEP] }
@SafeVarargs public static <T> T randomFrom(T[] array, T... excludes) { return randomFrom(array, Arrays.asList(excludes)); }
class class_name[name] begin[{] method[randomFrom, return_type[type[T]], modifier[public static], parameter[array, excludes]] begin[{] return[call[.randomFrom, parameter[member[.array], call[Arrays.asList, parameter[member[.excludes]]]]]] end[}] END[}]
annotation[@] identifier[SafeVarargs] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[randomFrom] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[array] , identifier[T] operator[...] identifier[excludes] operator[SEP] { Keyword[return] identifier[randomFrom] operator[SEP] identifier[array] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[excludes] operator[SEP] operator[SEP] operator[SEP] }
public synchronized long read(OutputStream stream, long length) throws IOException { if (true) throw new IOException("Not implemented"); boolean recreateBuffer = true; try { if (fileIn != null && stream instanceof FileOutputStream) { // use NIO return fileIn.getChannel().transferTo(0, length, ((FileOutputStream)stream).getChannel()); } else { // bytes copy // choose which kind of stream to use // if this input stream contains enough available bytes we think it's // large content - use // fileIn // if not - use buffered write InputStream readIn; if (fileIn != null && fileIn.available() >= SerializationConstants.INTERNAL_BUFFER_SIZE) { readIn = fileIn; // and use File stream } else { readIn = this.in; recreateBuffer = false; } byte[] buf = new byte[SerializationConstants.INTERNAL_BUFFER_SIZE]; int r; int readed = 0; while ((r = readIn.read(buf)) <= 0) { stream.write(buf, 0, r); readed += r; } return readed; } } finally { if (recreateBuffer) // we cannot use existing buffered stream anymore, create one new this.in = new BufferedInputStream(in, SerializationConstants.INTERNAL_BUFFER_SIZE); } }
class class_name[name] begin[{] method[read, return_type[type[long]], modifier[synchronized public], parameter[stream, length]] begin[{] if[literal[true]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not implemented")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[boolean], recreateBuffer] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=fileIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None), operator=instanceof), operator=&&), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=readIn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=fileIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=available, postfix_operators=[], prefix_operators=[], qualifier=fileIn, selectors=[], type_arguments=None), operandr=MemberReference(member=INTERNAL_BUFFER_SIZE, postfix_operators=[], prefix_operators=[], qualifier=SerializationConstants, selectors=[]), operator=>=), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=readIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=in, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=recreateBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=readIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=fileIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=INTERNAL_BUFFER_SIZE, postfix_operators=[], prefix_operators=[], qualifier=SerializationConstants, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=buf)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=r)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=readed)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=readed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buf, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=readIn, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<=), label=None), ReturnStatement(expression=MemberReference(member=readed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=fileIn, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None))], member=transferTo, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], catches=None, finally_block=[IfStatement(condition=MemberReference(member=recreateBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=in, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=ClassCreator(arguments=[MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=INTERNAL_BUFFER_SIZE, postfix_operators=[], prefix_operators=[], qualifier=SerializationConstants, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedInputStream, sub_type=None))), label=None))], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[long] identifier[read] operator[SEP] identifier[OutputStream] identifier[stream] , Keyword[long] identifier[length] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] literal[boolean] operator[SEP] Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[boolean] identifier[recreateBuffer] operator[=] literal[boolean] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[fileIn] operator[!=] Other[null] operator[&&] identifier[stream] Keyword[instanceof] identifier[FileOutputStream] operator[SEP] { Keyword[return] identifier[fileIn] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] identifier[transferTo] operator[SEP] Other[0] , identifier[length] , operator[SEP] operator[SEP] identifier[FileOutputStream] operator[SEP] identifier[stream] operator[SEP] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[InputStream] identifier[readIn] operator[SEP] Keyword[if] operator[SEP] identifier[fileIn] operator[!=] Other[null] operator[&&] identifier[fileIn] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[>=] identifier[SerializationConstants] operator[SEP] identifier[INTERNAL_BUFFER_SIZE] operator[SEP] { identifier[readIn] operator[=] identifier[fileIn] operator[SEP] } Keyword[else] { identifier[readIn] operator[=] Keyword[this] operator[SEP] identifier[in] operator[SEP] identifier[recreateBuffer] operator[=] literal[boolean] operator[SEP] } Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[SerializationConstants] operator[SEP] identifier[INTERNAL_BUFFER_SIZE] operator[SEP] operator[SEP] Keyword[int] identifier[r] operator[SEP] Keyword[int] identifier[readed] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[r] operator[=] identifier[readIn] operator[SEP] identifier[read] operator[SEP] identifier[buf] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] { identifier[stream] operator[SEP] identifier[write] operator[SEP] identifier[buf] , Other[0] , identifier[r] operator[SEP] operator[SEP] identifier[readed] operator[+=] identifier[r] operator[SEP] } Keyword[return] identifier[readed] operator[SEP] } } Keyword[finally] { Keyword[if] operator[SEP] identifier[recreateBuffer] operator[SEP] Keyword[this] operator[SEP] identifier[in] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[in] , identifier[SerializationConstants] operator[SEP] identifier[INTERNAL_BUFFER_SIZE] operator[SEP] operator[SEP] } }
public void verify(ServerStoreConfiguration serverConfiguration, ServerStoreConfiguration clientConfiguration) throws InvalidServerStoreConfigurationException { StringBuilder sb = new StringBuilder("Existing ServerStore configuration is not compatible with the desired configuration: "); if (!serverConfiguration.isCompatible(clientConfiguration, sb)) { throw new InvalidServerStoreConfigurationException(sb.toString()); } }
class class_name[name] begin[{] method[verify, return_type[void], modifier[public], parameter[serverConfiguration, clientConfiguration]] begin[{] local_variable[type[StringBuilder], sb] if[call[serverConfiguration.isCompatible, parameter[member[.clientConfiguration], member[.sb]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidServerStoreConfigurationException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[verify] operator[SEP] identifier[ServerStoreConfiguration] identifier[serverConfiguration] , identifier[ServerStoreConfiguration] identifier[clientConfiguration] operator[SEP] Keyword[throws] identifier[InvalidServerStoreConfigurationException] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[serverConfiguration] operator[SEP] identifier[isCompatible] operator[SEP] identifier[clientConfiguration] , identifier[sb] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvalidServerStoreConfigurationException] operator[SEP] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@CheckForNull public static InstallState valueOf(@Nonnull String name) { for (InstallState state : all()) { if (name.equals(state.name)) { return state; } } return null; }
class class_name[name] begin[{] method[valueOf, return_type[type[InstallState]], modifier[public static], parameter[name]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=state, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=all, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=state)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InstallState, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
annotation[@] identifier[CheckForNull] Keyword[public] Keyword[static] identifier[InstallState] identifier[valueOf] operator[SEP] annotation[@] identifier[Nonnull] identifier[String] identifier[name] operator[SEP] { Keyword[for] operator[SEP] identifier[InstallState] identifier[state] operator[:] identifier[all] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[state] operator[SEP] identifier[name] operator[SEP] operator[SEP] { Keyword[return] identifier[state] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public static UUID from128(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 15) || (Integer.MAX_VALUE - 15) < offset) { return null; } String uuid; if (littleEndian) { uuid = String.format(GENERIC_UUID_FORMAT, data[offset + 15] & 0xFF, data[offset + 14] & 0xFF, data[offset + 13] & 0xFF, data[offset + 12] & 0xFF, data[offset + 11] & 0xFF, data[offset + 10] & 0xFF, data[offset + 9] & 0xFF, data[offset + 8] & 0xFF, data[offset + 7] & 0xFF, data[offset + 6] & 0xFF, data[offset + 5] & 0xFF, data[offset + 4] & 0xFF, data[offset + 3] & 0xFF, data[offset + 2] & 0xFF, data[offset + 1] & 0xFF, data[offset + 0] & 0xFF); } else { uuid = String.format(GENERIC_UUID_FORMAT, data[offset + 0] & 0xFF, data[offset + 1] & 0xFF, data[offset + 2] & 0xFF, data[offset + 3] & 0xFF, data[offset + 4] & 0xFF, data[offset + 5] & 0xFF, data[offset + 6] & 0xFF, data[offset + 7] & 0xFF, data[offset + 8] & 0xFF, data[offset + 9] & 0xFF, data[offset + 10] & 0xFF, data[offset + 11] & 0xFF, data[offset + 12] & 0xFF, data[offset + 13] & 0xFF, data[offset + 14] & 0xFF, data[offset + 15] & 0xFF); } return UUID.fromString(uuid); }
class class_name[name] begin[{] method[from128, return_type[type[UUID]], modifier[public static], parameter[data, offset, littleEndian]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[member[.data], ==, literal[null]], ||, binary_operation[member[.offset], <, literal[0]]], ||, binary_operation[member[data.length], <=, binary_operation[member[.offset], +, literal[15]]]], ||, binary_operation[binary_operation[member[Integer.MAX_VALUE], -, literal[15]], <, member[.offset]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[String], uuid] if[member[.littleEndian]] begin[{] assign[member[.uuid], call[String.format, parameter[member[.GENERIC_UUID_FORMAT], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]]]]] else begin[{] assign[member[.uuid], call[String.format, parameter[member[.GENERIC_UUID_FORMAT], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]], binary_operation[member[.data], &, literal[0xFF]]]]] end[}] return[call[UUID.fromString, parameter[member[.uuid]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[UUID] identifier[from128] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] , Keyword[int] identifier[offset] , Keyword[boolean] identifier[littleEndian] operator[SEP] { Keyword[if] operator[SEP] identifier[data] operator[==] Other[null] operator[||] identifier[offset] operator[<] Other[0] operator[||] identifier[data] operator[SEP] identifier[length] operator[<=] operator[SEP] identifier[offset] operator[+] Other[15] operator[SEP] operator[||] operator[SEP] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[-] Other[15] operator[SEP] operator[<] identifier[offset] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[String] identifier[uuid] operator[SEP] Keyword[if] operator[SEP] identifier[littleEndian] operator[SEP] { identifier[uuid] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[GENERIC_UUID_FORMAT] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[15] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[14] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[13] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[12] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[11] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[10] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[9] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[8] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[7] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[6] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[5] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[4] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[3] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[2] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[1] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[0] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] } Keyword[else] { identifier[uuid] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[GENERIC_UUID_FORMAT] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[0] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[1] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[2] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[3] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[4] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[5] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[6] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[7] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[8] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[9] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[10] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[11] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[12] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[13] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[14] operator[SEP] operator[&] literal[Integer] , identifier[data] operator[SEP] identifier[offset] operator[+] Other[15] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] } Keyword[return] identifier[UUID] operator[SEP] identifier[fromString] operator[SEP] identifier[uuid] operator[SEP] operator[SEP] }
@Override public ConfusionMessage createCNF() { ConfusionMessage msg = new ConfusionMessageImpl(_CNF_HOLDER.mandatoryCodes, _CNF_HOLDER.mandatoryVariableCodes, _CNF_HOLDER.optionalCodes, _CNF_HOLDER.mandatoryCodeToIndex, _CNF_HOLDER.mandatoryVariableCodeToIndex, _CNF_HOLDER.optionalCodeToIndex); return msg; }
class class_name[name] begin[{] method[createCNF, return_type[type[ConfusionMessage]], modifier[public], parameter[]] begin[{] local_variable[type[ConfusionMessage], msg] return[member[.msg]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ConfusionMessage] identifier[createCNF] operator[SEP] operator[SEP] { identifier[ConfusionMessage] identifier[msg] operator[=] Keyword[new] identifier[ConfusionMessageImpl] operator[SEP] identifier[_CNF_HOLDER] operator[SEP] identifier[mandatoryCodes] , identifier[_CNF_HOLDER] operator[SEP] identifier[mandatoryVariableCodes] , identifier[_CNF_HOLDER] operator[SEP] identifier[optionalCodes] , identifier[_CNF_HOLDER] operator[SEP] identifier[mandatoryCodeToIndex] , identifier[_CNF_HOLDER] operator[SEP] identifier[mandatoryVariableCodeToIndex] , identifier[_CNF_HOLDER] operator[SEP] identifier[optionalCodeToIndex] operator[SEP] operator[SEP] Keyword[return] identifier[msg] operator[SEP] }
public void marshall(CreateLogStreamRequest createLogStreamRequest, ProtocolMarshaller protocolMarshaller) { if (createLogStreamRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createLogStreamRequest.getLogGroupName(), LOGGROUPNAME_BINDING); protocolMarshaller.marshall(createLogStreamRequest.getLogStreamName(), LOGSTREAMNAME_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[createLogStreamRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.createLogStreamRequest], ==, 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=getLogGroupName, postfix_operators=[], prefix_operators=[], qualifier=createLogStreamRequest, selectors=[], type_arguments=None), MemberReference(member=LOGGROUPNAME_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=getLogStreamName, postfix_operators=[], prefix_operators=[], qualifier=createLogStreamRequest, selectors=[], type_arguments=None), MemberReference(member=LOGSTREAMNAME_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[CreateLogStreamRequest] identifier[createLogStreamRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createLogStreamRequest] 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[createLogStreamRequest] operator[SEP] identifier[getLogGroupName] operator[SEP] operator[SEP] , identifier[LOGGROUPNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createLogStreamRequest] operator[SEP] identifier[getLogStreamName] operator[SEP] operator[SEP] , identifier[LOGSTREAMNAME_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] } }
@Nonnull @Nonempty @Deprecated public static String getFieldName (@Nonnull @Nonempty final String sBaseName) { ValueEnforcer.notEmpty (sBaseName, "BaseName"); return sBaseName; }
class class_name[name] begin[{] method[getFieldName, return_type[type[String]], modifier[public static], parameter[sBaseName]] begin[{] call[ValueEnforcer.notEmpty, parameter[member[.sBaseName], literal["BaseName"]]] return[member[.sBaseName]] end[}] END[}]
annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[String] identifier[getFieldName] operator[SEP] annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] Keyword[final] identifier[String] identifier[sBaseName] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notEmpty] operator[SEP] identifier[sBaseName] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sBaseName] operator[SEP] }
public Credentials getCredentials(AuthScope scope) { serverF.setText(scope.getHost()+":"+scope.getPort()); String realmName = scope.getRealm(); if (realmName == null) { realmName = "THREDDS Data Server"; } realmF.setText(realmName); dialog.setVisible( true); if (pwa == null) throw new IllegalStateException(); if (debug) { System.out.println("user= ("+pwa.getUserName()+")"); System.out.println("password= ("+new String(pwa.getPassword())+")"); } // Is this really necessary? UsernamePasswordCredentials upc = new UsernamePasswordCredentials(pwa.getUserName(), new String(pwa.getPassword())); return upc; }
class class_name[name] begin[{] method[getCredentials, return_type[type[Credentials]], modifier[public], parameter[scope]] begin[{] call[serverF.setText, parameter[binary_operation[binary_operation[call[scope.getHost, parameter[]], +, literal[":"]], +, call[scope.getPort, parameter[]]]]] local_variable[type[String], realmName] if[binary_operation[member[.realmName], ==, literal[null]]] begin[{] assign[member[.realmName], literal["THREDDS Data Server"]] else begin[{] None end[}] call[realmF.setText, parameter[member[.realmName]]] call[dialog.setVisible, parameter[literal[true]]] if[binary_operation[member[.pwa], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[member[.debug]] begin[{] call[System.out.println, parameter[binary_operation[binary_operation[literal["user= ("], +, call[pwa.getUserName, parameter[]]], +, literal[")"]]]] call[System.out.println, parameter[binary_operation[binary_operation[literal["password= ("], +, ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPassword, postfix_operators=[], prefix_operators=[], qualifier=pwa, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], +, literal[")"]]]] else begin[{] None end[}] local_variable[type[UsernamePasswordCredentials], upc] return[member[.upc]] end[}] END[}]
Keyword[public] identifier[Credentials] identifier[getCredentials] operator[SEP] identifier[AuthScope] identifier[scope] operator[SEP] { identifier[serverF] operator[SEP] identifier[setText] operator[SEP] identifier[scope] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[scope] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[realmName] operator[=] identifier[scope] operator[SEP] identifier[getRealm] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[realmName] operator[==] Other[null] operator[SEP] { identifier[realmName] operator[=] literal[String] operator[SEP] } identifier[realmF] operator[SEP] identifier[setText] operator[SEP] identifier[realmName] operator[SEP] operator[SEP] identifier[dialog] operator[SEP] identifier[setVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pwa] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[debug] operator[SEP] { identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[pwa] operator[SEP] identifier[getUserName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] Keyword[new] identifier[String] operator[SEP] identifier[pwa] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[UsernamePasswordCredentials] identifier[upc] operator[=] Keyword[new] identifier[UsernamePasswordCredentials] operator[SEP] identifier[pwa] operator[SEP] identifier[getUserName] operator[SEP] operator[SEP] , Keyword[new] identifier[String] operator[SEP] identifier[pwa] operator[SEP] identifier[getPassword] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[upc] operator[SEP] }
@Override public EClass getIfcDuctSegment() { if (ifcDuctSegmentEClass == null) { ifcDuctSegmentEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(202); } return ifcDuctSegmentEClass; }
class class_name[name] begin[{] method[getIfcDuctSegment, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcDuctSegmentEClass], ==, literal[null]]] begin[{] assign[member[.ifcDuctSegmentEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=202)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcDuctSegmentEClass]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getIfcDuctSegment] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcDuctSegmentEClass] operator[==] Other[null] operator[SEP] { identifier[ifcDuctSegmentEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[202] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcDuctSegmentEClass] operator[SEP] }
private void setTrimLeadingWhitespacesByReflection(Renderer result, boolean trimLeadingCommonSourceWhitespaces) { String fieldName = "trimLeadingWhitespace"; if (logger.isDebugEnabled()) { logger.debug("Try setting '{}' field to '{}' for '{}' by reflection.", fieldName, trimLeadingCommonSourceWhitespaces, result); } try { Field field = SimpleRenderer.class.getDeclaredField(fieldName); field.setAccessible(true); field.set(result, trimLeadingCommonSourceWhitespaces); } catch (Exception e) { if (logger.isWarnEnabled()) { // TODO test if it is really logged? logger.warn(String.format("Could not set field '%s' on created SimpleRenderer by reflection due to:", fieldName), e); } } }
class class_name[name] begin[{] method[setTrimLeadingWhitespacesByReflection, return_type[void], modifier[private], parameter[result, trimLeadingCommonSourceWhitespaces]] begin[{] local_variable[type[String], fieldName] if[call[logger.isDebugEnabled, parameter[]]] begin[{] call[logger.debug, parameter[literal["Try setting '{}' field to '{}' for '{}' by reflection."], member[.fieldName], member[.trimLeadingCommonSourceWhitespaces], member[.result]]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDeclaredField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SimpleRenderer, sub_type=None)), name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAccessible, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=trimLeadingCommonSourceWhitespaces, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isWarnEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not set field '%s' on created SimpleRenderer by reflection due to:"), MemberReference(member=fieldName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[setTrimLeadingWhitespacesByReflection] operator[SEP] identifier[Renderer] identifier[result] , Keyword[boolean] identifier[trimLeadingCommonSourceWhitespaces] operator[SEP] { identifier[String] identifier[fieldName] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[fieldName] , identifier[trimLeadingCommonSourceWhitespaces] , identifier[result] operator[SEP] operator[SEP] } Keyword[try] { identifier[Field] identifier[field] operator[=] identifier[SimpleRenderer] operator[SEP] Keyword[class] operator[SEP] identifier[getDeclaredField] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[field] operator[SEP] identifier[set] operator[SEP] identifier[result] , identifier[trimLeadingCommonSourceWhitespaces] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isWarnEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[fieldName] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } }
public void setMode(int mode) { // check arg switch (mode) { case MODE_EXACT: case MODE_JCOMPOUNDMAPPER: break; default: throw new IllegalArgumentException("Invalid mode specified!"); } this.mode = mode; // re-gen atom expressions int numAtoms = mol.getAtomCount(); for (int atomIdx = 0; atomIdx < numAtoms; atomIdx++) this.aexpr[atomIdx] = encodeAtomExpr(atomIdx); }
class class_name[name] begin[{] method[setMode, return_type[void], modifier[public], parameter[mode]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['MODE_EXACT', 'MODE_JCOMPOUNDMAPPER'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid mode specified!")], 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)])], expression=MemberReference(member=mode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) assign[THIS[member[None.mode]], member[.mode]] local_variable[type[int], numAtoms] ForStatement(body=StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=aexpr, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), ArraySelector(index=MemberReference(member=atomIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=atomIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encodeAtomExpr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=atomIdx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numAtoms, 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=atomIdx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=atomIdx, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setMode] operator[SEP] Keyword[int] identifier[mode] operator[SEP] { Keyword[switch] operator[SEP] identifier[mode] operator[SEP] { Keyword[case] identifier[MODE_EXACT] operator[:] Keyword[case] identifier[MODE_JCOMPOUNDMAPPER] operator[:] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[this] operator[SEP] identifier[mode] operator[=] identifier[mode] operator[SEP] Keyword[int] identifier[numAtoms] operator[=] identifier[mol] operator[SEP] identifier[getAtomCount] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[atomIdx] operator[=] Other[0] operator[SEP] identifier[atomIdx] operator[<] identifier[numAtoms] operator[SEP] identifier[atomIdx] operator[++] operator[SEP] Keyword[this] operator[SEP] identifier[aexpr] operator[SEP] identifier[atomIdx] operator[SEP] operator[=] identifier[encodeAtomExpr] operator[SEP] identifier[atomIdx] operator[SEP] operator[SEP] }
public FollowPlaylistRequest.Builder followPlaylist(String owner_id, String playlist_id, boolean public_) { return new FollowPlaylistRequest.Builder(accessToken) .setDefaults(httpManager, scheme, host, port) .owner_id(owner_id) .playlist_id(playlist_id) .public_(public_); }
class class_name[name] begin[{] method[followPlaylist, return_type[type[FollowPlaylistRequest]], modifier[public], parameter[owner_id, playlist_id, public_]] begin[{] return[ClassCreator(arguments=[MemberReference(member=accessToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=httpManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=scheme, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setDefaults, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=owner_id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=owner_id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=playlist_id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=playlist_id, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=public_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=public_, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=FollowPlaylistRequest, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None)))] end[}] END[}]
Keyword[public] identifier[FollowPlaylistRequest] operator[SEP] identifier[Builder] identifier[followPlaylist] operator[SEP] identifier[String] identifier[owner_id] , identifier[String] identifier[playlist_id] , Keyword[boolean] identifier[public_] operator[SEP] { Keyword[return] Keyword[new] identifier[FollowPlaylistRequest] operator[SEP] identifier[Builder] operator[SEP] identifier[accessToken] operator[SEP] operator[SEP] identifier[setDefaults] operator[SEP] identifier[httpManager] , identifier[scheme] , identifier[host] , identifier[port] operator[SEP] operator[SEP] identifier[owner_id] operator[SEP] identifier[owner_id] operator[SEP] operator[SEP] identifier[playlist_id] operator[SEP] identifier[playlist_id] operator[SEP] operator[SEP] identifier[public_] operator[SEP] identifier[public_] operator[SEP] operator[SEP] }
public HttpMessage cookie(final Cookie cookie) { this.cookies.put(cookie.getName(), cookie); setHeader( HttpMessageHeaders.HTTP_COOKIE_PREFIX + cookie.getName(), cookieConverter.getCookieString(cookie)); return this; }
class class_name[name] begin[{] method[cookie, return_type[type[HttpMessage]], modifier[public], parameter[cookie]] begin[{] THIS[member[None.cookies]call[None.put, parameter[call[cookie.getName, parameter[]], member[.cookie]]]] call[.setHeader, parameter[binary_operation[member[HttpMessageHeaders.HTTP_COOKIE_PREFIX], +, call[cookie.getName, parameter[]]], call[cookieConverter.getCookieString, parameter[member[.cookie]]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[HttpMessage] identifier[cookie] operator[SEP] Keyword[final] identifier[Cookie] identifier[cookie] operator[SEP] { Keyword[this] operator[SEP] identifier[cookies] operator[SEP] identifier[put] operator[SEP] identifier[cookie] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[cookie] operator[SEP] operator[SEP] identifier[setHeader] operator[SEP] identifier[HttpMessageHeaders] operator[SEP] identifier[HTTP_COOKIE_PREFIX] operator[+] identifier[cookie] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[cookieConverter] operator[SEP] identifier[getCookieString] operator[SEP] identifier[cookie] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(String name, double[] times, double[] givenZeroRates) { double[] givenDiscountFactors = new double[givenZeroRates.length]; for(int timeIndex=0; timeIndex<times.length;timeIndex++) { givenDiscountFactors[timeIndex] = Math.exp(- givenZeroRates[timeIndex] * times[timeIndex]); } return createDiscountCurveFromDiscountFactors(name, times, givenDiscountFactors); }
class class_name[name] begin[{] method[createDiscountCurveFromZeroRates, return_type[type[DiscountCurveInterpolation]], modifier[public static], parameter[name, times, givenZeroRates]] begin[{] local_variable[type[double], givenDiscountFactors] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=givenDiscountFactors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=timeIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=givenZeroRates, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[ArraySelector(index=MemberReference(member=timeIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=times, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=timeIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*)], member=exp, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=timeIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=times, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=timeIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=timeIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[call[.createDiscountCurveFromDiscountFactors, parameter[member[.name], member[.times], member[.givenDiscountFactors]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[DiscountCurveInterpolation] identifier[createDiscountCurveFromZeroRates] operator[SEP] identifier[String] identifier[name] , Keyword[double] operator[SEP] operator[SEP] identifier[times] , Keyword[double] operator[SEP] operator[SEP] identifier[givenZeroRates] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] identifier[givenDiscountFactors] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[givenZeroRates] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[timeIndex] operator[=] Other[0] operator[SEP] identifier[timeIndex] operator[<] identifier[times] operator[SEP] identifier[length] operator[SEP] identifier[timeIndex] operator[++] operator[SEP] { identifier[givenDiscountFactors] operator[SEP] identifier[timeIndex] operator[SEP] operator[=] identifier[Math] operator[SEP] identifier[exp] operator[SEP] operator[-] identifier[givenZeroRates] operator[SEP] identifier[timeIndex] operator[SEP] operator[*] identifier[times] operator[SEP] identifier[timeIndex] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[createDiscountCurveFromDiscountFactors] operator[SEP] identifier[name] , identifier[times] , identifier[givenDiscountFactors] operator[SEP] operator[SEP] }
private void createFunction(String name, GeometryFunction function) { try { Function.create(getGeoPackage().getConnection().getConnection(), name, function); } catch (SQLException e) { log.log(Level.SEVERE, "Failed to create function: " + name, e); } }
class class_name[name] begin[{] method[createFunction, return_type[void], modifier[private], parameter[name, function]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getGeoPackage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getConnection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getConnection, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=function, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=Function, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to create function: "), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[createFunction] operator[SEP] identifier[String] identifier[name] , identifier[GeometryFunction] identifier[function] operator[SEP] { Keyword[try] { identifier[Function] operator[SEP] identifier[create] operator[SEP] identifier[getGeoPackage] operator[SEP] operator[SEP] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] , identifier[name] , identifier[function] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , literal[String] operator[+] identifier[name] , identifier[e] operator[SEP] operator[SEP] } }
@Nonnull public CascadingStyleSheet addNamespaceRule (@Nonnegative final int nIndex, @Nonnull final CSSNamespaceRule aNamespaceRule) { ValueEnforcer.isGE0 (nIndex, "Index"); ValueEnforcer.notNull (aNamespaceRule, "NamespaceRule"); if (nIndex >= getNamespaceRuleCount ()) m_aNamespaceRules.add (aNamespaceRule); else m_aNamespaceRules.add (nIndex, aNamespaceRule); return this; }
class class_name[name] begin[{] method[addNamespaceRule, return_type[type[CascadingStyleSheet]], modifier[public], parameter[nIndex, aNamespaceRule]] begin[{] call[ValueEnforcer.isGE0, parameter[member[.nIndex], literal["Index"]]] call[ValueEnforcer.notNull, parameter[member[.aNamespaceRule], literal["NamespaceRule"]]] if[binary_operation[member[.nIndex], >=, call[.getNamespaceRuleCount, parameter[]]]] begin[{] call[m_aNamespaceRules.add, parameter[member[.aNamespaceRule]]] else begin[{] call[m_aNamespaceRules.add, parameter[member[.nIndex], member[.aNamespaceRule]]] end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] identifier[CascadingStyleSheet] identifier[addNamespaceRule] operator[SEP] annotation[@] identifier[Nonnegative] Keyword[final] Keyword[int] identifier[nIndex] , annotation[@] identifier[Nonnull] Keyword[final] identifier[CSSNamespaceRule] identifier[aNamespaceRule] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[isGE0] operator[SEP] identifier[nIndex] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aNamespaceRule] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nIndex] operator[>=] identifier[getNamespaceRuleCount] operator[SEP] operator[SEP] operator[SEP] identifier[m_aNamespaceRules] operator[SEP] identifier[add] operator[SEP] identifier[aNamespaceRule] operator[SEP] operator[SEP] Keyword[else] identifier[m_aNamespaceRules] operator[SEP] identifier[add] operator[SEP] identifier[nIndex] , identifier[aNamespaceRule] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public void write(List<? extends File> items) throws Exception { log.info("starting to write {} file(s) to duracloud", items.size()); for (final File file : items) { restoreFile(file, watchDir); } }
class class_name[name] begin[{] method[write, return_type[void], modifier[public], parameter[items]] begin[{] call[log.info, parameter[literal["starting to write {} file(s) to duracloud"], call[items.size, parameter[]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=watchDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=restoreFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=items, 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=File, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[List] operator[<] operator[?] Keyword[extends] identifier[File] operator[>] identifier[items] operator[SEP] Keyword[throws] identifier[Exception] { identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[items] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[File] identifier[file] operator[:] identifier[items] operator[SEP] { identifier[restoreFile] operator[SEP] identifier[file] , identifier[watchDir] operator[SEP] operator[SEP] } }
@WithBridgeMethods(List.class) @Deprecated public RunList<RunT> getBuildsByTimestamp(long start, long end) { return getBuilds().byTimestamp(start,end); }
class class_name[name] begin[{] method[getBuildsByTimestamp, return_type[type[RunList]], modifier[public], parameter[start, end]] begin[{] return[call[.getBuilds, parameter[]]] end[}] END[}]
annotation[@] identifier[WithBridgeMethods] operator[SEP] identifier[List] operator[SEP] Keyword[class] operator[SEP] annotation[@] identifier[Deprecated] Keyword[public] identifier[RunList] operator[<] identifier[RunT] operator[>] identifier[getBuildsByTimestamp] operator[SEP] Keyword[long] identifier[start] , Keyword[long] identifier[end] operator[SEP] { Keyword[return] identifier[getBuilds] operator[SEP] operator[SEP] operator[SEP] identifier[byTimestamp] operator[SEP] identifier[start] , identifier[end] operator[SEP] operator[SEP] }
public static SettingsInsert get(Map<String, String[]> clArgs) { String[] params = clArgs.remove("-insert"); if (params == null) return new SettingsInsert(new InsertOptions()); InsertOptions options = GroupedOptions.select(params, new InsertOptions()); if (options == null) { printHelp(); System.out.println("Invalid -insert options provided, see output for valid options"); System.exit(1); } return new SettingsInsert(options); }
class class_name[name] begin[{] method[get, return_type[type[SettingsInsert]], modifier[public static], parameter[clArgs]] begin[{] local_variable[type[String], params] if[binary_operation[member[.params], ==, literal[null]]] begin[{] return[ClassCreator(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InsertOptions, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SettingsInsert, sub_type=None))] else begin[{] None end[}] local_variable[type[InsertOptions], options] if[binary_operation[member[.options], ==, literal[null]]] begin[{] call[.printHelp, parameter[]] call[System.out.println, parameter[literal["Invalid -insert options provided, see output for valid options"]]] call[System.exit, parameter[literal[1]]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=options, 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=SettingsInsert, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[SettingsInsert] identifier[get] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[SEP] operator[SEP] operator[>] identifier[clArgs] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[params] operator[=] identifier[clArgs] operator[SEP] identifier[remove] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[params] operator[==] Other[null] operator[SEP] Keyword[return] Keyword[new] identifier[SettingsInsert] operator[SEP] Keyword[new] identifier[InsertOptions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[InsertOptions] identifier[options] operator[=] identifier[GroupedOptions] operator[SEP] identifier[select] operator[SEP] identifier[params] , Keyword[new] identifier[InsertOptions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[options] operator[==] Other[null] operator[SEP] { identifier[printHelp] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[SettingsInsert] operator[SEP] identifier[options] operator[SEP] operator[SEP] }
public void marshall(ListJobsRequest listJobsRequest, ProtocolMarshaller protocolMarshaller) { if (listJobsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listJobsRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(listJobsRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(listJobsRequest.getOrder(), ORDER_BINDING); protocolMarshaller.marshall(listJobsRequest.getQueue(), QUEUE_BINDING); protocolMarshaller.marshall(listJobsRequest.getStatus(), STATUS_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[listJobsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.listJobsRequest], ==, 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=listJobsRequest, 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=listJobsRequest, 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), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=listJobsRequest, selectors=[], type_arguments=None), MemberReference(member=ORDER_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=getQueue, postfix_operators=[], prefix_operators=[], qualifier=listJobsRequest, selectors=[], type_arguments=None), MemberReference(member=QUEUE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=listJobsRequest, selectors=[], type_arguments=None), MemberReference(member=STATUS_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], 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[ListJobsRequest] identifier[listJobsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[listJobsRequest] 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[listJobsRequest] operator[SEP] identifier[getMaxResults] operator[SEP] operator[SEP] , identifier[MAXRESULTS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listJobsRequest] operator[SEP] identifier[getNextToken] operator[SEP] operator[SEP] , identifier[NEXTTOKEN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listJobsRequest] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] , identifier[ORDER_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listJobsRequest] operator[SEP] identifier[getQueue] operator[SEP] operator[SEP] , identifier[QUEUE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[listJobsRequest] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public static Result onBackground(Action action) { final HandlerPoster poster = getBackgroundPoster(); if (Looper.myLooper() == poster.getLooper()) { action.call(); return new ActionAsyncTask(action, true); } ActionAsyncTask task = new ActionAsyncTask(action); poster.async(task); return task; }
class class_name[name] begin[{] method[onBackground, return_type[type[Result]], modifier[public static], parameter[action]] begin[{] local_variable[type[HandlerPoster], poster] if[binary_operation[call[Looper.myLooper, parameter[]], ==, call[poster.getLooper, parameter[]]]] begin[{] call[action.call, parameter[]] return[ClassCreator(arguments=[MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ActionAsyncTask, sub_type=None))] else begin[{] None end[}] local_variable[type[ActionAsyncTask], task] call[poster.async, parameter[member[.task]]] return[member[.task]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Result] identifier[onBackground] operator[SEP] identifier[Action] identifier[action] operator[SEP] { Keyword[final] identifier[HandlerPoster] identifier[poster] operator[=] identifier[getBackgroundPoster] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Looper] operator[SEP] identifier[myLooper] operator[SEP] operator[SEP] operator[==] identifier[poster] operator[SEP] identifier[getLooper] operator[SEP] operator[SEP] operator[SEP] { identifier[action] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ActionAsyncTask] operator[SEP] identifier[action] , literal[boolean] operator[SEP] operator[SEP] } identifier[ActionAsyncTask] identifier[task] operator[=] Keyword[new] identifier[ActionAsyncTask] operator[SEP] identifier[action] operator[SEP] operator[SEP] identifier[poster] operator[SEP] identifier[async] operator[SEP] identifier[task] operator[SEP] operator[SEP] Keyword[return] identifier[task] operator[SEP] }