code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public List<T> hasValue(String property, String value) { List<T> geoPackages = new ArrayList<>(); for (PropertiesCoreExtension<T, ?, ?, ?> properties : propertiesMap .values()) { if (properties.hasValue(property, value)) { geoPackages.add(properties.getGeoPackage()); } } return geoPackages; }
class class_name[name] begin[{] method[hasValue, return_type[type[List]], modifier[public], parameter[property, value]] begin[{] local_variable[type[List], geoPackages] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hasValue, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getGeoPackage, postfix_operators=[], prefix_operators=[], qualifier=properties, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=geoPackages, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=propertiesMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=properties)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=PropertiesCoreExtension, sub_type=None))), label=None) return[member[.geoPackages]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[T] operator[>] identifier[hasValue] operator[SEP] identifier[String] identifier[property] , identifier[String] identifier[value] operator[SEP] { identifier[List] operator[<] identifier[T] operator[>] identifier[geoPackages] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PropertiesCoreExtension] operator[<] identifier[T] , operator[?] , operator[?] , operator[?] operator[>] identifier[properties] operator[:] identifier[propertiesMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[properties] operator[SEP] identifier[hasValue] operator[SEP] identifier[property] , identifier[value] operator[SEP] operator[SEP] { identifier[geoPackages] operator[SEP] identifier[add] operator[SEP] identifier[properties] operator[SEP] identifier[getGeoPackage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[geoPackages] operator[SEP] }
public static String[] toStrings(SymbolToken[] symbols, int count) { if (count == 0) return _Private_Utils.EMPTY_STRING_ARRAY; String[] annotations = new String[count]; for (int i = 0; i < count; i++) { SymbolToken tok = symbols[i]; String text = tok.getText(); if (text == null) { throw new UnknownSymbolException(tok.getSid()); } annotations[i] = text; } return annotations; }
class class_name[name] begin[{] method[toStrings, return_type[type[String]], modifier[public static], parameter[symbols, count]] begin[{] if[binary_operation[member[.count], ==, literal[0]]] begin[{] return[member[_Private_Utils.EMPTY_STRING_ARRAY]] else begin[{] None end[}] local_variable[type[String], annotations] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=symbols, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=tok)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SymbolToken, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=tok, selectors=[], type_arguments=None), name=text)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=text, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getSid, postfix_operators=[], prefix_operators=[], qualifier=tok, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnknownSymbolException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=annotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=text, 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=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.annotations]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[toStrings] operator[SEP] identifier[SymbolToken] operator[SEP] operator[SEP] identifier[symbols] , Keyword[int] identifier[count] operator[SEP] { Keyword[if] operator[SEP] identifier[count] operator[==] Other[0] operator[SEP] Keyword[return] identifier[_Private_Utils] operator[SEP] identifier[EMPTY_STRING_ARRAY] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[annotations] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[count] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[count] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[SymbolToken] identifier[tok] operator[=] identifier[symbols] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[String] identifier[text] operator[=] identifier[tok] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[text] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[UnknownSymbolException] operator[SEP] identifier[tok] operator[SEP] identifier[getSid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[annotations] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[text] operator[SEP] } Keyword[return] identifier[annotations] operator[SEP] }
public static void callAnnotated(Object o, Class<? extends Annotation> ann, boolean lazy) { try { getMethodOfInterest(o, ann).invoke(o); } catch (IllegalAccessException ex) { throw new RuntimeException(ex); } catch (InvocationTargetException ex) { throw new RuntimeException(ex.getCause()); } catch (IllegalArgumentException ex) { if (!lazy) { throw new RuntimeException(ex.getMessage()); } } }
class class_name[name] begin[{] method[callAnnotated, return_type[void], modifier[public static], parameter[o, ann, lazy]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ann, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMethodOfInterest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalAccessException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['InvocationTargetException'])), CatchClause(block=[IfStatement(condition=MemberReference(member=lazy, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[callAnnotated] operator[SEP] identifier[Object] identifier[o] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[ann] , Keyword[boolean] identifier[lazy] operator[SEP] { Keyword[try] { identifier[getMethodOfInterest] operator[SEP] identifier[o] , identifier[ann] operator[SEP] operator[SEP] identifier[invoke] operator[SEP] identifier[o] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InvocationTargetException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ex] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[ex] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[lazy] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[ex] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
public static ModelNode createUndefineAttributeOperation(PathAddress address, String name) { return createAttributeOperation(ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION, address, name); }
class class_name[name] begin[{] method[createUndefineAttributeOperation, return_type[type[ModelNode]], modifier[public static], parameter[address, name]] begin[{] return[call[.createAttributeOperation, parameter[member[ModelDescriptionConstants.UNDEFINE_ATTRIBUTE_OPERATION], member[.address], member[.name]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ModelNode] identifier[createUndefineAttributeOperation] operator[SEP] identifier[PathAddress] identifier[address] , identifier[String] identifier[name] operator[SEP] { Keyword[return] identifier[createAttributeOperation] operator[SEP] identifier[ModelDescriptionConstants] operator[SEP] identifier[UNDEFINE_ATTRIBUTE_OPERATION] , identifier[address] , identifier[name] operator[SEP] operator[SEP] }
public String queryString() { if (query == null) { return StringPool.EMPTY; } return HttpUtil.buildQuery(query, queryEncoding); }
class class_name[name] begin[{] method[queryString, return_type[type[String]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.query], ==, literal[null]]] begin[{] return[member[StringPool.EMPTY]] else begin[{] None end[}] return[call[HttpUtil.buildQuery, parameter[member[.query], member[.queryEncoding]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[queryString] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[query] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[StringPool] operator[SEP] identifier[EMPTY] operator[SEP] } Keyword[return] identifier[HttpUtil] operator[SEP] identifier[buildQuery] operator[SEP] identifier[query] , identifier[queryEncoding] operator[SEP] operator[SEP] }
public void init(Object parent, Object strURL) { super.init(parent, strURL); this.setLayout(new BorderLayout()); BaseApplet applet = null; if (strURL instanceof BaseApplet) applet = (BaseApplet)strURL; if (applet == null) applet = this.getBaseApplet(); URL url = null; String path = null; if ((strURL instanceof String) && (((String)strURL).length() > 0)) path = strURL.toString(); else if (strURL instanceof URL) url = (URL)strURL; else if (applet != null) path = applet.getProperty(Params.URL); //System.out.println("URL: " + path); if ((url == null) && (path != null)) url = JHtmlView.getURLFromPath(path, applet); if (applet == null) applet = BaseApplet.getSharedInstance(); m_editorPane = new JHtmlEditor(applet, url); m_editorPane.setOpaque(false); JScrollPane scrollpane = new JScrollPane(); scrollpane.setOpaque(false); // If no background, show mine. scrollpane.setAlignmentX(Component.LEFT_ALIGNMENT); scrollpane.setPreferredSize(new Dimension(10,10)); JViewport vp = scrollpane.getViewport(); vp.setOpaque(false); vp.add(m_editorPane); this.add(scrollpane, BorderLayout.CENTER); }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[parent, strURL]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=strURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) THIS[call[None.setLayout, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BorderLayout, sub_type=None))]]] local_variable[type[BaseApplet], applet] if[binary_operation[member[.strURL], instanceof, type[BaseApplet]]] begin[{] assign[member[.applet], Cast(expression=MemberReference(member=strURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BaseApplet, sub_type=None))] else begin[{] None end[}] if[binary_operation[member[.applet], ==, literal[null]]] begin[{] assign[member[.applet], THIS[call[None.getBaseApplet, parameter[]]]] else begin[{] None end[}] local_variable[type[URL], url] local_variable[type[String], path] if[binary_operation[binary_operation[member[.strURL], instanceof, type[String]], &&, binary_operation[Cast(expression=MemberReference(member=strURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), >, literal[0]]]] begin[{] assign[member[.path], call[strURL.toString, parameter[]]] else begin[{] if[binary_operation[member[.strURL], instanceof, type[URL]]] begin[{] assign[member[.url], Cast(expression=MemberReference(member=strURL, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=URL, sub_type=None))] else begin[{] if[binary_operation[member[.applet], !=, literal[null]]] begin[{] assign[member[.path], call[applet.getProperty, parameter[member[Params.URL]]]] else begin[{] None end[}] end[}] end[}] if[binary_operation[binary_operation[member[.url], ==, literal[null]], &&, binary_operation[member[.path], !=, literal[null]]]] begin[{] assign[member[.url], call[JHtmlView.getURLFromPath, parameter[member[.path], member[.applet]]]] else begin[{] None end[}] if[binary_operation[member[.applet], ==, literal[null]]] begin[{] assign[member[.applet], call[BaseApplet.getSharedInstance, parameter[]]] else begin[{] None end[}] assign[member[.m_editorPane], ClassCreator(arguments=[MemberReference(member=applet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=url, 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=JHtmlEditor, sub_type=None))] call[m_editorPane.setOpaque, parameter[literal[false]]] local_variable[type[JScrollPane], scrollpane] call[scrollpane.setOpaque, parameter[literal[false]]] call[scrollpane.setAlignmentX, parameter[member[Component.LEFT_ALIGNMENT]]] call[scrollpane.setPreferredSize, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dimension, sub_type=None))]] local_variable[type[JViewport], vp] call[vp.setOpaque, parameter[literal[false]]] call[vp.add, parameter[member[.m_editorPane]]] THIS[call[None.add, parameter[member[.scrollpane], member[BorderLayout.CENTER]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[Object] identifier[parent] , identifier[Object] identifier[strURL] operator[SEP] { Keyword[super] operator[SEP] identifier[init] operator[SEP] identifier[parent] , identifier[strURL] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setLayout] operator[SEP] Keyword[new] identifier[BorderLayout] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[BaseApplet] identifier[applet] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[strURL] Keyword[instanceof] identifier[BaseApplet] operator[SEP] identifier[applet] operator[=] operator[SEP] identifier[BaseApplet] operator[SEP] identifier[strURL] operator[SEP] Keyword[if] operator[SEP] identifier[applet] operator[==] Other[null] operator[SEP] identifier[applet] operator[=] Keyword[this] operator[SEP] identifier[getBaseApplet] operator[SEP] operator[SEP] operator[SEP] identifier[URL] identifier[url] operator[=] Other[null] operator[SEP] identifier[String] identifier[path] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[strURL] Keyword[instanceof] identifier[String] operator[SEP] operator[&&] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[strURL] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] operator[SEP] identifier[path] operator[=] identifier[strURL] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[strURL] Keyword[instanceof] identifier[URL] operator[SEP] identifier[url] operator[=] operator[SEP] identifier[URL] operator[SEP] identifier[strURL] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[applet] operator[!=] Other[null] operator[SEP] identifier[path] operator[=] identifier[applet] operator[SEP] identifier[getProperty] operator[SEP] identifier[Params] operator[SEP] identifier[URL] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[url] operator[==] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[path] operator[!=] Other[null] operator[SEP] operator[SEP] identifier[url] operator[=] identifier[JHtmlView] operator[SEP] identifier[getURLFromPath] operator[SEP] identifier[path] , identifier[applet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[applet] operator[==] Other[null] operator[SEP] identifier[applet] operator[=] identifier[BaseApplet] operator[SEP] identifier[getSharedInstance] operator[SEP] operator[SEP] operator[SEP] identifier[m_editorPane] operator[=] Keyword[new] identifier[JHtmlEditor] operator[SEP] identifier[applet] , identifier[url] operator[SEP] operator[SEP] identifier[m_editorPane] operator[SEP] identifier[setOpaque] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[JScrollPane] identifier[scrollpane] operator[=] Keyword[new] identifier[JScrollPane] operator[SEP] operator[SEP] operator[SEP] identifier[scrollpane] operator[SEP] identifier[setOpaque] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[scrollpane] operator[SEP] identifier[setAlignmentX] operator[SEP] identifier[Component] operator[SEP] identifier[LEFT_ALIGNMENT] operator[SEP] operator[SEP] identifier[scrollpane] operator[SEP] identifier[setPreferredSize] operator[SEP] Keyword[new] identifier[Dimension] operator[SEP] Other[10] , Other[10] operator[SEP] operator[SEP] operator[SEP] identifier[JViewport] identifier[vp] operator[=] identifier[scrollpane] operator[SEP] identifier[getViewport] operator[SEP] operator[SEP] operator[SEP] identifier[vp] operator[SEP] identifier[setOpaque] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[vp] operator[SEP] identifier[add] operator[SEP] identifier[m_editorPane] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[add] operator[SEP] identifier[scrollpane] , identifier[BorderLayout] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] }
private Animation createAnimation(MovingParams params) { Animation animation = new TranslateAnimation(0, params.getXAxisDelta(), 0, params.getYAxisDelta()); animation.setFillEnabled(true); animation.setFillBefore(false); animation.setDuration(params.getAnimationDuration()); Interpolator interpolator = params.getAnimationInterpolator(); if (interpolator != null) { animation.setInterpolator(interpolator); } animation.setAnimationListener(new MoveAnimationListener(params)); return animation; }
class class_name[name] begin[{] method[createAnimation, return_type[type[Animation]], modifier[private], parameter[params]] begin[{] local_variable[type[Animation], animation] call[animation.setFillEnabled, parameter[literal[true]]] call[animation.setFillBefore, parameter[literal[false]]] call[animation.setDuration, parameter[call[params.getAnimationDuration, parameter[]]]] local_variable[type[Interpolator], interpolator] if[binary_operation[member[.interpolator], !=, literal[null]]] begin[{] call[animation.setInterpolator, parameter[member[.interpolator]]] else begin[{] None end[}] call[animation.setAnimationListener, parameter[ClassCreator(arguments=[MemberReference(member=params, 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=MoveAnimationListener, sub_type=None))]] return[member[.animation]] end[}] END[}]
Keyword[private] identifier[Animation] identifier[createAnimation] operator[SEP] identifier[MovingParams] identifier[params] operator[SEP] { identifier[Animation] identifier[animation] operator[=] Keyword[new] identifier[TranslateAnimation] operator[SEP] Other[0] , identifier[params] operator[SEP] identifier[getXAxisDelta] operator[SEP] operator[SEP] , Other[0] , identifier[params] operator[SEP] identifier[getYAxisDelta] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[animation] operator[SEP] identifier[setFillEnabled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[animation] operator[SEP] identifier[setFillBefore] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[animation] operator[SEP] identifier[setDuration] operator[SEP] identifier[params] operator[SEP] identifier[getAnimationDuration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Interpolator] identifier[interpolator] operator[=] identifier[params] operator[SEP] identifier[getAnimationInterpolator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[interpolator] operator[!=] Other[null] operator[SEP] { identifier[animation] operator[SEP] identifier[setInterpolator] operator[SEP] identifier[interpolator] operator[SEP] operator[SEP] } identifier[animation] operator[SEP] identifier[setAnimationListener] operator[SEP] Keyword[new] identifier[MoveAnimationListener] operator[SEP] identifier[params] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[animation] operator[SEP] }
private CallStatus beforePromotion() { NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine(); InternalOperationService operationService = nodeEngine.getOperationService(); InternalPartitionServiceImpl partitionService = getService(); if (!partitionService.getMigrationManager().acquirePromotionPermit()) { throw new RetryableHazelcastException("Another promotion is being run currently. " + "This is only expected when promotion is retried to an unresponsive destination."); } ILogger logger = getLogger(); int partitionStateVersion = partitionService.getPartitionStateVersion(); if (partitionState.getVersion() <= partitionStateVersion) { logger.warning("Already applied promotions to the partition state. Promotion state version: " + partitionState.getVersion() + ", current version: " + partitionStateVersion); partitionService.getMigrationManager().releasePromotionPermit(); success = true; return CallStatus.DONE_RESPONSE; } partitionService.getInternalMigrationListener().onPromotionStart(MigrationParticipant.DESTINATION, promotions); if (logger.isFineEnabled()) { logger.fine("Submitting BeforePromotionOperations for " + promotions.size() + " promotions. " + "Promotion partition state version: " + partitionState.getVersion() + ", current partition state version: " + partitionStateVersion); } Runnable beforePromotionsCallback = new BeforePromotionOperationCallback(this, new AtomicInteger(promotions.size())); for (MigrationInfo promotion : promotions) { if (logger.isFinestEnabled()) { logger.finest("Submitting BeforePromotionOperation for promotion: " + promotion); } BeforePromotionOperation op = new BeforePromotionOperation(promotion, beforePromotionsCallback); op.setPartitionId(promotion.getPartitionId()).setNodeEngine(nodeEngine).setService(partitionService); operationService.execute(op); } return CallStatus.DONE_VOID; }
class class_name[name] begin[{] method[beforePromotion, return_type[type[CallStatus]], modifier[private], parameter[]] begin[{] local_variable[type[NodeEngineImpl], nodeEngine] local_variable[type[InternalOperationService], operationService] local_variable[type[InternalPartitionServiceImpl], partitionService] if[call[partitionService.getMigrationManager, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Another promotion is being run currently. "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This is only expected when promotion is retried to an unresponsive destination."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RetryableHazelcastException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[ILogger], logger] local_variable[type[int], partitionStateVersion] if[binary_operation[call[partitionState.getVersion, parameter[]], <=, member[.partitionStateVersion]]] begin[{] call[logger.warning, parameter[binary_operation[binary_operation[binary_operation[literal["Already applied promotions to the partition state. Promotion state version: "], +, call[partitionState.getVersion, parameter[]]], +, literal[", current version: "]], +, member[.partitionStateVersion]]]] call[partitionService.getMigrationManager, parameter[]] assign[member[.success], literal[true]] return[member[CallStatus.DONE_RESPONSE]] else begin[{] None end[}] call[partitionService.getInternalMigrationListener, parameter[]] if[call[logger.isFineEnabled, parameter[]]] begin[{] call[logger.fine, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["Submitting BeforePromotionOperations for "], +, call[promotions.size, parameter[]]], +, literal[" promotions. "]], +, literal["Promotion partition state version: "]], +, call[partitionState.getVersion, parameter[]]], +, literal[", current partition state version: "]], +, member[.partitionStateVersion]]]] else begin[{] None end[}] local_variable[type[Runnable], beforePromotionsCallback] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isFinestEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Submitting BeforePromotionOperation for promotion: "), operandr=MemberReference(member=promotion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=finest, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=promotion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=beforePromotionsCallback, 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=BeforePromotionOperation, sub_type=None)), name=op)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BeforePromotionOperation, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPartitionId, postfix_operators=[], prefix_operators=[], qualifier=promotion, selectors=[], type_arguments=None)], member=setPartitionId, postfix_operators=[], prefix_operators=[], qualifier=op, selectors=[MethodInvocation(arguments=[MemberReference(member=nodeEngine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setNodeEngine, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=partitionService, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setService, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=op, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=execute, postfix_operators=[], prefix_operators=[], qualifier=operationService, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=promotions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=promotion)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MigrationInfo, sub_type=None))), label=None) return[member[CallStatus.DONE_VOID]] end[}] END[}]
Keyword[private] identifier[CallStatus] identifier[beforePromotion] operator[SEP] operator[SEP] { identifier[NodeEngineImpl] identifier[nodeEngine] operator[=] operator[SEP] identifier[NodeEngineImpl] operator[SEP] identifier[getNodeEngine] operator[SEP] operator[SEP] operator[SEP] identifier[InternalOperationService] identifier[operationService] operator[=] identifier[nodeEngine] operator[SEP] identifier[getOperationService] operator[SEP] operator[SEP] operator[SEP] identifier[InternalPartitionServiceImpl] identifier[partitionService] operator[=] identifier[getService] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[partitionService] operator[SEP] identifier[getMigrationManager] operator[SEP] operator[SEP] operator[SEP] identifier[acquirePromotionPermit] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[RetryableHazelcastException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[ILogger] identifier[logger] operator[=] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[partitionStateVersion] operator[=] identifier[partitionService] operator[SEP] identifier[getPartitionStateVersion] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[partitionState] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[<=] identifier[partitionStateVersion] operator[SEP] { identifier[logger] operator[SEP] identifier[warning] operator[SEP] literal[String] operator[+] identifier[partitionState] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[partitionStateVersion] operator[SEP] operator[SEP] identifier[partitionService] operator[SEP] identifier[getMigrationManager] operator[SEP] operator[SEP] operator[SEP] identifier[releasePromotionPermit] operator[SEP] operator[SEP] operator[SEP] identifier[success] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[CallStatus] operator[SEP] identifier[DONE_RESPONSE] operator[SEP] } identifier[partitionService] operator[SEP] identifier[getInternalMigrationListener] operator[SEP] operator[SEP] operator[SEP] identifier[onPromotionStart] operator[SEP] identifier[MigrationParticipant] operator[SEP] identifier[DESTINATION] , identifier[promotions] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isFineEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[promotions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[partitionState] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[partitionStateVersion] operator[SEP] operator[SEP] } identifier[Runnable] identifier[beforePromotionsCallback] operator[=] Keyword[new] identifier[BeforePromotionOperationCallback] operator[SEP] Keyword[this] , Keyword[new] identifier[AtomicInteger] operator[SEP] identifier[promotions] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[MigrationInfo] identifier[promotion] operator[:] identifier[promotions] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isFinestEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[finest] operator[SEP] literal[String] operator[+] identifier[promotion] operator[SEP] operator[SEP] } identifier[BeforePromotionOperation] identifier[op] operator[=] Keyword[new] identifier[BeforePromotionOperation] operator[SEP] identifier[promotion] , identifier[beforePromotionsCallback] operator[SEP] operator[SEP] identifier[op] operator[SEP] identifier[setPartitionId] operator[SEP] identifier[promotion] operator[SEP] identifier[getPartitionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setNodeEngine] operator[SEP] identifier[nodeEngine] operator[SEP] operator[SEP] identifier[setService] operator[SEP] identifier[partitionService] operator[SEP] operator[SEP] identifier[operationService] operator[SEP] identifier[execute] operator[SEP] identifier[op] operator[SEP] operator[SEP] } Keyword[return] identifier[CallStatus] operator[SEP] identifier[DONE_VOID] operator[SEP] }
private Asset getInlineAsset(Resource ntResourceResource, Media media, String fileName) { return new InlineAsset(ntResourceResource, media, fileName, adaptable); }
class class_name[name] begin[{] method[getInlineAsset, return_type[type[Asset]], modifier[private], parameter[ntResourceResource, media, fileName]] begin[{] return[ClassCreator(arguments=[MemberReference(member=ntResourceResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=media, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=adaptable, 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=InlineAsset, sub_type=None))] end[}] END[}]
Keyword[private] identifier[Asset] identifier[getInlineAsset] operator[SEP] identifier[Resource] identifier[ntResourceResource] , identifier[Media] identifier[media] , identifier[String] identifier[fileName] operator[SEP] { Keyword[return] Keyword[new] identifier[InlineAsset] operator[SEP] identifier[ntResourceResource] , identifier[media] , identifier[fileName] , identifier[adaptable] operator[SEP] operator[SEP] }
public static long getHoursDifference(Date startDate, Date endDate) { long startTime = startDate.getTime(); long endTime = endDate.getTime(); long diffTime = endTime - startTime; long diffInHours = TimeUnit.MILLISECONDS.toHours(diffTime); return diffInHours; }
class class_name[name] begin[{] method[getHoursDifference, return_type[type[long]], modifier[public static], parameter[startDate, endDate]] begin[{] local_variable[type[long], startTime] local_variable[type[long], endTime] local_variable[type[long], diffTime] local_variable[type[long], diffInHours] return[member[.diffInHours]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[long] identifier[getHoursDifference] operator[SEP] identifier[Date] identifier[startDate] , identifier[Date] identifier[endDate] operator[SEP] { Keyword[long] identifier[startTime] operator[=] identifier[startDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[endTime] operator[=] identifier[endDate] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[diffTime] operator[=] identifier[endTime] operator[-] identifier[startTime] operator[SEP] Keyword[long] identifier[diffInHours] operator[=] identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] identifier[toHours] operator[SEP] identifier[diffTime] operator[SEP] operator[SEP] Keyword[return] identifier[diffInHours] operator[SEP] }
public static ConnectionHandler register(final String id, final ConnectionHandler handler) { if (id == null || id.length() == 0) { throw new IllegalArgumentException("Invalid ID: " + id); } // end of if if (handler == null) { throw new IllegalArgumentException("Invalid handler: " + handler); } // end of if // --- return handlers.put(id, handler); }
class class_name[name] begin[{] method[register, return_type[type[ConnectionHandler]], modifier[public static], parameter[id, handler]] begin[{] if[binary_operation[binary_operation[member[.id], ==, literal[null]], ||, binary_operation[call[id.length, parameter[]], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid ID: "), operandr=MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.handler], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid handler: "), operandr=MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[handlers.put, parameter[member[.id], member[.handler]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ConnectionHandler] identifier[register] operator[SEP] Keyword[final] identifier[String] identifier[id] , Keyword[final] identifier[ConnectionHandler] identifier[handler] operator[SEP] { Keyword[if] operator[SEP] identifier[id] operator[==] Other[null] operator[||] identifier[id] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[id] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[handler] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[handler] operator[SEP] operator[SEP] } Keyword[return] identifier[handlers] operator[SEP] identifier[put] operator[SEP] identifier[id] , identifier[handler] operator[SEP] operator[SEP] }
public static File copyIntoTempFile(String fileName, InputStream inputStream) throws IOException { BufferedInputStream bufferedStream = inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream : new BufferedInputStream(inputStream); File destFile = null; try { destFile = File.createTempFile(fileName, null); destFile.deleteOnExit(); FileOutputStream fileOutputStream = new FileOutputStream(destFile); BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(fileOutputStream); try { byte[] buffer = new byte[8192]; int length; while ((length = bufferedStream.read(buffer)) > 0) { bufferedOutputStream.write(buffer, 0, length); } } finally { bufferedOutputStream.close(); fileOutputStream.close(); } } finally { bufferedStream.close(); inputStream.close(); } return destFile; }
class class_name[name] begin[{] method[copyIntoTempFile, return_type[type[File]], modifier[public static], parameter[fileName, inputStream]] begin[{] local_variable[type[BufferedInputStream], bufferedStream] local_variable[type[File], destFile] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=destFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=createTempFile, postfix_operators=[], prefix_operators=[], qualifier=File, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=deleteOnExit, postfix_operators=[], prefix_operators=[], qualifier=destFile, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=destFile, 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=FileOutputStream, sub_type=None)), name=fileOutputStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=fileOutputStream, 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=BufferedOutputStream, sub_type=None)), name=bufferedOutputStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedOutputStream, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8192)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte)), name=buffer)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=length)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=bufferedOutputStream, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=bufferedStream, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=bufferedOutputStream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=fileOutputStream, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=bufferedStream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=inputStream, selectors=[], type_arguments=None), label=None)], label=None, resources=None) return[member[.destFile]] end[}] END[}]
Keyword[public] Keyword[static] identifier[File] identifier[copyIntoTempFile] operator[SEP] identifier[String] identifier[fileName] , identifier[InputStream] identifier[inputStream] operator[SEP] Keyword[throws] identifier[IOException] { identifier[BufferedInputStream] identifier[bufferedStream] operator[=] identifier[inputStream] Keyword[instanceof] identifier[BufferedInputStream] operator[?] operator[SEP] identifier[BufferedInputStream] operator[SEP] identifier[inputStream] operator[:] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] identifier[File] identifier[destFile] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[destFile] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] identifier[fileName] , Other[null] operator[SEP] operator[SEP] identifier[destFile] operator[SEP] identifier[deleteOnExit] operator[SEP] operator[SEP] operator[SEP] identifier[FileOutputStream] identifier[fileOutputStream] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[destFile] operator[SEP] operator[SEP] identifier[BufferedOutputStream] identifier[bufferedOutputStream] operator[=] Keyword[new] identifier[BufferedOutputStream] operator[SEP] identifier[fileOutputStream] operator[SEP] operator[SEP] Keyword[try] { Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[8192] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[length] operator[=] identifier[bufferedStream] operator[SEP] identifier[read] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[bufferedOutputStream] operator[SEP] identifier[write] operator[SEP] identifier[buffer] , Other[0] , identifier[length] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[bufferedOutputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[fileOutputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[finally] { identifier[bufferedStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[inputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[destFile] operator[SEP] }
@Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.TILE_TOCRG__XOFFSET: setXOFFSET((Integer)newValue); return; case AfplibPackage.TILE_TOCRG__YOFFSET: setYOFFSET((Integer)newValue); return; case AfplibPackage.TILE_TOCRG__THSIZE: setTHSIZE((Integer)newValue); return; case AfplibPackage.TILE_TOCRG__TVSIZE: setTVSIZE((Integer)newValue); return; case AfplibPackage.TILE_TOCRG__RELRES: setRELRES((Integer)newValue); return; case AfplibPackage.TILE_TOCRG__COMPR: setCOMPR((Integer)newValue); return; case AfplibPackage.TILE_TOCRG__DATAPOS: setDATAPOS((Integer)newValue); return; } super.eSet(featureID, newValue); }
class class_name[name] begin[{] method[eSet, return_type[void], modifier[public], parameter[featureID, newValue]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=TILE_TOCRG__XOFFSET, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setXOFFSET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TILE_TOCRG__YOFFSET, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setYOFFSET, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TILE_TOCRG__THSIZE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setTHSIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TILE_TOCRG__TVSIZE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setTVSIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TILE_TOCRG__RELRES, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setRELRES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TILE_TOCRG__COMPR, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setCOMPR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=TILE_TOCRG__DATAPOS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=setDATAPOS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eSet] operator[SEP] Keyword[int] identifier[featureID] , identifier[Object] identifier[newValue] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[TILE_TOCRG__XOFFSET] operator[:] identifier[setXOFFSET] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[TILE_TOCRG__YOFFSET] operator[:] identifier[setYOFFSET] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[TILE_TOCRG__THSIZE] operator[:] identifier[setTHSIZE] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[TILE_TOCRG__TVSIZE] operator[:] identifier[setTVSIZE] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[TILE_TOCRG__RELRES] operator[:] identifier[setRELRES] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[TILE_TOCRG__COMPR] operator[:] identifier[setCOMPR] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[TILE_TOCRG__DATAPOS] operator[:] identifier[setDATAPOS] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[eSet] operator[SEP] identifier[featureID] , identifier[newValue] operator[SEP] operator[SEP] }
public ApplicationDetail withCloudWatchLoggingOptionDescriptions(CloudWatchLoggingOptionDescription... cloudWatchLoggingOptionDescriptions) { if (this.cloudWatchLoggingOptionDescriptions == null) { setCloudWatchLoggingOptionDescriptions(new java.util.ArrayList<CloudWatchLoggingOptionDescription>(cloudWatchLoggingOptionDescriptions.length)); } for (CloudWatchLoggingOptionDescription ele : cloudWatchLoggingOptionDescriptions) { this.cloudWatchLoggingOptionDescriptions.add(ele); } return this; }
class class_name[name] begin[{] method[withCloudWatchLoggingOptionDescriptions, return_type[type[ApplicationDetail]], modifier[public], parameter[cloudWatchLoggingOptionDescriptions]] begin[{] if[binary_operation[THIS[member[None.cloudWatchLoggingOptionDescriptions]], ==, literal[null]]] begin[{] call[.setCloudWatchLoggingOptionDescriptions, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=cloudWatchLoggingOptionDescriptions, 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=CloudWatchLoggingOptionDescription, 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=cloudWatchLoggingOptionDescriptions, 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=cloudWatchLoggingOptionDescriptions, 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=CloudWatchLoggingOptionDescription, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[ApplicationDetail] identifier[withCloudWatchLoggingOptionDescriptions] operator[SEP] identifier[CloudWatchLoggingOptionDescription] operator[...] identifier[cloudWatchLoggingOptionDescriptions] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[cloudWatchLoggingOptionDescriptions] operator[==] Other[null] operator[SEP] { identifier[setCloudWatchLoggingOptionDescriptions] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[CloudWatchLoggingOptionDescription] operator[>] operator[SEP] identifier[cloudWatchLoggingOptionDescriptions] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[CloudWatchLoggingOptionDescription] identifier[ele] operator[:] identifier[cloudWatchLoggingOptionDescriptions] operator[SEP] { Keyword[this] operator[SEP] identifier[cloudWatchLoggingOptionDescriptions] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public static void write( Document bson, OutputStream stream ) throws IOException { getBsonWriter().write(bson, stream); }
class class_name[name] begin[{] method[write, return_type[void], modifier[public static], parameter[bson, stream]] begin[{] call[.getBsonWriter, parameter[]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[write] operator[SEP] identifier[Document] identifier[bson] , identifier[OutputStream] identifier[stream] operator[SEP] Keyword[throws] identifier[IOException] { identifier[getBsonWriter] operator[SEP] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[bson] , identifier[stream] operator[SEP] operator[SEP] }
private XML checksAttributesExistence(Class<?> aClass,Attribute[] attributes){ String[] attributesNames = new String[attributes.length]; for (int i = attributes.length; i --> 0;) attributesNames[i] = attributes[i].getName(); checksAttributesExistence(aClass,attributesNames); return this; }
class class_name[name] begin[{] method[checksAttributesExistence, return_type[type[XML]], modifier[private], parameter[aClass, attributes]] begin[{] local_variable[type[String], attributesNames] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=attributesNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=None), label=None) call[.checksAttributesExistence, parameter[member[.aClass], member[.attributesNames]]] return[THIS[]] end[}] END[}]
Keyword[private] identifier[XML] identifier[checksAttributesExistence] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[aClass] , identifier[Attribute] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[attributesNames] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[attributes] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[attributes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[--] operator[>] Other[0] operator[SEP] operator[SEP] identifier[attributesNames] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[attributes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[checksAttributesExistence] operator[SEP] identifier[aClass] , identifier[attributesNames] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public Collection<String> getSlaveDataSourceNames() { if (disabledDataSourceNames.isEmpty()) { return super.getSlaveDataSourceNames(); } Collection<String> result = new LinkedList<>(super.getSlaveDataSourceNames()); result.removeAll(disabledDataSourceNames); return result; }
class class_name[name] begin[{] method[getSlaveDataSourceNames, return_type[type[Collection]], modifier[public], parameter[]] begin[{] if[call[disabledDataSourceNames.isEmpty, parameter[]]] begin[{] return[SuperMethodInvocation(arguments=[], member=getSlaveDataSourceNames, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] else begin[{] None end[}] local_variable[type[Collection], result] call[result.removeAll, parameter[member[.disabledDataSourceNames]]] return[member[.result]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Collection] operator[<] identifier[String] operator[>] identifier[getSlaveDataSourceNames] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[disabledDataSourceNames] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[super] operator[SEP] identifier[getSlaveDataSourceNames] operator[SEP] operator[SEP] operator[SEP] } identifier[Collection] operator[<] identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] Keyword[super] operator[SEP] identifier[getSlaveDataSourceNames] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[removeAll] operator[SEP] identifier[disabledDataSourceNames] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static <E, C extends Counter<E>> C L2Normalize(C c) { return scale(c, 1.0 / L2Norm(c)); }
class class_name[name] begin[{] method[L2Normalize, return_type[type[C]], modifier[public static], parameter[c]] begin[{] return[call[.scale, parameter[member[.c], binary_operation[literal[1.0], /, call[.L2Norm, parameter[member[.c]]]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] , identifier[C] Keyword[extends] identifier[Counter] operator[<] identifier[E] operator[>] operator[>] identifier[C] identifier[L2Normalize] operator[SEP] identifier[C] identifier[c] operator[SEP] { Keyword[return] identifier[scale] operator[SEP] identifier[c] , literal[Float] operator[/] identifier[L2Norm] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] }
public boolean goBack() { if (_entries.size() > 0 && (_entries.get(0).getName().equals(".."))) { _list.performItemClick(_list, 0, 0); return true; } return false; }
class class_name[name] begin[{] method[goBack, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[call[_entries.size, parameter[]], >, literal[0]], &&, call[_entries.get, parameter[literal[0]]]]] begin[{] call[_list.performItemClick, parameter[member[._list], literal[0], literal[0]]] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[goBack] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[_entries] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[&&] operator[SEP] identifier[_entries] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] { identifier[_list] operator[SEP] identifier[performItemClick] operator[SEP] identifier[_list] , Other[0] , Other[0] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
@FFDCIgnore(PrivilegedActionException.class) private void resolveListenerAddress() throws PrivilegedActionException { if (host == null) { try { host = AccessController.doPrivileged(new PrivilegedExceptionAction<String>() { @Override public String run() throws UnknownHostException { return InetAddress.getLocalHost().getHostName(); } }); } catch (PrivilegedActionException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "IiopEndpoint cannot determine name of local host", e); } // just punt an use localhost as an absolute fallback. host = "localhost"; } } }
class class_name[name] begin[{] method[resolveListenerAddress, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[member[.host], ==, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getLocalHost, postfix_operators=[], prefix_operators=[], qualifier=InetAddress, selectors=[MethodInvocation(arguments=[], member=getHostName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=['UnknownHostException'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=PrivilegedExceptionAction, sub_type=None))], member=doPrivileged, postfix_operators=[], prefix_operators=[], qualifier=AccessController, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="IiopEndpoint cannot determine name of local host"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="localhost")), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PrivilegedActionException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[FFDCIgnore] operator[SEP] identifier[PrivilegedActionException] operator[SEP] Keyword[class] operator[SEP] Keyword[private] Keyword[void] identifier[resolveListenerAddress] operator[SEP] operator[SEP] Keyword[throws] identifier[PrivilegedActionException] { Keyword[if] operator[SEP] identifier[host] operator[==] Other[null] operator[SEP] { Keyword[try] { identifier[host] operator[=] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedExceptionAction] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[run] operator[SEP] operator[SEP] Keyword[throws] identifier[UnknownHostException] { Keyword[return] identifier[InetAddress] operator[SEP] identifier[getLocalHost] operator[SEP] operator[SEP] operator[SEP] identifier[getHostName] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[PrivilegedActionException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] , identifier[e] operator[SEP] operator[SEP] } identifier[host] operator[=] literal[String] operator[SEP] } } }
public int[] getUnsignedPixelValues(WritableRaster raster) { short[] pixelValues = getPixelValues(raster); int[] unsignedPixelValues = getUnsignedPixelValues(pixelValues); return unsignedPixelValues; }
class class_name[name] begin[{] method[getUnsignedPixelValues, return_type[type[int]], modifier[public], parameter[raster]] begin[{] local_variable[type[short], pixelValues] local_variable[type[int], unsignedPixelValues] return[member[.unsignedPixelValues]] end[}] END[}]
Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[getUnsignedPixelValues] operator[SEP] identifier[WritableRaster] identifier[raster] operator[SEP] { Keyword[short] operator[SEP] operator[SEP] identifier[pixelValues] operator[=] identifier[getPixelValues] operator[SEP] identifier[raster] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[unsignedPixelValues] operator[=] identifier[getUnsignedPixelValues] operator[SEP] identifier[pixelValues] operator[SEP] operator[SEP] Keyword[return] identifier[unsignedPixelValues] operator[SEP] }
private List<ViewApplicationActionEventPageElementDailySummary> getApplicationActionEventPageElementDailySummaryList( final String page, final String elementId) { final DataContainer<ViewApplicationActionEventPageElementDailySummary, ApplicationActionEventPageElementPeriodSummaryEmbeddedId> documentTypeSummaryDailyDataContainer = getApplicationManager() .getDataContainer(ViewApplicationActionEventPageElementDailySummary.class); final List<ViewApplicationActionEventPageElementDailySummary> findOrderedListByEmbeddedProperty = documentTypeSummaryDailyDataContainer .findOrderedListByEmbeddedProperty(ViewApplicationActionEventPageElementDailySummary.class, ViewApplicationActionEventPageElementDailySummary_.embeddedId, ApplicationActionEventPageElementPeriodSummaryEmbeddedId.class, ApplicationActionEventPageElementPeriodSummaryEmbeddedId_.elementId, elementId, ApplicationActionEventPageElementPeriodSummaryEmbeddedId_.createdDate); return findOrderedListByEmbeddedProperty.parallelStream() .filter(t -> t != null && t.getEmbeddedId().getPage().equals(page)).collect(Collectors.toList()); }
class class_name[name] begin[{] method[getApplicationActionEventPageElementDailySummaryList, return_type[type[List]], modifier[private], parameter[page, elementId]] begin[{] local_variable[type[DataContainer], documentTypeSummaryDailyDataContainer] local_variable[type[List], findOrderedListByEmbeddedProperty] return[call[findOrderedListByEmbeddedProperty.parallelStream, parameter[]]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[ViewApplicationActionEventPageElementDailySummary] operator[>] identifier[getApplicationActionEventPageElementDailySummaryList] operator[SEP] Keyword[final] identifier[String] identifier[page] , Keyword[final] identifier[String] identifier[elementId] operator[SEP] { Keyword[final] identifier[DataContainer] operator[<] identifier[ViewApplicationActionEventPageElementDailySummary] , identifier[ApplicationActionEventPageElementPeriodSummaryEmbeddedId] operator[>] identifier[documentTypeSummaryDailyDataContainer] operator[=] identifier[getApplicationManager] operator[SEP] operator[SEP] operator[SEP] identifier[getDataContainer] operator[SEP] identifier[ViewApplicationActionEventPageElementDailySummary] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[ViewApplicationActionEventPageElementDailySummary] operator[>] identifier[findOrderedListByEmbeddedProperty] operator[=] identifier[documentTypeSummaryDailyDataContainer] operator[SEP] identifier[findOrderedListByEmbeddedProperty] operator[SEP] identifier[ViewApplicationActionEventPageElementDailySummary] operator[SEP] Keyword[class] , identifier[ViewApplicationActionEventPageElementDailySummary_] operator[SEP] identifier[embeddedId] , identifier[ApplicationActionEventPageElementPeriodSummaryEmbeddedId] operator[SEP] Keyword[class] , identifier[ApplicationActionEventPageElementPeriodSummaryEmbeddedId_] operator[SEP] identifier[elementId] , identifier[elementId] , identifier[ApplicationActionEventPageElementPeriodSummaryEmbeddedId_] operator[SEP] identifier[createdDate] operator[SEP] operator[SEP] Keyword[return] identifier[findOrderedListByEmbeddedProperty] operator[SEP] identifier[parallelStream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[t] operator[->] identifier[t] operator[!=] Other[null] operator[&&] identifier[t] operator[SEP] identifier[getEmbeddedId] operator[SEP] operator[SEP] operator[SEP] identifier[getPage] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[page] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private boolean isIncluded(String _fqcn) { if (includePackageNames.contains(_fqcn)) { return true; } String packageName = _fqcn.substring(0, _fqcn.lastIndexOf('.') + 1); for (String str : includePackageNames) { if (packageName.startsWith(str)) { return true; } } return false; }
class class_name[name] begin[{] method[isIncluded, return_type[type[boolean]], modifier[private], parameter[_fqcn]] begin[{] if[call[includePackageNames.contains, parameter[member[._fqcn]]]] begin[{] return[literal[true]] else begin[{] None end[}] local_variable[type[String], packageName] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=packageName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=includePackageNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=str)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isIncluded] operator[SEP] identifier[String] identifier[_fqcn] operator[SEP] { Keyword[if] operator[SEP] identifier[includePackageNames] operator[SEP] identifier[contains] operator[SEP] identifier[_fqcn] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } identifier[String] identifier[packageName] operator[=] identifier[_fqcn] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[_fqcn] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[str] operator[:] identifier[includePackageNames] operator[SEP] { Keyword[if] operator[SEP] identifier[packageName] operator[SEP] identifier[startsWith] operator[SEP] identifier[str] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public static Optional<Scheme> tryParse(@Nullable String scheme) { if (scheme == null) { return Optional.empty(); } return Optional.ofNullable(SCHEMES.get(Ascii.toLowerCase(scheme))); }
class class_name[name] begin[{] method[tryParse, return_type[type[Optional]], modifier[public static], parameter[scheme]] begin[{] if[binary_operation[member[.scheme], ==, literal[null]]] begin[{] return[call[Optional.empty, parameter[]]] else begin[{] None end[}] return[call[Optional.ofNullable, parameter[call[SCHEMES.get, parameter[call[Ascii.toLowerCase, parameter[member[.scheme]]]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Optional] operator[<] identifier[Scheme] operator[>] identifier[tryParse] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[scheme] operator[SEP] { Keyword[if] operator[SEP] identifier[scheme] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[Optional] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Optional] operator[SEP] identifier[ofNullable] operator[SEP] identifier[SCHEMES] operator[SEP] identifier[get] operator[SEP] identifier[Ascii] operator[SEP] identifier[toLowerCase] operator[SEP] identifier[scheme] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private URIBuilder addFieldsParam(URIBuilder builder, Class<? extends BaseResource> type, Collection<? extends Field> fields) { List<String> fieldNames = new ArrayList<>(); for (Field f : fields) { fieldNames.add(f.getPropertyName()); } String typeStr = BaseResource.getType(type); builder.addParameter("fields[" + typeStr + "]", String.join(",", fieldNames)); return builder; }
class class_name[name] begin[{] method[addFieldsParam, return_type[type[URIBuilder]], modifier[private], parameter[builder, type, fields]] begin[{] local_variable[type[List], fieldNames] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPropertyName, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=fieldNames, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None) local_variable[type[String], typeStr] call[builder.addParameter, parameter[binary_operation[binary_operation[literal["fields["], +, member[.typeStr]], +, literal["]"]], call[String.join, parameter[literal[","], member[.fieldNames]]]]] return[member[.builder]] end[}] END[}]
Keyword[private] identifier[URIBuilder] identifier[addFieldsParam] operator[SEP] identifier[URIBuilder] identifier[builder] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[BaseResource] operator[>] identifier[type] , identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[Field] operator[>] identifier[fields] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[fieldNames] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[f] operator[:] identifier[fields] operator[SEP] { identifier[fieldNames] operator[SEP] identifier[add] operator[SEP] identifier[f] operator[SEP] identifier[getPropertyName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[typeStr] operator[=] identifier[BaseResource] operator[SEP] identifier[getType] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[addParameter] operator[SEP] literal[String] operator[+] identifier[typeStr] operator[+] literal[String] , identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[fieldNames] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] }
public final void increaseReadBytes(long increment, long currentTime) { if (increment <= 0) { return; } readBytes += increment; lastReadTime = currentTime; idleCountForBoth.set(0); idleCountForRead.set(0); // if (getService() instanceof AbstractIoService) { // ((AbstractIoService) getService()).getStatistics().increaseReadBytes(increment, currentTime); // } }
class class_name[name] begin[{] method[increaseReadBytes, return_type[void], modifier[final public], parameter[increment, currentTime]] begin[{] if[binary_operation[member[.increment], <=, literal[0]]] begin[{] return[None] else begin[{] None end[}] assign[member[.readBytes], member[.increment]] assign[member[.lastReadTime], member[.currentTime]] call[idleCountForBoth.set, parameter[literal[0]]] call[idleCountForRead.set, parameter[literal[0]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[increaseReadBytes] operator[SEP] Keyword[long] identifier[increment] , Keyword[long] identifier[currentTime] operator[SEP] { Keyword[if] operator[SEP] identifier[increment] operator[<=] Other[0] operator[SEP] { Keyword[return] operator[SEP] } identifier[readBytes] operator[+=] identifier[increment] operator[SEP] identifier[lastReadTime] operator[=] identifier[currentTime] operator[SEP] identifier[idleCountForBoth] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[idleCountForRead] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] }
public static <T> Set<T> modes(Collection<T> values) { Counter<T> counter = new ClassicCounter<T>(values); List<Double> sortedCounts = CollectionUtils.sorted(counter.values()); Double highestCount = sortedCounts.get(sortedCounts.size() - 1); Counters.retainAbove(counter, highestCount); return counter.keySet(); }
class class_name[name] begin[{] method[modes, return_type[type[Set]], modifier[public static], parameter[values]] begin[{] local_variable[type[Counter], counter] local_variable[type[List], sortedCounts] local_variable[type[Double], highestCount] call[Counters.retainAbove, parameter[member[.counter], member[.highestCount]]] return[call[counter.keySet, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Set] operator[<] identifier[T] operator[>] identifier[modes] operator[SEP] identifier[Collection] operator[<] identifier[T] operator[>] identifier[values] operator[SEP] { identifier[Counter] operator[<] identifier[T] operator[>] identifier[counter] operator[=] Keyword[new] identifier[ClassicCounter] operator[<] identifier[T] operator[>] operator[SEP] identifier[values] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Double] operator[>] identifier[sortedCounts] operator[=] identifier[CollectionUtils] operator[SEP] identifier[sorted] operator[SEP] identifier[counter] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Double] identifier[highestCount] operator[=] identifier[sortedCounts] operator[SEP] identifier[get] operator[SEP] identifier[sortedCounts] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[Counters] operator[SEP] identifier[retainAbove] operator[SEP] identifier[counter] , identifier[highestCount] operator[SEP] operator[SEP] Keyword[return] identifier[counter] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] }
private static void setContentTypeHeader(HttpResponse response, File file) { String contentType = StringKit.mimeType(file.getName()); if (null == contentType) { contentType = URLConnection.guessContentTypeFromName(file.getName()); } response.headers().set(HttpConst.CONTENT_TYPE, contentType); }
class class_name[name] begin[{] method[setContentTypeHeader, return_type[void], modifier[private static], parameter[response, file]] begin[{] local_variable[type[String], contentType] if[binary_operation[literal[null], ==, member[.contentType]]] begin[{] assign[member[.contentType], call[URLConnection.guessContentTypeFromName, parameter[call[file.getName, parameter[]]]]] else begin[{] None end[}] call[response.headers, parameter[]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[setContentTypeHeader] operator[SEP] identifier[HttpResponse] identifier[response] , identifier[File] identifier[file] operator[SEP] { identifier[String] identifier[contentType] operator[=] identifier[StringKit] operator[SEP] identifier[mimeType] operator[SEP] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[contentType] operator[SEP] { identifier[contentType] operator[=] identifier[URLConnection] operator[SEP] identifier[guessContentTypeFromName] operator[SEP] identifier[file] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[response] operator[SEP] identifier[headers] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[HttpConst] operator[SEP] identifier[CONTENT_TYPE] , identifier[contentType] operator[SEP] operator[SEP] }
void validateStopCloseForMessageListener(String functionCall) throws IllegalStateException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "validateStopForMessageListener"); //Before triggering onMessage .. SIB pushes "owning session object" to Thread Local, //Now obtain the Session object from Thread Local and validate with 'this'. if ((JmsSessionImpl.asyncReceiverThreadLocal.get() != null) && (JmsSessionImpl.asyncReceiverThreadLocal.get() == this)) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Message Listener onMessage called stop on its own Context/connection."); if (functionCall.equalsIgnoreCase("stop")) { //stop is called. //the stop call is driven from this JmsSessionImpl object only.. throw JMSException throw (IllegalStateException) JmsErrorUtils.newThrowable(IllegalStateException.class, "INVALID_METHOD_CWSIA0517", new Object[] { this }, tc ); } else { //close is called //the stop call is driven from this JmsSessionImpl object only.. throw JMSException throw (IllegalStateException) JmsErrorUtils.newThrowable(IllegalStateException.class, "INVALID_METHOD_CWSIA0518", new Object[] { this }, tc ); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "validateStopForMessageListener"); }
class class_name[name] begin[{] method[validateStopCloseForMessageListener, return_type[void], modifier[default], parameter[functionCall]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["validateStopForMessageListener"]]] else begin[{] None end[}] if[binary_operation[binary_operation[call[JmsSessionImpl.asyncReceiverThreadLocal.get, parameter[]], !=, literal[null]], &&, binary_operation[call[JmsSessionImpl.asyncReceiverThreadLocal.get, parameter[]], ==, THIS[]]]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{] call[SibTr.debug, parameter[member[.tc], literal["Message Listener onMessage called stop on its own Context/connection."]]] else begin[{] None end[}] if[call[functionCall.equalsIgnoreCase, parameter[literal["stop"]]]] begin[{] ThrowStatement(expression=Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INVALID_METHOD_CWSIA0517"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newThrowable, postfix_operators=[], prefix_operators=[], qualifier=JmsErrorUtils, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IllegalStateException, sub_type=None)), label=None) else begin[{] ThrowStatement(expression=Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="INVALID_METHOD_CWSIA0518"), ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None)), MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newThrowable, postfix_operators=[], prefix_operators=[], qualifier=JmsErrorUtils, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=IllegalStateException, sub_type=None)), label=None) end[}] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[THIS[], member[.tc], literal["validateStopForMessageListener"]]] else begin[{] None end[}] end[}] END[}]
Keyword[void] identifier[validateStopCloseForMessageListener] operator[SEP] identifier[String] identifier[functionCall] operator[SEP] Keyword[throws] identifier[IllegalStateException] { 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[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[JmsSessionImpl] operator[SEP] identifier[asyncReceiverThreadLocal] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[&&] operator[SEP] identifier[JmsSessionImpl] operator[SEP] identifier[asyncReceiverThreadLocal] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[==] Keyword[this] 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[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[functionCall] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[throw] operator[SEP] identifier[IllegalStateException] operator[SEP] identifier[JmsErrorUtils] operator[SEP] identifier[newThrowable] operator[SEP] identifier[IllegalStateException] operator[SEP] Keyword[class] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { Keyword[this] } , identifier[tc] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] operator[SEP] identifier[IllegalStateException] operator[SEP] identifier[JmsErrorUtils] operator[SEP] identifier[newThrowable] operator[SEP] identifier[IllegalStateException] operator[SEP] Keyword[class] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { Keyword[this] } , identifier[tc] 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[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] operator[SEP] operator[SEP] }
@Override protected RemoteAppenderClient createClient(String id, Socket socket) throws IOException { return new RemoteAppenderStreamClient(id, socket); }
class class_name[name] begin[{] method[createClient, return_type[type[RemoteAppenderClient]], modifier[protected], parameter[id, socket]] begin[{] return[ClassCreator(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=socket, 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=RemoteAppenderStreamClient, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] identifier[RemoteAppenderClient] identifier[createClient] operator[SEP] identifier[String] identifier[id] , identifier[Socket] identifier[socket] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] Keyword[new] identifier[RemoteAppenderStreamClient] operator[SEP] identifier[id] , identifier[socket] operator[SEP] operator[SEP] }
public Datatype.Builder addAllValueTypeAnnotations(Spliterator<? extends Excerpt> elements) { if ((elements.characteristics() & Spliterator.SIZED) != 0) { long elementsSize = elements.estimateSize(); if (elementsSize > 0 && elementsSize <= Integer.MAX_VALUE) { if (valueTypeAnnotations instanceof ImmutableList) { valueTypeAnnotations = new ArrayList<>(valueTypeAnnotations); } ((ArrayList<?>) valueTypeAnnotations) .ensureCapacity(valueTypeAnnotations.size() + (int) elementsSize); } } elements.forEachRemaining(this::addValueTypeAnnotations); return (Datatype.Builder) this; }
class class_name[name] begin[{] method[addAllValueTypeAnnotations, return_type[type[Datatype]], modifier[public], parameter[elements]] begin[{] if[binary_operation[binary_operation[call[elements.characteristics, parameter[]], &, member[Spliterator.SIZED]], !=, literal[0]]] begin[{] local_variable[type[long], elementsSize] if[binary_operation[binary_operation[member[.elementsSize], >, literal[0]], &&, binary_operation[member[.elementsSize], <=, member[Integer.MAX_VALUE]]]] begin[{] if[binary_operation[member[.valueTypeAnnotations], instanceof, type[ImmutableList]]] begin[{] assign[member[.valueTypeAnnotations], ClassCreator(arguments=[MemberReference(member=valueTypeAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] Cast(expression=MemberReference(member=valueTypeAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=ArrayList, sub_type=None)) else begin[{] None end[}] else begin[{] None end[}] call[elements.forEachRemaining, parameter[MethodReference(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), method=MemberReference(member=addValueTypeAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]] return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Datatype, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None)))] end[}] END[}]
Keyword[public] identifier[Datatype] operator[SEP] identifier[Builder] identifier[addAllValueTypeAnnotations] operator[SEP] identifier[Spliterator] operator[<] operator[?] Keyword[extends] identifier[Excerpt] operator[>] identifier[elements] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[elements] operator[SEP] identifier[characteristics] operator[SEP] operator[SEP] operator[&] identifier[Spliterator] operator[SEP] identifier[SIZED] operator[SEP] operator[!=] Other[0] operator[SEP] { Keyword[long] identifier[elementsSize] operator[=] identifier[elements] operator[SEP] identifier[estimateSize] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[elementsSize] operator[>] Other[0] operator[&&] identifier[elementsSize] operator[<=] identifier[Integer] operator[SEP] identifier[MAX_VALUE] operator[SEP] { Keyword[if] operator[SEP] identifier[valueTypeAnnotations] Keyword[instanceof] identifier[ImmutableList] operator[SEP] { identifier[valueTypeAnnotations] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[valueTypeAnnotations] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] identifier[ArrayList] operator[<] operator[?] operator[>] operator[SEP] identifier[valueTypeAnnotations] operator[SEP] operator[SEP] identifier[ensureCapacity] operator[SEP] identifier[valueTypeAnnotations] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] operator[SEP] Keyword[int] operator[SEP] identifier[elementsSize] operator[SEP] operator[SEP] } } identifier[elements] operator[SEP] identifier[forEachRemaining] operator[SEP] Keyword[this] operator[::] identifier[addValueTypeAnnotations] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[Datatype] operator[SEP] identifier[Builder] operator[SEP] Keyword[this] operator[SEP] }
static Scenario scenario(String text) { reset(); final Scenario scenario = new Scenario(text); sRoot = scenario; return scenario; }
class class_name[name] begin[{] method[scenario, return_type[type[Scenario]], modifier[static], parameter[text]] begin[{] call[.reset, parameter[]] local_variable[type[Scenario], scenario] assign[member[.sRoot], member[.scenario]] return[member[.scenario]] end[}] END[}]
Keyword[static] identifier[Scenario] identifier[scenario] operator[SEP] identifier[String] identifier[text] operator[SEP] { identifier[reset] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Scenario] identifier[scenario] operator[=] Keyword[new] identifier[Scenario] operator[SEP] identifier[text] operator[SEP] operator[SEP] identifier[sRoot] operator[=] identifier[scenario] operator[SEP] Keyword[return] identifier[scenario] operator[SEP] }
public static Slice currentTokenAsVarchar(JsonParser parser) throws IOException { switch (parser.currentToken()) { case VALUE_NULL: return null; case VALUE_STRING: case FIELD_NAME: return Slices.utf8Slice(parser.getText()); case VALUE_NUMBER_FLOAT: // Avoidance of loss of precision does not seem to be possible here because of Jackson implementation. return DoubleOperators.castToVarchar(parser.getDoubleValue()); case VALUE_NUMBER_INT: // An alternative is calling getLongValue and then BigintOperators.castToVarchar. // It doesn't work as well because it can result in overflow and underflow exceptions for large integral numbers. return Slices.utf8Slice(parser.getText()); case VALUE_TRUE: return BooleanOperators.castToVarchar(true); case VALUE_FALSE: return BooleanOperators.castToVarchar(false); default: throw new JsonCastException(format("Unexpected token when cast to %s: %s", StandardTypes.VARCHAR, parser.getText())); } }
class class_name[name] begin[{] method[currentTokenAsVarchar, return_type[type[Slice]], modifier[public static], parameter[parser]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=['VALUE_NULL'], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]), SwitchStatementCase(case=['VALUE_STRING', 'FIELD_NAME'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None)], member=utf8Slice, postfix_operators=[], prefix_operators=[], qualifier=Slices, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['VALUE_NUMBER_FLOAT'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDoubleValue, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None)], member=castToVarchar, postfix_operators=[], prefix_operators=[], qualifier=DoubleOperators, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['VALUE_NUMBER_INT'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None)], member=utf8Slice, postfix_operators=[], prefix_operators=[], qualifier=Slices, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['VALUE_TRUE'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=castToVarchar, postfix_operators=[], prefix_operators=[], qualifier=BooleanOperators, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['VALUE_FALSE'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=castToVarchar, postfix_operators=[], prefix_operators=[], qualifier=BooleanOperators, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected token when cast to %s: %s"), MemberReference(member=VARCHAR, postfix_operators=[], prefix_operators=[], qualifier=StandardTypes, selectors=[]), MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None)], member=format, 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=JsonCastException, sub_type=None)), label=None)])], expression=MethodInvocation(arguments=[], member=currentToken, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[Slice] identifier[currentTokenAsVarchar] operator[SEP] identifier[JsonParser] identifier[parser] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[switch] operator[SEP] identifier[parser] operator[SEP] identifier[currentToken] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[VALUE_NULL] operator[:] Keyword[return] Other[null] operator[SEP] Keyword[case] identifier[VALUE_STRING] operator[:] Keyword[case] identifier[FIELD_NAME] operator[:] Keyword[return] identifier[Slices] operator[SEP] identifier[utf8Slice] operator[SEP] identifier[parser] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[VALUE_NUMBER_FLOAT] operator[:] Keyword[return] identifier[DoubleOperators] operator[SEP] identifier[castToVarchar] operator[SEP] identifier[parser] operator[SEP] identifier[getDoubleValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[VALUE_NUMBER_INT] operator[:] Keyword[return] identifier[Slices] operator[SEP] identifier[utf8Slice] operator[SEP] identifier[parser] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[VALUE_TRUE] operator[:] Keyword[return] identifier[BooleanOperators] operator[SEP] identifier[castToVarchar] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[case] identifier[VALUE_FALSE] operator[:] Keyword[return] identifier[BooleanOperators] operator[SEP] identifier[castToVarchar] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[JsonCastException] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[StandardTypes] operator[SEP] identifier[VARCHAR] , identifier[parser] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@Override public JSONObject toJSON() throws JSONException { JSONObject json = super.toJSON(); JSONArray features = new JSONArray(); for (Feature feature : this.mFeatures) { features.put(feature.toJSON()); } json.put(JSON_FEATURES, features); return json; }
class class_name[name] begin[{] method[toJSON, return_type[type[JSONObject]], modifier[public], parameter[]] begin[{] local_variable[type[JSONObject], json] local_variable[type[JSONArray], features] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toJSON, postfix_operators=[], prefix_operators=[], qualifier=feature, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=features, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=mFeatures, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=feature)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Feature, sub_type=None))), label=None) call[json.put, parameter[member[.JSON_FEATURES], member[.features]]] return[member[.json]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[JSONObject] identifier[toJSON] operator[SEP] operator[SEP] Keyword[throws] identifier[JSONException] { identifier[JSONObject] identifier[json] operator[=] Keyword[super] operator[SEP] identifier[toJSON] operator[SEP] operator[SEP] operator[SEP] identifier[JSONArray] identifier[features] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Feature] identifier[feature] operator[:] Keyword[this] operator[SEP] identifier[mFeatures] operator[SEP] { identifier[features] operator[SEP] identifier[put] operator[SEP] identifier[feature] operator[SEP] identifier[toJSON] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[json] operator[SEP] identifier[put] operator[SEP] identifier[JSON_FEATURES] , identifier[features] operator[SEP] operator[SEP] Keyword[return] identifier[json] operator[SEP] }
public void marshall(GetStagesRequest getStagesRequest, ProtocolMarshaller protocolMarshaller) { if (getStagesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getStagesRequest.getRestApiId(), RESTAPIID_BINDING); protocolMarshaller.marshall(getStagesRequest.getDeploymentId(), DEPLOYMENTID_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[getStagesRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.getStagesRequest], ==, 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=getRestApiId, postfix_operators=[], prefix_operators=[], qualifier=getStagesRequest, selectors=[], type_arguments=None), MemberReference(member=RESTAPIID_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=getDeploymentId, postfix_operators=[], prefix_operators=[], qualifier=getStagesRequest, selectors=[], type_arguments=None), MemberReference(member=DEPLOYMENTID_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[GetStagesRequest] identifier[getStagesRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[getStagesRequest] 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[getStagesRequest] operator[SEP] identifier[getRestApiId] operator[SEP] operator[SEP] , identifier[RESTAPIID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[getStagesRequest] operator[SEP] identifier[getDeploymentId] operator[SEP] operator[SEP] , identifier[DEPLOYMENTID_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
public void assertSubscriptions() { for (String channel : subscribers.keySet()) { try { subscribers.put(channel, null); subscribe(channel); } catch (Throwable e) { break; } } }
class class_name[name] begin[{] method[assertSubscriptions, return_type[void], modifier[public], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=put, postfix_operators=[], prefix_operators=[], qualifier=subscribers, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=subscribe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[BreakStatement(goto=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=subscribers, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=channel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[assertSubscriptions] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[channel] operator[:] identifier[subscribers] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[subscribers] operator[SEP] identifier[put] operator[SEP] identifier[channel] , Other[null] operator[SEP] operator[SEP] identifier[subscribe] operator[SEP] identifier[channel] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] { Keyword[break] operator[SEP] } } }
public void marshall(WorkflowTypeInfo workflowTypeInfo, ProtocolMarshaller protocolMarshaller) { if (workflowTypeInfo == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(workflowTypeInfo.getWorkflowType(), WORKFLOWTYPE_BINDING); protocolMarshaller.marshall(workflowTypeInfo.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(workflowTypeInfo.getDescription(), DESCRIPTION_BINDING); protocolMarshaller.marshall(workflowTypeInfo.getCreationDate(), CREATIONDATE_BINDING); protocolMarshaller.marshall(workflowTypeInfo.getDeprecationDate(), DEPRECATIONDATE_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[workflowTypeInfo, protocolMarshaller]] begin[{] if[binary_operation[member[.workflowTypeInfo], ==, 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=getWorkflowType, postfix_operators=[], prefix_operators=[], qualifier=workflowTypeInfo, selectors=[], type_arguments=None), MemberReference(member=WORKFLOWTYPE_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=workflowTypeInfo, 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), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getDescription, postfix_operators=[], prefix_operators=[], qualifier=workflowTypeInfo, selectors=[], type_arguments=None), MemberReference(member=DESCRIPTION_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=getCreationDate, postfix_operators=[], prefix_operators=[], qualifier=workflowTypeInfo, selectors=[], type_arguments=None), MemberReference(member=CREATIONDATE_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=getDeprecationDate, postfix_operators=[], prefix_operators=[], qualifier=workflowTypeInfo, selectors=[], type_arguments=None), MemberReference(member=DEPRECATIONDATE_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[WorkflowTypeInfo] identifier[workflowTypeInfo] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[workflowTypeInfo] 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[workflowTypeInfo] operator[SEP] identifier[getWorkflowType] operator[SEP] operator[SEP] , identifier[WORKFLOWTYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[workflowTypeInfo] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] , identifier[STATUS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[workflowTypeInfo] operator[SEP] identifier[getDescription] operator[SEP] operator[SEP] , identifier[DESCRIPTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[workflowTypeInfo] operator[SEP] identifier[getCreationDate] operator[SEP] operator[SEP] , identifier[CREATIONDATE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[workflowTypeInfo] operator[SEP] identifier[getDeprecationDate] operator[SEP] operator[SEP] , identifier[DEPRECATIONDATE_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private int getOdoValue(String dependingOn) { Object odoValue = variables.get(dependingOn); if (odoValue == null) { return 0; } else if (odoValue instanceof Number) { return ((Number) odoValue).intValue(); } else { throw new CobolODOResolutionException("The value " + odoValue.toString() + " for ODOObject " + dependingOn + " si not numeric" + ". Path: " + getCurFieldFullCobolName()); } }
class class_name[name] begin[{] method[getOdoValue, return_type[type[int]], modifier[private], parameter[dependingOn]] begin[{] local_variable[type[Object], odoValue] if[binary_operation[member[.odoValue], ==, literal[null]]] begin[{] return[literal[0]] else begin[{] if[binary_operation[member[.odoValue], instanceof, type[Number]]] begin[{] return[Cast(expression=MemberReference(member=odoValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value "), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=odoValue, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for ODOObject "), operator=+), operandr=MemberReference(member=dependingOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" si not numeric"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=". Path: "), operator=+), operandr=MethodInvocation(arguments=[], member=getCurFieldFullCobolName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CobolODOResolutionException, sub_type=None)), label=None) end[}] end[}] end[}] END[}]
Keyword[private] Keyword[int] identifier[getOdoValue] operator[SEP] identifier[String] identifier[dependingOn] operator[SEP] { identifier[Object] identifier[odoValue] operator[=] identifier[variables] operator[SEP] identifier[get] operator[SEP] identifier[dependingOn] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[odoValue] operator[==] Other[null] operator[SEP] { Keyword[return] Other[0] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[odoValue] Keyword[instanceof] identifier[Number] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[odoValue] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[CobolODOResolutionException] operator[SEP] literal[String] operator[+] identifier[odoValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[dependingOn] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[getCurFieldFullCobolName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public void removeTarget(T target) { Iterator<Pattern<T>> it = patterns.iterator(); while (it.hasNext()) { Pattern<T> pattern = it.next(); if (pattern.target().equals(target)) it.remove(); } reverse.remove(target); }
class class_name[name] begin[{] method[removeTarget, return_type[void], modifier[public], parameter[target]] begin[{] local_variable[type[Iterator], it] while[call[it.hasNext, parameter[]]] begin[{] local_variable[type[Pattern], pattern] if[call[pattern.target, parameter[]]] begin[{] call[it.remove, parameter[]] else begin[{] None end[}] end[}] call[reverse.remove, parameter[member[.target]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[removeTarget] operator[SEP] identifier[T] identifier[target] operator[SEP] { identifier[Iterator] operator[<] identifier[Pattern] operator[<] identifier[T] operator[>] operator[>] identifier[it] operator[=] identifier[patterns] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[Pattern] operator[<] identifier[T] operator[>] identifier[pattern] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pattern] operator[SEP] identifier[target] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[target] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] } identifier[reverse] operator[SEP] identifier[remove] operator[SEP] identifier[target] operator[SEP] operator[SEP] }
public void put(final String pattern, final V value) throws IllegalStateException { if (pattern != null) { if (keys.containsKey(pattern)) { throw new IllegalStateException(""); } keys.put(pattern, value); final Pattern p = Pattern.compile(pattern); patternMap.put(p, value); } else { nullValue = value; } }
class class_name[name] begin[{] method[put, return_type[void], modifier[public], parameter[pattern, value]] begin[{] if[binary_operation[member[.pattern], !=, literal[null]]] begin[{] if[call[keys.containsKey, parameter[member[.pattern]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] call[keys.put, parameter[member[.pattern], member[.value]]] local_variable[type[Pattern], p] call[patternMap.put, parameter[member[.p], member[.value]]] else begin[{] assign[member[.nullValue], member[.value]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[put] operator[SEP] Keyword[final] identifier[String] identifier[pattern] , Keyword[final] identifier[V] identifier[value] operator[SEP] Keyword[throws] identifier[IllegalStateException] { Keyword[if] operator[SEP] identifier[pattern] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[keys] operator[SEP] identifier[containsKey] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[keys] operator[SEP] identifier[put] operator[SEP] identifier[pattern] , identifier[value] operator[SEP] operator[SEP] Keyword[final] identifier[Pattern] identifier[p] operator[=] identifier[Pattern] operator[SEP] identifier[compile] operator[SEP] identifier[pattern] operator[SEP] operator[SEP] identifier[patternMap] operator[SEP] identifier[put] operator[SEP] identifier[p] , identifier[value] operator[SEP] operator[SEP] } Keyword[else] { identifier[nullValue] operator[=] identifier[value] operator[SEP] } }
public static MemberExistsResult fieldExists(String fieldName, JavacNode node) { node = upToTypeNode(node); if (node != null && node.get() instanceof JCClassDecl) { for (JCTree def : ((JCClassDecl)node.get()).defs) { if (def instanceof JCVariableDecl) { if (((JCVariableDecl)def).name.contentEquals(fieldName)) { return getGeneratedBy(def) == null ? MemberExistsResult.EXISTS_BY_USER : MemberExistsResult.EXISTS_BY_LOMBOK; } } } } return MemberExistsResult.NOT_EXISTS; }
class class_name[name] begin[{] method[fieldExists, return_type[type[MemberExistsResult]], modifier[public static], parameter[fieldName, node]] begin[{] assign[member[.node], call[.upToTypeNode, parameter[member[.node]]]] if[binary_operation[binary_operation[member[.node], !=, literal[null]], &&, binary_operation[call[node.get, parameter[]], instanceof, type[JCClassDecl]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=JCVariableDecl, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=Cast(expression=MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JCVariableDecl, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getGeneratedBy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=EXISTS_BY_LOMBOK, postfix_operators=[], prefix_operators=[], qualifier=MemberExistsResult, selectors=[]), if_true=MemberReference(member=EXISTS_BY_USER, postfix_operators=[], prefix_operators=[], qualifier=MemberExistsResult, selectors=[])), label=None)]))]))]), control=EnhancedForControl(iterable=Cast(expression=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=JCClassDecl, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=def)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JCTree, sub_type=None))), label=None) else begin[{] None end[}] return[member[MemberExistsResult.NOT_EXISTS]] end[}] END[}]
Keyword[public] Keyword[static] identifier[MemberExistsResult] identifier[fieldExists] operator[SEP] identifier[String] identifier[fieldName] , identifier[JavacNode] identifier[node] operator[SEP] { identifier[node] operator[=] identifier[upToTypeNode] operator[SEP] identifier[node] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[!=] Other[null] operator[&&] identifier[node] operator[SEP] identifier[get] operator[SEP] operator[SEP] Keyword[instanceof] identifier[JCClassDecl] operator[SEP] { Keyword[for] operator[SEP] identifier[JCTree] identifier[def] operator[:] operator[SEP] operator[SEP] identifier[JCClassDecl] operator[SEP] identifier[node] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[defs] operator[SEP] { Keyword[if] operator[SEP] identifier[def] Keyword[instanceof] identifier[JCVariableDecl] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[JCVariableDecl] operator[SEP] identifier[def] operator[SEP] operator[SEP] identifier[name] operator[SEP] identifier[contentEquals] operator[SEP] identifier[fieldName] operator[SEP] operator[SEP] { Keyword[return] identifier[getGeneratedBy] operator[SEP] identifier[def] operator[SEP] operator[==] Other[null] operator[?] identifier[MemberExistsResult] operator[SEP] identifier[EXISTS_BY_USER] operator[:] identifier[MemberExistsResult] operator[SEP] identifier[EXISTS_BY_LOMBOK] operator[SEP] } } } } Keyword[return] identifier[MemberExistsResult] operator[SEP] identifier[NOT_EXISTS] operator[SEP] }
public alluxio.proto.dataserver.Protocol.OpenUfsBlockOptions getOpenUfsBlockOptions() { return openUfsBlockOptions_ == null ? alluxio.proto.dataserver.Protocol.OpenUfsBlockOptions.getDefaultInstance() : openUfsBlockOptions_; }
class class_name[name] begin[{] method[getOpenUfsBlockOptions, return_type[type[alluxio]], modifier[public], parameter[]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=openUfsBlockOptions_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=openUfsBlockOptions_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=getDefaultInstance, postfix_operators=[], prefix_operators=[], qualifier=alluxio.proto.dataserver.Protocol.OpenUfsBlockOptions, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] identifier[alluxio] operator[SEP] identifier[proto] operator[SEP] identifier[dataserver] operator[SEP] identifier[Protocol] operator[SEP] identifier[OpenUfsBlockOptions] identifier[getOpenUfsBlockOptions] operator[SEP] operator[SEP] { Keyword[return] identifier[openUfsBlockOptions_] operator[==] Other[null] operator[?] identifier[alluxio] operator[SEP] identifier[proto] operator[SEP] identifier[dataserver] operator[SEP] identifier[Protocol] operator[SEP] identifier[OpenUfsBlockOptions] operator[SEP] identifier[getDefaultInstance] operator[SEP] operator[SEP] operator[:] identifier[openUfsBlockOptions_] operator[SEP] }
public void marshall(PutLoggingOptionsRequest putLoggingOptionsRequest, ProtocolMarshaller protocolMarshaller) { if (putLoggingOptionsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(putLoggingOptionsRequest.getLoggingOptions(), LOGGINGOPTIONS_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[putLoggingOptionsRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.putLoggingOptionsRequest], ==, 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=getLoggingOptions, postfix_operators=[], prefix_operators=[], qualifier=putLoggingOptionsRequest, selectors=[], type_arguments=None), MemberReference(member=LOGGINGOPTIONS_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[PutLoggingOptionsRequest] identifier[putLoggingOptionsRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[putLoggingOptionsRequest] 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[putLoggingOptionsRequest] operator[SEP] identifier[getLoggingOptions] operator[SEP] operator[SEP] , identifier[LOGGINGOPTIONS_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 FloatMatrix ger(float alpha, FloatMatrix x, FloatMatrix y, FloatMatrix a) { NativeBlas.sger(a.rows, a.columns, alpha, x.data, 0, 1, y.data, 0, 1, a.data, 0, a.rows); return a; }
class class_name[name] begin[{] method[ger, return_type[type[FloatMatrix]], modifier[public static], parameter[alpha, x, y, a]] begin[{] call[NativeBlas.sger, parameter[member[a.rows], member[a.columns], member[.alpha], member[x.data], literal[0], literal[1], member[y.data], literal[0], literal[1], member[a.data], literal[0], member[a.rows]]] return[member[.a]] end[}] END[}]
Keyword[public] Keyword[static] identifier[FloatMatrix] identifier[ger] operator[SEP] Keyword[float] identifier[alpha] , identifier[FloatMatrix] identifier[x] , identifier[FloatMatrix] identifier[y] , identifier[FloatMatrix] identifier[a] operator[SEP] { identifier[NativeBlas] operator[SEP] identifier[sger] operator[SEP] identifier[a] operator[SEP] identifier[rows] , identifier[a] operator[SEP] identifier[columns] , identifier[alpha] , identifier[x] operator[SEP] identifier[data] , Other[0] , Other[1] , identifier[y] operator[SEP] identifier[data] , Other[0] , Other[1] , identifier[a] operator[SEP] identifier[data] , Other[0] , identifier[a] operator[SEP] identifier[rows] operator[SEP] operator[SEP] Keyword[return] identifier[a] operator[SEP] }
@Override public <T extends GedObject> T find( final FinderObject owner, final String str, final Class<T> clazz) { return clazz.cast(owner.find(str)); }
class class_name[name] begin[{] method[find, return_type[type[T]], modifier[public], parameter[owner, str, clazz]] begin[{] return[call[clazz.cast, parameter[call[owner.find, parameter[member[.str]]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[GedObject] operator[>] identifier[T] identifier[find] operator[SEP] Keyword[final] identifier[FinderObject] identifier[owner] , Keyword[final] identifier[String] identifier[str] , Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] operator[SEP] { Keyword[return] identifier[clazz] operator[SEP] identifier[cast] operator[SEP] identifier[owner] operator[SEP] identifier[find] operator[SEP] identifier[str] operator[SEP] operator[SEP] operator[SEP] }
public TypeToken<?> parse(String string) throws ParserException { Parser.Reference<Type> ref = Parser.newReference(); Parser<Type> type = Parsers.or( wildcardType(ref.lazy()), parameterizedType(ref.lazy()), arrayClass(), rawType()); ref.set(type.postfix(TERMS.phrase("[", "]").retn(Types::newArrayType))); return TypeToken.of( ref.get().from(TERMS.tokenizer(), Scanners.WHITESPACES.optional()).parse(string)); }
class class_name[name] begin[{] method[parse, return_type[type[TypeToken]], modifier[public], parameter[string]] begin[{] local_variable[type[Parser], ref] local_variable[type[Parser], type] call[ref.set, parameter[call[type.postfix, parameter[call[TERMS.phrase, parameter[literal["["], literal["]"]]]]]]] return[call[TypeToken.of, parameter[call[ref.get, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[TypeToken] operator[<] operator[?] operator[>] identifier[parse] operator[SEP] identifier[String] identifier[string] operator[SEP] Keyword[throws] identifier[ParserException] { identifier[Parser] operator[SEP] identifier[Reference] operator[<] identifier[Type] operator[>] identifier[ref] operator[=] identifier[Parser] operator[SEP] identifier[newReference] operator[SEP] operator[SEP] operator[SEP] identifier[Parser] operator[<] identifier[Type] operator[>] identifier[type] operator[=] identifier[Parsers] operator[SEP] identifier[or] operator[SEP] identifier[wildcardType] operator[SEP] identifier[ref] operator[SEP] identifier[lazy] operator[SEP] operator[SEP] operator[SEP] , identifier[parameterizedType] operator[SEP] identifier[ref] operator[SEP] identifier[lazy] operator[SEP] operator[SEP] operator[SEP] , identifier[arrayClass] operator[SEP] operator[SEP] , identifier[rawType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ref] operator[SEP] identifier[set] operator[SEP] identifier[type] operator[SEP] identifier[postfix] operator[SEP] identifier[TERMS] operator[SEP] identifier[phrase] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[retn] operator[SEP] identifier[Types] operator[::] identifier[newArrayType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[TypeToken] operator[SEP] identifier[of] operator[SEP] identifier[ref] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[from] operator[SEP] identifier[TERMS] operator[SEP] identifier[tokenizer] operator[SEP] operator[SEP] , identifier[Scanners] operator[SEP] identifier[WHITESPACES] operator[SEP] identifier[optional] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[string] operator[SEP] operator[SEP] operator[SEP] }
public static void validateArgument(Method method, Class<? extends Annotation> annotationType, Class<?> expectedParameterType) { if (method.getParameterTypes().length != 1 || !method.getParameterTypes()[0].equals(expectedParameterType)) { throw new BeanCreationException(String.format( "Method %s with @%s MUST take a single argument of type %s", method, annotationType.getName(), expectedParameterType.getName() )); } }
class class_name[name] begin[{] method[validateArgument, return_type[void], modifier[public static], parameter[method, annotationType, expectedParameterType]] begin[{] if[binary_operation[binary_operation[call[method.getParameterTypes, parameter[]], !=, literal[1]], ||, call[method.getParameterTypes, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Method %s with @%s MUST take a single argument of type %s"), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=annotationType, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=expectedParameterType, 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=BeanCreationException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[validateArgument] operator[SEP] identifier[Method] identifier[method] , identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[annotationType] , identifier[Class] operator[<] operator[?] operator[>] identifier[expectedParameterType] operator[SEP] { Keyword[if] operator[SEP] identifier[method] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[!=] Other[1] operator[||] operator[!] identifier[method] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[expectedParameterType] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[BeanCreationException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[method] , identifier[annotationType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[expectedParameterType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public boolean generateAndSort(final Iterator<long[]> iterator, final long seed) { // We cache all variables for faster access final int[] d = this.d; final int[] e = new int[3]; cleanUpIfNecessary(); /* We build the XOR'd edge list and compute the degree of each vertex. */ for(int k = 0; k < numEdges; k++) { tripleToEdge(iterator.next(), seed, numVertices, partSize, e); xorEdge(k, e[0], e[1], e[2], false); d[e[0]]++; d[e[1]]++; d[e[2]]++; } if (iterator.hasNext()) throw new IllegalStateException("This " + HypergraphSorter.class.getSimpleName() + " has " + numEdges + " edges, but the provided iterator returns more"); return sort(); }
class class_name[name] begin[{] method[generateAndSort, return_type[type[boolean]], modifier[public], parameter[iterator, seed]] begin[{] local_variable[type[int], d] local_variable[type[int], e] call[.cleanUpIfNecessary, parameter[]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), MemberReference(member=seed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numVertices, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=partSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=tripleToEdge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=xorEdge, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]))]), label=None), StatementExpression(expression=MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]))]), label=None), StatementExpression(expression=MemberReference(member=d, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]))]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numEdges, 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=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[call[iterator.hasNext, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This "), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=HypergraphSorter, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" has "), operator=+), operandr=MemberReference(member=numEdges, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" edges, but the provided iterator returns more"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] return[call[.sort, parameter[]]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[generateAndSort] operator[SEP] Keyword[final] identifier[Iterator] operator[<] Keyword[long] operator[SEP] operator[SEP] operator[>] identifier[iterator] , Keyword[final] Keyword[long] identifier[seed] operator[SEP] { Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[d] operator[=] Keyword[this] operator[SEP] identifier[d] operator[SEP] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[e] operator[=] Keyword[new] Keyword[int] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[cleanUpIfNecessary] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[numEdges] operator[SEP] identifier[k] operator[++] operator[SEP] { identifier[tripleToEdge] operator[SEP] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] , identifier[seed] , identifier[numVertices] , identifier[partSize] , identifier[e] operator[SEP] operator[SEP] identifier[xorEdge] operator[SEP] identifier[k] , identifier[e] operator[SEP] Other[0] operator[SEP] , identifier[e] operator[SEP] Other[1] operator[SEP] , identifier[e] operator[SEP] Other[2] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[d] operator[SEP] identifier[e] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[++] operator[SEP] identifier[d] operator[SEP] identifier[e] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[++] operator[SEP] identifier[d] operator[SEP] identifier[e] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[++] operator[SEP] } Keyword[if] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[HypergraphSorter] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[numEdges] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sort] operator[SEP] operator[SEP] operator[SEP] }
@Override public ShardedRedisCounter setCounterFactory(AbstractCounterFactory counterFactory) { if (counterFactory instanceof ShardedRedisCounterFactory) { super.setCounterFactory(counterFactory); } else { throw new IllegalArgumentException("Argument must be an instance of " + ShardedRedisCounterFactory.class.getName()); } return this; }
class class_name[name] begin[{] method[setCounterFactory, return_type[type[ShardedRedisCounter]], modifier[public], parameter[counterFactory]] begin[{] if[binary_operation[member[.counterFactory], instanceof, type[ShardedRedisCounterFactory]]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=counterFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setCounterFactory, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Argument must be an instance of "), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ShardedRedisCounterFactory, sub_type=None)), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ShardedRedisCounter] identifier[setCounterFactory] operator[SEP] identifier[AbstractCounterFactory] identifier[counterFactory] operator[SEP] { Keyword[if] operator[SEP] identifier[counterFactory] Keyword[instanceof] identifier[ShardedRedisCounterFactory] operator[SEP] { Keyword[super] operator[SEP] identifier[setCounterFactory] operator[SEP] identifier[counterFactory] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[ShardedRedisCounterFactory] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public Result<List<StraightPathItem>> findStraightPath(float[] startPos, float[] endPos, List<Long> path, int maxStraightPath, int options) { List<StraightPathItem> straightPath = new ArrayList<>(); if (Objects.isNull(startPos) || !vIsFinite(startPos) || Objects.isNull(endPos) || !vIsFinite(endPos) || Objects.isNull(path) || path.isEmpty() || path.get(0) == 0 || maxStraightPath <= 0) { return Result.invalidParam(); } // TODO: Should this be callers responsibility? Result<float[]> closestStartPosRes = closestPointOnPolyBoundary(path.get(0), startPos); if (closestStartPosRes.failed()) { return Result.invalidParam("Cannot find start position"); } float[] closestStartPos = closestStartPosRes.result; Result<float[]> closestEndPosRes = closestPointOnPolyBoundary(path.get(path.size() - 1), endPos); if (closestEndPosRes.failed()) { return Result.invalidParam("Cannot find end position"); } float[] closestEndPos = closestEndPosRes.result; // Add start point. Status stat = appendVertex(closestStartPos, DT_STRAIGHTPATH_START, path.get(0), straightPath, maxStraightPath); if (!stat.isInProgress()) { return Result.success(straightPath); } if (path.size() > 1) { float[] portalApex = vCopy(closestStartPos); float[] portalLeft = vCopy(portalApex); float[] portalRight = vCopy(portalApex); int apexIndex = 0; int leftIndex = 0; int rightIndex = 0; int leftPolyType = 0; int rightPolyType = 0; long leftPolyRef = path.get(0); long rightPolyRef = path.get(0); for (int i = 0; i < path.size(); ++i) { float[] left; float[] right; int toType; if (i + 1 < path.size()) { // Next portal. Result<PortalResult> portalPoints = getPortalPoints(path.get(i), path.get(i + 1)); left = portalPoints.result.left; right = portalPoints.result.right; toType = portalPoints.result.toType; if (portalPoints.failed()) { closestEndPosRes = closestPointOnPolyBoundary(path.get(i), endPos); if (closestEndPosRes.failed()) { return Result.invalidParam(); } closestEndPos = closestEndPosRes.result; // Append portals along the current straight path segment. if ((options & (DT_STRAIGHTPATH_AREA_CROSSINGS | DT_STRAIGHTPATH_ALL_CROSSINGS)) != 0) { // Ignore status return value as we're just about to return anyway. appendPortals(apexIndex, i, closestEndPos, path, straightPath, maxStraightPath, options); } // Ignore status return value as we're just about to return anyway. appendVertex(closestEndPos, 0, path.get(i), straightPath, maxStraightPath); return Result.success(straightPath); } // If starting really close the portal, advance. if (i == 0) { Tupple2<Float, Float> dt = distancePtSegSqr2D(portalApex, left, right); if (dt.first < sqr(0.001f)) { continue; } } } else { // End of the path. left = vCopy(closestEndPos); right = vCopy(closestEndPos); toType = Poly.DT_POLYTYPE_GROUND; } // Right vertex. if (triArea2D(portalApex, portalRight, right) <= 0.0f) { if (vEqual(portalApex, portalRight) || triArea2D(portalApex, portalLeft, right) > 0.0f) { portalRight = vCopy(right); rightPolyRef = (i + 1 < path.size()) ? path.get(i + 1) : 0; rightPolyType = toType; rightIndex = i; } else { // Append portals along the current straight path segment. if ((options & (DT_STRAIGHTPATH_AREA_CROSSINGS | DT_STRAIGHTPATH_ALL_CROSSINGS)) != 0) { stat = appendPortals(apexIndex, leftIndex, portalLeft, path, straightPath, maxStraightPath, options); if (!stat.isInProgress()) { return Result.success(straightPath); } } portalApex = vCopy(portalLeft); apexIndex = leftIndex; int flags = 0; if (leftPolyRef == 0) { flags = DT_STRAIGHTPATH_END; } else if (leftPolyType == Poly.DT_POLYTYPE_OFFMESH_CONNECTION) { flags = DT_STRAIGHTPATH_OFFMESH_CONNECTION; } long ref = leftPolyRef; // Append or update vertex stat = appendVertex(portalApex, flags, ref, straightPath, maxStraightPath); if (!stat.isInProgress()) { return Result.success(straightPath); } portalLeft = vCopy(portalApex); portalRight = vCopy(portalApex); leftIndex = apexIndex; rightIndex = apexIndex; // Restart i = apexIndex; continue; } } // Left vertex. if (triArea2D(portalApex, portalLeft, left) >= 0.0f) { if (vEqual(portalApex, portalLeft) || triArea2D(portalApex, portalRight, left) < 0.0f) { portalLeft = vCopy(left); leftPolyRef = (i + 1 < path.size()) ? path.get(i + 1) : 0; leftPolyType = toType; leftIndex = i; } else { // Append portals along the current straight path segment. if ((options & (DT_STRAIGHTPATH_AREA_CROSSINGS | DT_STRAIGHTPATH_ALL_CROSSINGS)) != 0) { stat = appendPortals(apexIndex, rightIndex, portalRight, path, straightPath, maxStraightPath, options); if (!stat.isInProgress()) { return Result.success(straightPath); } } portalApex = vCopy(portalRight); apexIndex = rightIndex; int flags = 0; if (rightPolyRef == 0) { flags = DT_STRAIGHTPATH_END; } else if (rightPolyType == Poly.DT_POLYTYPE_OFFMESH_CONNECTION) { flags = DT_STRAIGHTPATH_OFFMESH_CONNECTION; } long ref = rightPolyRef; // Append or update vertex stat = appendVertex(portalApex, flags, ref, straightPath, maxStraightPath); if (!stat.isInProgress()) { return Result.success(straightPath); } portalLeft = vCopy(portalApex); portalRight = vCopy(portalApex); leftIndex = apexIndex; rightIndex = apexIndex; // Restart i = apexIndex; continue; } } } // Append portals along the current straight path segment. if ((options & (DT_STRAIGHTPATH_AREA_CROSSINGS | DT_STRAIGHTPATH_ALL_CROSSINGS)) != 0) { stat = appendPortals(apexIndex, path.size() - 1, closestEndPos, path, straightPath, maxStraightPath, options); if (!stat.isInProgress()) { return Result.success(straightPath); } } } // Ignore status return value as we're just about to return anyway. appendVertex(closestEndPos, DT_STRAIGHTPATH_END, 0, straightPath, maxStraightPath); return Result.success(straightPath); }
class class_name[name] begin[{] method[findStraightPath, return_type[type[Result]], modifier[public], parameter[startPos, endPos, path, maxStraightPath, options]] begin[{] local_variable[type[List], straightPath] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[Objects.isNull, parameter[member[.startPos]]], ||, call[.vIsFinite, parameter[member[.startPos]]]], ||, call[Objects.isNull, parameter[member[.endPos]]]], ||, call[.vIsFinite, parameter[member[.endPos]]]], ||, call[Objects.isNull, parameter[member[.path]]]], ||, call[path.isEmpty, parameter[]]], ||, binary_operation[call[path.get, parameter[literal[0]]], ==, literal[0]]], ||, binary_operation[member[.maxStraightPath], <=, literal[0]]]] begin[{] return[call[Result.invalidParam, parameter[]]] else begin[{] None end[}] local_variable[type[Result], closestStartPosRes] if[call[closestStartPosRes.failed, parameter[]]] begin[{] return[call[Result.invalidParam, parameter[literal["Cannot find start position"]]]] else begin[{] None end[}] local_variable[type[float], closestStartPos] local_variable[type[Result], closestEndPosRes] if[call[closestEndPosRes.failed, parameter[]]] begin[{] return[call[Result.invalidParam, parameter[literal["Cannot find end position"]]]] else begin[{] None end[}] local_variable[type[float], closestEndPos] local_variable[type[Status], stat] if[call[stat.isInProgress, parameter[]]] begin[{] return[call[Result.success, parameter[member[.straightPath]]]] else begin[{] None end[}] if[binary_operation[call[path.size, parameter[]], >, literal[1]]] begin[{] local_variable[type[float], portalApex] local_variable[type[float], portalLeft] local_variable[type[float], portalRight] local_variable[type[int], apexIndex] local_variable[type[int], leftIndex] local_variable[type[int], rightIndex] local_variable[type[int], leftPolyType] local_variable[type[int], rightPolyType] local_variable[type[long], leftPolyRef] local_variable[type[long], rightPolyRef] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=left)], modifiers=set(), type=BasicType(dimensions=[None], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=right)], modifiers=set(), type=BasicType(dimensions=[None], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=toType)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operator=<), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=closestEndPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=closestEndPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=toType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=DT_POLYTYPE_GROUND, postfix_operators=[], prefix_operators=[], qualifier=Poly, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None)], member=getPortalPoints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=portalPoints)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=PortalResult, sub_type=None))], dimensions=[], name=Result, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=portalPoints.result, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=portalPoints.result, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=toType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=toType, postfix_operators=[], prefix_operators=[], qualifier=portalPoints.result, selectors=[])), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=failed, postfix_operators=[], prefix_operators=[], qualifier=portalPoints, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=closestEndPosRes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), MemberReference(member=endPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closestPointOnPolyBoundary, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=failed, postfix_operators=[], prefix_operators=[], qualifier=closestEndPosRes, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=invalidParam, postfix_operators=[], prefix_operators=[], qualifier=Result, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=closestEndPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=closestEndPosRes, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=DT_STRAIGHTPATH_AREA_CROSSINGS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DT_STRAIGHTPATH_ALL_CROSSINGS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=closestEndPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxStraightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendPortals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=closestEndPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxStraightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendVertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=success, postfix_operators=[], prefix_operators=[], qualifier=Result, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=i, 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=distancePtSegSqr2D, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=dt)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None))], dimensions=[], name=Tupple2, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=dt, selectors=[]), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.001f)], member=sqr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)]))]))])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=portalRight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=triArea2D, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0f), operator=<=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=portalRight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vEqual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=portalLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=triArea2D, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0f), operator=>), operator=||), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=DT_STRAIGHTPATH_AREA_CROSSINGS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DT_STRAIGHTPATH_ALL_CROSSINGS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=leftIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=portalLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxStraightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendPortals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isInProgress, postfix_operators=[], prefix_operators=['!'], qualifier=stat, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=success, postfix_operators=[], prefix_operators=[], qualifier=Result, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=portalLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=leftIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=flags)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=leftPolyRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=leftPolyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DT_POLYTYPE_OFFMESH_CONNECTION, postfix_operators=[], prefix_operators=[], qualifier=Poly, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=DT_STRAIGHTPATH_OFFMESH_CONNECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=DT_STRAIGHTPATH_END, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=leftPolyRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=ref)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxStraightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendVertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isInProgress, postfix_operators=[], prefix_operators=['!'], qualifier=stat, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=success, postfix_operators=[], prefix_operators=[], qualifier=Result, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=portalLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=portalRight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=leftIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rightIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ContinueStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=portalRight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rightPolyRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rightPolyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=toType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rightIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=portalLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=triArea2D, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0f), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=portalLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vEqual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=portalRight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=triArea2D, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.0f), operator=<), operator=||), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=DT_STRAIGHTPATH_AREA_CROSSINGS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DT_STRAIGHTPATH_ALL_CROSSINGS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=|), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rightIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=portalRight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxStraightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=options, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendPortals, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isInProgress, postfix_operators=[], prefix_operators=['!'], qualifier=stat, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=success, postfix_operators=[], prefix_operators=[], qualifier=Result, selectors=[], type_arguments=None), label=None)]))])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=portalRight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=rightIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=flags)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rightPolyRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=rightPolyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DT_POLYTYPE_OFFMESH_CONNECTION, postfix_operators=[], prefix_operators=[], qualifier=Poly, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=DT_STRAIGHTPATH_OFFMESH_CONNECTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=DT_STRAIGHTPATH_END, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=rightPolyRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=ref)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxStraightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=appendVertex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=isInProgress, postfix_operators=[], prefix_operators=['!'], qualifier=stat, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=straightPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=success, postfix_operators=[], prefix_operators=[], qualifier=Result, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=portalLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=portalRight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=portalApex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=leftIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=rightIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=apexIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ContinueStatement(goto=None, label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=portalLeft, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=vCopy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=leftPolyRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None), operator=<), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[], type_arguments=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=leftPolyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=toType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=leftIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=path, 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[binary_operation[member[.options], &, binary_operation[member[.DT_STRAIGHTPATH_AREA_CROSSINGS], |, member[.DT_STRAIGHTPATH_ALL_CROSSINGS]]], !=, literal[0]]] begin[{] assign[member[.stat], call[.appendPortals, parameter[member[.apexIndex], binary_operation[call[path.size, parameter[]], -, literal[1]], member[.closestEndPos], member[.path], member[.straightPath], member[.maxStraightPath], member[.options]]]] if[call[stat.isInProgress, parameter[]]] begin[{] return[call[Result.success, parameter[member[.straightPath]]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] call[.appendVertex, parameter[member[.closestEndPos], member[.DT_STRAIGHTPATH_END], literal[0], member[.straightPath], member[.maxStraightPath]]] return[call[Result.success, parameter[member[.straightPath]]]] end[}] END[}]
Keyword[public] identifier[Result] operator[<] identifier[List] operator[<] identifier[StraightPathItem] operator[>] operator[>] identifier[findStraightPath] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[startPos] , Keyword[float] operator[SEP] operator[SEP] identifier[endPos] , identifier[List] operator[<] identifier[Long] operator[>] identifier[path] , Keyword[int] identifier[maxStraightPath] , Keyword[int] identifier[options] operator[SEP] { identifier[List] operator[<] identifier[StraightPathItem] operator[>] identifier[straightPath] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Objects] operator[SEP] identifier[isNull] operator[SEP] identifier[startPos] operator[SEP] operator[||] operator[!] identifier[vIsFinite] operator[SEP] identifier[startPos] operator[SEP] operator[||] identifier[Objects] operator[SEP] identifier[isNull] operator[SEP] identifier[endPos] operator[SEP] operator[||] operator[!] identifier[vIsFinite] operator[SEP] identifier[endPos] operator[SEP] operator[||] identifier[Objects] operator[SEP] identifier[isNull] operator[SEP] identifier[path] operator[SEP] operator[||] identifier[path] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[path] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[==] Other[0] operator[||] identifier[maxStraightPath] operator[<=] Other[0] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[invalidParam] operator[SEP] operator[SEP] operator[SEP] } identifier[Result] operator[<] Keyword[float] operator[SEP] operator[SEP] operator[>] identifier[closestStartPosRes] operator[=] identifier[closestPointOnPolyBoundary] operator[SEP] identifier[path] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] , identifier[startPos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[closestStartPosRes] operator[SEP] identifier[failed] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[invalidParam] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[float] operator[SEP] operator[SEP] identifier[closestStartPos] operator[=] identifier[closestStartPosRes] operator[SEP] identifier[result] operator[SEP] identifier[Result] operator[<] Keyword[float] operator[SEP] operator[SEP] operator[>] identifier[closestEndPosRes] operator[=] identifier[closestPointOnPolyBoundary] operator[SEP] identifier[path] operator[SEP] identifier[get] operator[SEP] identifier[path] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[endPos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[closestEndPosRes] operator[SEP] identifier[failed] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[invalidParam] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[float] operator[SEP] operator[SEP] identifier[closestEndPos] operator[=] identifier[closestEndPosRes] operator[SEP] identifier[result] operator[SEP] identifier[Status] identifier[stat] operator[=] identifier[appendVertex] operator[SEP] identifier[closestStartPos] , identifier[DT_STRAIGHTPATH_START] , identifier[path] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] , identifier[straightPath] , identifier[maxStraightPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[stat] operator[SEP] identifier[isInProgress] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[success] operator[SEP] identifier[straightPath] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[path] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] { Keyword[float] operator[SEP] operator[SEP] identifier[portalApex] operator[=] identifier[vCopy] operator[SEP] identifier[closestStartPos] operator[SEP] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[portalLeft] operator[=] identifier[vCopy] operator[SEP] identifier[portalApex] operator[SEP] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[portalRight] operator[=] identifier[vCopy] operator[SEP] identifier[portalApex] operator[SEP] operator[SEP] Keyword[int] identifier[apexIndex] operator[=] Other[0] operator[SEP] Keyword[int] identifier[leftIndex] operator[=] Other[0] operator[SEP] Keyword[int] identifier[rightIndex] operator[=] Other[0] operator[SEP] Keyword[int] identifier[leftPolyType] operator[=] Other[0] operator[SEP] Keyword[int] identifier[rightPolyType] operator[=] Other[0] operator[SEP] Keyword[long] identifier[leftPolyRef] operator[=] identifier[path] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[long] identifier[rightPolyRef] operator[=] identifier[path] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[path] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[float] operator[SEP] operator[SEP] identifier[left] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[right] operator[SEP] Keyword[int] identifier[toType] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[path] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { identifier[Result] operator[<] identifier[PortalResult] operator[>] identifier[portalPoints] operator[=] identifier[getPortalPoints] operator[SEP] identifier[path] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[path] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[left] operator[=] identifier[portalPoints] operator[SEP] identifier[result] operator[SEP] identifier[left] operator[SEP] identifier[right] operator[=] identifier[portalPoints] operator[SEP] identifier[result] operator[SEP] identifier[right] operator[SEP] identifier[toType] operator[=] identifier[portalPoints] operator[SEP] identifier[result] operator[SEP] identifier[toType] operator[SEP] Keyword[if] operator[SEP] identifier[portalPoints] operator[SEP] identifier[failed] operator[SEP] operator[SEP] operator[SEP] { identifier[closestEndPosRes] operator[=] identifier[closestPointOnPolyBoundary] operator[SEP] identifier[path] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[endPos] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[closestEndPosRes] operator[SEP] identifier[failed] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[invalidParam] operator[SEP] operator[SEP] operator[SEP] } identifier[closestEndPos] operator[=] identifier[closestEndPosRes] operator[SEP] identifier[result] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[options] operator[&] operator[SEP] identifier[DT_STRAIGHTPATH_AREA_CROSSINGS] operator[|] identifier[DT_STRAIGHTPATH_ALL_CROSSINGS] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[appendPortals] operator[SEP] identifier[apexIndex] , identifier[i] , identifier[closestEndPos] , identifier[path] , identifier[straightPath] , identifier[maxStraightPath] , identifier[options] operator[SEP] operator[SEP] } identifier[appendVertex] operator[SEP] identifier[closestEndPos] , Other[0] , identifier[path] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] , identifier[straightPath] , identifier[maxStraightPath] operator[SEP] operator[SEP] Keyword[return] identifier[Result] operator[SEP] identifier[success] operator[SEP] identifier[straightPath] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[i] operator[==] Other[0] operator[SEP] { identifier[Tupple2] operator[<] identifier[Float] , identifier[Float] operator[>] identifier[dt] operator[=] identifier[distancePtSegSqr2D] operator[SEP] identifier[portalApex] , identifier[left] , identifier[right] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dt] operator[SEP] identifier[first] operator[<] identifier[sqr] operator[SEP] literal[Float] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } } } Keyword[else] { identifier[left] operator[=] identifier[vCopy] operator[SEP] identifier[closestEndPos] operator[SEP] operator[SEP] identifier[right] operator[=] identifier[vCopy] operator[SEP] identifier[closestEndPos] operator[SEP] operator[SEP] identifier[toType] operator[=] identifier[Poly] operator[SEP] identifier[DT_POLYTYPE_GROUND] operator[SEP] } Keyword[if] operator[SEP] identifier[triArea2D] operator[SEP] identifier[portalApex] , identifier[portalRight] , identifier[right] operator[SEP] operator[<=] literal[Float] operator[SEP] { Keyword[if] operator[SEP] identifier[vEqual] operator[SEP] identifier[portalApex] , identifier[portalRight] operator[SEP] operator[||] identifier[triArea2D] operator[SEP] identifier[portalApex] , identifier[portalLeft] , identifier[right] operator[SEP] operator[>] literal[Float] operator[SEP] { identifier[portalRight] operator[=] identifier[vCopy] operator[SEP] identifier[right] operator[SEP] operator[SEP] identifier[rightPolyRef] operator[=] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[path] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[path] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[:] Other[0] operator[SEP] identifier[rightPolyType] operator[=] identifier[toType] operator[SEP] identifier[rightIndex] operator[=] identifier[i] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[SEP] identifier[options] operator[&] operator[SEP] identifier[DT_STRAIGHTPATH_AREA_CROSSINGS] operator[|] identifier[DT_STRAIGHTPATH_ALL_CROSSINGS] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[stat] operator[=] identifier[appendPortals] operator[SEP] identifier[apexIndex] , identifier[leftIndex] , identifier[portalLeft] , identifier[path] , identifier[straightPath] , identifier[maxStraightPath] , identifier[options] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[stat] operator[SEP] identifier[isInProgress] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[success] operator[SEP] identifier[straightPath] operator[SEP] operator[SEP] } } identifier[portalApex] operator[=] identifier[vCopy] operator[SEP] identifier[portalLeft] operator[SEP] operator[SEP] identifier[apexIndex] operator[=] identifier[leftIndex] operator[SEP] Keyword[int] identifier[flags] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[leftPolyRef] operator[==] Other[0] operator[SEP] { identifier[flags] operator[=] identifier[DT_STRAIGHTPATH_END] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[leftPolyType] operator[==] identifier[Poly] operator[SEP] identifier[DT_POLYTYPE_OFFMESH_CONNECTION] operator[SEP] { identifier[flags] operator[=] identifier[DT_STRAIGHTPATH_OFFMESH_CONNECTION] operator[SEP] } Keyword[long] identifier[ref] operator[=] identifier[leftPolyRef] operator[SEP] identifier[stat] operator[=] identifier[appendVertex] operator[SEP] identifier[portalApex] , identifier[flags] , identifier[ref] , identifier[straightPath] , identifier[maxStraightPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[stat] operator[SEP] identifier[isInProgress] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[success] operator[SEP] identifier[straightPath] operator[SEP] operator[SEP] } identifier[portalLeft] operator[=] identifier[vCopy] operator[SEP] identifier[portalApex] operator[SEP] operator[SEP] identifier[portalRight] operator[=] identifier[vCopy] operator[SEP] identifier[portalApex] operator[SEP] operator[SEP] identifier[leftIndex] operator[=] identifier[apexIndex] operator[SEP] identifier[rightIndex] operator[=] identifier[apexIndex] operator[SEP] identifier[i] operator[=] identifier[apexIndex] operator[SEP] Keyword[continue] operator[SEP] } } Keyword[if] operator[SEP] identifier[triArea2D] operator[SEP] identifier[portalApex] , identifier[portalLeft] , identifier[left] operator[SEP] operator[>=] literal[Float] operator[SEP] { Keyword[if] operator[SEP] identifier[vEqual] operator[SEP] identifier[portalApex] , identifier[portalLeft] operator[SEP] operator[||] identifier[triArea2D] operator[SEP] identifier[portalApex] , identifier[portalRight] , identifier[left] operator[SEP] operator[<] literal[Float] operator[SEP] { identifier[portalLeft] operator[=] identifier[vCopy] operator[SEP] identifier[left] operator[SEP] operator[SEP] identifier[leftPolyRef] operator[=] operator[SEP] identifier[i] operator[+] Other[1] operator[<] identifier[path] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[path] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[:] Other[0] operator[SEP] identifier[leftPolyType] operator[=] identifier[toType] operator[SEP] identifier[leftIndex] operator[=] identifier[i] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] operator[SEP] identifier[options] operator[&] operator[SEP] identifier[DT_STRAIGHTPATH_AREA_CROSSINGS] operator[|] identifier[DT_STRAIGHTPATH_ALL_CROSSINGS] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[stat] operator[=] identifier[appendPortals] operator[SEP] identifier[apexIndex] , identifier[rightIndex] , identifier[portalRight] , identifier[path] , identifier[straightPath] , identifier[maxStraightPath] , identifier[options] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[stat] operator[SEP] identifier[isInProgress] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[success] operator[SEP] identifier[straightPath] operator[SEP] operator[SEP] } } identifier[portalApex] operator[=] identifier[vCopy] operator[SEP] identifier[portalRight] operator[SEP] operator[SEP] identifier[apexIndex] operator[=] identifier[rightIndex] operator[SEP] Keyword[int] identifier[flags] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[rightPolyRef] operator[==] Other[0] operator[SEP] { identifier[flags] operator[=] identifier[DT_STRAIGHTPATH_END] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[rightPolyType] operator[==] identifier[Poly] operator[SEP] identifier[DT_POLYTYPE_OFFMESH_CONNECTION] operator[SEP] { identifier[flags] operator[=] identifier[DT_STRAIGHTPATH_OFFMESH_CONNECTION] operator[SEP] } Keyword[long] identifier[ref] operator[=] identifier[rightPolyRef] operator[SEP] identifier[stat] operator[=] identifier[appendVertex] operator[SEP] identifier[portalApex] , identifier[flags] , identifier[ref] , identifier[straightPath] , identifier[maxStraightPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[stat] operator[SEP] identifier[isInProgress] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[success] operator[SEP] identifier[straightPath] operator[SEP] operator[SEP] } identifier[portalLeft] operator[=] identifier[vCopy] operator[SEP] identifier[portalApex] operator[SEP] operator[SEP] identifier[portalRight] operator[=] identifier[vCopy] operator[SEP] identifier[portalApex] operator[SEP] operator[SEP] identifier[leftIndex] operator[=] identifier[apexIndex] operator[SEP] identifier[rightIndex] operator[=] identifier[apexIndex] operator[SEP] identifier[i] operator[=] identifier[apexIndex] operator[SEP] Keyword[continue] operator[SEP] } } } Keyword[if] operator[SEP] operator[SEP] identifier[options] operator[&] operator[SEP] identifier[DT_STRAIGHTPATH_AREA_CROSSINGS] operator[|] identifier[DT_STRAIGHTPATH_ALL_CROSSINGS] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[stat] operator[=] identifier[appendPortals] operator[SEP] identifier[apexIndex] , identifier[path] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] , identifier[closestEndPos] , identifier[path] , identifier[straightPath] , identifier[maxStraightPath] , identifier[options] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[stat] operator[SEP] identifier[isInProgress] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Result] operator[SEP] identifier[success] operator[SEP] identifier[straightPath] operator[SEP] operator[SEP] } } } identifier[appendVertex] operator[SEP] identifier[closestEndPos] , identifier[DT_STRAIGHTPATH_END] , Other[0] , identifier[straightPath] , identifier[maxStraightPath] operator[SEP] operator[SEP] Keyword[return] identifier[Result] operator[SEP] identifier[success] operator[SEP] identifier[straightPath] operator[SEP] operator[SEP] }
@Override public Validation validate(Context context, String pid, Date asOfDateTime) throws ServerException { return mgmt.validate(context, pid, asOfDateTime); }
class class_name[name] begin[{] method[validate, return_type[type[Validation]], modifier[public], parameter[context, pid, asOfDateTime]] begin[{] return[call[mgmt.validate, parameter[member[.context], member[.pid], member[.asOfDateTime]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Validation] identifier[validate] operator[SEP] identifier[Context] identifier[context] , identifier[String] identifier[pid] , identifier[Date] identifier[asOfDateTime] operator[SEP] Keyword[throws] identifier[ServerException] { Keyword[return] identifier[mgmt] operator[SEP] identifier[validate] operator[SEP] identifier[context] , identifier[pid] , identifier[asOfDateTime] operator[SEP] operator[SEP] }
public void stop(String logicalQueueName) { stopQueue(logicalQueueName); try { if (isRunning(logicalQueueName)) { Future<?> future = this.scheduledFutureByQueue.remove(logicalQueueName); if (future != null) { future.get(this.queueStopTimeout, TimeUnit.MILLISECONDS); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException | TimeoutException e) { getLogger().warn("Error stopping queue with name: '" + logicalQueueName + "'", e); } }
class class_name[name] begin[{] method[stop, return_type[void], modifier[public], parameter[logicalQueueName]] begin[{] call[.stopQueue, parameter[member[.logicalQueueName]]] TryStatement(block=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=logicalQueueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isRunning, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=scheduledFutureByQueue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=logicalQueueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=future)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Future, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=future, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=queueStopTimeout, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), MemberReference(member=MILLISECONDS, postfix_operators=[], prefix_operators=[], qualifier=TimeUnit, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=future, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogger, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error stopping queue with name: '"), operandr=MemberReference(member=logicalQueueName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ExecutionException', 'TimeoutException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[stop] operator[SEP] identifier[String] identifier[logicalQueueName] operator[SEP] { identifier[stopQueue] operator[SEP] identifier[logicalQueueName] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[isRunning] operator[SEP] identifier[logicalQueueName] operator[SEP] operator[SEP] { identifier[Future] operator[<] operator[?] operator[>] identifier[future] operator[=] Keyword[this] operator[SEP] identifier[scheduledFutureByQueue] operator[SEP] identifier[remove] operator[SEP] identifier[logicalQueueName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[future] operator[!=] Other[null] operator[SEP] { identifier[future] operator[SEP] identifier[get] operator[SEP] Keyword[this] operator[SEP] identifier[queueStopTimeout] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ExecutionException] operator[|] identifier[TimeoutException] identifier[e] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[logicalQueueName] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public static SampleDialogFragment newInstance(int radius, float downScaleFactor, boolean dimming, boolean debug) { SampleDialogFragment fragment = new SampleDialogFragment(); Bundle args = new Bundle(); args.putInt( BUNDLE_KEY_BLUR_RADIUS, radius ); args.putFloat( BUNDLE_KEY_DOWN_SCALE_FACTOR, downScaleFactor ); args.putBoolean( BUNDLE_KEY_DIMMING, dimming ); args.putBoolean( BUNDLE_KEY_DEBUG, debug ); fragment.setArguments(args); return fragment; }
class class_name[name] begin[{] method[newInstance, return_type[type[SampleDialogFragment]], modifier[public static], parameter[radius, downScaleFactor, dimming, debug]] begin[{] local_variable[type[SampleDialogFragment], fragment] local_variable[type[Bundle], args] call[args.putInt, parameter[member[.BUNDLE_KEY_BLUR_RADIUS], member[.radius]]] call[args.putFloat, parameter[member[.BUNDLE_KEY_DOWN_SCALE_FACTOR], member[.downScaleFactor]]] call[args.putBoolean, parameter[member[.BUNDLE_KEY_DIMMING], member[.dimming]]] call[args.putBoolean, parameter[member[.BUNDLE_KEY_DEBUG], member[.debug]]] call[fragment.setArguments, parameter[member[.args]]] return[member[.fragment]] end[}] END[}]
Keyword[public] Keyword[static] identifier[SampleDialogFragment] identifier[newInstance] operator[SEP] Keyword[int] identifier[radius] , Keyword[float] identifier[downScaleFactor] , Keyword[boolean] identifier[dimming] , Keyword[boolean] identifier[debug] operator[SEP] { identifier[SampleDialogFragment] identifier[fragment] operator[=] Keyword[new] identifier[SampleDialogFragment] operator[SEP] operator[SEP] operator[SEP] identifier[Bundle] identifier[args] operator[=] Keyword[new] identifier[Bundle] operator[SEP] operator[SEP] operator[SEP] identifier[args] operator[SEP] identifier[putInt] operator[SEP] identifier[BUNDLE_KEY_BLUR_RADIUS] , identifier[radius] operator[SEP] operator[SEP] identifier[args] operator[SEP] identifier[putFloat] operator[SEP] identifier[BUNDLE_KEY_DOWN_SCALE_FACTOR] , identifier[downScaleFactor] operator[SEP] operator[SEP] identifier[args] operator[SEP] identifier[putBoolean] operator[SEP] identifier[BUNDLE_KEY_DIMMING] , identifier[dimming] operator[SEP] operator[SEP] identifier[args] operator[SEP] identifier[putBoolean] operator[SEP] identifier[BUNDLE_KEY_DEBUG] , identifier[debug] operator[SEP] operator[SEP] identifier[fragment] operator[SEP] identifier[setArguments] operator[SEP] identifier[args] operator[SEP] operator[SEP] Keyword[return] identifier[fragment] operator[SEP] }
@Override public boolean publishAll(boolean dryDeploy) { return stages.publishAll(dryDeploy, (progress, maxProgress) -> context.broadcast(Orchid.Lifecycle.ProgressEvent.fire(this, "deploying", progress, maxProgress))); }
class class_name[name] begin[{] method[publishAll, return_type[type[boolean]], modifier[public], parameter[dryDeploy]] begin[{] return[call[stages.publishAll, parameter[member[.dryDeploy], LambdaExpression(body=MethodInvocation(arguments=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="deploying"), MemberReference(member=progress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxProgress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fire, postfix_operators=[], prefix_operators=[], qualifier=Orchid.Lifecycle.ProgressEvent, selectors=[], type_arguments=None)], member=broadcast, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[], type_arguments=None), parameters=[InferredFormalParameter(name=progress), InferredFormalParameter(name=maxProgress)])]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[publishAll] operator[SEP] Keyword[boolean] identifier[dryDeploy] operator[SEP] { Keyword[return] identifier[stages] operator[SEP] identifier[publishAll] operator[SEP] identifier[dryDeploy] , operator[SEP] identifier[progress] , identifier[maxProgress] operator[SEP] operator[->] identifier[context] operator[SEP] identifier[broadcast] operator[SEP] identifier[Orchid] operator[SEP] identifier[Lifecycle] operator[SEP] identifier[ProgressEvent] operator[SEP] identifier[fire] operator[SEP] Keyword[this] , literal[String] , identifier[progress] , identifier[maxProgress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static ReasonerQueryImpl create(Conjunction<Statement> pattern, TransactionOLTP tx) { ReasonerQueryImpl query = new ReasonerQueryImpl(pattern, tx).inferTypes(); return query.isAtomic()? new ReasonerAtomicQuery(query.getAtoms(), tx) : query; }
class class_name[name] begin[{] method[create, return_type[type[ReasonerQueryImpl]], modifier[public static], parameter[pattern, tx]] begin[{] local_variable[type[ReasonerQueryImpl], query] return[TernaryExpression(condition=MethodInvocation(arguments=[], member=isAtomic, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), if_false=MemberReference(member=query, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getAtoms, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), MemberReference(member=tx, 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=ReasonerAtomicQuery, sub_type=None)))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ReasonerQueryImpl] identifier[create] operator[SEP] identifier[Conjunction] operator[<] identifier[Statement] operator[>] identifier[pattern] , identifier[TransactionOLTP] identifier[tx] operator[SEP] { identifier[ReasonerQueryImpl] identifier[query] operator[=] Keyword[new] identifier[ReasonerQueryImpl] operator[SEP] identifier[pattern] , identifier[tx] operator[SEP] operator[SEP] identifier[inferTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[query] operator[SEP] identifier[isAtomic] operator[SEP] operator[SEP] operator[?] Keyword[new] identifier[ReasonerAtomicQuery] operator[SEP] identifier[query] operator[SEP] identifier[getAtoms] operator[SEP] operator[SEP] , identifier[tx] operator[SEP] operator[:] identifier[query] operator[SEP] }
public static void compute(List<Vertex> vertexList, TransformMatrix transformMatrixDictionary) { if (Nature.values().length != transformMatrixDictionary.states.length) transformMatrixDictionary.extend(Nature.values().length); int length = vertexList.size() - 1; double[][] cost = new double[2][]; // 滚动数组 Iterator<Vertex> iterator = vertexList.iterator(); Vertex start = iterator.next(); Nature pre = start.attribute.nature[0]; // 第一个是确定的 // start.confirmNature(pre); // 第二个也可以简单地算出来 Vertex preItem; Nature[] preTagSet; { Vertex item = iterator.next(); cost[0] = new double[item.attribute.nature.length]; int j = 0; int curIndex = 0; for (Nature cur : item.attribute.nature) { cost[0][j] = transformMatrixDictionary.transititon_probability[pre.ordinal()][cur.ordinal()] - Math.log((item.attribute.frequency[curIndex] + 1e-8) / transformMatrixDictionary.getTotalFrequency(cur.ordinal())); ++j; ++curIndex; } preTagSet = item.attribute.nature; preItem = item; } // 第三个开始复杂一些 for (int i = 1; i < length; ++i) { int index_i = i & 1; int index_i_1 = 1 - index_i; Vertex item = iterator.next(); cost[index_i] = new double[item.attribute.nature.length]; double perfect_cost_line = Double.MAX_VALUE; int k = 0; Nature[] curTagSet = item.attribute.nature; for (Nature cur : curTagSet) { cost[index_i][k] = Double.MAX_VALUE; int j = 0; for (Nature p : preTagSet) { double now = cost[index_i_1][j] + transformMatrixDictionary.transititon_probability[p.ordinal()][cur.ordinal()] - Math.log((item.attribute.frequency[k] + 1e-8) / transformMatrixDictionary.getTotalFrequency(cur.ordinal())); if (now < cost[index_i][k]) { cost[index_i][k] = now; if (now < perfect_cost_line) { perfect_cost_line = now; pre = p; } } ++j; } ++k; } preItem.confirmNature(pre); preTagSet = curTagSet; preItem = item; } }
class class_name[name] begin[{] method[compute, return_type[void], modifier[public static], parameter[vertexList, transformMatrixDictionary]] begin[{] if[binary_operation[call[Nature.values, parameter[]], !=, member[transformMatrixDictionary.states.length]]] begin[{] call[transformMatrixDictionary.extend, parameter[call[Nature.values, parameter[]]]] else begin[{] None end[}] local_variable[type[int], length] local_variable[type[double], cost] local_variable[type[Iterator], iterator] local_variable[type[Vertex], start] local_variable[type[Nature], pre] local_variable[type[Vertex], preItem] local_variable[type[Nature], preTagSet] local_variable[type[Vertex], item] assign[member[.cost], ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=item.attribute.nature, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))] local_variable[type[int], j] local_variable[type[int], curIndex] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=transititon_probability, postfix_operators=[], prefix_operators=[], qualifier=transformMatrixDictionary, selectors=[ArraySelector(index=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=pre, selectors=[], type_arguments=None)), ArraySelector(index=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=cur, selectors=[], type_arguments=None))]), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=frequency, postfix_operators=[], prefix_operators=[], qualifier=item.attribute, selectors=[ArraySelector(index=MemberReference(member=curIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1e-8), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=cur, selectors=[], type_arguments=None)], member=getTotalFrequency, postfix_operators=[], prefix_operators=[], qualifier=transformMatrixDictionary, selectors=[], type_arguments=None), operator=/)], member=log, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operator=-)), label=None), StatementExpression(expression=MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None), StatementExpression(expression=MemberReference(member=curIndex, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=nature, postfix_operators=[], prefix_operators=[], qualifier=item.attribute, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cur)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Nature, sub_type=None))), label=None) assign[member[.preTagSet], member[item.attribute.nature]] assign[member[.preItem], member[.item]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=&), name=index_i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MemberReference(member=index_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=index_i_1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Vertex, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=cost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=item.attribute.nature, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[]), name=perfect_cost_line)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=nature, postfix_operators=[], prefix_operators=[], qualifier=item.attribute, selectors=[]), name=curTagSet)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Nature, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=MAX_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[])), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=cost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index_i_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=transititon_probability, postfix_operators=[], prefix_operators=[], qualifier=transformMatrixDictionary, selectors=[ArraySelector(index=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)), ArraySelector(index=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=cur, selectors=[], type_arguments=None))]), operator=+), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=frequency, postfix_operators=[], prefix_operators=[], qualifier=item.attribute, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1e-8), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=cur, selectors=[], type_arguments=None)], member=getTotalFrequency, postfix_operators=[], prefix_operators=[], qualifier=transformMatrixDictionary, selectors=[], type_arguments=None), operator=/)], member=log, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), operator=-), name=now)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=cost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=cost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index_i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=perfect_cost_line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=perfect_cost_line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=now, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=pre, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))])), StatementExpression(expression=MemberReference(member=j, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=preTagSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=p)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Nature, sub_type=None))), label=None), StatementExpression(expression=MemberReference(member=k, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=curTagSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cur)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Nature, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pre, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=confirmNature, postfix_operators=[], prefix_operators=[], qualifier=preItem, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=preTagSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=curTagSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=preItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), 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[static] Keyword[void] identifier[compute] operator[SEP] identifier[List] operator[<] identifier[Vertex] operator[>] identifier[vertexList] , identifier[TransformMatrix] identifier[transformMatrixDictionary] operator[SEP] { Keyword[if] operator[SEP] identifier[Nature] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[!=] identifier[transformMatrixDictionary] operator[SEP] identifier[states] operator[SEP] identifier[length] operator[SEP] identifier[transformMatrixDictionary] operator[SEP] identifier[extend] operator[SEP] identifier[Nature] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[vertexList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cost] operator[=] Keyword[new] Keyword[double] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[Vertex] operator[>] identifier[iterator] operator[=] identifier[vertexList] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[Vertex] identifier[start] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Nature] identifier[pre] operator[=] identifier[start] operator[SEP] identifier[attribute] operator[SEP] identifier[nature] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Vertex] identifier[preItem] operator[SEP] identifier[Nature] operator[SEP] operator[SEP] identifier[preTagSet] operator[SEP] { identifier[Vertex] identifier[item] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[cost] operator[SEP] Other[0] operator[SEP] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[item] operator[SEP] identifier[attribute] operator[SEP] identifier[nature] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[int] identifier[curIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Nature] identifier[cur] operator[:] identifier[item] operator[SEP] identifier[attribute] operator[SEP] identifier[nature] operator[SEP] { identifier[cost] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[transformMatrixDictionary] operator[SEP] identifier[transititon_probability] operator[SEP] identifier[pre] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cur] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] operator[-] identifier[Math] operator[SEP] identifier[log] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[attribute] operator[SEP] identifier[frequency] operator[SEP] identifier[curIndex] operator[SEP] operator[+] literal[Float] operator[SEP] operator[/] identifier[transformMatrixDictionary] operator[SEP] identifier[getTotalFrequency] operator[SEP] identifier[cur] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[j] operator[SEP] operator[++] identifier[curIndex] operator[SEP] } identifier[preTagSet] operator[=] identifier[item] operator[SEP] identifier[attribute] operator[SEP] identifier[nature] operator[SEP] identifier[preItem] operator[=] identifier[item] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { Keyword[int] identifier[index_i] operator[=] identifier[i] operator[&] Other[1] operator[SEP] Keyword[int] identifier[index_i_1] operator[=] Other[1] operator[-] identifier[index_i] operator[SEP] identifier[Vertex] identifier[item] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[cost] operator[SEP] identifier[index_i] operator[SEP] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[item] operator[SEP] identifier[attribute] operator[SEP] identifier[nature] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[double] identifier[perfect_cost_line] operator[=] identifier[Double] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[Nature] operator[SEP] operator[SEP] identifier[curTagSet] operator[=] identifier[item] operator[SEP] identifier[attribute] operator[SEP] identifier[nature] operator[SEP] Keyword[for] operator[SEP] identifier[Nature] identifier[cur] operator[:] identifier[curTagSet] operator[SEP] { identifier[cost] operator[SEP] identifier[index_i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[=] identifier[Double] operator[SEP] identifier[MAX_VALUE] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Nature] identifier[p] operator[:] identifier[preTagSet] operator[SEP] { Keyword[double] identifier[now] operator[=] identifier[cost] operator[SEP] identifier[index_i_1] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[+] identifier[transformMatrixDictionary] operator[SEP] identifier[transititon_probability] operator[SEP] identifier[p] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cur] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] operator[-] identifier[Math] operator[SEP] identifier[log] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[attribute] operator[SEP] identifier[frequency] operator[SEP] identifier[k] operator[SEP] operator[+] literal[Float] operator[SEP] operator[/] identifier[transformMatrixDictionary] operator[SEP] identifier[getTotalFrequency] operator[SEP] identifier[cur] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[now] operator[<] identifier[cost] operator[SEP] identifier[index_i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[SEP] { identifier[cost] operator[SEP] identifier[index_i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[=] identifier[now] operator[SEP] Keyword[if] operator[SEP] identifier[now] operator[<] identifier[perfect_cost_line] operator[SEP] { identifier[perfect_cost_line] operator[=] identifier[now] operator[SEP] identifier[pre] operator[=] identifier[p] operator[SEP] } } operator[++] identifier[j] operator[SEP] } operator[++] identifier[k] operator[SEP] } identifier[preItem] operator[SEP] identifier[confirmNature] operator[SEP] identifier[pre] operator[SEP] operator[SEP] identifier[preTagSet] operator[=] identifier[curTagSet] operator[SEP] identifier[preItem] operator[=] identifier[item] operator[SEP] } }
public static INDArray eq(INDArray x, INDArray y, INDArray z, int... dimensions) { if(dimensions == null || dimensions.length == 0) { validateShapesNoDimCase(x,y,z); return Nd4j.getExecutioner().exec(new OldEqualTo(x,y,z)); } return Nd4j.getExecutioner().exec(new BroadcastEqualTo(x,y,z,dimensions)); }
class class_name[name] begin[{] method[eq, return_type[type[INDArray]], modifier[public static], parameter[x, y, z, dimensions]] begin[{] if[binary_operation[binary_operation[member[.dimensions], ==, literal[null]], ||, binary_operation[member[dimensions.length], ==, literal[0]]]] begin[{] call[.validateShapesNoDimCase, parameter[member[.x], member[.y], member[.z]]] return[call[Nd4j.getExecutioner, parameter[]]] else begin[{] None end[}] return[call[Nd4j.getExecutioner, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[INDArray] identifier[eq] operator[SEP] identifier[INDArray] identifier[x] , identifier[INDArray] identifier[y] , identifier[INDArray] identifier[z] , Keyword[int] operator[...] identifier[dimensions] operator[SEP] { Keyword[if] operator[SEP] identifier[dimensions] operator[==] Other[null] operator[||] identifier[dimensions] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { identifier[validateShapesNoDimCase] operator[SEP] identifier[x] , identifier[y] , identifier[z] operator[SEP] operator[SEP] Keyword[return] identifier[Nd4j] operator[SEP] identifier[getExecutioner] operator[SEP] operator[SEP] operator[SEP] identifier[exec] operator[SEP] Keyword[new] identifier[OldEqualTo] operator[SEP] identifier[x] , identifier[y] , identifier[z] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Nd4j] operator[SEP] identifier[getExecutioner] operator[SEP] operator[SEP] operator[SEP] identifier[exec] operator[SEP] Keyword[new] identifier[BroadcastEqualTo] operator[SEP] identifier[x] , identifier[y] , identifier[z] , identifier[dimensions] operator[SEP] operator[SEP] operator[SEP] }
@Override public void addPackageDescription(Content packageContentTree) { if (!utils.getBody(packageElement).isEmpty()) { Content tree = configuration.allowTag(HtmlTag.SECTION) ? sectionTree : packageContentTree; addDeprecationInfo(tree); addInlineComment(packageElement, tree); } }
class class_name[name] begin[{] method[addPackageDescription, return_type[void], modifier[public], parameter[packageContentTree]] begin[{] if[call[utils.getBody, parameter[member[.packageElement]]]] begin[{] local_variable[type[Content], tree] call[.addDeprecationInfo, parameter[member[.tree]]] call[.addInlineComment, parameter[member[.packageElement], member[.tree]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addPackageDescription] operator[SEP] identifier[Content] identifier[packageContentTree] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[utils] operator[SEP] identifier[getBody] operator[SEP] identifier[packageElement] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Content] identifier[tree] operator[=] identifier[configuration] operator[SEP] identifier[allowTag] operator[SEP] identifier[HtmlTag] operator[SEP] identifier[SECTION] operator[SEP] operator[?] identifier[sectionTree] operator[:] identifier[packageContentTree] operator[SEP] identifier[addDeprecationInfo] operator[SEP] identifier[tree] operator[SEP] operator[SEP] identifier[addInlineComment] operator[SEP] identifier[packageElement] , identifier[tree] operator[SEP] operator[SEP] } }
public void addStructural(E entry) { if (entry.getNext() != null) throw new IllegalArgumentException( "The given entry should be fresh!"); int h = entry.structuralHashCode(); int i = indexFor(h, buckets.length); modCount++; E e = buckets[i]; entry.setNext(e); buckets[i] = entry; if (size++ >= oversize) resize(2 * buckets.length); }
class class_name[name] begin[{] method[addStructural, return_type[void], modifier[public], parameter[entry]] begin[{] if[binary_operation[call[entry.getNext, parameter[]], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The given entry should be fresh!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], h] local_variable[type[int], i] member[.modCount] local_variable[type[E], e] call[entry.setNext, parameter[member[.e]]] assign[member[.buckets], member[.entry]] if[binary_operation[member[.size], >=, member[.oversize]]] begin[{] call[.resize, parameter[binary_operation[literal[2], *, member[buckets.length]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[addStructural] operator[SEP] identifier[E] identifier[entry] operator[SEP] { Keyword[if] operator[SEP] identifier[entry] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[h] operator[=] identifier[entry] operator[SEP] identifier[structuralHashCode] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[indexFor] operator[SEP] identifier[h] , identifier[buckets] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[modCount] operator[++] operator[SEP] identifier[E] identifier[e] operator[=] identifier[buckets] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[entry] operator[SEP] identifier[setNext] operator[SEP] identifier[e] operator[SEP] operator[SEP] identifier[buckets] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[entry] operator[SEP] Keyword[if] operator[SEP] identifier[size] operator[++] operator[>=] identifier[oversize] operator[SEP] identifier[resize] operator[SEP] Other[2] operator[*] identifier[buckets] operator[SEP] identifier[length] operator[SEP] operator[SEP] }
public static ConditionBuilder isCommitted() { return new HttpCondition() { @Override public boolean evaluateHttp(HttpServletRewrite event, EvaluationContext context) { return event.getResponse().isCommitted(); } @Override public String toString() { return "Response.isCommitted()"; } }; }
class class_name[name] begin[{] method[isCommitted, return_type[type[ConditionBuilder]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=event, selectors=[MethodInvocation(arguments=[], member=isCommitted, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=evaluateHttp, parameters=[FormalParameter(annotations=[], modifiers=set(), name=event, type=ReferenceType(arguments=None, dimensions=[], name=HttpServletRewrite, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=context, type=ReferenceType(arguments=None, dimensions=[], name=EvaluationContext, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Response.isCommitted()"), label=None)], documentation=None, modifiers={'public'}, name=toString, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpCondition, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[ConditionBuilder] identifier[isCommitted] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[HttpCondition] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[evaluateHttp] operator[SEP] identifier[HttpServletRewrite] identifier[event] , identifier[EvaluationContext] identifier[context] operator[SEP] { Keyword[return] identifier[event] operator[SEP] identifier[getResponse] operator[SEP] operator[SEP] operator[SEP] identifier[isCommitted] operator[SEP] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[toString] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } } operator[SEP] }
public void sortXml() { newDocument = (Document) originalDocument.clone(); final Element rootElement = (Element) originalDocument.getRootElement().clone(); HierarchyRootWrapper rootWrapper = factory.createFromRootElement(rootElement); rootWrapper.createWrappedStructure(factory); rootWrapper.detachStructure(); rootWrapper.sortStructureAttributes(); rootWrapper.sortStructureElements(); rootWrapper.connectXmlStructure(); newDocument.setRootElement(rootWrapper.getElementContent().getContent()); }
class class_name[name] begin[{] method[sortXml, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.newDocument], Cast(expression=MethodInvocation(arguments=[], member=clone, postfix_operators=[], prefix_operators=[], qualifier=originalDocument, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Document, sub_type=None))] local_variable[type[Element], rootElement] local_variable[type[HierarchyRootWrapper], rootWrapper] call[rootWrapper.createWrappedStructure, parameter[member[.factory]]] call[rootWrapper.detachStructure, parameter[]] call[rootWrapper.sortStructureAttributes, parameter[]] call[rootWrapper.sortStructureElements, parameter[]] call[rootWrapper.connectXmlStructure, parameter[]] call[newDocument.setRootElement, parameter[call[rootWrapper.getElementContent, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[sortXml] operator[SEP] operator[SEP] { identifier[newDocument] operator[=] operator[SEP] identifier[Document] operator[SEP] identifier[originalDocument] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Element] identifier[rootElement] operator[=] operator[SEP] identifier[Element] operator[SEP] identifier[originalDocument] operator[SEP] identifier[getRootElement] operator[SEP] operator[SEP] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] identifier[HierarchyRootWrapper] identifier[rootWrapper] operator[=] identifier[factory] operator[SEP] identifier[createFromRootElement] operator[SEP] identifier[rootElement] operator[SEP] operator[SEP] identifier[rootWrapper] operator[SEP] identifier[createWrappedStructure] operator[SEP] identifier[factory] operator[SEP] operator[SEP] identifier[rootWrapper] operator[SEP] identifier[detachStructure] operator[SEP] operator[SEP] operator[SEP] identifier[rootWrapper] operator[SEP] identifier[sortStructureAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[rootWrapper] operator[SEP] identifier[sortStructureElements] operator[SEP] operator[SEP] operator[SEP] identifier[rootWrapper] operator[SEP] identifier[connectXmlStructure] operator[SEP] operator[SEP] operator[SEP] identifier[newDocument] operator[SEP] identifier[setRootElement] operator[SEP] identifier[rootWrapper] operator[SEP] identifier[getElementContent] operator[SEP] operator[SEP] operator[SEP] identifier[getContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static void getDeclaredFields(Class c, Collection<Field> fields) { try { Field[] local = c.getDeclaredFields(); for (Field field : local) { if (!field.isAccessible()) { try { field.setAccessible(true); } catch (Exception ignored) { } } int modifiers = field.getModifiers(); if (!Modifier.isStatic(modifiers) && !field.getName().startsWith("this$") && !Modifier.isTransient(modifiers)) { // speed up: do not count static fields, do not go back up to enclosing object in nested case, do not consider transients fields.add(field); } } } catch (Throwable ignored) { ExceptionUtilities.safelyIgnoreException(ignored); } }
class class_name[name] begin[{] method[getDeclaredFields, return_type[void], modifier[public static], parameter[c, fields]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDeclaredFields, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), name=local)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Field, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isAccessible, postfix_operators=[], prefix_operators=['!'], qualifier=field, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[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)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['Exception']))], finally_block=None, label=None, resources=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getModifiers, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), name=modifiers)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isStatic, postfix_operators=[], prefix_operators=['!'], qualifier=Modifier, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=['!'], qualifier=field, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="this$")], member=startsWith, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), operandr=MethodInvocation(arguments=[MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isTransient, postfix_operators=[], prefix_operators=['!'], qualifier=Modifier, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=fields, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=local, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ignored, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=safelyIgnoreException, postfix_operators=[], prefix_operators=[], qualifier=ExceptionUtilities, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[getDeclaredFields] operator[SEP] identifier[Class] identifier[c] , identifier[Collection] operator[<] identifier[Field] operator[>] identifier[fields] operator[SEP] { Keyword[try] { identifier[Field] operator[SEP] operator[SEP] identifier[local] operator[=] identifier[c] operator[SEP] identifier[getDeclaredFields] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[field] operator[:] identifier[local] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[field] operator[SEP] identifier[isAccessible] operator[SEP] operator[SEP] operator[SEP] { Keyword[try] { identifier[field] operator[SEP] identifier[setAccessible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ignored] operator[SEP] { } } Keyword[int] identifier[modifiers] operator[=] identifier[field] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Modifier] operator[SEP] identifier[isStatic] operator[SEP] identifier[modifiers] operator[SEP] operator[&&] operator[!] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[Modifier] operator[SEP] identifier[isTransient] operator[SEP] identifier[modifiers] operator[SEP] operator[SEP] { identifier[fields] operator[SEP] identifier[add] operator[SEP] identifier[field] operator[SEP] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[Throwable] identifier[ignored] operator[SEP] { identifier[ExceptionUtilities] operator[SEP] identifier[safelyIgnoreException] operator[SEP] identifier[ignored] operator[SEP] operator[SEP] } }
public <S extends Service> S getService(Class<S> type) { for (final Service serv : this.serviceManager.servicesByState().values()) { if (serv.isRunning() && type.isInstance(serv)) { return type.cast(serv); } } return null; }
class class_name[name] begin[{] method[getService, return_type[type[S]], modifier[public], parameter[type]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isRunning, postfix_operators=[], prefix_operators=[], qualifier=serv, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=serv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isInstance, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=serv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=cast, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=serviceManager, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=servicesByState, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=serv)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Service, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] operator[<] identifier[S] Keyword[extends] identifier[Service] operator[>] identifier[S] identifier[getService] operator[SEP] identifier[Class] operator[<] identifier[S] operator[>] identifier[type] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[Service] identifier[serv] operator[:] Keyword[this] operator[SEP] identifier[serviceManager] operator[SEP] identifier[servicesByState] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[serv] operator[SEP] identifier[isRunning] operator[SEP] operator[SEP] operator[&&] identifier[type] operator[SEP] identifier[isInstance] operator[SEP] identifier[serv] operator[SEP] operator[SEP] { Keyword[return] identifier[type] operator[SEP] identifier[cast] operator[SEP] identifier[serv] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public T get(String key) throws Exception { CacheEntry<T> entry = this.objects.get(key); return entry != null ? entry.getUpToDateObject() : null; }
class class_name[name] begin[{] method[get, return_type[type[T]], modifier[public], parameter[key]] begin[{] local_variable[type[CacheEntry], entry] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), if_true=MethodInvocation(arguments=[], member=getUpToDateObject, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] identifier[T] identifier[get] operator[SEP] identifier[String] identifier[key] operator[SEP] Keyword[throws] identifier[Exception] { identifier[CacheEntry] operator[<] identifier[T] operator[>] identifier[entry] operator[=] Keyword[this] operator[SEP] identifier[objects] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] identifier[entry] operator[!=] Other[null] operator[?] identifier[entry] operator[SEP] identifier[getUpToDateObject] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] }
protected void computeClusterDistance() { for( int i = 0; i < pixels.size; i++ ) { pixels.data[i].reset(); } for( int i = 0; i < clusters.size && !stopRequested; i++ ) { Cluster c = clusters.data[i]; // compute search bounds int centerX = (int)(c.x + 0.5f); int centerY = (int)(c.y + 0.5f); int x0 = centerX - gridInterval; int x1 = centerX + gridInterval + 1; int y0 = centerY - gridInterval; int y1 = centerY + gridInterval + 1; if( x0 < 0 ) x0 = 0; if( y0 < 0 ) y0 = 0; if( x1 > input.width ) x1 = input.width; if( y1 > input.height ) y1 = input.height; for( int y = y0; y < y1; y++ ) { int indexPixel = y*input.width + x0; int indexInput = input.startIndex + y*input.stride + x0; int dy = y-centerY; for( int x = x0; x < x1; x++ ) { int dx = x-centerX; float distanceColor = colorDistance(c.color,indexInput++); float distanceSpacial = dx*dx + dy*dy; pixels.data[indexPixel++].add(c,distanceColor + adjustSpacial*distanceSpacial); } } } }
class class_name[name] begin[{] method[computeClusterDistance, return_type[void], modifier[protected], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=pixels, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=reset, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=pixels, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=clusters, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cluster, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.5f), operator=+), type=BasicType(dimensions=[], name=int)), name=centerX)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.5f), operator=+), type=BasicType(dimensions=[], name=int)), name=centerY)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=centerX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=gridInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=x0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=centerX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=gridInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=x1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=centerY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=gridInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=y0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=centerY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=gridInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=y1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=x0, 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=StatementExpression(expression=Assignment(expressionl=MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=y0, 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=StatementExpression(expression=Assignment(expressionl=MemberReference(member=y0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[]), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[])), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=y1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[]), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=y1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[])), label=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[]), operator=*), operandr=MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=indexPixel)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=startIndex, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=stride, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[]), operator=*), operator=+), operandr=MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=indexInput)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=centerY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=dy)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=centerX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=dx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=color, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[]), MemberReference(member=indexInput, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])], member=colorDistance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=distanceColor)], modifiers=set(), type=BasicType(dimensions=[], name=float)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=BinaryOperation(operandl=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=dy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), name=distanceSpacial)], modifiers=set(), type=BasicType(dimensions=[], name=float)), StatementExpression(expression=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=pixels, selectors=[ArraySelector(index=MemberReference(member=indexPixel, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=distanceColor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=adjustSpacial, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=distanceSpacial, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+)], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=x1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=x0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=y1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=y0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=clusters, selectors=[]), operator=<), operandr=MemberReference(member=stopRequested, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[computeClusterDistance] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[pixels] operator[SEP] identifier[size] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[pixels] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[clusters] operator[SEP] identifier[size] operator[&&] operator[!] identifier[stopRequested] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Cluster] identifier[c] operator[=] identifier[clusters] operator[SEP] identifier[data] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[centerX] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[x] operator[+] literal[Float] operator[SEP] operator[SEP] Keyword[int] identifier[centerY] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[y] operator[+] literal[Float] operator[SEP] operator[SEP] Keyword[int] identifier[x0] operator[=] identifier[centerX] operator[-] identifier[gridInterval] operator[SEP] Keyword[int] identifier[x1] operator[=] identifier[centerX] operator[+] identifier[gridInterval] operator[+] Other[1] operator[SEP] Keyword[int] identifier[y0] operator[=] identifier[centerY] operator[-] identifier[gridInterval] operator[SEP] Keyword[int] identifier[y1] operator[=] identifier[centerY] operator[+] identifier[gridInterval] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[x0] operator[<] Other[0] operator[SEP] identifier[x0] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[y0] operator[<] Other[0] operator[SEP] identifier[y0] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[x1] operator[>] identifier[input] operator[SEP] identifier[width] operator[SEP] identifier[x1] operator[=] identifier[input] operator[SEP] identifier[width] operator[SEP] Keyword[if] operator[SEP] identifier[y1] operator[>] identifier[input] operator[SEP] identifier[height] operator[SEP] identifier[y1] operator[=] identifier[input] operator[SEP] identifier[height] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] identifier[y0] operator[SEP] identifier[y] operator[<] identifier[y1] operator[SEP] identifier[y] operator[++] operator[SEP] { Keyword[int] identifier[indexPixel] operator[=] identifier[y] operator[*] identifier[input] operator[SEP] identifier[width] operator[+] identifier[x0] operator[SEP] Keyword[int] identifier[indexInput] operator[=] identifier[input] operator[SEP] identifier[startIndex] operator[+] identifier[y] operator[*] identifier[input] operator[SEP] identifier[stride] operator[+] identifier[x0] operator[SEP] Keyword[int] identifier[dy] operator[=] identifier[y] operator[-] identifier[centerY] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] identifier[x0] operator[SEP] identifier[x] operator[<] identifier[x1] operator[SEP] identifier[x] operator[++] operator[SEP] { Keyword[int] identifier[dx] operator[=] identifier[x] operator[-] identifier[centerX] operator[SEP] Keyword[float] identifier[distanceColor] operator[=] identifier[colorDistance] operator[SEP] identifier[c] operator[SEP] identifier[color] , identifier[indexInput] operator[++] operator[SEP] operator[SEP] Keyword[float] identifier[distanceSpacial] operator[=] identifier[dx] operator[*] identifier[dx] operator[+] identifier[dy] operator[*] identifier[dy] operator[SEP] identifier[pixels] operator[SEP] identifier[data] operator[SEP] identifier[indexPixel] operator[++] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[c] , identifier[distanceColor] operator[+] identifier[adjustSpacial] operator[*] identifier[distanceSpacial] operator[SEP] operator[SEP] } } } }
public NodeType[] getRequiredPrimaryTypes() { InternalQName[] requiredPrimaryTypes = nodeDefinitionData.getRequiredPrimaryTypes(); NodeType[] result = new NodeType[requiredPrimaryTypes.length]; for (int i = 0; i < requiredPrimaryTypes.length; i++) { NodeTypeData ntData = nodeTypeDataManager.getNodeType(requiredPrimaryTypes[i]); if (ntData == null) { LOG.error("NODE TYPE NOT FOUND " + requiredPrimaryTypes[i].getAsString()); } else result[i] = new NodeTypeImpl(ntData, nodeTypeDataManager, nodeTypeManager, locationFactory, valueFactory, dataManager); } return result; }
class class_name[name] begin[{] method[getRequiredPrimaryTypes, return_type[type[NodeType]], modifier[public], parameter[]] begin[{] local_variable[type[InternalQName], requiredPrimaryTypes] local_variable[type[NodeType], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=requiredPrimaryTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=getNodeType, postfix_operators=[], prefix_operators=[], qualifier=nodeTypeDataManager, selectors=[], type_arguments=None), name=ntData)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeTypeData, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ntData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[MemberReference(member=ntData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nodeTypeDataManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nodeTypeManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=locationFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=valueFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataManager, 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=NodeTypeImpl, sub_type=None))), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NODE TYPE NOT FOUND "), operandr=MemberReference(member=requiredPrimaryTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getAsString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=requiredPrimaryTypes, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.result]] end[}] END[}]
Keyword[public] identifier[NodeType] operator[SEP] operator[SEP] identifier[getRequiredPrimaryTypes] operator[SEP] operator[SEP] { identifier[InternalQName] operator[SEP] operator[SEP] identifier[requiredPrimaryTypes] operator[=] identifier[nodeDefinitionData] operator[SEP] identifier[getRequiredPrimaryTypes] operator[SEP] operator[SEP] operator[SEP] identifier[NodeType] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[NodeType] operator[SEP] identifier[requiredPrimaryTypes] 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[requiredPrimaryTypes] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[NodeTypeData] identifier[ntData] operator[=] identifier[nodeTypeDataManager] operator[SEP] identifier[getNodeType] operator[SEP] identifier[requiredPrimaryTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ntData] operator[==] Other[null] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[requiredPrimaryTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getAsString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[NodeTypeImpl] operator[SEP] identifier[ntData] , identifier[nodeTypeDataManager] , identifier[nodeTypeManager] , identifier[locationFactory] , identifier[valueFactory] , identifier[dataManager] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public Bucket reload() { // [START reload] Bucket latestBucket = bucket.reload(BucketSourceOption.metagenerationMatch()); if (latestBucket == null) { // the bucket was not found } // [END reload] return latestBucket; }
class class_name[name] begin[{] method[reload, return_type[type[Bucket]], modifier[public], parameter[]] begin[{] local_variable[type[Bucket], latestBucket] if[binary_operation[member[.latestBucket], ==, literal[null]]] begin[{] else begin[{] None end[}] return[member[.latestBucket]] end[}] END[}]
Keyword[public] identifier[Bucket] identifier[reload] operator[SEP] operator[SEP] { identifier[Bucket] identifier[latestBucket] operator[=] identifier[bucket] operator[SEP] identifier[reload] operator[SEP] identifier[BucketSourceOption] operator[SEP] identifier[metagenerationMatch] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[latestBucket] operator[==] Other[null] operator[SEP] { } Keyword[return] identifier[latestBucket] operator[SEP] }
public IfcHumidifierTypeEnum createIfcHumidifierTypeEnumFromString(EDataType eDataType, String initialValue) { IfcHumidifierTypeEnum result = IfcHumidifierTypeEnum.get(initialValue); if (result == null) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
class class_name[name] begin[{] method[createIfcHumidifierTypeEnumFromString, return_type[type[IfcHumidifierTypeEnum]], modifier[public], parameter[eDataType, initialValue]] begin[{] local_variable[type[IfcHumidifierTypeEnum], result] if[binary_operation[member[.result], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The value '"), operandr=MemberReference(member=initialValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is not a valid enumerator of '"), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=eDataType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[IfcHumidifierTypeEnum] identifier[createIfcHumidifierTypeEnumFromString] operator[SEP] identifier[EDataType] identifier[eDataType] , identifier[String] identifier[initialValue] operator[SEP] { identifier[IfcHumidifierTypeEnum] identifier[result] operator[=] identifier[IfcHumidifierTypeEnum] operator[SEP] identifier[get] operator[SEP] identifier[initialValue] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[initialValue] operator[+] literal[String] operator[+] identifier[eDataType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
@Override public List<Record> signalEndTrack(int newDepth, long timeEnded) { List<Record> willReturn = new ArrayList<Record>(); //(get state info) boolean trackWasNonempty = current.somethingPrinted; //(flush) flush(current,willReturn); current = stack.pop(); //(update seen counts) if(trackWasNonempty){ if(current.trackCountPending == PendingType.PRINTING){ //((track was in fact printed)) current.timesPrinted += 1; } if(current.trackCountPending != PendingType.NONE){ //((track was in fact seen)) current.timesSeen += 1; } //((track is nonempty)) current.somethingPrinted = true; } //(update this track) current.trackCountPending = PendingType.NONE; return willReturn; }
class class_name[name] begin[{] method[signalEndTrack, return_type[type[List]], modifier[public], parameter[newDepth, timeEnded]] begin[{] local_variable[type[List], willReturn] local_variable[type[boolean], trackWasNonempty] call[.flush, parameter[member[.current], member[.willReturn]]] assign[member[.current], call[stack.pop, parameter[]]] if[member[.trackWasNonempty]] begin[{] if[binary_operation[member[current.trackCountPending], ==, member[PendingType.PRINTING]]] begin[{] assign[member[current.timesPrinted], literal[1]] else begin[{] None end[}] if[binary_operation[member[current.trackCountPending], !=, member[PendingType.NONE]]] begin[{] assign[member[current.timesSeen], literal[1]] else begin[{] None end[}] assign[member[current.somethingPrinted], literal[true]] else begin[{] None end[}] assign[member[current.trackCountPending], member[PendingType.NONE]] return[member[.willReturn]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[Record] operator[>] identifier[signalEndTrack] operator[SEP] Keyword[int] identifier[newDepth] , Keyword[long] identifier[timeEnded] operator[SEP] { identifier[List] operator[<] identifier[Record] operator[>] identifier[willReturn] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Record] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[trackWasNonempty] operator[=] identifier[current] operator[SEP] identifier[somethingPrinted] operator[SEP] identifier[flush] operator[SEP] identifier[current] , identifier[willReturn] operator[SEP] operator[SEP] identifier[current] operator[=] identifier[stack] operator[SEP] identifier[pop] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trackWasNonempty] operator[SEP] { Keyword[if] operator[SEP] identifier[current] operator[SEP] identifier[trackCountPending] operator[==] identifier[PendingType] operator[SEP] identifier[PRINTING] operator[SEP] { identifier[current] operator[SEP] identifier[timesPrinted] operator[+=] Other[1] operator[SEP] } Keyword[if] operator[SEP] identifier[current] operator[SEP] identifier[trackCountPending] operator[!=] identifier[PendingType] operator[SEP] identifier[NONE] operator[SEP] { identifier[current] operator[SEP] identifier[timesSeen] operator[+=] Other[1] operator[SEP] } identifier[current] operator[SEP] identifier[somethingPrinted] operator[=] literal[boolean] operator[SEP] } identifier[current] operator[SEP] identifier[trackCountPending] operator[=] identifier[PendingType] operator[SEP] identifier[NONE] operator[SEP] Keyword[return] identifier[willReturn] operator[SEP] }
public void activateOptions() { getLogger().info("activateOptions"); active = true; Runnable runnable = new Runnable() { public void run() { initialize(); while (reader == null) { getLogger().info("attempting to load file: " + getFileURL()); try { reader = new InputStreamReader(new URL(getFileURL()).openStream()); } catch (FileNotFoundException fnfe) { getLogger().info("file not available - will try again"); synchronized (this) { try { wait(MISSING_FILE_RETRY_MILLIS); } catch (InterruptedException ie) {} } } catch (IOException ioe) { getLogger().warn("unable to load file", ioe); return; } } try { BufferedReader bufferedReader = new BufferedReader(reader); createPattern(); do { process(bufferedReader); try { synchronized (this) { wait(waitMillis); } } catch (InterruptedException ie) {} if (tailing) { getLogger().debug("tailing file"); } } while (tailing); } catch (IOException ioe) { //io exception - probably shut down getLogger().info("stream closed"); } getLogger().debug("processing " + path + " complete"); shutdown(); } }; if(useCurrentThread) { runnable.run(); }else { new Thread(runnable, "LogFilePatternReceiver-"+getName()).start(); } }
class class_name[name] begin[{] method[activateOptions, return_type[void], modifier[public], parameter[]] begin[{] call[.getLogger, parameter[]] assign[member[.active], literal[true]] local_variable[type[Runnable], runnable] if[member[.useCurrentThread]] begin[{] call[runnable.run, parameter[]] else begin[{] ClassCreator(arguments=[MemberReference(member=runnable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="LogFilePatternReceiver-"), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=start, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Thread, sub_type=None)) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[activateOptions] operator[SEP] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[active] operator[=] literal[boolean] operator[SEP] identifier[Runnable] identifier[runnable] operator[=] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[initialize] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[reader] operator[==] Other[null] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[getFileURL] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[reader] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] Keyword[new] identifier[URL] operator[SEP] identifier[getFileURL] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[openStream] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[fnfe] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { Keyword[try] { identifier[wait] operator[SEP] identifier[MISSING_FILE_RETRY_MILLIS] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ie] operator[SEP] { } } } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[ioe] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } } Keyword[try] { identifier[BufferedReader] identifier[bufferedReader] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] identifier[reader] operator[SEP] operator[SEP] identifier[createPattern] operator[SEP] operator[SEP] operator[SEP] Keyword[do] { identifier[process] operator[SEP] identifier[bufferedReader] operator[SEP] operator[SEP] Keyword[try] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[wait] operator[SEP] identifier[waitMillis] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ie] operator[SEP] { } Keyword[if] operator[SEP] identifier[tailing] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[while] operator[SEP] identifier[tailing] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[path] operator[+] literal[String] operator[SEP] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] Keyword[if] operator[SEP] identifier[useCurrentThread] operator[SEP] { identifier[runnable] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[new] identifier[Thread] operator[SEP] identifier[runnable] , literal[String] operator[+] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] } }
@Override public void setIsolationLevel(IsolationLevel level) throws IllegalStateException { if(level != IsolationLevels.SNAPSHOT){ throw new IllegalStateException("Only IsolationLevels.SNAPSHOT level supported."); }else{ super.setIsolationLevel(level); } }
class class_name[name] begin[{] method[setIsolationLevel, return_type[void], modifier[public], parameter[level]] begin[{] if[binary_operation[member[.level], !=, member[IsolationLevels.SNAPSHOT]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Only IsolationLevels.SNAPSHOT level supported.")], 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[{] SuperMethodInvocation(arguments=[MemberReference(member=level, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setIsolationLevel, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setIsolationLevel] operator[SEP] identifier[IsolationLevel] identifier[level] operator[SEP] Keyword[throws] identifier[IllegalStateException] { Keyword[if] operator[SEP] identifier[level] operator[!=] identifier[IsolationLevels] operator[SEP] identifier[SNAPSHOT] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] { Keyword[super] operator[SEP] identifier[setIsolationLevel] operator[SEP] identifier[level] operator[SEP] operator[SEP] } }
public static final <X> Function<X,Boolean> isNullBy(final IFunction<X,?> by) { return FnFunc.chain(by, FnObject.isNull()); }
class class_name[name] begin[{] method[isNullBy, return_type[type[Function]], modifier[final public static], parameter[by]] begin[{] return[call[FnFunc.chain, parameter[member[.by], call[FnObject.isNull, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] operator[<] identifier[X] operator[>] identifier[Function] operator[<] identifier[X] , identifier[Boolean] operator[>] identifier[isNullBy] operator[SEP] Keyword[final] identifier[IFunction] operator[<] identifier[X] , operator[?] operator[>] identifier[by] operator[SEP] { Keyword[return] identifier[FnFunc] operator[SEP] identifier[chain] operator[SEP] identifier[by] , identifier[FnObject] operator[SEP] identifier[isNull] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
void flush() { internalLock.writeLock().lock(); flushLock.lock(); try { if (isNew || modifiedBy.size() > 0) { VanillaDb.logMgr().flush(lastLsn); contents.write(blk); modifiedBy.clear(); isNew = false; } } finally { flushLock.unlock(); internalLock.writeLock().unlock(); } }
class class_name[name] begin[{] method[flush, return_type[void], modifier[default], parameter[]] begin[{] call[internalLock.writeLock, parameter[]] call[flushLock.lock, parameter[]] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=isNew, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=modifiedBy, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=logMgr, postfix_operators=[], prefix_operators=[], qualifier=VanillaDb, selectors=[MethodInvocation(arguments=[MemberReference(member=lastLsn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=flush, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=blk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=contents, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clear, postfix_operators=[], prefix_operators=[], qualifier=modifiedBy, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=isNew, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None)]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlock, postfix_operators=[], prefix_operators=[], qualifier=flushLock, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=writeLock, postfix_operators=[], prefix_operators=[], qualifier=internalLock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[void] identifier[flush] operator[SEP] operator[SEP] { identifier[internalLock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] identifier[flushLock] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[if] operator[SEP] identifier[isNew] operator[||] identifier[modifiedBy] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[VanillaDb] operator[SEP] identifier[logMgr] operator[SEP] operator[SEP] operator[SEP] identifier[flush] operator[SEP] identifier[lastLsn] operator[SEP] operator[SEP] identifier[contents] operator[SEP] identifier[write] operator[SEP] identifier[blk] operator[SEP] operator[SEP] identifier[modifiedBy] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[isNew] operator[=] literal[boolean] operator[SEP] } } Keyword[finally] { identifier[flushLock] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] identifier[internalLock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP] } }
public Status validateResponseContent(Object responseContent, String uri, String httpMethod, String statusCode, String mediaTypeName) { OpenApiOperation operation = null; try { operation = getOpenApiOperation(uri, httpMethod); } catch (URISyntaxException e) { logger.error(e.getMessage()); return new Status(VALIDATOR_RESPONSE_CONTENT_UNEXPECTED, httpMethod, uri); } if(operation == null) { return new Status(VALIDATOR_RESPONSE_CONTENT_UNEXPECTED, httpMethod, uri); } return validateResponseContent(responseContent, operation, statusCode, mediaTypeName); }
class class_name[name] begin[{] method[validateResponseContent, return_type[type[Status]], modifier[public], parameter[responseContent, uri, httpMethod, statusCode, mediaTypeName]] begin[{] local_variable[type[OpenApiOperation], operation] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=operation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getOpenApiOperation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=VALIDATOR_RESPONSE_CONTENT_UNEXPECTED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uri, 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=Status, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.operation], ==, literal[null]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=VALIDATOR_RESPONSE_CONTENT_UNEXPECTED, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=httpMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uri, 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=Status, sub_type=None))] else begin[{] None end[}] return[call[.validateResponseContent, parameter[member[.responseContent], member[.operation], member[.statusCode], member[.mediaTypeName]]]] end[}] END[}]
Keyword[public] identifier[Status] identifier[validateResponseContent] operator[SEP] identifier[Object] identifier[responseContent] , identifier[String] identifier[uri] , identifier[String] identifier[httpMethod] , identifier[String] identifier[statusCode] , identifier[String] identifier[mediaTypeName] operator[SEP] { identifier[OpenApiOperation] identifier[operation] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[operation] operator[=] identifier[getOpenApiOperation] operator[SEP] identifier[uri] , identifier[httpMethod] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Status] operator[SEP] identifier[VALIDATOR_RESPONSE_CONTENT_UNEXPECTED] , identifier[httpMethod] , identifier[uri] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[operation] operator[==] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[Status] operator[SEP] identifier[VALIDATOR_RESPONSE_CONTENT_UNEXPECTED] , identifier[httpMethod] , identifier[uri] operator[SEP] operator[SEP] } Keyword[return] identifier[validateResponseContent] operator[SEP] identifier[responseContent] , identifier[operation] , identifier[statusCode] , identifier[mediaTypeName] operator[SEP] operator[SEP] }
private Set<Alert> getSelectedAlertsImpl(boolean allAlerts) { TreePath[] paths = getTreeAlert().getSelectionPaths(); if (paths == null || paths.length == 0) { return Collections.emptySet(); } Set<Alert> alerts = new HashSet<>(); if (!allAlerts) { DefaultMutableTreeNode alertNode = (DefaultMutableTreeNode) paths[0].getLastPathComponent(); alerts.add((Alert) alertNode.getUserObject()); return alerts; } for (int i = 0; i < paths.length; i++) { DefaultMutableTreeNode alertNode = (DefaultMutableTreeNode) paths[i].getLastPathComponent(); if (alertNode.getChildCount() == 0) { alerts.add((Alert) alertNode.getUserObject()); continue; } for (int j = 0; j < alertNode.getChildCount(); j++) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) alertNode.getChildAt(j); alerts.add((Alert) node.getUserObject()); } } return alerts; }
class class_name[name] begin[{] method[getSelectedAlertsImpl, return_type[type[Set]], modifier[private], parameter[allAlerts]] begin[{] local_variable[type[TreePath], paths] if[binary_operation[binary_operation[member[.paths], ==, literal[null]], ||, binary_operation[member[paths.length], ==, literal[0]]]] begin[{] return[call[Collections.emptySet, parameter[]]] else begin[{] None end[}] local_variable[type[Set], alerts] if[member[.allAlerts]] begin[{] local_variable[type[DefaultMutableTreeNode], alertNode] call[alerts.add, parameter[Cast(expression=MethodInvocation(arguments=[], member=getUserObject, postfix_operators=[], prefix_operators=[], qualifier=alertNode, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Alert, sub_type=None))]] return[member[.alerts]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=paths, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getLastPathComponent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=DefaultMutableTreeNode, sub_type=None)), name=alertNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DefaultMutableTreeNode, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getChildCount, postfix_operators=[], prefix_operators=[], qualifier=alertNode, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getUserObject, postfix_operators=[], prefix_operators=[], qualifier=alertNode, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Alert, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=alerts, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getChildAt, postfix_operators=[], prefix_operators=[], qualifier=alertNode, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=DefaultMutableTreeNode, sub_type=None)), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DefaultMutableTreeNode, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[], member=getUserObject, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Alert, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=alerts, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getChildCount, postfix_operators=[], prefix_operators=[], qualifier=alertNode, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=paths, 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[.alerts]] end[}] END[}]
Keyword[private] identifier[Set] operator[<] identifier[Alert] operator[>] identifier[getSelectedAlertsImpl] operator[SEP] Keyword[boolean] identifier[allAlerts] operator[SEP] { identifier[TreePath] operator[SEP] operator[SEP] identifier[paths] operator[=] identifier[getTreeAlert] operator[SEP] operator[SEP] operator[SEP] identifier[getSelectionPaths] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[paths] operator[==] Other[null] operator[||] identifier[paths] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[Collections] operator[SEP] identifier[emptySet] operator[SEP] operator[SEP] operator[SEP] } identifier[Set] operator[<] identifier[Alert] operator[>] identifier[alerts] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[allAlerts] operator[SEP] { identifier[DefaultMutableTreeNode] identifier[alertNode] operator[=] operator[SEP] identifier[DefaultMutableTreeNode] operator[SEP] identifier[paths] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getLastPathComponent] operator[SEP] operator[SEP] operator[SEP] identifier[alerts] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[Alert] operator[SEP] identifier[alertNode] operator[SEP] identifier[getUserObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[alerts] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[paths] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[DefaultMutableTreeNode] identifier[alertNode] operator[=] operator[SEP] identifier[DefaultMutableTreeNode] operator[SEP] identifier[paths] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getLastPathComponent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[alertNode] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[alerts] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[Alert] operator[SEP] identifier[alertNode] operator[SEP] identifier[getUserObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[alertNode] operator[SEP] identifier[getChildCount] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[DefaultMutableTreeNode] identifier[node] operator[=] operator[SEP] identifier[DefaultMutableTreeNode] operator[SEP] identifier[alertNode] operator[SEP] identifier[getChildAt] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[alerts] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[Alert] operator[SEP] identifier[node] operator[SEP] identifier[getUserObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[alerts] operator[SEP] }
public Observable<ServiceResponse<SiteSealInner>> retrieveSiteSealWithServiceResponseAsync(String resourceGroupName, String certificateOrderName, SiteSealRequest siteSealRequest) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (certificateOrderName == null) { throw new IllegalArgumentException("Parameter certificateOrderName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (siteSealRequest == null) { throw new IllegalArgumentException("Parameter siteSealRequest is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(siteSealRequest); return service.retrieveSiteSeal(resourceGroupName, certificateOrderName, this.client.subscriptionId(), siteSealRequest, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<SiteSealInner>>>() { @Override public Observable<ServiceResponse<SiteSealInner>> call(Response<ResponseBody> response) { try { ServiceResponse<SiteSealInner> clientResponse = retrieveSiteSealDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[retrieveSiteSealWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, certificateOrderName, siteSealRequest]] begin[{] if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.certificateOrderName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter certificateOrderName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.siteSealRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter siteSealRequest is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[Validator.validate, parameter[member[.siteSealRequest]]] return[call[service.retrieveSiteSeal, parameter[member[.resourceGroupName], member[.certificateOrderName], THIS[member[None.client]call[None.subscriptionId, parameter[]]], member[.siteSealRequest], THIS[member[None.client]call[None.apiVersion, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[SiteSealInner] operator[>] operator[>] identifier[retrieveSiteSealWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[certificateOrderName] , identifier[SiteSealRequest] identifier[siteSealRequest] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[certificateOrderName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[siteSealRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[siteSealRequest] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[retrieveSiteSeal] operator[SEP] identifier[resourceGroupName] , identifier[certificateOrderName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[siteSealRequest] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[SiteSealInner] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[SiteSealInner] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[SiteSealInner] operator[>] identifier[clientResponse] operator[=] identifier[retrieveSiteSealDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public static void setAtomProperties(IChemModel chemModel, Object propKey, Object propVal) { if (chemModel.getMoleculeSet() != null) { MoleculeSetManipulator.setAtomProperties(chemModel.getMoleculeSet(), propKey, propVal); } if (chemModel.getReactionSet() != null) { ReactionSetManipulator.setAtomProperties(chemModel.getReactionSet(), propKey, propVal); } if (chemModel.getCrystal() != null) { AtomContainerManipulator.setAtomProperties(chemModel.getCrystal(), propKey, propVal); } }
class class_name[name] begin[{] method[setAtomProperties, return_type[void], modifier[public static], parameter[chemModel, propKey, propVal]] begin[{] if[binary_operation[call[chemModel.getMoleculeSet, parameter[]], !=, literal[null]]] begin[{] call[MoleculeSetManipulator.setAtomProperties, parameter[call[chemModel.getMoleculeSet, parameter[]], member[.propKey], member[.propVal]]] else begin[{] None end[}] if[binary_operation[call[chemModel.getReactionSet, parameter[]], !=, literal[null]]] begin[{] call[ReactionSetManipulator.setAtomProperties, parameter[call[chemModel.getReactionSet, parameter[]], member[.propKey], member[.propVal]]] else begin[{] None end[}] if[binary_operation[call[chemModel.getCrystal, parameter[]], !=, literal[null]]] begin[{] call[AtomContainerManipulator.setAtomProperties, parameter[call[chemModel.getCrystal, parameter[]], member[.propKey], member[.propVal]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setAtomProperties] operator[SEP] identifier[IChemModel] identifier[chemModel] , identifier[Object] identifier[propKey] , identifier[Object] identifier[propVal] operator[SEP] { Keyword[if] operator[SEP] identifier[chemModel] operator[SEP] identifier[getMoleculeSet] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[MoleculeSetManipulator] operator[SEP] identifier[setAtomProperties] operator[SEP] identifier[chemModel] operator[SEP] identifier[getMoleculeSet] operator[SEP] operator[SEP] , identifier[propKey] , identifier[propVal] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[chemModel] operator[SEP] identifier[getReactionSet] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[ReactionSetManipulator] operator[SEP] identifier[setAtomProperties] operator[SEP] identifier[chemModel] operator[SEP] identifier[getReactionSet] operator[SEP] operator[SEP] , identifier[propKey] , identifier[propVal] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[chemModel] operator[SEP] identifier[getCrystal] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[AtomContainerManipulator] operator[SEP] identifier[setAtomProperties] operator[SEP] identifier[chemModel] operator[SEP] identifier[getCrystal] operator[SEP] operator[SEP] , identifier[propKey] , identifier[propVal] operator[SEP] operator[SEP] } }
private static DistributionValue.BucketOptions toBucketOptionsProto( Distribution.BucketOptions bucketOptions) { final DistributionValue.BucketOptions.Builder builder = DistributionValue.BucketOptions.newBuilder(); bucketOptions.match( new Function<Distribution.BucketOptions.ExplicitOptions, Void>() { @Override public Void apply(Distribution.BucketOptions.ExplicitOptions arg) { builder.setExplicit( DistributionValue.BucketOptions.Explicit.newBuilder() .addAllBounds(arg.getBucketBoundaries()) .build()); return null; } }, Functions.<Void>throwAssertionError()); return builder.build(); }
class class_name[name] begin[{] method[toBucketOptionsProto, return_type[type[DistributionValue]], modifier[private static], parameter[bucketOptions]] begin[{] local_variable[type[DistributionValue], builder] call[bucketOptions.match, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=newBuilder, postfix_operators=[], prefix_operators=[], qualifier=DistributionValue.BucketOptions.Explicit, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getBucketBoundaries, postfix_operators=[], prefix_operators=[], qualifier=arg, selectors=[], type_arguments=None)], member=addAllBounds, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setExplicit, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], documentation=None, modifiers={'public'}, name=apply, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg, type=ReferenceType(arguments=None, dimensions=[], name=Distribution, sub_type=ReferenceType(arguments=None, dimensions=None, name=BucketOptions, sub_type=ReferenceType(arguments=None, dimensions=None, name=ExplicitOptions, sub_type=None))), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Distribution, sub_type=ReferenceType(arguments=None, dimensions=None, name=BucketOptions, sub_type=ReferenceType(arguments=None, dimensions=None, name=ExplicitOptions, sub_type=None)))), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Void, sub_type=None))], dimensions=None, name=Function, sub_type=None)), call[.Functions, parameter[]]]] return[call[builder.build, parameter[]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[DistributionValue] operator[SEP] identifier[BucketOptions] identifier[toBucketOptionsProto] operator[SEP] identifier[Distribution] operator[SEP] identifier[BucketOptions] identifier[bucketOptions] operator[SEP] { Keyword[final] identifier[DistributionValue] operator[SEP] identifier[BucketOptions] operator[SEP] identifier[Builder] identifier[builder] operator[=] identifier[DistributionValue] operator[SEP] identifier[BucketOptions] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[bucketOptions] operator[SEP] identifier[match] operator[SEP] Keyword[new] identifier[Function] operator[<] identifier[Distribution] operator[SEP] identifier[BucketOptions] operator[SEP] identifier[ExplicitOptions] , identifier[Void] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Void] identifier[apply] operator[SEP] identifier[Distribution] operator[SEP] identifier[BucketOptions] operator[SEP] identifier[ExplicitOptions] identifier[arg] operator[SEP] { identifier[builder] operator[SEP] identifier[setExplicit] operator[SEP] identifier[DistributionValue] operator[SEP] identifier[BucketOptions] operator[SEP] identifier[Explicit] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[addAllBounds] operator[SEP] identifier[arg] operator[SEP] identifier[getBucketBoundaries] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } } , identifier[Functions] operator[SEP] operator[<] identifier[Void] operator[>] identifier[throwAssertionError] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
@BetaApi public final Operation setSslPolicyTargetSslProxy( String targetSslProxy, SslPolicyReference sslPolicyReferenceResource) { SetSslPolicyTargetSslProxyHttpRequest request = SetSslPolicyTargetSslProxyHttpRequest.newBuilder() .setTargetSslProxy(targetSslProxy) .setSslPolicyReferenceResource(sslPolicyReferenceResource) .build(); return setSslPolicyTargetSslProxy(request); }
class class_name[name] begin[{] method[setSslPolicyTargetSslProxy, return_type[type[Operation]], modifier[final public], parameter[targetSslProxy, sslPolicyReferenceResource]] begin[{] local_variable[type[SetSslPolicyTargetSslProxyHttpRequest], request] return[call[.setSslPolicyTargetSslProxy, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[BetaApi] Keyword[public] Keyword[final] identifier[Operation] identifier[setSslPolicyTargetSslProxy] operator[SEP] identifier[String] identifier[targetSslProxy] , identifier[SslPolicyReference] identifier[sslPolicyReferenceResource] operator[SEP] { identifier[SetSslPolicyTargetSslProxyHttpRequest] identifier[request] operator[=] identifier[SetSslPolicyTargetSslProxyHttpRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setTargetSslProxy] operator[SEP] identifier[targetSslProxy] operator[SEP] operator[SEP] identifier[setSslPolicyReferenceResource] operator[SEP] identifier[sslPolicyReferenceResource] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[setSslPolicyTargetSslProxy] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
private Optional<HttpSessionToken> getDefaultToken(String name) { return defaultTokens.stream().filter(e -> name.equalsIgnoreCase(e.getName())).findFirst(); }
class class_name[name] begin[{] method[getDefaultToken, return_type[type[Optional]], modifier[private], parameter[name]] begin[{] return[call[defaultTokens.stream, parameter[]]] end[}] END[}]
Keyword[private] identifier[Optional] operator[<] identifier[HttpSessionToken] operator[>] identifier[getDefaultToken] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[return] identifier[defaultTokens] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[e] operator[->] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[e] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[findFirst] operator[SEP] operator[SEP] operator[SEP] }
@Override public HttpMessage get(int index) { try { return historyReferences.get(index).getHttpMessage(); } catch (HttpMalformedHeaderException | DatabaseException e) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Failed to get the message from DB: " + e.getMessage(), e); } } return null; }
class class_name[name] begin[{] method[get, return_type[type[HttpMessage]], modifier[public], parameter[index]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=historyReferences, selectors=[MethodInvocation(arguments=[], member=getHttpMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to get the message from DB: "), 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=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['HttpMalformedHeaderException', 'DatabaseException']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[HttpMessage] identifier[get] operator[SEP] Keyword[int] identifier[index] operator[SEP] { Keyword[try] { Keyword[return] identifier[historyReferences] operator[SEP] identifier[get] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[getHttpMessage] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[HttpMalformedHeaderException] operator[|] identifier[DatabaseException] identifier[e] 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] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
protected final void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { vcs.fireVetoableChange(propertyName, oldValue, newValue); }
class class_name[name] begin[{] method[fireVetoableChange, return_type[void], modifier[final protected], parameter[propertyName, oldValue, newValue]] begin[{] call[vcs.fireVetoableChange, parameter[member[.propertyName], member[.oldValue], member[.newValue]]] end[}] END[}]
Keyword[protected] Keyword[final] Keyword[void] identifier[fireVetoableChange] operator[SEP] identifier[String] identifier[propertyName] , identifier[Object] identifier[oldValue] , identifier[Object] identifier[newValue] operator[SEP] Keyword[throws] identifier[PropertyVetoException] { identifier[vcs] operator[SEP] identifier[fireVetoableChange] operator[SEP] identifier[propertyName] , identifier[oldValue] , identifier[newValue] operator[SEP] operator[SEP] }
void errorForDOM3(String msg, Object[] args) throws TransformerException { String fmsg = XSLMessages.createXPATHMessage(msg, args); ErrorListener ehandler = this.getErrorListener(); TransformerException te = new XPathStylesheetDOM3Exception(fmsg, m_sourceLocator); if (null != ehandler) { // TO DO: Need to get stylesheet Locator from here. ehandler.fatalError(te); } else { // System.err.println(fmsg); throw te; } }
class class_name[name] begin[{] method[errorForDOM3, return_type[void], modifier[default], parameter[msg, args]] begin[{] local_variable[type[String], fmsg] local_variable[type[ErrorListener], ehandler] local_variable[type[TransformerException], te] if[binary_operation[literal[null], !=, member[.ehandler]]] begin[{] call[ehandler.fatalError, parameter[member[.te]]] else begin[{] ThrowStatement(expression=MemberReference(member=te, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) end[}] end[}] END[}]
Keyword[void] identifier[errorForDOM3] operator[SEP] identifier[String] identifier[msg] , identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[TransformerException] { identifier[String] identifier[fmsg] operator[=] identifier[XSLMessages] operator[SEP] identifier[createXPATHMessage] operator[SEP] identifier[msg] , identifier[args] operator[SEP] operator[SEP] identifier[ErrorListener] identifier[ehandler] operator[=] Keyword[this] operator[SEP] identifier[getErrorListener] operator[SEP] operator[SEP] operator[SEP] identifier[TransformerException] identifier[te] operator[=] Keyword[new] identifier[XPathStylesheetDOM3Exception] operator[SEP] identifier[fmsg] , identifier[m_sourceLocator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[ehandler] operator[SEP] { identifier[ehandler] operator[SEP] identifier[fatalError] operator[SEP] identifier[te] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] identifier[te] operator[SEP] } }
public FragmentBundlerCompat<F> putStringArrayList(String key, ArrayList<String> value) { bundler.putStringArrayList(key, value); return this; }
class class_name[name] begin[{] method[putStringArrayList, return_type[type[FragmentBundlerCompat]], modifier[public], parameter[key, value]] begin[{] call[bundler.putStringArrayList, parameter[member[.key], member[.value]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[FragmentBundlerCompat] operator[<] identifier[F] operator[>] identifier[putStringArrayList] operator[SEP] identifier[String] identifier[key] , identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[value] operator[SEP] { identifier[bundler] operator[SEP] identifier[putStringArrayList] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
private static void writeFlags(ObjectOutput out, Fieldable field) throws IOException { int flags = 0; if (field.isStored()) { flags |= STORED_FLAG; } if (field.isIndexed()) { flags |= INDEXED_FLAG; } if (field.isTokenized()) { flags |= TOKENIZED_FLAG; } if (field.getOmitNorms()) { flags |= OMIT_NORMS_FLAG; } if (field.isBinary()) { flags |= BINARY_FLAG; } if (field.isTermVectorStored()) { flags |= STORE_TERM_VECTOR_FLAG; } if (field.isStorePositionWithTermVector()) { flags |= STORE_POSITION_WITH_TERM_VECTOR_FLAG; } if (field.isStoreOffsetWithTermVector()) { flags |= STORE_OFFSET_WITH_TERM_VECTOR_FLAG; } if (field.isLazy()) { flags |= LAZY_FLAG; } if (field instanceof AbstractField && ((AbstractField)field).getIndexOptions() == IndexOptions.DOCS_ONLY) { flags |= OMIT_TF_FLAG; } if (field.getBoost() != 1.0f) { flags |= BOOST_FLAG; } out.writeInt(flags); }
class class_name[name] begin[{] method[writeFlags, return_type[void], modifier[private static], parameter[out, field]] begin[{] local_variable[type[int], flags] if[call[field.isStored, parameter[]]] begin[{] assign[member[.flags], member[.STORED_FLAG]] else begin[{] None end[}] if[call[field.isIndexed, parameter[]]] begin[{] assign[member[.flags], member[.INDEXED_FLAG]] else begin[{] None end[}] if[call[field.isTokenized, parameter[]]] begin[{] assign[member[.flags], member[.TOKENIZED_FLAG]] else begin[{] None end[}] if[call[field.getOmitNorms, parameter[]]] begin[{] assign[member[.flags], member[.OMIT_NORMS_FLAG]] else begin[{] None end[}] if[call[field.isBinary, parameter[]]] begin[{] assign[member[.flags], member[.BINARY_FLAG]] else begin[{] None end[}] if[call[field.isTermVectorStored, parameter[]]] begin[{] assign[member[.flags], member[.STORE_TERM_VECTOR_FLAG]] else begin[{] None end[}] if[call[field.isStorePositionWithTermVector, parameter[]]] begin[{] assign[member[.flags], member[.STORE_POSITION_WITH_TERM_VECTOR_FLAG]] else begin[{] None end[}] if[call[field.isStoreOffsetWithTermVector, parameter[]]] begin[{] assign[member[.flags], member[.STORE_OFFSET_WITH_TERM_VECTOR_FLAG]] else begin[{] None end[}] if[call[field.isLazy, parameter[]]] begin[{] assign[member[.flags], member[.LAZY_FLAG]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.field], instanceof, type[AbstractField]], &&, binary_operation[Cast(expression=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractField, sub_type=None)), ==, member[IndexOptions.DOCS_ONLY]]]] begin[{] assign[member[.flags], member[.OMIT_TF_FLAG]] else begin[{] None end[}] if[binary_operation[call[field.getBoost, parameter[]], !=, literal[1.0f]]] begin[{] assign[member[.flags], member[.BOOST_FLAG]] else begin[{] None end[}] call[out.writeInt, parameter[member[.flags]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[writeFlags] operator[SEP] identifier[ObjectOutput] identifier[out] , identifier[Fieldable] identifier[field] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[flags] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isStored] operator[SEP] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[STORED_FLAG] operator[SEP] } Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isIndexed] operator[SEP] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[INDEXED_FLAG] operator[SEP] } Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isTokenized] operator[SEP] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[TOKENIZED_FLAG] operator[SEP] } Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[getOmitNorms] operator[SEP] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[OMIT_NORMS_FLAG] operator[SEP] } Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isBinary] operator[SEP] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[BINARY_FLAG] operator[SEP] } Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isTermVectorStored] operator[SEP] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[STORE_TERM_VECTOR_FLAG] operator[SEP] } Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isStorePositionWithTermVector] operator[SEP] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[STORE_POSITION_WITH_TERM_VECTOR_FLAG] operator[SEP] } Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isStoreOffsetWithTermVector] operator[SEP] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[STORE_OFFSET_WITH_TERM_VECTOR_FLAG] operator[SEP] } Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[isLazy] operator[SEP] operator[SEP] operator[SEP] { identifier[flags] operator[|=] identifier[LAZY_FLAG] operator[SEP] } Keyword[if] operator[SEP] identifier[field] Keyword[instanceof] identifier[AbstractField] operator[&&] operator[SEP] operator[SEP] identifier[AbstractField] operator[SEP] identifier[field] operator[SEP] operator[SEP] identifier[getIndexOptions] operator[SEP] operator[SEP] operator[==] identifier[IndexOptions] operator[SEP] identifier[DOCS_ONLY] operator[SEP] { identifier[flags] operator[|=] identifier[OMIT_TF_FLAG] operator[SEP] } Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[getBoost] operator[SEP] operator[SEP] operator[!=] literal[Float] operator[SEP] { identifier[flags] operator[|=] identifier[BOOST_FLAG] operator[SEP] } identifier[out] operator[SEP] identifier[writeInt] operator[SEP] identifier[flags] operator[SEP] operator[SEP] }
protected AuthenticationBuilder authenticateInternal(final AuthenticationTransaction transaction) throws AuthenticationException { val credentials = transaction.getCredentials(); LOGGER.debug("Authentication credentials provided for this transaction are [{}]", credentials); if (credentials.isEmpty()) { LOGGER.error("Resolved authentication handlers for this transaction are empty"); throw new AuthenticationException("Resolved credentials for this transaction are empty"); } val builder = new DefaultAuthenticationBuilder(NullPrincipal.getInstance()); credentials.forEach(cred -> builder.addCredential(new BasicCredentialMetaData(cred))); val handlerSet = this.authenticationEventExecutionPlan.getAuthenticationHandlersForTransaction(transaction); LOGGER.debug("Candidate resolved authentication handlers for this transaction are [{}]", handlerSet); if (handlerSet.isEmpty()) { LOGGER.error("Resolved authentication handlers for this transaction are empty"); throw new AuthenticationException(builder.getFailures(), builder.getSuccesses()); } try { val it = credentials.iterator(); AuthenticationCredentialsThreadLocalBinder.clearInProgressAuthentication(); while (it.hasNext()) { val credential = it.next(); LOGGER.debug("Attempting to authenticate credential [{}]", credential); val itHandlers = handlerSet.iterator(); var proceedWithNextHandler = true; while (proceedWithNextHandler && itHandlers.hasNext()) { val handler = itHandlers.next(); if (handler.supports(credential)) { try { val resolver = getPrincipalResolverLinkedToHandlerIfAny(handler, transaction); LOGGER.debug("Attempting authentication of [{}] using [{}]", credential.getId(), handler.getName()); authenticateAndResolvePrincipal(builder, credential, resolver, handler); val authnResult = builder.build(); AuthenticationCredentialsThreadLocalBinder.bindInProgress(authnResult); val failures = evaluateAuthenticationPolicies(authnResult, transaction, handlerSet); proceedWithNextHandler = !failures.getKey(); } catch (final Exception e) { LOGGER.error("Authentication has failed. Credentials may be incorrect or CAS cannot " + "find authentication handler that supports [{}] of type [{}]. Examine the configuration to " + "ensure a method of authentication is defined and analyze CAS logs at DEBUG level to trace " + "the authentication event.", credential, credential.getClass().getSimpleName()); handleAuthenticationException(e, handler.getName(), builder); proceedWithNextHandler = true; } } else { LOGGER.debug("Authentication handler [{}] does not support the credential type [{}]. Trying next...", handler.getName(), credential); } } } evaluateFinalAuthentication(builder, transaction, handlerSet); return builder; } finally { AuthenticationCredentialsThreadLocalBinder.clearInProgressAuthentication(); } }
class class_name[name] begin[{] method[authenticateInternal, return_type[type[AuthenticationBuilder]], modifier[protected], parameter[transaction]] begin[{] local_variable[type[val], credentials] call[LOGGER.debug, parameter[literal["Authentication credentials provided for this transaction are [{}]"], member[.credentials]]] if[call[credentials.isEmpty, parameter[]]] begin[{] call[LOGGER.error, parameter[literal["Resolved authentication handlers for this transaction are empty"]]] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Resolved credentials for this transaction are empty")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuthenticationException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[val], builder] call[credentials.forEach, parameter[LambdaExpression(body=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=cred, 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=BasicCredentialMetaData, sub_type=None))], member=addCredential, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), parameters=[MemberReference(member=cred, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]] local_variable[type[val], handlerSet] call[LOGGER.debug, parameter[literal["Candidate resolved authentication handlers for this transaction are [{}]"], member[.handlerSet]]] if[call[handlerSet.isEmpty, parameter[]]] begin[{] call[LOGGER.error, parameter[literal["Resolved authentication handlers for this transaction are empty"]]] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getFailures, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSuccesses, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuthenticationException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=credentials, selectors=[], type_arguments=None), name=it)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=clearInProgressAuthentication, postfix_operators=[], prefix_operators=[], qualifier=AuthenticationCredentialsThreadLocalBinder, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), name=credential)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attempting to authenticate credential [{}]"), MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=handlerSet, selectors=[], type_arguments=None), name=itHandlers)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), name=proceedWithNextHandler)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=var, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=itHandlers, selectors=[], type_arguments=None), name=handler)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=supports, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Authentication handler [{}] does not support the credential type [{}]. Trying next..."), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=transaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPrincipalResolverLinkedToHandlerIfAny, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=resolver)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attempting authentication of [{}] using [{}]"), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=credential, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=authenticateAndResolvePrincipal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=build, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), name=authnResult)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=authnResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bindInProgress, postfix_operators=[], prefix_operators=[], qualifier=AuthenticationCredentialsThreadLocalBinder, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=authnResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=transaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handlerSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=evaluateAuthenticationPolicies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=failures)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=val, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=proceedWithNextHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=['!'], qualifier=failures, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Authentication has failed. Credentials may be incorrect or CAS cannot "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="find authentication handler that supports [{}] of type [{}]. Examine the configuration to "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ensure a method of authentication is defined and analyze CAS logs at DEBUG level to trace "), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="the authentication event."), operator=+), MemberReference(member=credential, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=credential, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=handler, selectors=[], type_arguments=None), MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleAuthenticationException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=proceedWithNextHandler, 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=['Exception']))], finally_block=None, label=None, resources=None)]))]), condition=BinaryOperation(operandl=MemberReference(member=proceedWithNextHandler, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=itHandlers, selectors=[], type_arguments=None), operator=&&), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=transaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=handlerSet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=evaluateFinalAuthentication, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=clearInProgressAuthentication, postfix_operators=[], prefix_operators=[], qualifier=AuthenticationCredentialsThreadLocalBinder, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[protected] identifier[AuthenticationBuilder] identifier[authenticateInternal] operator[SEP] Keyword[final] identifier[AuthenticationTransaction] identifier[transaction] operator[SEP] Keyword[throws] identifier[AuthenticationException] { identifier[val] identifier[credentials] operator[=] identifier[transaction] operator[SEP] identifier[getCredentials] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[credentials] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[credentials] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[AuthenticationException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[val] identifier[builder] operator[=] Keyword[new] identifier[DefaultAuthenticationBuilder] operator[SEP] identifier[NullPrincipal] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[credentials] operator[SEP] identifier[forEach] operator[SEP] identifier[cred] operator[->] identifier[builder] operator[SEP] identifier[addCredential] operator[SEP] Keyword[new] identifier[BasicCredentialMetaData] operator[SEP] identifier[cred] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[val] identifier[handlerSet] operator[=] Keyword[this] operator[SEP] identifier[authenticationEventExecutionPlan] operator[SEP] identifier[getAuthenticationHandlersForTransaction] operator[SEP] identifier[transaction] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[handlerSet] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handlerSet] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[AuthenticationException] operator[SEP] identifier[builder] operator[SEP] identifier[getFailures] operator[SEP] operator[SEP] , identifier[builder] operator[SEP] identifier[getSuccesses] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[val] identifier[it] operator[=] identifier[credentials] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[AuthenticationCredentialsThreadLocalBinder] operator[SEP] identifier[clearInProgressAuthentication] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[val] identifier[credential] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[credential] operator[SEP] operator[SEP] identifier[val] identifier[itHandlers] operator[=] identifier[handlerSet] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[var] identifier[proceedWithNextHandler] operator[=] literal[boolean] operator[SEP] Keyword[while] operator[SEP] identifier[proceedWithNextHandler] operator[&&] identifier[itHandlers] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[val] identifier[handler] operator[=] identifier[itHandlers] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[handler] operator[SEP] identifier[supports] operator[SEP] identifier[credential] operator[SEP] operator[SEP] { Keyword[try] { identifier[val] identifier[resolver] operator[=] identifier[getPrincipalResolverLinkedToHandlerIfAny] operator[SEP] identifier[handler] , identifier[transaction] operator[SEP] operator[SEP] identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[credential] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[handler] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[authenticateAndResolvePrincipal] operator[SEP] identifier[builder] , identifier[credential] , identifier[resolver] , identifier[handler] operator[SEP] operator[SEP] identifier[val] identifier[authnResult] operator[=] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[AuthenticationCredentialsThreadLocalBinder] operator[SEP] identifier[bindInProgress] operator[SEP] identifier[authnResult] operator[SEP] operator[SEP] identifier[val] identifier[failures] operator[=] identifier[evaluateAuthenticationPolicies] operator[SEP] identifier[authnResult] , identifier[transaction] , identifier[handlerSet] operator[SEP] operator[SEP] identifier[proceedWithNextHandler] operator[=] operator[!] identifier[failures] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Exception] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] , identifier[credential] , identifier[credential] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[handleAuthenticationException] operator[SEP] identifier[e] , identifier[handler] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[builder] operator[SEP] operator[SEP] identifier[proceedWithNextHandler] operator[=] literal[boolean] operator[SEP] } } Keyword[else] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[handler] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[credential] operator[SEP] operator[SEP] } } } identifier[evaluateFinalAuthentication] operator[SEP] identifier[builder] , identifier[transaction] , identifier[handlerSet] operator[SEP] operator[SEP] Keyword[return] identifier[builder] operator[SEP] } Keyword[finally] { identifier[AuthenticationCredentialsThreadLocalBinder] operator[SEP] identifier[clearInProgressAuthentication] operator[SEP] operator[SEP] operator[SEP] } }
public String storeExternalLink(String externalLink) { if (!CmsStringUtil.isEmptyOrWhitespaceOnly(m_linkGallery)) { m_externalLinks.add(externalLink); return getExternalLinkFile(externalLink); } return null; }
class class_name[name] begin[{] method[storeExternalLink, return_type[type[String]], modifier[public], parameter[externalLink]] begin[{] if[call[CmsStringUtil.isEmptyOrWhitespaceOnly, parameter[member[.m_linkGallery]]]] begin[{] call[m_externalLinks.add, parameter[member[.externalLink]]] return[call[.getExternalLinkFile, parameter[member[.externalLink]]]] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[String] identifier[storeExternalLink] operator[SEP] identifier[String] identifier[externalLink] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[CmsStringUtil] operator[SEP] identifier[isEmptyOrWhitespaceOnly] operator[SEP] identifier[m_linkGallery] operator[SEP] operator[SEP] { identifier[m_externalLinks] operator[SEP] identifier[add] operator[SEP] identifier[externalLink] operator[SEP] operator[SEP] Keyword[return] identifier[getExternalLinkFile] operator[SEP] identifier[externalLink] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
@Override public IComplexNDArray mmuli(INDArray other, INDArray result) { IComplexNDArray otherArray = (IComplexNDArray) other; IComplexNDArray resultArray = (IComplexNDArray) result; if (other.shape().length > 2) { for (int i = 0; i < other.slices(); i++) { resultArray.putSlice(i, slice(i).mmul(otherArray.slice(i))); } return resultArray; } LinAlgExceptions.assertMultiplies(this, other); if (other.isScalar()) { return muli(otherArray.getComplex(0), resultArray); } if (isScalar()) { return otherArray.muli(getComplex(0), resultArray); } /* check sizes and resize if necessary */ //assertMultipliesWith(other); if (result == this || result == other) { /* actually, blas cannot do multiplications in-place. Therefore, we will fake by * allocating a temporary object on the side and copy the result later. */ IComplexNDArray temp = Nd4j.createComplex(resultArray.shape()); if (otherArray.columns() == 1) { Nd4j.getBlasWrapper().level2().gemv(BlasBufferUtil.getCharForTranspose(temp), BlasBufferUtil.getCharForTranspose(this), Nd4j.UNIT, this, otherArray, Nd4j.ZERO, temp); } else { Nd4j.getBlasWrapper().level3().gemm(BlasBufferUtil.getCharForTranspose(temp), BlasBufferUtil.getCharForTranspose(this), BlasBufferUtil.getCharForTranspose(other), Nd4j.UNIT, this, otherArray, Nd4j.ZERO, temp); } Nd4j.getBlasWrapper().copy(temp, resultArray); } else { if (otherArray.columns() == 1) { Nd4j.getBlasWrapper().level2().gemv(BlasBufferUtil.getCharForTranspose(resultArray), BlasBufferUtil.getCharForTranspose(this), Nd4j.UNIT, this, otherArray, Nd4j.ZERO, resultArray); } else { Nd4j.getBlasWrapper().level3().gemm(BlasBufferUtil.getCharForTranspose(resultArray), BlasBufferUtil.getCharForTranspose(this), BlasBufferUtil.getCharForTranspose(other), Nd4j.UNIT, this, otherArray, Nd4j.ZERO, resultArray); } } return resultArray; }
class class_name[name] begin[{] method[mmuli, return_type[type[IComplexNDArray]], modifier[public], parameter[other, result]] begin[{] local_variable[type[IComplexNDArray], otherArray] local_variable[type[IComplexNDArray], resultArray] if[binary_operation[call[other.shape, parameter[]], >, literal[2]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=slice, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=slice, postfix_operators=[], prefix_operators=[], qualifier=otherArray, selectors=[], type_arguments=None)], member=mmul, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=putSlice, postfix_operators=[], prefix_operators=[], qualifier=resultArray, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=slices, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.resultArray]] else begin[{] None end[}] call[LinAlgExceptions.assertMultiplies, parameter[THIS[], member[.other]]] if[call[other.isScalar, parameter[]]] begin[{] return[call[.muli, parameter[call[otherArray.getComplex, parameter[literal[0]]], member[.resultArray]]]] else begin[{] None end[}] if[call[.isScalar, parameter[]]] begin[{] return[call[otherArray.muli, parameter[call[.getComplex, parameter[literal[0]]], member[.resultArray]]]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.result], ==, THIS[]], ||, binary_operation[member[.result], ==, member[.other]]]] begin[{] local_variable[type[IComplexNDArray], temp] if[binary_operation[call[otherArray.columns, parameter[]], ==, literal[1]]] begin[{] call[Nd4j.getBlasWrapper, parameter[]] else begin[{] call[Nd4j.getBlasWrapper, parameter[]] end[}] call[Nd4j.getBlasWrapper, parameter[]] else begin[{] if[binary_operation[call[otherArray.columns, parameter[]], ==, literal[1]]] begin[{] call[Nd4j.getBlasWrapper, parameter[]] else begin[{] call[Nd4j.getBlasWrapper, parameter[]] end[}] end[}] return[member[.resultArray]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[IComplexNDArray] identifier[mmuli] operator[SEP] identifier[INDArray] identifier[other] , identifier[INDArray] identifier[result] operator[SEP] { identifier[IComplexNDArray] identifier[otherArray] operator[=] operator[SEP] identifier[IComplexNDArray] operator[SEP] identifier[other] operator[SEP] identifier[IComplexNDArray] identifier[resultArray] operator[=] operator[SEP] identifier[IComplexNDArray] operator[SEP] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[other] operator[SEP] identifier[shape] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[>] Other[2] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[other] operator[SEP] identifier[slices] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[resultArray] operator[SEP] identifier[putSlice] operator[SEP] identifier[i] , identifier[slice] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[mmul] operator[SEP] identifier[otherArray] operator[SEP] identifier[slice] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[resultArray] operator[SEP] } identifier[LinAlgExceptions] operator[SEP] identifier[assertMultiplies] operator[SEP] Keyword[this] , identifier[other] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[other] operator[SEP] identifier[isScalar] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[muli] operator[SEP] identifier[otherArray] operator[SEP] identifier[getComplex] operator[SEP] Other[0] operator[SEP] , identifier[resultArray] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isScalar] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[otherArray] operator[SEP] identifier[muli] operator[SEP] identifier[getComplex] operator[SEP] Other[0] operator[SEP] , identifier[resultArray] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[result] operator[==] Keyword[this] operator[||] identifier[result] operator[==] identifier[other] operator[SEP] { identifier[IComplexNDArray] identifier[temp] operator[=] identifier[Nd4j] operator[SEP] identifier[createComplex] operator[SEP] identifier[resultArray] operator[SEP] identifier[shape] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[otherArray] operator[SEP] identifier[columns] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { identifier[Nd4j] operator[SEP] identifier[getBlasWrapper] operator[SEP] operator[SEP] operator[SEP] identifier[level2] operator[SEP] operator[SEP] operator[SEP] identifier[gemv] operator[SEP] identifier[BlasBufferUtil] operator[SEP] identifier[getCharForTranspose] operator[SEP] identifier[temp] operator[SEP] , identifier[BlasBufferUtil] operator[SEP] identifier[getCharForTranspose] operator[SEP] Keyword[this] operator[SEP] , identifier[Nd4j] operator[SEP] identifier[UNIT] , Keyword[this] , identifier[otherArray] , identifier[Nd4j] operator[SEP] identifier[ZERO] , identifier[temp] operator[SEP] operator[SEP] } Keyword[else] { identifier[Nd4j] operator[SEP] identifier[getBlasWrapper] operator[SEP] operator[SEP] operator[SEP] identifier[level3] operator[SEP] operator[SEP] operator[SEP] identifier[gemm] operator[SEP] identifier[BlasBufferUtil] operator[SEP] identifier[getCharForTranspose] operator[SEP] identifier[temp] operator[SEP] , identifier[BlasBufferUtil] operator[SEP] identifier[getCharForTranspose] operator[SEP] Keyword[this] operator[SEP] , identifier[BlasBufferUtil] operator[SEP] identifier[getCharForTranspose] operator[SEP] identifier[other] operator[SEP] , identifier[Nd4j] operator[SEP] identifier[UNIT] , Keyword[this] , identifier[otherArray] , identifier[Nd4j] operator[SEP] identifier[ZERO] , identifier[temp] operator[SEP] operator[SEP] } identifier[Nd4j] operator[SEP] identifier[getBlasWrapper] operator[SEP] operator[SEP] operator[SEP] identifier[copy] operator[SEP] identifier[temp] , identifier[resultArray] operator[SEP] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[otherArray] operator[SEP] identifier[columns] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] { identifier[Nd4j] operator[SEP] identifier[getBlasWrapper] operator[SEP] operator[SEP] operator[SEP] identifier[level2] operator[SEP] operator[SEP] operator[SEP] identifier[gemv] operator[SEP] identifier[BlasBufferUtil] operator[SEP] identifier[getCharForTranspose] operator[SEP] identifier[resultArray] operator[SEP] , identifier[BlasBufferUtil] operator[SEP] identifier[getCharForTranspose] operator[SEP] Keyword[this] operator[SEP] , identifier[Nd4j] operator[SEP] identifier[UNIT] , Keyword[this] , identifier[otherArray] , identifier[Nd4j] operator[SEP] identifier[ZERO] , identifier[resultArray] operator[SEP] operator[SEP] } Keyword[else] { identifier[Nd4j] operator[SEP] identifier[getBlasWrapper] operator[SEP] operator[SEP] operator[SEP] identifier[level3] operator[SEP] operator[SEP] operator[SEP] identifier[gemm] operator[SEP] identifier[BlasBufferUtil] operator[SEP] identifier[getCharForTranspose] operator[SEP] identifier[resultArray] operator[SEP] , identifier[BlasBufferUtil] operator[SEP] identifier[getCharForTranspose] operator[SEP] Keyword[this] operator[SEP] , identifier[BlasBufferUtil] operator[SEP] identifier[getCharForTranspose] operator[SEP] identifier[other] operator[SEP] , identifier[Nd4j] operator[SEP] identifier[UNIT] , Keyword[this] , identifier[otherArray] , identifier[Nd4j] operator[SEP] identifier[ZERO] , identifier[resultArray] operator[SEP] operator[SEP] } } Keyword[return] identifier[resultArray] operator[SEP] }
protected void generateRowStart(ResponseWriter writer, int row, String[] rowClasses, PanelGrid panelGrid) throws IOException { writer.startElement("div", panelGrid); if (null == rowClasses) writer.writeAttribute("class", "row", "class"); else writer.writeAttribute("class", "row " + rowClasses[row % rowClasses.length], "class"); }
class class_name[name] begin[{] method[generateRowStart, return_type[void], modifier[protected], parameter[writer, row, rowClasses, panelGrid]] begin[{] call[writer.startElement, parameter[literal["div"], member[.panelGrid]]] if[binary_operation[literal[null], ==, member[.rowClasses]]] begin[{] call[writer.writeAttribute, parameter[literal["class"], literal["row"], literal["class"]]] else begin[{] call[writer.writeAttribute, parameter[literal["class"], binary_operation[literal["row "], +, member[.rowClasses]], literal["class"]]] end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[generateRowStart] operator[SEP] identifier[ResponseWriter] identifier[writer] , Keyword[int] identifier[row] , identifier[String] operator[SEP] operator[SEP] identifier[rowClasses] , identifier[PanelGrid] identifier[panelGrid] operator[SEP] Keyword[throws] identifier[IOException] { identifier[writer] operator[SEP] identifier[startElement] operator[SEP] literal[String] , identifier[panelGrid] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[rowClasses] operator[SEP] identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[else] identifier[writer] operator[SEP] identifier[writeAttribute] operator[SEP] literal[String] , literal[String] operator[+] identifier[rowClasses] operator[SEP] identifier[row] operator[%] identifier[rowClasses] operator[SEP] identifier[length] operator[SEP] , literal[String] operator[SEP] operator[SEP] }
public MethodHandle getStatic(MethodHandles.Lookup lookup, Class<?> target, String name) throws NoSuchFieldException, IllegalAccessException { return invoke(lookup.findStaticGetter(target, name, type().returnType())); }
class class_name[name] begin[{] method[getStatic, return_type[type[MethodHandle]], modifier[public], parameter[lookup, target, name]] begin[{] return[call[.invoke, parameter[call[lookup.findStaticGetter, parameter[member[.target], member[.name], call[.type, parameter[]]]]]]] end[}] END[}]
Keyword[public] identifier[MethodHandle] identifier[getStatic] operator[SEP] identifier[MethodHandles] operator[SEP] identifier[Lookup] identifier[lookup] , identifier[Class] operator[<] operator[?] operator[>] identifier[target] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[NoSuchFieldException] , identifier[IllegalAccessException] { Keyword[return] identifier[invoke] operator[SEP] identifier[lookup] operator[SEP] identifier[findStaticGetter] operator[SEP] identifier[target] , identifier[name] , identifier[type] operator[SEP] operator[SEP] operator[SEP] identifier[returnType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Override public <E> E get(Class<E> clazz, Object key) throws ConcurrentModificationException, IndoubtException { Key k = Keys.create(Translation.toKind(clazz), key); unlock(k); List<Entity> entities = null; if ((local == null)) { entities = datastore.query(new Query(k)); } else { entities = datastore.query(local, new Query(k)); } for (Entity entity : entities) { if (entity.getKind().equals(Translation.LOCK_KIND)) { throw new ConcurrentModificationException( "Entity corresponding to [" + k + "] is processed under a transaction"); } } E object = Translation.toObject(clazz, entities, new HashMap<Key, Object>(), datastore); entity = object; operation = Log.Operation.GET; return object; }
class class_name[name] begin[{] method[get, return_type[type[E]], modifier[public], parameter[clazz, key]] begin[{] local_variable[type[Key], k] call[.unlock, parameter[member[.k]]] local_variable[type[List], entities] if[binary_operation[member[.local], ==, literal[null]]] begin[{] assign[member[.entities], call[datastore.query, parameter[ClassCreator(arguments=[MemberReference(member=k, 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=Query, sub_type=None))]]] else begin[{] assign[member[.entities], call[datastore.query, parameter[member[.local], ClassCreator(arguments=[MemberReference(member=k, 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=Query, sub_type=None))]]] end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getKind, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[MethodInvocation(arguments=[MemberReference(member=LOCK_KIND, postfix_operators=[], prefix_operators=[], qualifier=Translation, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Entity corresponding to ["), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] is processed under a transaction"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConcurrentModificationException, sub_type=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=entities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Entity, sub_type=None))), label=None) local_variable[type[E], object] assign[member[.entity], member[.object]] assign[member[.operation], member[Log.Operation.GET]] return[member[.object]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[E] operator[>] identifier[E] identifier[get] operator[SEP] identifier[Class] operator[<] identifier[E] operator[>] identifier[clazz] , identifier[Object] identifier[key] operator[SEP] Keyword[throws] identifier[ConcurrentModificationException] , identifier[IndoubtException] { identifier[Key] identifier[k] operator[=] identifier[Keys] operator[SEP] identifier[create] operator[SEP] identifier[Translation] operator[SEP] identifier[toKind] operator[SEP] identifier[clazz] operator[SEP] , identifier[key] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Entity] operator[>] identifier[entities] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[local] operator[==] Other[null] operator[SEP] operator[SEP] { identifier[entities] operator[=] identifier[datastore] operator[SEP] identifier[query] operator[SEP] Keyword[new] identifier[Query] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[entities] operator[=] identifier[datastore] operator[SEP] identifier[query] operator[SEP] identifier[local] , Keyword[new] identifier[Query] operator[SEP] identifier[k] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Entity] identifier[entity] operator[:] identifier[entities] operator[SEP] { Keyword[if] operator[SEP] identifier[entity] operator[SEP] identifier[getKind] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[Translation] operator[SEP] identifier[LOCK_KIND] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[ConcurrentModificationException] operator[SEP] literal[String] operator[+] identifier[k] operator[+] literal[String] operator[SEP] operator[SEP] } } identifier[E] identifier[object] operator[=] identifier[Translation] operator[SEP] identifier[toObject] operator[SEP] identifier[clazz] , identifier[entities] , Keyword[new] identifier[HashMap] operator[<] identifier[Key] , identifier[Object] operator[>] operator[SEP] operator[SEP] , identifier[datastore] operator[SEP] operator[SEP] identifier[entity] operator[=] identifier[object] operator[SEP] identifier[operation] operator[=] identifier[Log] operator[SEP] identifier[Operation] operator[SEP] identifier[GET] operator[SEP] Keyword[return] identifier[object] operator[SEP] }
public ExpressRouteCircuitAuthorizationInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().single().body(); }
class class_name[name] begin[{] method[beginCreateOrUpdate, return_type[type[ExpressRouteCircuitAuthorizationInner]], modifier[public], parameter[resourceGroupName, circuitName, authorizationName, authorizationParameters]] begin[{] return[call[.beginCreateOrUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.circuitName], member[.authorizationName], member[.authorizationParameters]]]] end[}] END[}]
Keyword[public] identifier[ExpressRouteCircuitAuthorizationInner] identifier[beginCreateOrUpdate] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[circuitName] , identifier[String] identifier[authorizationName] , identifier[ExpressRouteCircuitAuthorizationInner] identifier[authorizationParameters] operator[SEP] { Keyword[return] identifier[beginCreateOrUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[circuitName] , identifier[authorizationName] , identifier[authorizationParameters] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public Page<T> page(String sql, PageRow pageRow) { return this.page(sql, paramValues, pageRow); }
class class_name[name] begin[{] method[page, return_type[type[Page]], modifier[public], parameter[sql, pageRow]] begin[{] return[THIS[call[None.page, parameter[member[.sql], member[.paramValues], member[.pageRow]]]]] end[}] END[}]
Keyword[public] identifier[Page] operator[<] identifier[T] operator[>] identifier[page] operator[SEP] identifier[String] identifier[sql] , identifier[PageRow] identifier[pageRow] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[page] operator[SEP] identifier[sql] , identifier[paramValues] , identifier[pageRow] operator[SEP] operator[SEP] }
public com.google.appengine.v1.LoginRequirement getLogin() { com.google.appengine.v1.LoginRequirement result = com.google.appengine.v1.LoginRequirement.valueOf(login_); return result == null ? com.google.appengine.v1.LoginRequirement.UNRECOGNIZED : result; }
class class_name[name] begin[{] method[getLogin, return_type[type[com]], modifier[public], parameter[]] begin[{] local_variable[type[com], result] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=UNRECOGNIZED, postfix_operators=[], prefix_operators=[], qualifier=com.google.appengine.v1.LoginRequirement, selectors=[]))] end[}] END[}]
Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[appengine] operator[SEP] identifier[v1] operator[SEP] identifier[LoginRequirement] identifier[getLogin] operator[SEP] operator[SEP] { identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[appengine] operator[SEP] identifier[v1] operator[SEP] identifier[LoginRequirement] identifier[result] operator[=] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[appengine] operator[SEP] identifier[v1] operator[SEP] identifier[LoginRequirement] operator[SEP] identifier[valueOf] operator[SEP] identifier[login_] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[==] Other[null] operator[?] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[appengine] operator[SEP] identifier[v1] operator[SEP] identifier[LoginRequirement] operator[SEP] identifier[UNRECOGNIZED] operator[:] identifier[result] operator[SEP] }
public static String asciiCharactersEncoding(String str) throws QSException { if (QSStringUtil.isEmpty(str)) { return ""; } try { String encoded = URLEncoder.encode(str, QSConstant.ENCODING_UTF8); encoded = encoded.replace("%2F", "/"); encoded = encoded.replace("%3D", "="); encoded = encoded.replace("+", "%20"); encoded = encoded.replace("%3A", ":"); return encoded; } catch (UnsupportedEncodingException e) { throw new QSException("UnsupportedEncodingException:", e); } }
class class_name[name] begin[{] method[asciiCharactersEncoding, return_type[type[String]], modifier[public static], parameter[str]] begin[{] if[call[QSStringUtil.isEmpty, parameter[member[.str]]]] begin[{] return[literal[""]] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ENCODING_UTF8, postfix_operators=[], prefix_operators=[], qualifier=QSConstant, selectors=[])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None), name=encoded)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=encoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%2F"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=encoded, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=encoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%3D"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="=")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=encoded, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=encoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="+"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%20")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=encoded, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=encoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%3A"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":")], member=replace, postfix_operators=[], prefix_operators=[], qualifier=encoded, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=MemberReference(member=encoded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UnsupportedEncodingException:"), 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=QSException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[asciiCharactersEncoding] operator[SEP] identifier[String] identifier[str] operator[SEP] Keyword[throws] identifier[QSException] { Keyword[if] operator[SEP] identifier[QSStringUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[str] operator[SEP] operator[SEP] { Keyword[return] literal[String] operator[SEP] } Keyword[try] { identifier[String] identifier[encoded] operator[=] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[str] , identifier[QSConstant] operator[SEP] identifier[ENCODING_UTF8] operator[SEP] operator[SEP] identifier[encoded] operator[=] identifier[encoded] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[encoded] operator[=] identifier[encoded] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[encoded] operator[=] identifier[encoded] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[encoded] operator[=] identifier[encoded] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[encoded] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[QSException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
@Override public boolean moveToPosition(int position) { try { // For SQLite forward only, best we can do is assume the result set // is at the beginning for (int i = 0; i < position; i++) { if (!resultSet.next()) { return false; } } } catch (SQLException e) { throw new GeoPackageException( "Failed to move ResultSet cursor to first", e); } return true; }
class class_name[name] begin[{] method[moveToPosition, return_type[type[boolean]], modifier[public], parameter[position]] begin[{] TryStatement(block=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=['!'], qualifier=resultSet, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to move ResultSet cursor to first"), 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=GeoPackageException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None) return[literal[true]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[moveToPosition] operator[SEP] Keyword[int] identifier[position] operator[SEP] { Keyword[try] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[position] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[resultSet] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[GeoPackageException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public static int nthOccurrenceOf(final String s, final char needle, int n) { checkNotNull(s); checkArgument(n > 0); for (int i = 0; i < s.length(); ++i) { if (needle == s.charAt(i)) { --n; if (n == 0) { return i; } } } return -1; }
class class_name[name] begin[{] method[nthOccurrenceOf, return_type[type[int]], modifier[public static], parameter[s, needle, n]] begin[{] call[.checkNotNull, parameter[member[.s]]] call[.checkArgument, parameter[binary_operation[member[.n], >, literal[0]]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=needle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MemberReference(member=n, postfix_operators=[], prefix_operators=['--'], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=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[literal[1]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[nthOccurrenceOf] operator[SEP] Keyword[final] identifier[String] identifier[s] , Keyword[final] Keyword[char] identifier[needle] , Keyword[int] identifier[n] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[checkArgument] operator[SEP] identifier[n] operator[>] Other[0] 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] operator[++] identifier[i] operator[SEP] { Keyword[if] operator[SEP] identifier[needle] operator[==] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] { operator[--] identifier[n] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[==] Other[0] operator[SEP] { Keyword[return] identifier[i] operator[SEP] } } } Keyword[return] operator[-] Other[1] operator[SEP] }
static boolean isLatin(String s) { int len = s.length(); for (int index = 0; index < len; index++) { char c = s.charAt(index); if (c > LARGEST_BASIC_LATIN) { return false; } } return true; }
class class_name[name] begin[{] method[isLatin, return_type[type[boolean]], modifier[static], parameter[s]] begin[{] local_variable[type[int], len] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=LARGEST_BASIC_LATIN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[literal[true]] end[}] END[}]
Keyword[static] Keyword[boolean] identifier[isLatin] operator[SEP] identifier[String] identifier[s] operator[SEP] { Keyword[int] identifier[len] operator[=] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] identifier[index] operator[<] identifier[len] operator[SEP] identifier[index] operator[++] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[>] identifier[LARGEST_BASIC_LATIN] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
@Override public String post_text(String path, String textData, boolean crumbFlag) throws IOException { return post_text(path, textData, ContentType.DEFAULT_TEXT, crumbFlag); }
class class_name[name] begin[{] method[post_text, return_type[type[String]], modifier[public], parameter[path, textData, crumbFlag]] begin[{] return[call[.post_text, parameter[member[.path], member[.textData], member[ContentType.DEFAULT_TEXT], member[.crumbFlag]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[post_text] operator[SEP] identifier[String] identifier[path] , identifier[String] identifier[textData] , Keyword[boolean] identifier[crumbFlag] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] identifier[post_text] operator[SEP] identifier[path] , identifier[textData] , identifier[ContentType] operator[SEP] identifier[DEFAULT_TEXT] , identifier[crumbFlag] operator[SEP] operator[SEP] }
public static <T extends Descriptor> DescriptorImporter<T> importAs(final Class<T> type) throws IllegalArgumentException { return importAs(type, null); }
class class_name[name] begin[{] method[importAs, return_type[type[DescriptorImporter]], modifier[public static], parameter[type]] begin[{] return[call[.importAs, parameter[member[.type], literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[Descriptor] operator[>] identifier[DescriptorImporter] operator[<] identifier[T] operator[>] identifier[importAs] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] { Keyword[return] identifier[importAs] operator[SEP] identifier[type] , Other[null] operator[SEP] operator[SEP] }