code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
private static Double validateDouble(String elementName, String attributeName, String value){ try { return Double.parseDouble(value); } catch (NumberFormatException e){ throw new ParsingException("The " + elementName + " " + attributeName + " attribute should be a numeric value."); } }
class class_name[name] begin[{] method[validateDouble, return_type[type[Double]], modifier[private static], parameter[elementName, attributeName, value]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseDouble, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The "), operandr=MemberReference(member=elementName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" "), operator=+), operandr=MemberReference(member=attributeName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" attribute should be a numeric value."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParsingException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[Double] identifier[validateDouble] operator[SEP] identifier[String] identifier[elementName] , identifier[String] identifier[attributeName] , identifier[String] identifier[value] operator[SEP] { Keyword[try] { Keyword[return] identifier[Double] operator[SEP] identifier[parseDouble] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[ParsingException] operator[SEP] literal[String] operator[+] identifier[elementName] operator[+] literal[String] operator[+] identifier[attributeName] operator[+] literal[String] operator[SEP] operator[SEP] } }
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { stateTextLabel = new javax.swing.JLabel(); addComponentListener(new java.awt.event.ComponentAdapter() { public void componentResized(java.awt.event.ComponentEvent evt) { formComponentResized(evt); } }); stateTextLabel.setBackground(new java.awt.Color(238, 38, 238)); stateTextLabel.setForeground(new java.awt.Color(255, 255, 255)); stateTextLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); stateTextLabel.setText("Loading"); stateTextLabel.setVerticalAlignment(javax.swing.SwingConstants.TOP); stateTextLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(stateTextLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(167, Short.MAX_VALUE) .addComponent(stateTextLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE) .addContainerGap()) ); }
class class_name[name] begin[{] method[initComponents, return_type[void], modifier[private], parameter[]] begin[{] assign[member[.stateTextLabel], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=javax, sub_type=ReferenceType(arguments=None, dimensions=None, name=swing, sub_type=ReferenceType(arguments=None, dimensions=None, name=JLabel, sub_type=None))))] call[.addComponentListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=formComponentResized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=componentResized, parameters=[FormalParameter(annotations=[], modifiers=set(), name=evt, type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=ComponentEvent, sub_type=None)))), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=ComponentAdapter, sub_type=None)))))]] call[stateTextLabel.setBackground, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=238), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=38), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=238)], 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=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=Color, sub_type=None))))]] call[stateTextLabel.setForeground, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255)], 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=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=Color, sub_type=None))))]] call[stateTextLabel.setHorizontalAlignment, parameter[member[javax.swing.SwingConstants.CENTER]]] call[stateTextLabel.setText, parameter[literal["Loading"]]] call[stateTextLabel.setVerticalAlignment, parameter[member[javax.swing.SwingConstants.TOP]]] call[stateTextLabel.setHorizontalTextPosition, parameter[member[javax.swing.SwingConstants.CENTER]]] local_variable[type[javax], layout] THIS[call[None.setLayout, parameter[member[.layout]]]] call[layout.setHorizontalGroup, parameter[call[layout.createParallelGroup, parameter[member[javax.swing.GroupLayout.Alignment.LEADING]]]]] call[layout.setVerticalGroup, parameter[call[layout.createParallelGroup, parameter[member[javax.swing.GroupLayout.Alignment.LEADING]]]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[initComponents] operator[SEP] operator[SEP] { identifier[stateTextLabel] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JLabel] operator[SEP] operator[SEP] operator[SEP] identifier[addComponentListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ComponentAdapter] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[componentResized] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ComponentEvent] identifier[evt] operator[SEP] { identifier[formComponentResized] operator[SEP] identifier[evt] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[stateTextLabel] operator[SEP] identifier[setBackground] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Color] operator[SEP] Other[238] , Other[38] , Other[238] operator[SEP] operator[SEP] operator[SEP] identifier[stateTextLabel] operator[SEP] identifier[setForeground] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Color] operator[SEP] Other[255] , Other[255] , Other[255] operator[SEP] operator[SEP] operator[SEP] identifier[stateTextLabel] operator[SEP] identifier[setHorizontalAlignment] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[SwingConstants] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] identifier[stateTextLabel] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[stateTextLabel] operator[SEP] identifier[setVerticalAlignment] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[SwingConstants] operator[SEP] identifier[TOP] operator[SEP] operator[SEP] identifier[stateTextLabel] operator[SEP] identifier[setHorizontalTextPosition] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[SwingConstants] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] identifier[layout] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setLayout] operator[SEP] identifier[layout] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[setHorizontalGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[LEADING] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createSequentialGroup] operator[SEP] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[stateTextLabel] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , Other[396] , identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[layout] operator[SEP] identifier[setVerticalGroup] operator[SEP] identifier[layout] operator[SEP] identifier[createParallelGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[LEADING] operator[SEP] operator[SEP] identifier[addGroup] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[Alignment] operator[SEP] identifier[TRAILING] , identifier[layout] operator[SEP] identifier[createSequentialGroup] operator[SEP] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] Other[167] , identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] identifier[addComponent] operator[SEP] identifier[stateTextLabel] , identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[GroupLayout] operator[SEP] identifier[DEFAULT_SIZE] , Other[121] , identifier[Short] operator[SEP] identifier[MAX_VALUE] operator[SEP] operator[SEP] identifier[addContainerGap] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public alluxio.grpc.UpdateUfsModePOptionsOrBuilder getOptionsOrBuilder() { return options_ == null ? alluxio.grpc.UpdateUfsModePOptions.getDefaultInstance() : options_; }
class class_name[name] begin[{] method[getOptionsOrBuilder, return_type[type[alluxio]], modifier[public], parameter[]] begin[{] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=options_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=options_, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[], member=getDefaultInstance, postfix_operators=[], prefix_operators=[], qualifier=alluxio.grpc.UpdateUfsModePOptions, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[public] identifier[alluxio] operator[SEP] identifier[grpc] operator[SEP] identifier[UpdateUfsModePOptionsOrBuilder] identifier[getOptionsOrBuilder] operator[SEP] operator[SEP] { Keyword[return] identifier[options_] operator[==] Other[null] operator[?] identifier[alluxio] operator[SEP] identifier[grpc] operator[SEP] identifier[UpdateUfsModePOptions] operator[SEP] identifier[getDefaultInstance] operator[SEP] operator[SEP] operator[:] identifier[options_] operator[SEP] }
protected void removeTargetListeners (Component comp) { comp.removeMouseListener(_targetListener); comp.removeMouseMotionListener(_targetListener); if (comp instanceof Container) { // again, always true for JComp... Container cont = (Container) comp; cont.removeContainerListener(_childListener); for (int ii=0, nn=cont.getComponentCount(); ii < nn; ii++) { removeTargetListeners(cont.getComponent(ii)); } } }
class class_name[name] begin[{] method[removeTargetListeners, return_type[void], modifier[protected], parameter[comp]] begin[{] call[comp.removeMouseListener, parameter[member[._targetListener]]] call[comp.removeMouseMotionListener, parameter[member[._targetListener]]] if[binary_operation[member[.comp], instanceof, type[Container]]] begin[{] local_variable[type[Container], cont] call[cont.removeContainerListener, parameter[member[._childListener]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getComponent, postfix_operators=[], prefix_operators=[], qualifier=cont, selectors=[], type_arguments=None)], member=removeTargetListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ii, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=nn, 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=ii), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getComponentCount, postfix_operators=[], prefix_operators=[], qualifier=cont, selectors=[], type_arguments=None), name=nn)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=ii, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[removeTargetListeners] operator[SEP] identifier[Component] identifier[comp] operator[SEP] { identifier[comp] operator[SEP] identifier[removeMouseListener] operator[SEP] identifier[_targetListener] operator[SEP] operator[SEP] identifier[comp] operator[SEP] identifier[removeMouseMotionListener] operator[SEP] identifier[_targetListener] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[comp] Keyword[instanceof] identifier[Container] operator[SEP] { identifier[Container] identifier[cont] operator[=] operator[SEP] identifier[Container] operator[SEP] identifier[comp] operator[SEP] identifier[cont] operator[SEP] identifier[removeContainerListener] operator[SEP] identifier[_childListener] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ii] operator[=] Other[0] , identifier[nn] operator[=] identifier[cont] operator[SEP] identifier[getComponentCount] operator[SEP] operator[SEP] operator[SEP] identifier[ii] operator[<] identifier[nn] operator[SEP] identifier[ii] operator[++] operator[SEP] { identifier[removeTargetListeners] operator[SEP] identifier[cont] operator[SEP] identifier[getComponent] operator[SEP] identifier[ii] operator[SEP] operator[SEP] operator[SEP] } } }
private void buildWebservicesMetaData(final Deployment dep, final EJBArchiveMetaData.Builder ejbArchiveMDBuilder) { final JBossWebservicesMetaData webservicesMD = WSHelper.getOptionalAttachment(dep, JBossWebservicesMetaData.class); if (webservicesMD == null) return; // set context root final String contextRoot = webservicesMD.getContextRoot(); ejbArchiveMDBuilder.setWebServiceContextRoot(contextRoot); WSLogger.ROOT_LOGGER.tracef("Setting context root: %s", contextRoot); // set config name final String configName = webservicesMD.getConfigName(); ejbArchiveMDBuilder.setConfigName(configName); WSLogger.ROOT_LOGGER.tracef("Setting config name: %s", configName); // set config file final String configFile = webservicesMD.getConfigFile(); ejbArchiveMDBuilder.setConfigFile(configFile); WSLogger.ROOT_LOGGER.tracef("Setting config file: %s", configFile); // set wsdl location resolver final JBossWebserviceDescriptionMetaData[] wsDescriptionsMD = webservicesMD.getWebserviceDescriptions(); final PublishLocationAdapter resolver = new PublishLocationAdapterImpl(wsDescriptionsMD); ejbArchiveMDBuilder.setPublishLocationAdapter(resolver); }
class class_name[name] begin[{] method[buildWebservicesMetaData, return_type[void], modifier[private], parameter[dep, ejbArchiveMDBuilder]] begin[{] local_variable[type[JBossWebservicesMetaData], webservicesMD] if[binary_operation[member[.webservicesMD], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[String], contextRoot] call[ejbArchiveMDBuilder.setWebServiceContextRoot, parameter[member[.contextRoot]]] call[WSLogger.ROOT_LOGGER.tracef, parameter[literal["Setting context root: %s"], member[.contextRoot]]] local_variable[type[String], configName] call[ejbArchiveMDBuilder.setConfigName, parameter[member[.configName]]] call[WSLogger.ROOT_LOGGER.tracef, parameter[literal["Setting config name: %s"], member[.configName]]] local_variable[type[String], configFile] call[ejbArchiveMDBuilder.setConfigFile, parameter[member[.configFile]]] call[WSLogger.ROOT_LOGGER.tracef, parameter[literal["Setting config file: %s"], member[.configFile]]] local_variable[type[JBossWebserviceDescriptionMetaData], wsDescriptionsMD] local_variable[type[PublishLocationAdapter], resolver] call[ejbArchiveMDBuilder.setPublishLocationAdapter, parameter[member[.resolver]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[buildWebservicesMetaData] operator[SEP] Keyword[final] identifier[Deployment] identifier[dep] , Keyword[final] identifier[EJBArchiveMetaData] operator[SEP] identifier[Builder] identifier[ejbArchiveMDBuilder] operator[SEP] { Keyword[final] identifier[JBossWebservicesMetaData] identifier[webservicesMD] operator[=] identifier[WSHelper] operator[SEP] identifier[getOptionalAttachment] operator[SEP] identifier[dep] , identifier[JBossWebservicesMetaData] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[webservicesMD] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[final] identifier[String] identifier[contextRoot] operator[=] identifier[webservicesMD] operator[SEP] identifier[getContextRoot] operator[SEP] operator[SEP] operator[SEP] identifier[ejbArchiveMDBuilder] operator[SEP] identifier[setWebServiceContextRoot] operator[SEP] identifier[contextRoot] operator[SEP] operator[SEP] identifier[WSLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[tracef] operator[SEP] literal[String] , identifier[contextRoot] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[configName] operator[=] identifier[webservicesMD] operator[SEP] identifier[getConfigName] operator[SEP] operator[SEP] operator[SEP] identifier[ejbArchiveMDBuilder] operator[SEP] identifier[setConfigName] operator[SEP] identifier[configName] operator[SEP] operator[SEP] identifier[WSLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[tracef] operator[SEP] literal[String] , identifier[configName] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[configFile] operator[=] identifier[webservicesMD] operator[SEP] identifier[getConfigFile] operator[SEP] operator[SEP] operator[SEP] identifier[ejbArchiveMDBuilder] operator[SEP] identifier[setConfigFile] operator[SEP] identifier[configFile] operator[SEP] operator[SEP] identifier[WSLogger] operator[SEP] identifier[ROOT_LOGGER] operator[SEP] identifier[tracef] operator[SEP] literal[String] , identifier[configFile] operator[SEP] operator[SEP] Keyword[final] identifier[JBossWebserviceDescriptionMetaData] operator[SEP] operator[SEP] identifier[wsDescriptionsMD] operator[=] identifier[webservicesMD] operator[SEP] identifier[getWebserviceDescriptions] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[PublishLocationAdapter] identifier[resolver] operator[=] Keyword[new] identifier[PublishLocationAdapterImpl] operator[SEP] identifier[wsDescriptionsMD] operator[SEP] operator[SEP] identifier[ejbArchiveMDBuilder] operator[SEP] identifier[setPublishLocationAdapter] operator[SEP] identifier[resolver] operator[SEP] operator[SEP] }
private Histogram getHistogramByProbing(TableCountProbingContext probingContext, int count, long startEpoch, long endEpoch) { Histogram histogram = new Histogram(); Map<String, String> values = new HashMap<>(); values.put("table", probingContext.entity); values.put("column", probingContext.watermarkColumn); values.put("greater", ">="); values.put("less", "<"); StrSubstitutor sub = new StrSubstitutor(values); getHistogramRecursively(probingContext, histogram, sub, values, count, startEpoch, endEpoch); return histogram; }
class class_name[name] begin[{] method[getHistogramByProbing, return_type[type[Histogram]], modifier[private], parameter[probingContext, count, startEpoch, endEpoch]] begin[{] local_variable[type[Histogram], histogram] local_variable[type[Map], values] call[values.put, parameter[literal["table"], member[probingContext.entity]]] call[values.put, parameter[literal["column"], member[probingContext.watermarkColumn]]] call[values.put, parameter[literal["greater"], literal[">="]]] call[values.put, parameter[literal["less"], literal["<"]]] local_variable[type[StrSubstitutor], sub] call[.getHistogramRecursively, parameter[member[.probingContext], member[.histogram], member[.sub], member[.values], member[.count], member[.startEpoch], member[.endEpoch]]] return[member[.histogram]] end[}] END[}]
Keyword[private] identifier[Histogram] identifier[getHistogramByProbing] operator[SEP] identifier[TableCountProbingContext] identifier[probingContext] , Keyword[int] identifier[count] , Keyword[long] identifier[startEpoch] , Keyword[long] identifier[endEpoch] operator[SEP] { identifier[Histogram] identifier[histogram] operator[=] Keyword[new] identifier[Histogram] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[values] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[probingContext] operator[SEP] identifier[entity] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[probingContext] operator[SEP] identifier[watermarkColumn] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[values] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[StrSubstitutor] identifier[sub] operator[=] Keyword[new] identifier[StrSubstitutor] operator[SEP] identifier[values] operator[SEP] operator[SEP] identifier[getHistogramRecursively] operator[SEP] identifier[probingContext] , identifier[histogram] , identifier[sub] , identifier[values] , identifier[count] , identifier[startEpoch] , identifier[endEpoch] operator[SEP] operator[SEP] Keyword[return] identifier[histogram] operator[SEP] }
public final void checkPermission( String resource , String action ) throws JMSException { if (securityContext == null) return; // Security is disabled securityContext.checkPermission(resource, action); }
class class_name[name] begin[{] method[checkPermission, return_type[void], modifier[final public], parameter[resource, action]] begin[{] if[binary_operation[member[.securityContext], ==, literal[null]]] begin[{] return[None] else begin[{] None end[}] call[securityContext.checkPermission, parameter[member[.resource], member[.action]]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[checkPermission] operator[SEP] identifier[String] identifier[resource] , identifier[String] identifier[action] operator[SEP] Keyword[throws] identifier[JMSException] { Keyword[if] operator[SEP] identifier[securityContext] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[securityContext] operator[SEP] identifier[checkPermission] operator[SEP] identifier[resource] , identifier[action] operator[SEP] operator[SEP] }
@Override public <T> CompletionStage<T> get(URI uri, Map<String, String> headers, JsonParser<T> parser) { return request(uri, headers, null, parser); }
class class_name[name] begin[{] method[get, return_type[type[CompletionStage]], modifier[public], parameter[uri, headers, parser]] begin[{] return[call[.request, parameter[member[.uri], member[.headers], literal[null], member[.parser]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[CompletionStage] operator[<] identifier[T] operator[>] identifier[get] operator[SEP] identifier[URI] identifier[uri] , identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[headers] , identifier[JsonParser] operator[<] identifier[T] operator[>] identifier[parser] operator[SEP] { Keyword[return] identifier[request] operator[SEP] identifier[uri] , identifier[headers] , Other[null] , identifier[parser] operator[SEP] operator[SEP] }
public void setStringAttribute(String name, String value) { ensureValue(); Attribute attribute = new StringAttribute(value); attribute.setEditable(isEditable(name)); getValue().getAllAttributes().put(name, attribute); }
class class_name[name] begin[{] method[setStringAttribute, return_type[void], modifier[public], parameter[name, value]] begin[{] call[.ensureValue, parameter[]] local_variable[type[Attribute], attribute] call[attribute.setEditable, parameter[call[.isEditable, parameter[member[.name]]]]] call[.getValue, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setStringAttribute] operator[SEP] identifier[String] identifier[name] , identifier[String] identifier[value] operator[SEP] { identifier[ensureValue] operator[SEP] operator[SEP] operator[SEP] identifier[Attribute] identifier[attribute] operator[=] Keyword[new] identifier[StringAttribute] operator[SEP] identifier[value] operator[SEP] operator[SEP] identifier[attribute] operator[SEP] identifier[setEditable] operator[SEP] identifier[isEditable] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[getAllAttributes] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[name] , identifier[attribute] operator[SEP] operator[SEP] }
public List<T> handle(List<QueryParameters> outputList) throws MjdbcException { List<T> result = new ArrayList<T>(); String parameterName = null; Object parameterValue = null; for (int i = 1; i < outputList.size(); i++) { if (this.columnName == null) { parameterName = outputList.get(i).getNameByPosition(this.columnIndex); parameterValue = outputList.get(i).getValue(parameterName); result.add((T) parameterValue); } else { parameterValue = outputList.get(i).getValue(this.columnName); result.add((T) parameterValue); } } return result; }
class class_name[name] begin[{] method[handle, return_type[type[List]], modifier[public], parameter[outputList]] begin[{] local_variable[type[List], result] local_variable[type[String], parameterName] local_variable[type[Object], parameterValue] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=columnName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=parameterValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=outputList, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=columnName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=parameterValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=parameterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=outputList, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=columnIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=getNameByPosition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=parameterValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=outputList, selectors=[MethodInvocation(arguments=[MemberReference(member=parameterName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=parameterValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=outputList, selectors=[], type_arguments=None), 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) return[member[.result]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[T] operator[>] identifier[handle] operator[SEP] identifier[List] operator[<] identifier[QueryParameters] operator[>] identifier[outputList] operator[SEP] Keyword[throws] identifier[MjdbcException] { identifier[List] operator[<] identifier[T] operator[>] identifier[result] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[T] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[parameterName] operator[=] Other[null] operator[SEP] identifier[Object] identifier[parameterValue] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[outputList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[columnName] operator[==] Other[null] operator[SEP] { identifier[parameterName] operator[=] identifier[outputList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getNameByPosition] operator[SEP] Keyword[this] operator[SEP] identifier[columnIndex] operator[SEP] operator[SEP] identifier[parameterValue] operator[=] identifier[outputList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] identifier[parameterName] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[T] operator[SEP] identifier[parameterValue] operator[SEP] operator[SEP] } Keyword[else] { identifier[parameterValue] operator[=] identifier[outputList] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] Keyword[this] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[T] operator[SEP] identifier[parameterValue] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public static boolean hasConstructors(List<JCTree> trees) { for (List<JCTree> l = trees; l.nonEmpty(); l = l.tail) if (isConstructor(l.head)) return true; return false; }
class class_name[name] begin[{] method[hasConstructors, return_type[type[boolean]], modifier[public static], parameter[trees]] begin[{] ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=head, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[])], member=isConstructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)), control=ForControl(condition=MethodInvocation(arguments=[], member=nonEmpty, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=trees, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=l)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JCTree, sub_type=None))], dimensions=[], name=List, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tail, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[]))]), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[hasConstructors] operator[SEP] identifier[List] operator[<] identifier[JCTree] operator[>] identifier[trees] operator[SEP] { Keyword[for] operator[SEP] identifier[List] operator[<] identifier[JCTree] operator[>] identifier[l] operator[=] identifier[trees] operator[SEP] identifier[l] operator[SEP] identifier[nonEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[l] operator[=] identifier[l] operator[SEP] identifier[tail] operator[SEP] Keyword[if] operator[SEP] identifier[isConstructor] operator[SEP] identifier[l] operator[SEP] identifier[head] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public void start() throws Exception { long startTime = System.currentTimeMillis(); HandlerCollection handlers = new HandlerCollection(); addModulesToJetty(handlers); // Create the server. int serverPort = serverPort(); System.out.println("**** Starting Server (" + getClass().getSimpleName() + ") on port: " + serverPort); server = new Server(serverPort); server.setHandler(handlers); server.start(); long endTime = System.currentTimeMillis(); System.out.println("******* Started in " + (endTime - startTime) + "ms"); }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[]] begin[{] local_variable[type[long], startTime] local_variable[type[HandlerCollection], handlers] call[.addModulesToJetty, parameter[member[.handlers]]] local_variable[type[int], serverPort] call[System.out.println, parameter[binary_operation[binary_operation[binary_operation[literal["**** Starting Server ("], +, call[.getClass, parameter[]]], +, literal[") on port: "]], +, member[.serverPort]]]] assign[member[.server], ClassCreator(arguments=[MemberReference(member=serverPort, 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=Server, sub_type=None))] call[server.setHandler, parameter[member[.handlers]]] call[server.start, parameter[]] local_variable[type[long], endTime] call[System.out.println, parameter[binary_operation[binary_operation[literal["******* Started in "], +, binary_operation[member[.endTime], -, member[.startTime]]], +, literal["ms"]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[start] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[long] identifier[startTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[HandlerCollection] identifier[handlers] operator[=] Keyword[new] identifier[HandlerCollection] operator[SEP] operator[SEP] operator[SEP] identifier[addModulesToJetty] operator[SEP] identifier[handlers] operator[SEP] operator[SEP] Keyword[int] identifier[serverPort] operator[=] identifier[serverPort] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[serverPort] operator[SEP] operator[SEP] identifier[server] operator[=] Keyword[new] identifier[Server] operator[SEP] identifier[serverPort] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[setHandler] operator[SEP] identifier[handlers] operator[SEP] operator[SEP] identifier[server] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[endTime] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] operator[SEP] identifier[endTime] operator[-] identifier[startTime] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] }
private List getVersions() { ArrayList ret = new ArrayList(); int defaultHistoryVersions = OpenCms.getSystemInfo().getHistoryVersions(); int historyVersions = 0; // Add the option for disabled version history ret.add( new CmsSelectWidgetOption( String.valueOf(-2), defaultHistoryVersions == -2, key(Messages.GUI_HISTORY_SETTINGS_VERSIONS_DISABLED_0))); // Iterate from 1 to 50 with a stepping of 1 for the first 10 entries and a stepping of five for the entries from 10 to 50 while (historyVersions < 50) { // increment the history version historyVersions++; if (((historyVersions % 5) == 0) || (historyVersions <= 10)) { boolean defaultValue = defaultHistoryVersions == historyVersions; ret.add( new CmsSelectWidgetOption( String.valueOf(historyVersions), defaultValue, String.valueOf(historyVersions))); } } // If the default setting for the version history is more than 50 if (defaultHistoryVersions > historyVersions) { ret.add( new CmsSelectWidgetOption( String.valueOf(defaultHistoryVersions), true, String.valueOf(defaultHistoryVersions))); } // Add the option for unlimited version history ret.add( new CmsSelectWidgetOption( String.valueOf(-1), defaultHistoryVersions == -1, key(Messages.GUI_HISTORY_SETTINGS_VERSIONS_UNLIMITED_0))); return ret; }
class class_name[name] begin[{] method[getVersions, return_type[type[List]], modifier[private], parameter[]] begin[{] local_variable[type[ArrayList], ret] local_variable[type[int], defaultHistoryVersions] local_variable[type[int], historyVersions] call[ret.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=2)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=defaultHistoryVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=2), operator===), MethodInvocation(arguments=[MemberReference(member=GUI_HISTORY_SETTINGS_VERSIONS_DISABLED_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, 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=CmsSelectWidgetOption, sub_type=None))]] while[binary_operation[member[.historyVersions], <, literal[50]]] begin[{] member[.historyVersions] if[binary_operation[binary_operation[binary_operation[member[.historyVersions], %, literal[5]], ==, literal[0]], ||, binary_operation[member[.historyVersions], <=, literal[10]]]] begin[{] local_variable[type[boolean], defaultValue] call[ret.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=historyVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=historyVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, 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=CmsSelectWidgetOption, sub_type=None))]] else begin[{] None end[}] end[}] if[binary_operation[member[.defaultHistoryVersions], >, member[.historyVersions]]] begin[{] call[ret.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=defaultHistoryVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MethodInvocation(arguments=[MemberReference(member=defaultHistoryVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, 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=CmsSelectWidgetOption, sub_type=None))]] else begin[{] None end[}] call[ret.add, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), BinaryOperation(operandl=MemberReference(member=defaultHistoryVersions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), MethodInvocation(arguments=[MemberReference(member=GUI_HISTORY_SETTINGS_VERSIONS_UNLIMITED_0, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[])], member=key, 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=CmsSelectWidgetOption, sub_type=None))]] return[member[.ret]] end[}] END[}]
Keyword[private] identifier[List] identifier[getVersions] operator[SEP] operator[SEP] { identifier[ArrayList] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[defaultHistoryVersions] operator[=] identifier[OpenCms] operator[SEP] identifier[getSystemInfo] operator[SEP] operator[SEP] operator[SEP] identifier[getHistoryVersions] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[historyVersions] operator[=] Other[0] operator[SEP] identifier[ret] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsSelectWidgetOption] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] operator[-] Other[2] operator[SEP] , identifier[defaultHistoryVersions] operator[==] operator[-] Other[2] , identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_HISTORY_SETTINGS_VERSIONS_DISABLED_0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[historyVersions] operator[<] Other[50] operator[SEP] { identifier[historyVersions] operator[++] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[historyVersions] operator[%] Other[5] operator[SEP] operator[==] Other[0] operator[SEP] operator[||] operator[SEP] identifier[historyVersions] operator[<=] Other[10] operator[SEP] operator[SEP] { Keyword[boolean] identifier[defaultValue] operator[=] identifier[defaultHistoryVersions] operator[==] identifier[historyVersions] operator[SEP] identifier[ret] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsSelectWidgetOption] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[historyVersions] operator[SEP] , identifier[defaultValue] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[historyVersions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[defaultHistoryVersions] operator[>] identifier[historyVersions] operator[SEP] { identifier[ret] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsSelectWidgetOption] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[defaultHistoryVersions] operator[SEP] , literal[boolean] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[defaultHistoryVersions] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ret] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[CmsSelectWidgetOption] operator[SEP] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[defaultHistoryVersions] operator[==] operator[-] Other[1] , identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_HISTORY_SETTINGS_VERSIONS_UNLIMITED_0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ret] operator[SEP] }
public Tree putMap(String path) { return putObjectInternal(path, new LinkedHashMap<String, Object>(), false); }
class class_name[name] begin[{] method[putMap, return_type[type[Tree]], modifier[public], parameter[path]] begin[{] return[call[.putObjectInternal, parameter[member[.path], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=LinkedHashMap, sub_type=None)), literal[false]]]] end[}] END[}]
Keyword[public] identifier[Tree] identifier[putMap] operator[SEP] identifier[String] identifier[path] operator[SEP] { Keyword[return] identifier[putObjectInternal] operator[SEP] identifier[path] , Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] }
public static void isNotEmpty( Collection<?> argument, String name ) { isNotNull(argument, name); if (argument.isEmpty()) { throw new IllegalArgumentException(CommonI18n.argumentMayNotBeEmpty.text(name)); } }
class class_name[name] begin[{] method[isNotEmpty, return_type[void], modifier[public static], parameter[argument, name]] begin[{] call[.isNotNull, parameter[member[.argument], member[.name]]] if[call[argument.isEmpty, parameter[]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=text, postfix_operators=[], prefix_operators=[], qualifier=CommonI18n.argumentMayNotBeEmpty, selectors=[], type_arguments=None)], 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[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[isNotEmpty] operator[SEP] identifier[Collection] operator[<] operator[?] operator[>] identifier[argument] , identifier[String] identifier[name] operator[SEP] { identifier[isNotNull] operator[SEP] identifier[argument] , identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[argument] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[CommonI18n] operator[SEP] identifier[argumentMayNotBeEmpty] operator[SEP] identifier[text] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] } }
private static void stripEmptyTextNodes(Node n) { NodeList children = n.getChildNodes(); int length = children.getLength(); for (int i = 0; i < length; i++) { Node c = children.item(i); if (!c.hasChildNodes() && c.getNodeType() == Node.TEXT_NODE && c.getTextContent().trim().length() == 0) { n.removeChild(c); i--; length--; children = n.getChildNodes(); } else { stripEmptyTextNodes(c); } } }
class class_name[name] begin[{] method[stripEmptyTextNodes, return_type[void], modifier[private static], parameter[n]] begin[{] local_variable[type[NodeList], children] local_variable[type[int], length] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=hasChildNodes, postfix_operators=[], prefix_operators=['!'], qualifier=c, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNodeType, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), operandr=MemberReference(member=TEXT_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[]), operator===), operator=&&), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTextContent, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[MethodInvocation(arguments=[], member=trim, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stripEmptyTextNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeChild, postfix_operators=[], prefix_operators=[], qualifier=n, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MemberReference(member=length, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=children, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getChildNodes, postfix_operators=[], prefix_operators=[], qualifier=n, 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=, 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[private] Keyword[static] Keyword[void] identifier[stripEmptyTextNodes] operator[SEP] identifier[Node] identifier[n] operator[SEP] { identifier[NodeList] identifier[children] operator[=] identifier[n] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[length] operator[=] identifier[children] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Node] identifier[c] operator[=] identifier[children] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[c] operator[SEP] identifier[hasChildNodes] operator[SEP] operator[SEP] operator[&&] identifier[c] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[TEXT_NODE] operator[&&] identifier[c] operator[SEP] identifier[getTextContent] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { identifier[n] operator[SEP] identifier[removeChild] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[i] operator[--] operator[SEP] identifier[length] operator[--] operator[SEP] identifier[children] operator[=] identifier[n] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[stripEmptyTextNodes] operator[SEP] identifier[c] operator[SEP] operator[SEP] } } }
int calculateWidth() { int result; if (m_inline && CmsDomUtil.getCurrentStyle(getElement(), Style.display).equals("inline")) { com.google.gwt.dom.client.Element parentBlock = getElement().getParentElement(); while (CmsDomUtil.getCurrentStyle(parentBlock, Style.display).equals("inline")) { parentBlock = parentBlock.getParentElement(); } result = parentBlock.getOffsetWidth(); } else { result = getElement().getOffsetWidth(); } return result - 2; }
class class_name[name] begin[{] method[calculateWidth, return_type[type[int]], modifier[default], parameter[]] begin[{] local_variable[type[int], result] if[binary_operation[member[.m_inline], &&, call[CmsDomUtil.getCurrentStyle, parameter[call[.getElement, parameter[]], member[Style.display]]]]] begin[{] local_variable[type[com], parentBlock] while[call[CmsDomUtil.getCurrentStyle, parameter[member[.parentBlock], member[Style.display]]]] begin[{] assign[member[.parentBlock], call[parentBlock.getParentElement, parameter[]]] end[}] assign[member[.result], call[parentBlock.getOffsetWidth, parameter[]]] else begin[{] assign[member[.result], call[.getElement, parameter[]]] end[}] return[binary_operation[member[.result], -, literal[2]]] end[}] END[}]
Keyword[int] identifier[calculateWidth] operator[SEP] operator[SEP] { Keyword[int] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[m_inline] operator[&&] identifier[CmsDomUtil] operator[SEP] identifier[getCurrentStyle] operator[SEP] identifier[getElement] operator[SEP] operator[SEP] , identifier[Style] operator[SEP] identifier[display] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[gwt] operator[SEP] identifier[dom] operator[SEP] identifier[client] operator[SEP] identifier[Element] identifier[parentBlock] operator[=] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getParentElement] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[CmsDomUtil] operator[SEP] identifier[getCurrentStyle] operator[SEP] identifier[parentBlock] , identifier[Style] operator[SEP] identifier[display] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[parentBlock] operator[=] identifier[parentBlock] operator[SEP] identifier[getParentElement] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[=] identifier[parentBlock] operator[SEP] identifier[getOffsetWidth] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[result] operator[=] identifier[getElement] operator[SEP] operator[SEP] operator[SEP] identifier[getOffsetWidth] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[-] Other[2] operator[SEP] }
public Reference addIndication() { //3 Reference t = new Reference(); if (this.indication == null) this.indication = new ArrayList<Reference>(); this.indication.add(t); return t; }
class class_name[name] begin[{] method[addIndication, return_type[type[Reference]], modifier[public], parameter[]] begin[{] local_variable[type[Reference], t] if[binary_operation[THIS[member[None.indication]], ==, literal[null]]] begin[{] assign[THIS[member[None.indication]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Reference, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] THIS[member[None.indication]call[None.add, parameter[member[.t]]]] return[member[.t]] end[}] END[}]
Keyword[public] identifier[Reference] identifier[addIndication] operator[SEP] operator[SEP] { identifier[Reference] identifier[t] operator[=] Keyword[new] identifier[Reference] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[indication] operator[==] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[indication] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Reference] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[indication] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[return] identifier[t] operator[SEP] }
public String getJSON(long maxBytes) { try { switch (getGELFType()) { case ZLIB: return Tools.decompressZlib(payload, maxBytes); case GZIP: return Tools.decompressGzip(payload, maxBytes); case UNCOMPRESSED: return new String(payload, StandardCharsets.UTF_8); case CHUNKED: case UNSUPPORTED: throw new IllegalStateException("Unknown GELF type. Not supported."); } } catch (final IOException e) { // Note that the UnsupportedEncodingException thrown by 'new String' can never happen because UTF-8 // is a mandatory JRE encoding which is always present. So we only need to mention the decompress exceptions here. throw new IllegalStateException("Failed to decompress the GELF message payload", e); } return null; }
class class_name[name] begin[{] method[getJSON, return_type[type[String]], modifier[public], parameter[maxBytes]] begin[{] TryStatement(block=[SwitchStatement(cases=[SwitchStatementCase(case=['ZLIB'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=payload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decompressZlib, postfix_operators=[], prefix_operators=[], qualifier=Tools, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['GZIP'], statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=payload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=maxBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decompressGzip, postfix_operators=[], prefix_operators=[], qualifier=Tools, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=['UNCOMPRESSED'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=payload, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=StandardCharsets, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), label=None)]), SwitchStatementCase(case=['CHUNKED', 'UNSUPPORTED'], statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown GELF type. Not 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)])], expression=MethodInvocation(arguments=[], member=getGELFType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to decompress the GELF message payload"), 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=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[String] identifier[getJSON] operator[SEP] Keyword[long] identifier[maxBytes] operator[SEP] { Keyword[try] { Keyword[switch] operator[SEP] identifier[getGELFType] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] identifier[ZLIB] operator[:] Keyword[return] identifier[Tools] operator[SEP] identifier[decompressZlib] operator[SEP] identifier[payload] , identifier[maxBytes] operator[SEP] operator[SEP] Keyword[case] identifier[GZIP] operator[:] Keyword[return] identifier[Tools] operator[SEP] identifier[decompressGzip] operator[SEP] identifier[payload] , identifier[maxBytes] operator[SEP] operator[SEP] Keyword[case] identifier[UNCOMPRESSED] operator[:] Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[payload] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] Keyword[case] identifier[CHUNKED] operator[:] Keyword[case] identifier[UNSUPPORTED] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] Keyword[final] identifier[IOException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
public static void log(final Level level, final Throwable exception) { String nameOfException = exception.getClass().getName(); String messageOfException = exception.getMessage(); if (messageOfException == null || messageOfException.isEmpty()) { System.err.println("LOGGER " + level + ": " + nameOfException); } else { System.err.println("LOGGER " + level + ": " + messageOfException + " (" + nameOfException + ")"); } }
class class_name[name] begin[{] method[log, return_type[void], modifier[public static], parameter[level, exception]] begin[{] local_variable[type[String], nameOfException] local_variable[type[String], messageOfException] if[binary_operation[binary_operation[member[.messageOfException], ==, literal[null]], ||, call[messageOfException.isEmpty, parameter[]]]] begin[{] call[System.err.println, parameter[binary_operation[binary_operation[binary_operation[literal["LOGGER "], +, member[.level]], +, literal[": "]], +, member[.nameOfException]]]] else begin[{] call[System.err.println, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["LOGGER "], +, member[.level]], +, literal[": "]], +, member[.messageOfException]], +, literal[" ("]], +, member[.nameOfException]], +, literal[")"]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[log] operator[SEP] Keyword[final] identifier[Level] identifier[level] , Keyword[final] identifier[Throwable] identifier[exception] operator[SEP] { identifier[String] identifier[nameOfException] operator[=] identifier[exception] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[messageOfException] operator[=] identifier[exception] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[messageOfException] operator[==] Other[null] operator[||] identifier[messageOfException] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[level] operator[+] literal[String] operator[+] identifier[nameOfException] operator[SEP] operator[SEP] } Keyword[else] { identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[level] operator[+] literal[String] operator[+] identifier[messageOfException] operator[+] literal[String] operator[+] identifier[nameOfException] operator[+] literal[String] operator[SEP] operator[SEP] } }
public static final int hash(double d, boolean isNull) { if (isNull) return NULL_HASH; long longVal = Double.doubleToLongBits(d); return (int)(longVal ^ (longVal >>> 32)); }
class class_name[name] begin[{] method[hash, return_type[type[int]], modifier[final public static], parameter[d, isNull]] begin[{] if[member[.isNull]] begin[{] return[member[.NULL_HASH]] else begin[{] None end[}] local_variable[type[long], longVal] return[Cast(expression=BinaryOperation(operandl=MemberReference(member=longVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=longVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=>>>), operator=^), type=BasicType(dimensions=[], name=int))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] Keyword[int] identifier[hash] operator[SEP] Keyword[double] identifier[d] , Keyword[boolean] identifier[isNull] operator[SEP] { Keyword[if] operator[SEP] identifier[isNull] operator[SEP] Keyword[return] identifier[NULL_HASH] operator[SEP] Keyword[long] identifier[longVal] operator[=] identifier[Double] operator[SEP] identifier[doubleToLongBits] operator[SEP] identifier[d] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[longVal] operator[^] operator[SEP] identifier[longVal] operator[>] operator[>] operator[>] Other[32] operator[SEP] operator[SEP] operator[SEP] }
@Override public int doEndTag() throws JspException { String input = null; // determine the input by... if (valueSpecified) { // ... reading 'value' attribute input = value; } else { // ... retrieving and trimming our body if (bodyContent != null && bodyContent.getString() != null) { input = bodyContent.getString().trim(); } } if ((input == null) || input.equals("")) { if (var != null) { pageContext.removeAttribute(var, scope); } return EVAL_PAGE; } /* * Set up parsing locale: Use locale specified via the 'parseLocale' * attribute (if present), or else determine page's locale. */ Locale loc = parseLocale; if (loc == null) { loc = SetLocaleSupport.getFormattingLocale( pageContext, this, false, NumberFormat.getAvailableLocales()); } if (loc == null) { throw new JspException( Resources.getMessage("PARSE_NUMBER_NO_PARSE_LOCALE")); } // Create parser NumberFormat parser = null; if ((pattern != null) && !pattern.equals("")) { // if 'pattern' is specified, 'type' is ignored DecimalFormatSymbols symbols = new DecimalFormatSymbols(loc); parser = new DecimalFormat(pattern, symbols); } else { parser = createParser(loc); } // Configure parser if (integerOnlySpecified) { parser.setParseIntegerOnly(isIntegerOnly); } // Parse number Number parsed = null; try { parsed = parser.parse(input); } catch (ParseException pe) { throw new JspException( Resources.getMessage("PARSE_NUMBER_PARSE_ERROR", input), pe); } if (var != null) { pageContext.setAttribute(var, parsed, scope); } else { try { pageContext.getOut().print(parsed); } catch (IOException ioe) { throw new JspTagException(ioe.toString(), ioe); } } return EVAL_PAGE; }
class class_name[name] begin[{] method[doEndTag, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[String], input] if[member[.valueSpecified]] begin[{] assign[member[.input], member[.value]] else begin[{] if[binary_operation[binary_operation[member[.bodyContent], !=, literal[null]], &&, binary_operation[call[bodyContent.getString, parameter[]], !=, literal[null]]]] begin[{] assign[member[.input], call[bodyContent.getString, parameter[]]] else begin[{] None end[}] end[}] if[binary_operation[binary_operation[member[.input], ==, literal[null]], ||, call[input.equals, parameter[literal[""]]]]] begin[{] if[binary_operation[member[.var], !=, literal[null]]] begin[{] call[pageContext.removeAttribute, parameter[member[.var], member[.scope]]] else begin[{] None end[}] return[member[.EVAL_PAGE]] else begin[{] None end[}] local_variable[type[Locale], loc] if[binary_operation[member[.loc], ==, literal[null]]] begin[{] assign[member[.loc], call[SetLocaleSupport.getFormattingLocale, parameter[member[.pageContext], THIS[], literal[false], call[NumberFormat.getAvailableLocales, parameter[]]]]] else begin[{] None end[}] if[binary_operation[member[.loc], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PARSE_NUMBER_NO_PARSE_LOCALE")], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=Resources, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JspException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[NumberFormat], parser] if[binary_operation[binary_operation[member[.pattern], !=, literal[null]], &&, call[pattern.equals, parameter[literal[""]]]]] begin[{] local_variable[type[DecimalFormatSymbols], symbols] assign[member[.parser], ClassCreator(arguments=[MemberReference(member=pattern, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=symbols, 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=DecimalFormat, sub_type=None))] else begin[{] assign[member[.parser], call[.createParser, parameter[member[.loc]]]] end[}] if[member[.integerOnlySpecified]] begin[{] call[parser.setParseIntegerOnly, parameter[member[.isIntegerOnly]]] else begin[{] None end[}] local_variable[type[Number], parsed] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=parsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=parser, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="PARSE_NUMBER_PARSE_ERROR"), MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=Resources, selectors=[], type_arguments=None), MemberReference(member=pe, 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=JspException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=pe, types=['ParseException']))], finally_block=None, label=None, resources=None) if[binary_operation[member[.var], !=, literal[null]]] begin[{] call[pageContext.setAttribute, parameter[member[.var], member[.parsed], member[.scope]]] else begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getOut, postfix_operators=[], prefix_operators=[], qualifier=pageContext, selectors=[MethodInvocation(arguments=[MemberReference(member=parsed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=print, 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=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=ioe, selectors=[], type_arguments=None), MemberReference(member=ioe, 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=JspTagException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ioe, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] return[member[.EVAL_PAGE]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[doEndTag] operator[SEP] operator[SEP] Keyword[throws] identifier[JspException] { identifier[String] identifier[input] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[valueSpecified] operator[SEP] { identifier[input] operator[=] identifier[value] operator[SEP] } Keyword[else] { Keyword[if] operator[SEP] identifier[bodyContent] operator[!=] Other[null] operator[&&] identifier[bodyContent] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[input] operator[=] identifier[bodyContent] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] operator[SEP] identifier[input] operator[==] Other[null] operator[SEP] operator[||] identifier[input] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[var] operator[!=] Other[null] operator[SEP] { identifier[pageContext] operator[SEP] identifier[removeAttribute] operator[SEP] identifier[var] , identifier[scope] operator[SEP] operator[SEP] } Keyword[return] identifier[EVAL_PAGE] operator[SEP] } identifier[Locale] identifier[loc] operator[=] identifier[parseLocale] operator[SEP] Keyword[if] operator[SEP] identifier[loc] operator[==] Other[null] operator[SEP] { identifier[loc] operator[=] identifier[SetLocaleSupport] operator[SEP] identifier[getFormattingLocale] operator[SEP] identifier[pageContext] , Keyword[this] , literal[boolean] , identifier[NumberFormat] operator[SEP] identifier[getAvailableLocales] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[loc] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[JspException] operator[SEP] identifier[Resources] operator[SEP] identifier[getMessage] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } identifier[NumberFormat] identifier[parser] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[pattern] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[pattern] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[DecimalFormatSymbols] identifier[symbols] operator[=] Keyword[new] identifier[DecimalFormatSymbols] operator[SEP] identifier[loc] operator[SEP] operator[SEP] identifier[parser] operator[=] Keyword[new] identifier[DecimalFormat] operator[SEP] identifier[pattern] , identifier[symbols] operator[SEP] operator[SEP] } Keyword[else] { identifier[parser] operator[=] identifier[createParser] operator[SEP] identifier[loc] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[integerOnlySpecified] operator[SEP] { identifier[parser] operator[SEP] identifier[setParseIntegerOnly] operator[SEP] identifier[isIntegerOnly] operator[SEP] operator[SEP] } identifier[Number] identifier[parsed] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[parsed] operator[=] identifier[parser] operator[SEP] identifier[parse] operator[SEP] identifier[input] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ParseException] identifier[pe] operator[SEP] { Keyword[throw] Keyword[new] identifier[JspException] operator[SEP] identifier[Resources] operator[SEP] identifier[getMessage] operator[SEP] literal[String] , identifier[input] operator[SEP] , identifier[pe] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[var] operator[!=] Other[null] operator[SEP] { identifier[pageContext] operator[SEP] identifier[setAttribute] operator[SEP] identifier[var] , identifier[parsed] , identifier[scope] operator[SEP] operator[SEP] } Keyword[else] { Keyword[try] { identifier[pageContext] operator[SEP] identifier[getOut] operator[SEP] operator[SEP] operator[SEP] identifier[print] operator[SEP] identifier[parsed] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ioe] operator[SEP] { Keyword[throw] Keyword[new] identifier[JspTagException] operator[SEP] identifier[ioe] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[ioe] operator[SEP] operator[SEP] } } Keyword[return] identifier[EVAL_PAGE] operator[SEP] }
public void convertTab(InputStream inputStream, OutputStream outputStream, boolean forceInteractionToComplex) throws IOException, PsimiTabException { // check args if (inputStream == null || outputStream == null) { throw new IllegalArgumentException("convertTab(): " + "one or more null arguments."); } // unmarshall the data, close the stream PsimiTabReader reader = new PsimiTabReader(); Collection<BinaryInteraction> interactions = reader.read(inputStream); Tab2Xml tab2Xml = new Tab2Xml(); EntrySet entrySet; try { entrySet = tab2Xml.convert(interactions); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (XmlConversionException e) { throw new RuntimeException(e); } inputStream.close(); // convert convert(entrySet, outputStream, forceInteractionToComplex); }
class class_name[name] begin[{] method[convertTab, return_type[void], modifier[public], parameter[inputStream, outputStream, forceInteractionToComplex]] begin[{] if[binary_operation[binary_operation[member[.inputStream], ==, literal[null]], ||, binary_operation[member[.outputStream], ==, literal[null]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="convertTab(): "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="one or more null arguments."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[PsimiTabReader], reader] local_variable[type[Collection], interactions] local_variable[type[Tab2Xml], tab2Xml] local_variable[type[EntrySet], entrySet] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=interactions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=tab2Xml, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['XmlConversionException']))], finally_block=None, label=None, resources=None) call[inputStream.close, parameter[]] call[.convert, parameter[member[.entrySet], member[.outputStream], member[.forceInteractionToComplex]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[convertTab] operator[SEP] identifier[InputStream] identifier[inputStream] , identifier[OutputStream] identifier[outputStream] , Keyword[boolean] identifier[forceInteractionToComplex] operator[SEP] Keyword[throws] identifier[IOException] , identifier[PsimiTabException] { Keyword[if] operator[SEP] identifier[inputStream] operator[==] Other[null] operator[||] identifier[outputStream] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[PsimiTabReader] identifier[reader] operator[=] Keyword[new] identifier[PsimiTabReader] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[BinaryInteraction] operator[>] identifier[interactions] operator[=] identifier[reader] operator[SEP] identifier[read] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP] identifier[Tab2Xml] identifier[tab2Xml] operator[=] Keyword[new] identifier[Tab2Xml] operator[SEP] operator[SEP] operator[SEP] identifier[EntrySet] identifier[entrySet] operator[SEP] Keyword[try] { identifier[entrySet] operator[=] identifier[tab2Xml] operator[SEP] identifier[convert] operator[SEP] identifier[interactions] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[XmlConversionException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } identifier[inputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[convert] operator[SEP] identifier[entrySet] , identifier[outputStream] , identifier[forceInteractionToComplex] operator[SEP] operator[SEP] }
public static boolean contains(final int[] iArray, final int iToFind) { if (iArray == null || iArray.length == 0) return false; for (int e : iArray) if (e == iToFind) return true; return false; }
class class_name[name] begin[{] method[contains, return_type[type[boolean]], modifier[public static], parameter[iArray, iToFind]] begin[{] if[binary_operation[binary_operation[member[.iArray], ==, literal[null]], ||, binary_operation[member[iArray.length], ==, literal[0]]]] begin[{] return[literal[false]] else begin[{] None end[}] ForStatement(body=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=iToFind, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)), control=EnhancedForControl(iterable=MemberReference(member=iArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[contains] operator[SEP] Keyword[final] Keyword[int] operator[SEP] operator[SEP] identifier[iArray] , Keyword[final] Keyword[int] identifier[iToFind] operator[SEP] { Keyword[if] operator[SEP] identifier[iArray] operator[==] Other[null] operator[||] identifier[iArray] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[e] operator[:] identifier[iArray] operator[SEP] Keyword[if] operator[SEP] identifier[e] operator[==] identifier[iToFind] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public UITabGroup attachTo(UIContainer container, boolean displace) { attachedContainer = container; if (activeTab != null) activeTab.setActive(true); switch (tabPosition) { case TOP: setPosition(Position.above(this, container, -2)); break; case BOTTOM: setPosition(Position.below(this, container, -2)); break; case LEFT: setPosition(Position.leftOf(this, container, -2)); break; case RIGHT: setPosition(Position.rightOf(this, container, -2)); break; } for (UIContainer tabContainer : listTabs.values()) setupTabContainer(tabContainer); calculateTabPosition(); if (activeTab != null) { UITab tab = activeTab; activeTab = null; setActiveTab(tab); } if (displace) { attachedContainer.setPosition(new AttachedContainerPosition(attachedContainer.position())); attachedContainer.setSize(new AttachedContainerSize(attachedContainer.size())); } return this; }
class class_name[name] begin[{] method[attachTo, return_type[type[UITabGroup]], modifier[public], parameter[container, displace]] begin[{] assign[member[.attachedContainer], member[.container]] if[binary_operation[member[.activeTab], !=, literal[null]]] begin[{] call[activeTab.setActive, parameter[literal[true]]] else begin[{] None end[}] SwitchStatement(cases=[SwitchStatementCase(case=['TOP'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=2)], member=above, postfix_operators=[], prefix_operators=[], qualifier=Position, selectors=[], type_arguments=None)], member=setPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['BOTTOM'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=2)], member=below, postfix_operators=[], prefix_operators=[], qualifier=Position, selectors=[], type_arguments=None)], member=setPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['LEFT'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=2)], member=leftOf, postfix_operators=[], prefix_operators=[], qualifier=Position, selectors=[], type_arguments=None)], member=setPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['RIGHT'], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=container, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=2)], member=rightOf, postfix_operators=[], prefix_operators=[], qualifier=Position, selectors=[], type_arguments=None)], member=setPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=tabPosition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tabContainer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setupTabContainer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=listTabs, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tabContainer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UIContainer, sub_type=None))), label=None) call[.calculateTabPosition, parameter[]] if[binary_operation[member[.activeTab], !=, literal[null]]] begin[{] local_variable[type[UITab], tab] assign[member[.activeTab], literal[null]] call[.setActiveTab, parameter[member[.tab]]] else begin[{] None end[}] if[member[.displace]] begin[{] call[attachedContainer.setPosition, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=position, postfix_operators=[], prefix_operators=[], qualifier=attachedContainer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AttachedContainerPosition, sub_type=None))]] call[attachedContainer.setSize, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=attachedContainer, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AttachedContainerSize, sub_type=None))]] else begin[{] None end[}] return[THIS[]] end[}] END[}]
Keyword[public] identifier[UITabGroup] identifier[attachTo] operator[SEP] identifier[UIContainer] identifier[container] , Keyword[boolean] identifier[displace] operator[SEP] { identifier[attachedContainer] operator[=] identifier[container] operator[SEP] Keyword[if] operator[SEP] identifier[activeTab] operator[!=] Other[null] operator[SEP] identifier[activeTab] operator[SEP] identifier[setActive] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[tabPosition] operator[SEP] { Keyword[case] identifier[TOP] operator[:] identifier[setPosition] operator[SEP] identifier[Position] operator[SEP] identifier[above] operator[SEP] Keyword[this] , identifier[container] , operator[-] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[BOTTOM] operator[:] identifier[setPosition] operator[SEP] identifier[Position] operator[SEP] identifier[below] operator[SEP] Keyword[this] , identifier[container] , operator[-] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[LEFT] operator[:] identifier[setPosition] operator[SEP] identifier[Position] operator[SEP] identifier[leftOf] operator[SEP] Keyword[this] , identifier[container] , operator[-] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[RIGHT] operator[:] identifier[setPosition] operator[SEP] identifier[Position] operator[SEP] identifier[rightOf] operator[SEP] Keyword[this] , identifier[container] , operator[-] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[for] operator[SEP] identifier[UIContainer] identifier[tabContainer] operator[:] identifier[listTabs] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[setupTabContainer] operator[SEP] identifier[tabContainer] operator[SEP] operator[SEP] identifier[calculateTabPosition] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[activeTab] operator[!=] Other[null] operator[SEP] { identifier[UITab] identifier[tab] operator[=] identifier[activeTab] operator[SEP] identifier[activeTab] operator[=] Other[null] operator[SEP] identifier[setActiveTab] operator[SEP] identifier[tab] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[displace] operator[SEP] { identifier[attachedContainer] operator[SEP] identifier[setPosition] operator[SEP] Keyword[new] identifier[AttachedContainerPosition] operator[SEP] identifier[attachedContainer] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[attachedContainer] operator[SEP] identifier[setSize] operator[SEP] Keyword[new] identifier[AttachedContainerSize] operator[SEP] identifier[attachedContainer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private static Map<String, Type> flatten(Schema schema) throws SchemaConversionException { Map<String, Type> flattened = new LinkedHashMap<>(); Schema recordSchema = determineType(schema); Preconditions.checkArgument(Type.RECORD.equals(recordSchema.getType()), "%s is expected. Schema: %s", Type.RECORD, recordSchema); for (Field f : recordSchema.getFields()) { produceFlattenedHelper(f, flattened); } return flattened; }
class class_name[name] begin[{] method[flatten, return_type[type[Map]], modifier[private static], parameter[schema]] begin[{] local_variable[type[Map], flattened] local_variable[type[Schema], recordSchema] call[Preconditions.checkArgument, parameter[call[Type.RECORD.equals, parameter[call[recordSchema.getType, parameter[]]]], literal["%s is expected. Schema: %s"], member[Type.RECORD], member[.recordSchema]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=flattened, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=produceFlattenedHelper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getFields, postfix_operators=[], prefix_operators=[], qualifier=recordSchema, selectors=[], type_arguments=None), 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) return[member[.flattened]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Type] operator[>] identifier[flatten] operator[SEP] identifier[Schema] identifier[schema] operator[SEP] Keyword[throws] identifier[SchemaConversionException] { identifier[Map] operator[<] identifier[String] , identifier[Type] operator[>] identifier[flattened] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Schema] identifier[recordSchema] operator[=] identifier[determineType] operator[SEP] identifier[schema] operator[SEP] operator[SEP] identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[Type] operator[SEP] identifier[RECORD] operator[SEP] identifier[equals] operator[SEP] identifier[recordSchema] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] , literal[String] , identifier[Type] operator[SEP] identifier[RECORD] , identifier[recordSchema] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[f] operator[:] identifier[recordSchema] operator[SEP] identifier[getFields] operator[SEP] operator[SEP] operator[SEP] { identifier[produceFlattenedHelper] operator[SEP] identifier[f] , identifier[flattened] operator[SEP] operator[SEP] } Keyword[return] identifier[flattened] operator[SEP] }
public void setIssuers(Collection<X500Principal> issuers) { if ((issuers == null) || issuers.isEmpty()) { issuerNames = null; issuerX500Principals = null; } else { // clone issuerX500Principals = new HashSet<X500Principal>(issuers); issuerNames = new HashSet<Object>(); for (X500Principal p : issuerX500Principals) { issuerNames.add(p.getEncoded()); } } }
class class_name[name] begin[{] method[setIssuers, return_type[void], modifier[public], parameter[issuers]] begin[{] if[binary_operation[binary_operation[member[.issuers], ==, literal[null]], ||, call[issuers.isEmpty, parameter[]]]] begin[{] assign[member[.issuerNames], literal[null]] assign[member[.issuerX500Principals], literal[null]] else begin[{] assign[member[.issuerX500Principals], ClassCreator(arguments=[MemberReference(member=issuers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=X500Principal, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))] assign[member[.issuerNames], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEncoded, postfix_operators=[], prefix_operators=[], qualifier=p, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=issuerNames, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=issuerX500Principals, 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=X500Principal, sub_type=None))), label=None) end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setIssuers] operator[SEP] identifier[Collection] operator[<] identifier[X500Principal] operator[>] identifier[issuers] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[issuers] operator[==] Other[null] operator[SEP] operator[||] identifier[issuers] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[issuerNames] operator[=] Other[null] operator[SEP] identifier[issuerX500Principals] operator[=] Other[null] operator[SEP] } Keyword[else] { identifier[issuerX500Principals] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[X500Principal] operator[>] operator[SEP] identifier[issuers] operator[SEP] operator[SEP] identifier[issuerNames] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[X500Principal] identifier[p] operator[:] identifier[issuerX500Principals] operator[SEP] { identifier[issuerNames] operator[SEP] identifier[add] operator[SEP] identifier[p] operator[SEP] identifier[getEncoded] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } }
public ViewTransitionBuilder transitViewGroup(@NonNull final ViewGroupTransition viewGroupTransition, @NonNull final Cascade cascade) { transitViewGroup(new ViewGroupTransition() { @Override public void transit(ViewTransitionBuilder builder, ViewGroupTransitionConfig config) { cascade.transit(builder, config); //sets up builder.range() viewGroupTransition.transit(builder, config); } }); return self(); }
class class_name[name] begin[{] method[transitViewGroup, return_type[type[ViewTransitionBuilder]], modifier[public], parameter[viewGroupTransition, cascade]] begin[{] call[.transitViewGroup, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transit, postfix_operators=[], prefix_operators=[], qualifier=cascade, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=transit, postfix_operators=[], prefix_operators=[], qualifier=viewGroupTransition, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=transit, parameters=[FormalParameter(annotations=[], modifiers=set(), name=builder, type=ReferenceType(arguments=None, dimensions=[], name=ViewTransitionBuilder, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=config, type=ReferenceType(arguments=None, dimensions=[], name=ViewGroupTransitionConfig, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ViewGroupTransition, sub_type=None))]] return[call[.self, parameter[]]] end[}] END[}]
Keyword[public] identifier[ViewTransitionBuilder] identifier[transitViewGroup] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[ViewGroupTransition] identifier[viewGroupTransition] , annotation[@] identifier[NonNull] Keyword[final] identifier[Cascade] identifier[cascade] operator[SEP] { identifier[transitViewGroup] operator[SEP] Keyword[new] identifier[ViewGroupTransition] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[transit] operator[SEP] identifier[ViewTransitionBuilder] identifier[builder] , identifier[ViewGroupTransitionConfig] identifier[config] operator[SEP] { identifier[cascade] operator[SEP] identifier[transit] operator[SEP] identifier[builder] , identifier[config] operator[SEP] operator[SEP] identifier[viewGroupTransition] operator[SEP] identifier[transit] operator[SEP] identifier[builder] , identifier[config] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] Keyword[return] identifier[self] operator[SEP] operator[SEP] operator[SEP] }
public final EObject ruleXBlockExpression() throws RecognitionException { EObject current = null; Token otherlv_1=null; Token otherlv_3=null; Token otherlv_4=null; EObject lv_expressions_2_0 = null; enterRule(); try { // InternalXbaseWithAnnotations.g:4239:2: ( ( () otherlv_1= '{' ( ( (lv_expressions_2_0= ruleXExpressionOrVarDeclaration ) ) (otherlv_3= ';' )? )* otherlv_4= '}' ) ) // InternalXbaseWithAnnotations.g:4240:2: ( () otherlv_1= '{' ( ( (lv_expressions_2_0= ruleXExpressionOrVarDeclaration ) ) (otherlv_3= ';' )? )* otherlv_4= '}' ) { // InternalXbaseWithAnnotations.g:4240:2: ( () otherlv_1= '{' ( ( (lv_expressions_2_0= ruleXExpressionOrVarDeclaration ) ) (otherlv_3= ';' )? )* otherlv_4= '}' ) // InternalXbaseWithAnnotations.g:4241:3: () otherlv_1= '{' ( ( (lv_expressions_2_0= ruleXExpressionOrVarDeclaration ) ) (otherlv_3= ';' )? )* otherlv_4= '}' { // InternalXbaseWithAnnotations.g:4241:3: () // InternalXbaseWithAnnotations.g:4242:4: { if ( state.backtracking==0 ) { current = forceCreateModelElement( grammarAccess.getXBlockExpressionAccess().getXBlockExpressionAction_0(), current); } } otherlv_1=(Token)match(input,55,FOLLOW_62); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(otherlv_1, grammarAccess.getXBlockExpressionAccess().getLeftCurlyBracketKeyword_1()); } // InternalXbaseWithAnnotations.g:4252:3: ( ( (lv_expressions_2_0= ruleXExpressionOrVarDeclaration ) ) (otherlv_3= ';' )? )* loop73: do { int alt73=2; int LA73_0 = input.LA(1); if ( ((LA73_0>=RULE_STRING && LA73_0<=RULE_ID)||LA73_0==14||(LA73_0>=18 && LA73_0<=19)||LA73_0==26||(LA73_0>=42 && LA73_0<=43)||LA73_0==48||LA73_0==55||LA73_0==59||LA73_0==61||(LA73_0>=65 && LA73_0<=82)||LA73_0==84) ) { alt73=1; } switch (alt73) { case 1 : // InternalXbaseWithAnnotations.g:4253:4: ( (lv_expressions_2_0= ruleXExpressionOrVarDeclaration ) ) (otherlv_3= ';' )? { // InternalXbaseWithAnnotations.g:4253:4: ( (lv_expressions_2_0= ruleXExpressionOrVarDeclaration ) ) // InternalXbaseWithAnnotations.g:4254:5: (lv_expressions_2_0= ruleXExpressionOrVarDeclaration ) { // InternalXbaseWithAnnotations.g:4254:5: (lv_expressions_2_0= ruleXExpressionOrVarDeclaration ) // InternalXbaseWithAnnotations.g:4255:6: lv_expressions_2_0= ruleXExpressionOrVarDeclaration { if ( state.backtracking==0 ) { newCompositeNode(grammarAccess.getXBlockExpressionAccess().getExpressionsXExpressionOrVarDeclarationParserRuleCall_2_0_0()); } pushFollow(FOLLOW_63); lv_expressions_2_0=ruleXExpressionOrVarDeclaration(); state._fsp--; if (state.failed) return current; if ( state.backtracking==0 ) { if (current==null) { current = createModelElementForParent(grammarAccess.getXBlockExpressionRule()); } add( current, "expressions", lv_expressions_2_0, "org.eclipse.xtext.xbase.Xbase.XExpressionOrVarDeclaration"); afterParserOrEnumRuleCall(); } } } // InternalXbaseWithAnnotations.g:4272:4: (otherlv_3= ';' )? int alt72=2; int LA72_0 = input.LA(1); if ( (LA72_0==58) ) { alt72=1; } switch (alt72) { case 1 : // InternalXbaseWithAnnotations.g:4273:5: otherlv_3= ';' { otherlv_3=(Token)match(input,58,FOLLOW_62); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(otherlv_3, grammarAccess.getXBlockExpressionAccess().getSemicolonKeyword_2_1()); } } break; } } break; default : break loop73; } } while (true); otherlv_4=(Token)match(input,56,FOLLOW_2); if (state.failed) return current; if ( state.backtracking==0 ) { newLeafNode(otherlv_4, grammarAccess.getXBlockExpressionAccess().getRightCurlyBracketKeyword_3()); } } } if ( state.backtracking==0 ) { leaveRule(); } } catch (RecognitionException re) { recover(input,re); appendSkippedTokens(); } finally { } return current; }
class class_name[name] begin[{] method[ruleXBlockExpression, return_type[type[EObject]], modifier[final public], parameter[]] begin[{] local_variable[type[EObject], current] local_variable[type[Token], otherlv_1] local_variable[type[Token], otherlv_3] local_variable[type[Token], otherlv_4] local_variable[type[EObject], lv_expressions_2_0] call[.enterRule, parameter[]] TryStatement(block=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), 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=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXBlockExpressionAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getXBlockExpressionAction_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forceCreateModelElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]))]), StatementExpression(expression=Assignment(expressionl=MemberReference(member=otherlv_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=55), MemberReference(member=FOLLOW_62, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), 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=otherlv_1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getXBlockExpressionAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getLeftCurlyBracketKeyword_1, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newLeafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), DoStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt73)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA73_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=RULE_STRING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=RULE_ID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=14), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=18), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=19), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=26), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=42), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=43), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=48), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=55), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=59), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=61), operator===), operator=||), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=65), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=82), operator=<=), operator=&&), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=LA73_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=84), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt73, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXBlockExpressionAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getExpressionsXExpressionOrVarDeclarationParserRuleCall_2_0_0, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newCompositeNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_63, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lv_expressions_2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=ruleXExpressionOrVarDeclaration, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getXBlockExpressionRule, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[], type_arguments=None)], member=createModelElementForParent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="expressions"), MemberReference(member=lv_expressions_2_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="org.eclipse.xtext.xbase.Xbase.XExpressionOrVarDeclaration")], member=add, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=afterParserOrEnumRuleCall, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])]), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), name=alt72)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), name=LA72_0)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=LA72_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=58), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt72, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=otherlv_3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=58), MemberReference(member=FOLLOW_62, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), 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=otherlv_3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getXBlockExpressionAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getSemicolonKeyword_2_1, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newLeafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt72, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=loop73, label=None)])], expression=MemberReference(member=alt73, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=loop73), StatementExpression(expression=Assignment(expressionl=MemberReference(member=otherlv_4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=56), MemberReference(member=FOLLOW_2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=match, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Token, sub_type=None))), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=current, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), 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=otherlv_4, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getXBlockExpressionAccess, postfix_operators=[], prefix_operators=[], qualifier=grammarAccess, selectors=[MethodInvocation(arguments=[], member=getRightCurlyBracketKeyword_3, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=newLeafNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))])]), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), 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=[], member=leaveRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=appendSkippedTokens, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None) return[member[.current]] end[}] END[}]
Keyword[public] Keyword[final] identifier[EObject] identifier[ruleXBlockExpression] operator[SEP] operator[SEP] Keyword[throws] identifier[RecognitionException] { identifier[EObject] identifier[current] operator[=] Other[null] operator[SEP] identifier[Token] identifier[otherlv_1] operator[=] Other[null] operator[SEP] identifier[Token] identifier[otherlv_3] operator[=] Other[null] operator[SEP] identifier[Token] identifier[otherlv_4] operator[=] Other[null] operator[SEP] identifier[EObject] identifier[lv_expressions_2_0] operator[=] Other[null] operator[SEP] identifier[enterRule] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { { { { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[current] operator[=] identifier[forceCreateModelElement] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXBlockExpressionAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getXBlockExpressionAction_0] operator[SEP] operator[SEP] , identifier[current] operator[SEP] operator[SEP] } } identifier[otherlv_1] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , Other[55] , identifier[FOLLOW_62] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[newLeafNode] operator[SEP] identifier[otherlv_1] , identifier[grammarAccess] operator[SEP] identifier[getXBlockExpressionAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getLeftCurlyBracketKeyword_1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[loop73] operator[:] Keyword[do] { Keyword[int] identifier[alt73] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA73_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[LA73_0] operator[>=] identifier[RULE_STRING] operator[&&] identifier[LA73_0] operator[<=] identifier[RULE_ID] operator[SEP] operator[||] identifier[LA73_0] operator[==] Other[14] operator[||] operator[SEP] identifier[LA73_0] operator[>=] Other[18] operator[&&] identifier[LA73_0] operator[<=] Other[19] operator[SEP] operator[||] identifier[LA73_0] operator[==] Other[26] operator[||] operator[SEP] identifier[LA73_0] operator[>=] Other[42] operator[&&] identifier[LA73_0] operator[<=] Other[43] operator[SEP] operator[||] identifier[LA73_0] operator[==] Other[48] operator[||] identifier[LA73_0] operator[==] Other[55] operator[||] identifier[LA73_0] operator[==] Other[59] operator[||] identifier[LA73_0] operator[==] Other[61] operator[||] operator[SEP] identifier[LA73_0] operator[>=] Other[65] operator[&&] identifier[LA73_0] operator[<=] Other[82] operator[SEP] operator[||] identifier[LA73_0] operator[==] Other[84] operator[SEP] operator[SEP] { identifier[alt73] operator[=] Other[1] operator[SEP] } Keyword[switch] operator[SEP] identifier[alt73] operator[SEP] { Keyword[case] Other[1] operator[:] { { { Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[newCompositeNode] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXBlockExpressionAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getExpressionsXExpressionOrVarDeclarationParserRuleCall_2_0_0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[pushFollow] operator[SEP] identifier[FOLLOW_63] operator[SEP] operator[SEP] identifier[lv_expressions_2_0] operator[=] identifier[ruleXExpressionOrVarDeclaration] operator[SEP] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[current] operator[==] Other[null] operator[SEP] { identifier[current] operator[=] identifier[createModelElementForParent] operator[SEP] identifier[grammarAccess] operator[SEP] identifier[getXBlockExpressionRule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[add] operator[SEP] identifier[current] , literal[String] , identifier[lv_expressions_2_0] , literal[String] operator[SEP] operator[SEP] identifier[afterParserOrEnumRuleCall] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[int] identifier[alt72] operator[=] Other[2] operator[SEP] Keyword[int] identifier[LA72_0] operator[=] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[LA72_0] operator[==] Other[58] operator[SEP] operator[SEP] { identifier[alt72] operator[=] Other[1] operator[SEP] } Keyword[switch] operator[SEP] identifier[alt72] operator[SEP] { Keyword[case] Other[1] operator[:] { identifier[otherlv_3] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , Other[58] , identifier[FOLLOW_62] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[newLeafNode] operator[SEP] identifier[otherlv_3] , identifier[grammarAccess] operator[SEP] identifier[getXBlockExpressionAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getSemicolonKeyword_2_1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] } } Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] identifier[loop73] operator[SEP] } } Keyword[while] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[otherlv_4] operator[=] operator[SEP] identifier[Token] operator[SEP] identifier[match] operator[SEP] identifier[input] , Other[56] , identifier[FOLLOW_2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[current] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[newLeafNode] operator[SEP] identifier[otherlv_4] , identifier[grammarAccess] operator[SEP] identifier[getXBlockExpressionAccess] operator[SEP] operator[SEP] operator[SEP] identifier[getRightCurlyBracketKeyword_3] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] { identifier[leaveRule] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] { identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[appendSkippedTokens] operator[SEP] operator[SEP] operator[SEP] } Keyword[finally] { } Keyword[return] identifier[current] operator[SEP] }
public void invalidate(String sessionId) { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { StringBuffer sb = new StringBuffer("for app ").append(_sap.getAppName()).append(" id ").append(sessionId); LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[INVALIDATE], sb.toString()); } ISession iSess = _coreHttpSessionManager.getISession(sessionId); if (iSess != null) { IStore iStore = _coreHttpSessionManager.getIStore(); try { iStore.setThreadContext(); synchronized (iSess) { // START PM47941 if (iSess.isValid()) { iSess.invalidate(); } } // END PM47941 } finally { iStore.unsetThreadContext(); } } if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[INVALIDATE]); } }
class class_name[name] begin[{] method[invalidate, return_type[void], modifier[public], parameter[sessionId]] begin[{] if[binary_operation[call[com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[LoggingUtil.SESSION_LOGGER_CORE.isLoggable, parameter[member[Level.FINE]]]]] begin[{] local_variable[type[StringBuffer], sb] call[LoggingUtil.SESSION_LOGGER_CORE.entering, parameter[member[.methodClassName], member[.methodNames], call[sb.toString, parameter[]]]] else begin[{] None end[}] local_variable[type[ISession], iSess] if[binary_operation[member[.iSess], !=, literal[null]]] begin[{] local_variable[type[IStore], iStore] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=setThreadContext, postfix_operators=[], prefix_operators=[], qualifier=iStore, selectors=[], type_arguments=None), label=None), SynchronizedStatement(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isValid, postfix_operators=[], prefix_operators=[], qualifier=iSess, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=invalidate, postfix_operators=[], prefix_operators=[], qualifier=iSess, selectors=[], type_arguments=None), label=None)]))], label=None, lock=MemberReference(member=iSess, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=unsetThreadContext, postfix_operators=[], prefix_operators=[], qualifier=iStore, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] if[binary_operation[call[com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[LoggingUtil.SESSION_LOGGER_CORE.isLoggable, parameter[member[Level.FINE]]]]] begin[{] call[LoggingUtil.SESSION_LOGGER_CORE.exiting, parameter[member[.methodClassName], member[.methodNames]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[invalidate] operator[SEP] identifier[String] identifier[sessionId] operator[SEP] { Keyword[if] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ejs] operator[SEP] identifier[ras] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[LoggingUtil] operator[SEP] identifier[SESSION_LOGGER_CORE] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[StringBuffer] identifier[sb] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[_sap] operator[SEP] identifier[getAppName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] identifier[LoggingUtil] operator[SEP] identifier[SESSION_LOGGER_CORE] operator[SEP] identifier[entering] operator[SEP] identifier[methodClassName] , identifier[methodNames] operator[SEP] identifier[INVALIDATE] operator[SEP] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ISession] identifier[iSess] operator[=] identifier[_coreHttpSessionManager] operator[SEP] identifier[getISession] operator[SEP] identifier[sessionId] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iSess] operator[!=] Other[null] operator[SEP] { identifier[IStore] identifier[iStore] operator[=] identifier[_coreHttpSessionManager] operator[SEP] identifier[getIStore] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[iStore] operator[SEP] identifier[setThreadContext] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[iSess] operator[SEP] { Keyword[if] operator[SEP] identifier[iSess] operator[SEP] identifier[isValid] operator[SEP] operator[SEP] operator[SEP] { identifier[iSess] operator[SEP] identifier[invalidate] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[finally] { identifier[iStore] operator[SEP] identifier[unsetThreadContext] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ejs] operator[SEP] identifier[ras] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[LoggingUtil] operator[SEP] identifier[SESSION_LOGGER_CORE] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[LoggingUtil] operator[SEP] identifier[SESSION_LOGGER_CORE] operator[SEP] identifier[exiting] operator[SEP] identifier[methodClassName] , identifier[methodNames] operator[SEP] identifier[INVALIDATE] operator[SEP] operator[SEP] operator[SEP] } }
public static X509Certificate mitmDuplicateCertificate(final X509Certificate originalCert, final PublicKey newPubKey, final X509Certificate caCert, final PrivateKey caPrivateKey, Set<String> extensionOidsNotToCopy) throws CertificateParsingException, SignatureException, InvalidKeyException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException { if(extensionOidsNotToCopy == null) { extensionOidsNotToCopy = new HashSet<String>(); } X509V3CertificateGenerator v3CertGen = new X509V3CertificateGenerator(); v3CertGen.setSubjectDN(originalCert.getSubjectX500Principal()); v3CertGen.setSignatureAlgorithm(CertificateCreator.SIGN_ALGO); // needs to be the same as the signing cert, not the copied cert v3CertGen.setPublicKey(newPubKey); v3CertGen.setNotAfter(originalCert.getNotAfter()); v3CertGen.setNotBefore(originalCert.getNotBefore()); v3CertGen.setIssuerDN(caCert.getSubjectX500Principal()); v3CertGen.setSerialNumber(originalCert.getSerialNumber()); // copy other extensions: Set<String> critExts = originalCert.getCriticalExtensionOIDs(); // get extensions returns null, not an empty set! if(critExts != null) { for (String oid : critExts) { if(!clientCertOidsNeverToCopy.contains(oid) && !extensionOidsNotToCopy.contains(oid)) { v3CertGen.copyAndAddExtension(new DERObjectIdentifier(oid), true, originalCert); } } } Set<String> nonCritExs = originalCert.getNonCriticalExtensionOIDs(); if(nonCritExs != null) { for(String oid: nonCritExs) { if(!clientCertOidsNeverToCopy.contains(oid) && !extensionOidsNotToCopy.contains(oid)){ v3CertGen.copyAndAddExtension(new DERObjectIdentifier(oid), false, originalCert); } } } v3CertGen.addExtension( X509Extensions.SubjectKeyIdentifier, false, new SubjectKeyIdentifierStructure(newPubKey)); v3CertGen.addExtension( X509Extensions.AuthorityKeyIdentifier, false, new AuthorityKeyIdentifierStructure(caCert.getPublicKey())); X509Certificate cert = v3CertGen.generate(caPrivateKey, "BC"); // For debugging purposes. //cert.checkValidity(new Date()); //cert.verify(caCert.getPublicKey()); return cert; }
class class_name[name] begin[{] method[mitmDuplicateCertificate, return_type[type[X509Certificate]], modifier[public static], parameter[originalCert, newPubKey, caCert, caPrivateKey, extensionOidsNotToCopy]] begin[{] if[binary_operation[member[.extensionOidsNotToCopy], ==, literal[null]]] begin[{] assign[member[.extensionOidsNotToCopy], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))] else begin[{] None end[}] local_variable[type[X509V3CertificateGenerator], v3CertGen] call[v3CertGen.setSubjectDN, parameter[call[originalCert.getSubjectX500Principal, parameter[]]]] call[v3CertGen.setSignatureAlgorithm, parameter[member[CertificateCreator.SIGN_ALGO]]] call[v3CertGen.setPublicKey, parameter[member[.newPubKey]]] call[v3CertGen.setNotAfter, parameter[call[originalCert.getNotAfter, parameter[]]]] call[v3CertGen.setNotBefore, parameter[call[originalCert.getNotBefore, parameter[]]]] call[v3CertGen.setIssuerDN, parameter[call[caCert.getSubjectX500Principal, parameter[]]]] call[v3CertGen.setSerialNumber, parameter[call[originalCert.getSerialNumber, parameter[]]]] local_variable[type[Set], critExts] if[binary_operation[member[.critExts], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=clientCertOidsNeverToCopy, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=extensionOidsNotToCopy, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=oid, 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=DERObjectIdentifier, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), MemberReference(member=originalCert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyAndAddExtension, postfix_operators=[], prefix_operators=[], qualifier=v3CertGen, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=critExts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=oid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] local_variable[type[Set], nonCritExs] if[binary_operation[member[.nonCritExs], !=, literal[null]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=clientCertOidsNeverToCopy, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=oid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=contains, postfix_operators=[], prefix_operators=['!'], qualifier=extensionOidsNotToCopy, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=oid, 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=DERObjectIdentifier, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=originalCert, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyAndAddExtension, postfix_operators=[], prefix_operators=[], qualifier=v3CertGen, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=nonCritExs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=oid)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] call[v3CertGen.addExtension, parameter[member[X509Extensions.SubjectKeyIdentifier], literal[false], ClassCreator(arguments=[MemberReference(member=newPubKey, 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=SubjectKeyIdentifierStructure, sub_type=None))]] call[v3CertGen.addExtension, parameter[member[X509Extensions.AuthorityKeyIdentifier], literal[false], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getPublicKey, postfix_operators=[], prefix_operators=[], qualifier=caCert, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AuthorityKeyIdentifierStructure, sub_type=None))]] local_variable[type[X509Certificate], cert] return[member[.cert]] end[}] END[}]
Keyword[public] Keyword[static] identifier[X509Certificate] identifier[mitmDuplicateCertificate] operator[SEP] Keyword[final] identifier[X509Certificate] identifier[originalCert] , Keyword[final] identifier[PublicKey] identifier[newPubKey] , Keyword[final] identifier[X509Certificate] identifier[caCert] , Keyword[final] identifier[PrivateKey] identifier[caPrivateKey] , identifier[Set] operator[<] identifier[String] operator[>] identifier[extensionOidsNotToCopy] operator[SEP] Keyword[throws] identifier[CertificateParsingException] , identifier[SignatureException] , identifier[InvalidKeyException] , identifier[CertificateException] , identifier[NoSuchAlgorithmException] , identifier[NoSuchProviderException] { Keyword[if] operator[SEP] identifier[extensionOidsNotToCopy] operator[==] Other[null] operator[SEP] { identifier[extensionOidsNotToCopy] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[X509V3CertificateGenerator] identifier[v3CertGen] operator[=] Keyword[new] identifier[X509V3CertificateGenerator] operator[SEP] operator[SEP] operator[SEP] identifier[v3CertGen] operator[SEP] identifier[setSubjectDN] operator[SEP] identifier[originalCert] operator[SEP] identifier[getSubjectX500Principal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[v3CertGen] operator[SEP] identifier[setSignatureAlgorithm] operator[SEP] identifier[CertificateCreator] operator[SEP] identifier[SIGN_ALGO] operator[SEP] operator[SEP] identifier[v3CertGen] operator[SEP] identifier[setPublicKey] operator[SEP] identifier[newPubKey] operator[SEP] operator[SEP] identifier[v3CertGen] operator[SEP] identifier[setNotAfter] operator[SEP] identifier[originalCert] operator[SEP] identifier[getNotAfter] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[v3CertGen] operator[SEP] identifier[setNotBefore] operator[SEP] identifier[originalCert] operator[SEP] identifier[getNotBefore] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[v3CertGen] operator[SEP] identifier[setIssuerDN] operator[SEP] identifier[caCert] operator[SEP] identifier[getSubjectX500Principal] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[v3CertGen] operator[SEP] identifier[setSerialNumber] operator[SEP] identifier[originalCert] operator[SEP] identifier[getSerialNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[critExts] operator[=] identifier[originalCert] operator[SEP] identifier[getCriticalExtensionOIDs] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[critExts] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[oid] operator[:] identifier[critExts] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[clientCertOidsNeverToCopy] operator[SEP] identifier[contains] operator[SEP] identifier[oid] operator[SEP] operator[&&] operator[!] identifier[extensionOidsNotToCopy] operator[SEP] identifier[contains] operator[SEP] identifier[oid] operator[SEP] operator[SEP] { identifier[v3CertGen] operator[SEP] identifier[copyAndAddExtension] operator[SEP] Keyword[new] identifier[DERObjectIdentifier] operator[SEP] identifier[oid] operator[SEP] , literal[boolean] , identifier[originalCert] operator[SEP] operator[SEP] } } } identifier[Set] operator[<] identifier[String] operator[>] identifier[nonCritExs] operator[=] identifier[originalCert] operator[SEP] identifier[getNonCriticalExtensionOIDs] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nonCritExs] operator[!=] Other[null] operator[SEP] { Keyword[for] operator[SEP] identifier[String] identifier[oid] operator[:] identifier[nonCritExs] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[clientCertOidsNeverToCopy] operator[SEP] identifier[contains] operator[SEP] identifier[oid] operator[SEP] operator[&&] operator[!] identifier[extensionOidsNotToCopy] operator[SEP] identifier[contains] operator[SEP] identifier[oid] operator[SEP] operator[SEP] { identifier[v3CertGen] operator[SEP] identifier[copyAndAddExtension] operator[SEP] Keyword[new] identifier[DERObjectIdentifier] operator[SEP] identifier[oid] operator[SEP] , literal[boolean] , identifier[originalCert] operator[SEP] operator[SEP] } } } identifier[v3CertGen] operator[SEP] identifier[addExtension] operator[SEP] identifier[X509Extensions] operator[SEP] identifier[SubjectKeyIdentifier] , literal[boolean] , Keyword[new] identifier[SubjectKeyIdentifierStructure] operator[SEP] identifier[newPubKey] operator[SEP] operator[SEP] operator[SEP] identifier[v3CertGen] operator[SEP] identifier[addExtension] operator[SEP] identifier[X509Extensions] operator[SEP] identifier[AuthorityKeyIdentifier] , literal[boolean] , Keyword[new] identifier[AuthorityKeyIdentifierStructure] operator[SEP] identifier[caCert] operator[SEP] identifier[getPublicKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[X509Certificate] identifier[cert] operator[=] identifier[v3CertGen] operator[SEP] identifier[generate] operator[SEP] identifier[caPrivateKey] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[cert] operator[SEP] }
public UpdateAppRequest withEnvironment(EnvironmentVariable... environment) { if (this.environment == null) { setEnvironment(new com.amazonaws.internal.SdkInternalList<EnvironmentVariable>(environment.length)); } for (EnvironmentVariable ele : environment) { this.environment.add(ele); } return this; }
class class_name[name] begin[{] method[withEnvironment, return_type[type[UpdateAppRequest]], modifier[public], parameter[environment]] begin[{] if[binary_operation[THIS[member[None.environment]], ==, literal[null]]] begin[{] call[.setEnvironment, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=environment, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=EnvironmentVariable, sub_type=None))], dimensions=None, name=SdkInternalList, 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=environment, 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=environment, 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=EnvironmentVariable, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[UpdateAppRequest] identifier[withEnvironment] operator[SEP] identifier[EnvironmentVariable] operator[...] identifier[environment] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[environment] operator[==] Other[null] operator[SEP] { identifier[setEnvironment] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[EnvironmentVariable] operator[>] operator[SEP] identifier[environment] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[EnvironmentVariable] identifier[ele] operator[:] identifier[environment] operator[SEP] { Keyword[this] operator[SEP] identifier[environment] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public V getQuietly(Object key) { final Node node = data.get(key); return (node == null) ? null : node.getValue(); }
class class_name[name] begin[{] method[getQuietly, return_type[type[V]], modifier[public], parameter[key]] begin[{] local_variable[type[Node], node] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[V] identifier[getQuietly] operator[SEP] identifier[Object] identifier[key] operator[SEP] { Keyword[final] identifier[Node] identifier[node] operator[=] identifier[data] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[node] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[node] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] }
private void escapeValueTo(final String field, final StringBuilder target) { if (field == null) { target.append(DETAILS_QUOTE_CHAR); target.append(DETAILS_QUOTE_CHAR); return; } target.append(DETAILS_QUOTE_CHAR); if (field.indexOf(DETAILS_ESCAPE_CHAR) == -1 && field.indexOf(DETAILS_QUOTE_CHAR) == -1) { target.append(field); } else { final int len = field.length(); for (int i = 0; i < len; i++) { final char charAt = field.charAt(i); if (charAt == DETAILS_ESCAPE_CHAR || charAt == DETAILS_QUOTE_CHAR) { target.append(DETAILS_ESCAPE_CHAR); } target.append(charAt); } } target.append(DETAILS_QUOTE_CHAR); }
class class_name[name] begin[{] method[escapeValueTo, return_type[void], modifier[private], parameter[field, target]] begin[{] if[binary_operation[member[.field], ==, literal[null]]] begin[{] call[target.append, parameter[member[.DETAILS_QUOTE_CHAR]]] call[target.append, parameter[member[.DETAILS_QUOTE_CHAR]]] return[None] else begin[{] None end[}] call[target.append, parameter[member[.DETAILS_QUOTE_CHAR]]] if[binary_operation[binary_operation[call[field.indexOf, parameter[member[.DETAILS_ESCAPE_CHAR]]], ==, literal[1]], &&, binary_operation[call[field.indexOf, parameter[member[.DETAILS_QUOTE_CHAR]]], ==, literal[1]]]] begin[{] call[target.append, parameter[member[.field]]] else begin[{] local_variable[type[int], len] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), name=charAt)], modifiers={'final'}, type=BasicType(dimensions=[], name=char)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=charAt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DETAILS_ESCAPE_CHAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operandr=BinaryOperation(operandl=MemberReference(member=charAt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=DETAILS_QUOTE_CHAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DETAILS_ESCAPE_CHAR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=charAt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, 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=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] call[target.append, parameter[member[.DETAILS_QUOTE_CHAR]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[escapeValueTo] operator[SEP] Keyword[final] identifier[String] identifier[field] , Keyword[final] identifier[StringBuilder] identifier[target] operator[SEP] { Keyword[if] operator[SEP] identifier[field] operator[==] Other[null] operator[SEP] { identifier[target] operator[SEP] identifier[append] operator[SEP] identifier[DETAILS_QUOTE_CHAR] operator[SEP] operator[SEP] identifier[target] operator[SEP] identifier[append] operator[SEP] identifier[DETAILS_QUOTE_CHAR] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } identifier[target] operator[SEP] identifier[append] operator[SEP] identifier[DETAILS_QUOTE_CHAR] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[SEP] identifier[indexOf] operator[SEP] identifier[DETAILS_ESCAPE_CHAR] operator[SEP] operator[==] operator[-] Other[1] operator[&&] identifier[field] operator[SEP] identifier[indexOf] operator[SEP] identifier[DETAILS_QUOTE_CHAR] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] { identifier[target] operator[SEP] identifier[append] operator[SEP] identifier[field] operator[SEP] operator[SEP] } Keyword[else] { Keyword[final] Keyword[int] identifier[len] operator[=] identifier[field] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] Keyword[char] identifier[charAt] operator[=] identifier[field] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[charAt] operator[==] identifier[DETAILS_ESCAPE_CHAR] operator[||] identifier[charAt] operator[==] identifier[DETAILS_QUOTE_CHAR] operator[SEP] { identifier[target] operator[SEP] identifier[append] operator[SEP] identifier[DETAILS_ESCAPE_CHAR] operator[SEP] operator[SEP] } identifier[target] operator[SEP] identifier[append] operator[SEP] identifier[charAt] operator[SEP] operator[SEP] } } identifier[target] operator[SEP] identifier[append] operator[SEP] identifier[DETAILS_QUOTE_CHAR] operator[SEP] operator[SEP] }
public void marshall(ScheduledAction scheduledAction, ProtocolMarshaller protocolMarshaller) { if (scheduledAction == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(scheduledAction.getScheduledActionName(), SCHEDULEDACTIONNAME_BINDING); protocolMarshaller.marshall(scheduledAction.getScheduledActionARN(), SCHEDULEDACTIONARN_BINDING); protocolMarshaller.marshall(scheduledAction.getServiceNamespace(), SERVICENAMESPACE_BINDING); protocolMarshaller.marshall(scheduledAction.getSchedule(), SCHEDULE_BINDING); protocolMarshaller.marshall(scheduledAction.getResourceId(), RESOURCEID_BINDING); protocolMarshaller.marshall(scheduledAction.getScalableDimension(), SCALABLEDIMENSION_BINDING); protocolMarshaller.marshall(scheduledAction.getStartTime(), STARTTIME_BINDING); protocolMarshaller.marshall(scheduledAction.getEndTime(), ENDTIME_BINDING); protocolMarshaller.marshall(scheduledAction.getScalableTargetAction(), SCALABLETARGETACTION_BINDING); protocolMarshaller.marshall(scheduledAction.getCreationTime(), CREATIONTIME_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[scheduledAction, protocolMarshaller]] begin[{] if[binary_operation[member[.scheduledAction], ==, 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=getScheduledActionName, postfix_operators=[], prefix_operators=[], qualifier=scheduledAction, selectors=[], type_arguments=None), MemberReference(member=SCHEDULEDACTIONNAME_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=getScheduledActionARN, postfix_operators=[], prefix_operators=[], qualifier=scheduledAction, selectors=[], type_arguments=None), MemberReference(member=SCHEDULEDACTIONARN_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=getServiceNamespace, postfix_operators=[], prefix_operators=[], qualifier=scheduledAction, selectors=[], type_arguments=None), MemberReference(member=SERVICENAMESPACE_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=getSchedule, postfix_operators=[], prefix_operators=[], qualifier=scheduledAction, selectors=[], type_arguments=None), MemberReference(member=SCHEDULE_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=getResourceId, postfix_operators=[], prefix_operators=[], qualifier=scheduledAction, selectors=[], type_arguments=None), MemberReference(member=RESOURCEID_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=getScalableDimension, postfix_operators=[], prefix_operators=[], qualifier=scheduledAction, selectors=[], type_arguments=None), MemberReference(member=SCALABLEDIMENSION_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=getStartTime, postfix_operators=[], prefix_operators=[], qualifier=scheduledAction, selectors=[], type_arguments=None), MemberReference(member=STARTTIME_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=getEndTime, postfix_operators=[], prefix_operators=[], qualifier=scheduledAction, selectors=[], type_arguments=None), MemberReference(member=ENDTIME_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=getScalableTargetAction, postfix_operators=[], prefix_operators=[], qualifier=scheduledAction, selectors=[], type_arguments=None), MemberReference(member=SCALABLETARGETACTION_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=getCreationTime, postfix_operators=[], prefix_operators=[], qualifier=scheduledAction, selectors=[], type_arguments=None), MemberReference(member=CREATIONTIME_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[ScheduledAction] identifier[scheduledAction] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[scheduledAction] 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[scheduledAction] operator[SEP] identifier[getScheduledActionName] operator[SEP] operator[SEP] , identifier[SCHEDULEDACTIONNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[scheduledAction] operator[SEP] identifier[getScheduledActionARN] operator[SEP] operator[SEP] , identifier[SCHEDULEDACTIONARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[scheduledAction] operator[SEP] identifier[getServiceNamespace] operator[SEP] operator[SEP] , identifier[SERVICENAMESPACE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[scheduledAction] operator[SEP] identifier[getSchedule] operator[SEP] operator[SEP] , identifier[SCHEDULE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[scheduledAction] operator[SEP] identifier[getResourceId] operator[SEP] operator[SEP] , identifier[RESOURCEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[scheduledAction] operator[SEP] identifier[getScalableDimension] operator[SEP] operator[SEP] , identifier[SCALABLEDIMENSION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[scheduledAction] operator[SEP] identifier[getStartTime] operator[SEP] operator[SEP] , identifier[STARTTIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[scheduledAction] operator[SEP] identifier[getEndTime] operator[SEP] operator[SEP] , identifier[ENDTIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[scheduledAction] operator[SEP] identifier[getScalableTargetAction] operator[SEP] operator[SEP] , identifier[SCALABLETARGETACTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[scheduledAction] operator[SEP] identifier[getCreationTime] operator[SEP] operator[SEP] , identifier[CREATIONTIME_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 String schedule(String pattern, Task task) { String id = UUID.randomUUID().toString(); schedule(id, pattern, task); return id; }
class class_name[name] begin[{] method[schedule, return_type[type[String]], modifier[public], parameter[pattern, task]] begin[{] local_variable[type[String], id] call[.schedule, parameter[member[.id], member[.pattern], member[.task]]] return[member[.id]] end[}] END[}]
Keyword[public] identifier[String] identifier[schedule] operator[SEP] identifier[String] identifier[pattern] , identifier[Task] identifier[task] operator[SEP] { identifier[String] identifier[id] operator[=] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[schedule] operator[SEP] identifier[id] , identifier[pattern] , identifier[task] operator[SEP] operator[SEP] Keyword[return] identifier[id] operator[SEP] }
private static ImmutableList<String> createRootPaths( Iterable<String> roots, PathResolver resolver, PathEscaper escaper) { // Sort longest length to shortest so that paths are applied most specific to least. Set<String> builder = new TreeSet<>( Comparator.comparingInt(String::length).thenComparing(String::compareTo).reversed()); for (String root : roots) { String rootModuleName = escaper.escape(resolver.apply(root)); if (isAmbiguousIdentifier(rootModuleName)) { rootModuleName = MODULE_SLASH + rootModuleName; } builder.add(rootModuleName); } return ImmutableList.copyOf(builder); }
class class_name[name] begin[{] method[createRootPaths, return_type[type[ImmutableList]], modifier[private static], parameter[roots, resolver, escaper]] begin[{] local_variable[type[Set], builder] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=root, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=apply, postfix_operators=[], prefix_operators=[], qualifier=resolver, selectors=[], type_arguments=None)], member=escape, postfix_operators=[], prefix_operators=[], qualifier=escaper, selectors=[], type_arguments=None), name=rootModuleName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=rootModuleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAmbiguousIdentifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=rootModuleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=MODULE_SLASH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=rootModuleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rootModuleName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=roots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=root)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[call[ImmutableList.copyOf, parameter[member[.builder]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[ImmutableList] operator[<] identifier[String] operator[>] identifier[createRootPaths] operator[SEP] identifier[Iterable] operator[<] identifier[String] operator[>] identifier[roots] , identifier[PathResolver] identifier[resolver] , identifier[PathEscaper] identifier[escaper] operator[SEP] { identifier[Set] operator[<] identifier[String] operator[>] identifier[builder] operator[=] Keyword[new] identifier[TreeSet] operator[<] operator[>] operator[SEP] identifier[Comparator] operator[SEP] identifier[comparingInt] operator[SEP] identifier[String] operator[::] identifier[length] operator[SEP] operator[SEP] identifier[thenComparing] operator[SEP] identifier[String] operator[::] identifier[compareTo] operator[SEP] operator[SEP] identifier[reversed] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[root] operator[:] identifier[roots] operator[SEP] { identifier[String] identifier[rootModuleName] operator[=] identifier[escaper] operator[SEP] identifier[escape] operator[SEP] identifier[resolver] operator[SEP] identifier[apply] operator[SEP] identifier[root] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isAmbiguousIdentifier] operator[SEP] identifier[rootModuleName] operator[SEP] operator[SEP] { identifier[rootModuleName] operator[=] identifier[MODULE_SLASH] operator[+] identifier[rootModuleName] operator[SEP] } identifier[builder] operator[SEP] identifier[add] operator[SEP] identifier[rootModuleName] operator[SEP] operator[SEP] } Keyword[return] identifier[ImmutableList] operator[SEP] identifier[copyOf] operator[SEP] identifier[builder] operator[SEP] operator[SEP] }
public com.squareup.okhttp.Call getDogmaAttributesAttributeIdAsync(Integer attributeId, String datasource, String ifNoneMatch, final ApiCallback<DogmaAttributeResponse> callback) throws ApiException { com.squareup.okhttp.Call call = getDogmaAttributesAttributeIdValidateBeforeCall(attributeId, datasource, ifNoneMatch, callback); Type localVarReturnType = new TypeToken<DogmaAttributeResponse>() { }.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; }
class class_name[name] begin[{] method[getDogmaAttributesAttributeIdAsync, return_type[type[com]], modifier[public], parameter[attributeId, datasource, ifNoneMatch, callback]] begin[{] local_variable[type[com], call] local_variable[type[Type], localVarReturnType] call[apiClient.executeAsync, parameter[member[.call], member[.localVarReturnType], member[.callback]]] return[member[.call]] end[}] END[}]
Keyword[public] identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[getDogmaAttributesAttributeIdAsync] operator[SEP] identifier[Integer] identifier[attributeId] , identifier[String] identifier[datasource] , identifier[String] identifier[ifNoneMatch] , Keyword[final] identifier[ApiCallback] operator[<] identifier[DogmaAttributeResponse] operator[>] identifier[callback] operator[SEP] Keyword[throws] identifier[ApiException] { identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[getDogmaAttributesAttributeIdValidateBeforeCall] operator[SEP] identifier[attributeId] , identifier[datasource] , identifier[ifNoneMatch] , identifier[callback] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[DogmaAttributeResponse] operator[>] operator[SEP] operator[SEP] { } operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[apiClient] operator[SEP] identifier[executeAsync] operator[SEP] identifier[call] , identifier[localVarReturnType] , identifier[callback] operator[SEP] operator[SEP] Keyword[return] identifier[call] operator[SEP] }
public E set(int index, E element) { checkElementIndex(index); Node<E> x = node(index); E oldVal = x.item; x.item = element; return oldVal; }
class class_name[name] begin[{] method[set, return_type[type[E]], modifier[public], parameter[index, element]] begin[{] call[.checkElementIndex, parameter[member[.index]]] local_variable[type[Node], x] local_variable[type[E], oldVal] assign[member[x.item], member[.element]] return[member[.oldVal]] end[}] END[}]
Keyword[public] identifier[E] identifier[set] operator[SEP] Keyword[int] identifier[index] , identifier[E] identifier[element] operator[SEP] { identifier[checkElementIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[Node] operator[<] identifier[E] operator[>] identifier[x] operator[=] identifier[node] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[E] identifier[oldVal] operator[=] identifier[x] operator[SEP] identifier[item] operator[SEP] identifier[x] operator[SEP] identifier[item] operator[=] identifier[element] operator[SEP] Keyword[return] identifier[oldVal] operator[SEP] }
public static String toHex(int d, int width) { return Strings.cutRight(Integer.toHexString(d), width, '0'); }
class class_name[name] begin[{] method[toHex, return_type[type[String]], modifier[public static], parameter[d, width]] begin[{] return[call[Strings.cutRight, parameter[call[Integer.toHexString, parameter[member[.d]]], member[.width], literal['0']]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[toHex] operator[SEP] Keyword[int] identifier[d] , Keyword[int] identifier[width] operator[SEP] { Keyword[return] identifier[Strings] operator[SEP] identifier[cutRight] operator[SEP] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[d] operator[SEP] , identifier[width] , literal[String] operator[SEP] operator[SEP] }
public static <T> Set<T> difference(Set<T> setA, Set<T> setB) { Set<T> difference = new HashSet<T>(setA); difference.removeAll(setB); return difference; }
class class_name[name] begin[{] method[difference, return_type[type[Set]], modifier[public static], parameter[setA, setB]] begin[{] local_variable[type[Set], difference] call[difference.removeAll, parameter[member[.setB]]] return[member[.difference]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Set] operator[<] identifier[T] operator[>] identifier[difference] operator[SEP] identifier[Set] operator[<] identifier[T] operator[>] identifier[setA] , identifier[Set] operator[<] identifier[T] operator[>] identifier[setB] operator[SEP] { identifier[Set] operator[<] identifier[T] operator[>] identifier[difference] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[T] operator[>] operator[SEP] identifier[setA] operator[SEP] operator[SEP] identifier[difference] operator[SEP] identifier[removeAll] operator[SEP] identifier[setB] operator[SEP] operator[SEP] Keyword[return] identifier[difference] operator[SEP] }
@Override public JdbcQueue<ID, DATA> init() throws Exception { SQL_COUNT = MessageFormat.format(SQL_COUNT, getTableName()); SQL_COUNT_EPHEMERAL = MessageFormat.format(SQL_COUNT_EPHEMERAL, getTableNameEphemeral()); if (jdbcHelper == null) { setJdbcHelper(buildJdbcHelper(), true); } super.init(); if (jdbcHelper == null) { throw new IllegalStateException("JDBC helper is null."); } return this; }
class class_name[name] begin[{] method[init, return_type[type[JdbcQueue]], modifier[public], parameter[]] begin[{] assign[member[.SQL_COUNT], call[MessageFormat.format, parameter[member[.SQL_COUNT], call[.getTableName, parameter[]]]]] assign[member[.SQL_COUNT_EPHEMERAL], call[MessageFormat.format, parameter[member[.SQL_COUNT_EPHEMERAL], call[.getTableNameEphemeral, parameter[]]]]] if[binary_operation[member[.jdbcHelper], ==, literal[null]]] begin[{] call[.setJdbcHelper, parameter[call[.buildJdbcHelper, parameter[]], literal[true]]] else begin[{] None end[}] SuperMethodInvocation(arguments=[], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) if[binary_operation[member[.jdbcHelper], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="JDBC helper is null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[JdbcQueue] operator[<] identifier[ID] , identifier[DATA] operator[>] identifier[init] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[SQL_COUNT] operator[=] identifier[MessageFormat] operator[SEP] identifier[format] operator[SEP] identifier[SQL_COUNT] , identifier[getTableName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SQL_COUNT_EPHEMERAL] operator[=] identifier[MessageFormat] operator[SEP] identifier[format] operator[SEP] identifier[SQL_COUNT_EPHEMERAL] , identifier[getTableNameEphemeral] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jdbcHelper] operator[==] Other[null] operator[SEP] { identifier[setJdbcHelper] operator[SEP] identifier[buildJdbcHelper] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] } Keyword[super] operator[SEP] identifier[init] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[jdbcHelper] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
public static boolean isExpression(String text) { text = text.trim(); return text.startsWith("${") || text.startsWith("#{"); }
class class_name[name] begin[{] method[isExpression, return_type[type[boolean]], modifier[public static], parameter[text]] begin[{] assign[member[.text], call[text.trim, parameter[]]] return[binary_operation[call[text.startsWith, parameter[literal["${"]]], ||, call[text.startsWith, parameter[literal["#{"]]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isExpression] operator[SEP] identifier[String] identifier[text] operator[SEP] { identifier[text] operator[=] identifier[text] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[text] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[||] identifier[text] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public static void updateMeasureSpec( Spec spec, float aspectRatio, @Nullable ViewGroup.LayoutParams layoutParams, int widthPadding, int heightPadding) { if (aspectRatio <= 0 || layoutParams == null) { return; } if (shouldAdjust(layoutParams.height)) { int widthSpecSize = View.MeasureSpec.getSize(spec.width); int desiredHeight = (int) ((widthSpecSize - widthPadding) / aspectRatio + heightPadding); int resolvedHeight = View.resolveSize(desiredHeight, spec.height); spec.height = View.MeasureSpec.makeMeasureSpec(resolvedHeight, View.MeasureSpec.EXACTLY); } else if (shouldAdjust(layoutParams.width)) { int heightSpecSize = View.MeasureSpec.getSize(spec.height); int desiredWidth = (int) ((heightSpecSize - heightPadding) * aspectRatio + widthPadding); int resolvedWidth = View.resolveSize(desiredWidth, spec.width); spec.width = View.MeasureSpec.makeMeasureSpec(resolvedWidth, View.MeasureSpec.EXACTLY); } }
class class_name[name] begin[{] method[updateMeasureSpec, return_type[void], modifier[public static], parameter[spec, aspectRatio, layoutParams, widthPadding, heightPadding]] begin[{] if[binary_operation[binary_operation[member[.aspectRatio], <=, literal[0]], ||, binary_operation[member[.layoutParams], ==, literal[null]]]] begin[{] return[None] else begin[{] None end[}] if[call[.shouldAdjust, parameter[member[layoutParams.height]]]] begin[{] local_variable[type[int], widthSpecSize] local_variable[type[int], desiredHeight] local_variable[type[int], resolvedHeight] assign[member[spec.height], call[View.MeasureSpec.makeMeasureSpec, parameter[member[.resolvedHeight], member[View.MeasureSpec.EXACTLY]]]] else begin[{] if[call[.shouldAdjust, parameter[member[layoutParams.width]]]] begin[{] local_variable[type[int], heightSpecSize] local_variable[type[int], desiredWidth] local_variable[type[int], resolvedWidth] assign[member[spec.width], call[View.MeasureSpec.makeMeasureSpec, parameter[member[.resolvedWidth], member[View.MeasureSpec.EXACTLY]]]] else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[updateMeasureSpec] operator[SEP] identifier[Spec] identifier[spec] , Keyword[float] identifier[aspectRatio] , annotation[@] identifier[Nullable] identifier[ViewGroup] operator[SEP] identifier[LayoutParams] identifier[layoutParams] , Keyword[int] identifier[widthPadding] , Keyword[int] identifier[heightPadding] operator[SEP] { Keyword[if] operator[SEP] identifier[aspectRatio] operator[<=] Other[0] operator[||] identifier[layoutParams] operator[==] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[shouldAdjust] operator[SEP] identifier[layoutParams] operator[SEP] identifier[height] operator[SEP] operator[SEP] { Keyword[int] identifier[widthSpecSize] operator[=] identifier[View] operator[SEP] identifier[MeasureSpec] operator[SEP] identifier[getSize] operator[SEP] identifier[spec] operator[SEP] identifier[width] operator[SEP] operator[SEP] Keyword[int] identifier[desiredHeight] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[widthSpecSize] operator[-] identifier[widthPadding] operator[SEP] operator[/] identifier[aspectRatio] operator[+] identifier[heightPadding] operator[SEP] operator[SEP] Keyword[int] identifier[resolvedHeight] operator[=] identifier[View] operator[SEP] identifier[resolveSize] operator[SEP] identifier[desiredHeight] , identifier[spec] operator[SEP] identifier[height] operator[SEP] operator[SEP] identifier[spec] operator[SEP] identifier[height] operator[=] identifier[View] operator[SEP] identifier[MeasureSpec] operator[SEP] identifier[makeMeasureSpec] operator[SEP] identifier[resolvedHeight] , identifier[View] operator[SEP] identifier[MeasureSpec] operator[SEP] identifier[EXACTLY] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[shouldAdjust] operator[SEP] identifier[layoutParams] operator[SEP] identifier[width] operator[SEP] operator[SEP] { Keyword[int] identifier[heightSpecSize] operator[=] identifier[View] operator[SEP] identifier[MeasureSpec] operator[SEP] identifier[getSize] operator[SEP] identifier[spec] operator[SEP] identifier[height] operator[SEP] operator[SEP] Keyword[int] identifier[desiredWidth] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] identifier[heightSpecSize] operator[-] identifier[heightPadding] operator[SEP] operator[*] identifier[aspectRatio] operator[+] identifier[widthPadding] operator[SEP] operator[SEP] Keyword[int] identifier[resolvedWidth] operator[=] identifier[View] operator[SEP] identifier[resolveSize] operator[SEP] identifier[desiredWidth] , identifier[spec] operator[SEP] identifier[width] operator[SEP] operator[SEP] identifier[spec] operator[SEP] identifier[width] operator[=] identifier[View] operator[SEP] identifier[MeasureSpec] operator[SEP] identifier[makeMeasureSpec] operator[SEP] identifier[resolvedWidth] , identifier[View] operator[SEP] identifier[MeasureSpec] operator[SEP] identifier[EXACTLY] operator[SEP] operator[SEP] } }
public <O extends Message> EnvelopeFuture<O> newProvisionalResponse( ClientMethod<O> clientMethod) { long requestId = ThreadLocalRandom.current().nextLong(); EnvelopeFuture<O> outputFuture = new EnvelopeFuture<>(requestId, clientMethod, new Cancel(requestId), clientLogger); inFlightRequests.put(requestId, outputFuture); return outputFuture; }
class class_name[name] begin[{] method[newProvisionalResponse, return_type[type[EnvelopeFuture]], modifier[public], parameter[clientMethod]] begin[{] local_variable[type[long], requestId] local_variable[type[EnvelopeFuture], outputFuture] call[inFlightRequests.put, parameter[member[.requestId], member[.outputFuture]]] return[member[.outputFuture]] end[}] END[}]
Keyword[public] operator[<] identifier[O] Keyword[extends] identifier[Message] operator[>] identifier[EnvelopeFuture] operator[<] identifier[O] operator[>] identifier[newProvisionalResponse] operator[SEP] identifier[ClientMethod] operator[<] identifier[O] operator[>] identifier[clientMethod] operator[SEP] { Keyword[long] identifier[requestId] operator[=] identifier[ThreadLocalRandom] operator[SEP] identifier[current] operator[SEP] operator[SEP] operator[SEP] identifier[nextLong] operator[SEP] operator[SEP] operator[SEP] identifier[EnvelopeFuture] operator[<] identifier[O] operator[>] identifier[outputFuture] operator[=] Keyword[new] identifier[EnvelopeFuture] operator[<] operator[>] operator[SEP] identifier[requestId] , identifier[clientMethod] , Keyword[new] identifier[Cancel] operator[SEP] identifier[requestId] operator[SEP] , identifier[clientLogger] operator[SEP] operator[SEP] identifier[inFlightRequests] operator[SEP] identifier[put] operator[SEP] identifier[requestId] , identifier[outputFuture] operator[SEP] operator[SEP] Keyword[return] identifier[outputFuture] operator[SEP] }
@Mandatory public void setFramework(final String frameworkName) { this.framework.set(WebIntegrationFragment.Framework.valueOf(frameworkName.toUpperCase())); }
class class_name[name] begin[{] method[setFramework, return_type[void], modifier[public], parameter[frameworkName]] begin[{] THIS[member[None.framework]call[None.set, parameter[call[WebIntegrationFragment.Framework.valueOf, parameter[call[frameworkName.toUpperCase, parameter[]]]]]]] end[}] END[}]
annotation[@] identifier[Mandatory] Keyword[public] Keyword[void] identifier[setFramework] operator[SEP] Keyword[final] identifier[String] identifier[frameworkName] operator[SEP] { Keyword[this] operator[SEP] identifier[framework] operator[SEP] identifier[set] operator[SEP] identifier[WebIntegrationFragment] operator[SEP] identifier[Framework] operator[SEP] identifier[valueOf] operator[SEP] identifier[frameworkName] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void setSUPid(Integer newSUPid) { Integer oldSUPid = suPid; suPid = newSUPid; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.MSURG__SU_PID, oldSUPid, suPid)); }
class class_name[name] begin[{] method[setSUPid, return_type[void], modifier[public], parameter[newSUPid]] begin[{] local_variable[type[Integer], oldSUPid] assign[member[.suPid], member[.newSUPid]] if[call[.eNotificationRequired, parameter[]]] begin[{] call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=MSURG__SU_PID, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldSUPid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=suPid, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ENotificationImpl, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setSUPid] operator[SEP] identifier[Integer] identifier[newSUPid] operator[SEP] { identifier[Integer] identifier[oldSUPid] operator[=] identifier[suPid] operator[SEP] identifier[suPid] operator[=] identifier[newSUPid] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[MSURG__SU_PID] , identifier[oldSUPid] , identifier[suPid] operator[SEP] operator[SEP] operator[SEP] }
public static String jsonEscape(String raw) { // can't use StringEscapeUtils here because it escapes all non ascii characters and doesn't unescape them. // this is unacceptable for most utf8 content where in fact you only want to escape if you really have to StringBuilder buf = new StringBuilder(raw.length()); for (char c : raw.toCharArray()) { // escape control characters if (c < 32) { switch (c) { case '\b': buf.append('\\'); buf.append('b'); break; case '\n': buf.append('\\'); buf.append('n'); break; case '\t': buf.append('\\'); buf.append('t'); break; case '\f': buf.append('\\'); buf.append('f'); break; case '\r': buf.append('\\'); buf.append('r'); break; default: // note, these characters are not unescaped. if (c > 0xf) { buf.append("\\u00" + hex(c)); } else { buf.append("\\u000" + hex(c)); } break; } } else if (isAllowedInXml(c)) { // note, this silently drops characters that would not be allowed in XML anyway. switch (c) { case '"': buf.append('\\'); buf.append('"'); break; case '\\': buf.append('\\'); buf.append('\\'); break; default: buf.append(c); break; } } else { // simply escape; emojis are apparently outside the xml friendly range buf.append("\\u" + hex(c)); } } return buf.toString(); }
class class_name[name] begin[{] method[jsonEscape, return_type[type[String]], modifier[public static], parameter[raw]] begin[{] local_variable[type[StringBuilder], buf] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=<), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAllowedInXml, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\u"), operandr=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='"')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='"')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\b')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='b')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='n')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='t')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\f')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r')], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\\')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='r')], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xf), operator=>), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\u000"), operandr=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=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="\\u00"), operandr=MethodInvocation(arguments=[MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=hex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buf, selectors=[], type_arguments=None), label=None)])), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=toCharArray, postfix_operators=[], prefix_operators=[], qualifier=raw, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=BasicType(dimensions=[], name=char))), label=None) return[call[buf.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[jsonEscape] operator[SEP] identifier[String] identifier[raw] operator[SEP] { identifier[StringBuilder] identifier[buf] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[raw] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[char] identifier[c] operator[:] identifier[raw] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[c] operator[<] Other[32] operator[SEP] { Keyword[switch] operator[SEP] identifier[c] operator[SEP] { Keyword[case] literal[String] operator[:] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] identifier[c] operator[>] literal[Integer] operator[SEP] { identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[hex] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[hex] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] } Keyword[break] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[isAllowedInXml] operator[SEP] identifier[c] operator[SEP] operator[SEP] { Keyword[switch] operator[SEP] identifier[c] operator[SEP] { Keyword[case] literal[String] operator[:] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] literal[String] operator[:] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] identifier[buf] operator[SEP] identifier[append] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } } Keyword[else] { identifier[buf] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[hex] operator[SEP] identifier[c] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[buf] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
private Builder createComponentExposedTypeBuilder(ClassName exposedTypeClassName) { return TypeSpec .classBuilder(exposedTypeClassName) .addModifiers(Modifier.PUBLIC) .superclass(TypeName.get(component.asType())) .addAnnotation(AnnotationSpec .builder(Generated.class) .addMember("value", "$S", ComponentExposedTypeGenerator.class.getCanonicalName()) .addMember("comments", "$S", "https://github.com/Axellience/vue-gwt") .build()); }
class class_name[name] begin[{] method[createComponentExposedTypeBuilder, return_type[type[Builder]], modifier[private], parameter[exposedTypeClassName]] begin[{] return[call[TypeSpec.classBuilder, parameter[member[.exposedTypeClassName]]]] end[}] END[}]
Keyword[private] identifier[Builder] identifier[createComponentExposedTypeBuilder] operator[SEP] identifier[ClassName] identifier[exposedTypeClassName] operator[SEP] { Keyword[return] identifier[TypeSpec] operator[SEP] identifier[classBuilder] operator[SEP] identifier[exposedTypeClassName] operator[SEP] operator[SEP] identifier[addModifiers] operator[SEP] identifier[Modifier] operator[SEP] identifier[PUBLIC] operator[SEP] operator[SEP] identifier[superclass] operator[SEP] identifier[TypeName] operator[SEP] identifier[get] operator[SEP] identifier[component] operator[SEP] identifier[asType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addAnnotation] operator[SEP] identifier[AnnotationSpec] operator[SEP] identifier[builder] operator[SEP] identifier[Generated] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[addMember] operator[SEP] literal[String] , literal[String] , identifier[ComponentExposedTypeGenerator] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[addMember] operator[SEP] literal[String] , literal[String] , literal[String] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static List<String> listClassnames(final File parentDirectory, final List<File> classFileList) throws IOException { if (null == classFileList || classFileList.isEmpty()) { return Collections.emptyList(); } final List<String> list = new ArrayList<String>(classFileList.size()); for (final File file : classFileList) { list.add(extractClassNameFromFile(parentDirectory, file)); } return list; }
class class_name[name] begin[{] method[listClassnames, return_type[type[List]], modifier[public static], parameter[parentDirectory, classFileList]] begin[{] if[binary_operation[binary_operation[literal[null], ==, member[.classFileList]], ||, call[classFileList.isEmpty, parameter[]]]] begin[{] return[call[Collections.emptyList, parameter[]]] else begin[{] None end[}] local_variable[type[List], list] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=parentDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=extractClassNameFromFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=classFileList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=file)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None) return[member[.list]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[listClassnames] operator[SEP] Keyword[final] identifier[File] identifier[parentDirectory] , Keyword[final] identifier[List] operator[<] identifier[File] operator[>] identifier[classFileList] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[classFileList] operator[||] identifier[classFileList] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[classFileList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[File] identifier[file] operator[:] identifier[classFileList] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[extractClassNameFromFile] operator[SEP] identifier[parentDirectory] , identifier[file] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[list] operator[SEP] }
public long free_mem() { long memsz = 0; for( H2ONode h2o : CLOUD._memary ) memsz += h2o._heartbeat.get_free_mem(); return memsz; }
class class_name[name] begin[{] method[free_mem, return_type[type[long]], modifier[public], parameter[]] begin[{] local_variable[type[long], memsz] ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=memsz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=get_free_mem, postfix_operators=[], prefix_operators=[], qualifier=h2o._heartbeat, selectors=[], type_arguments=None)), label=None), control=EnhancedForControl(iterable=MemberReference(member=_memary, postfix_operators=[], prefix_operators=[], qualifier=CLOUD, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=h2o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=H2ONode, sub_type=None))), label=None) return[member[.memsz]] end[}] END[}]
Keyword[public] Keyword[long] identifier[free_mem] operator[SEP] operator[SEP] { Keyword[long] identifier[memsz] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[H2ONode] identifier[h2o] operator[:] identifier[CLOUD] operator[SEP] identifier[_memary] operator[SEP] identifier[memsz] operator[+=] identifier[h2o] operator[SEP] identifier[_heartbeat] operator[SEP] identifier[get_free_mem] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[memsz] operator[SEP] }
@Nullable public static PrimitiveNode convertPrimitiveDataToExpr( PrimitiveData primitiveData, SourceLocation location) { if (primitiveData instanceof StringData) { return new StringNode(primitiveData.stringValue(), QuoteStyle.SINGLE, location); } else if (primitiveData instanceof BooleanData) { return new BooleanNode(primitiveData.booleanValue(), location); } else if (primitiveData instanceof IntegerData) { // NOTE: We only support numbers in the range of JS [MIN_SAFE_INTEGER, MAX_SAFE_INTEGER] if (!IntegerNode.isInRange(primitiveData.longValue())) { return null; } else { return new IntegerNode(primitiveData.longValue(), location); } } else if (primitiveData instanceof FloatData) { return new FloatNode(primitiveData.floatValue(), location); } else if (primitiveData instanceof NullData) { return new NullNode(location); } else { throw new IllegalArgumentException(); } }
class class_name[name] begin[{] method[convertPrimitiveDataToExpr, return_type[type[PrimitiveNode]], modifier[public static], parameter[primitiveData, location]] begin[{] if[binary_operation[member[.primitiveData], instanceof, type[StringData]]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=stringValue, postfix_operators=[], prefix_operators=[], qualifier=primitiveData, selectors=[], type_arguments=None), MemberReference(member=SINGLE, postfix_operators=[], prefix_operators=[], qualifier=QuoteStyle, selectors=[]), MemberReference(member=location, 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=StringNode, sub_type=None))] else begin[{] if[binary_operation[member[.primitiveData], instanceof, type[BooleanData]]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=booleanValue, postfix_operators=[], prefix_operators=[], qualifier=primitiveData, selectors=[], type_arguments=None), MemberReference(member=location, 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=BooleanNode, sub_type=None))] else begin[{] if[binary_operation[member[.primitiveData], instanceof, type[IntegerData]]] begin[{] if[call[IntegerNode.isInRange, parameter[call[primitiveData.longValue, parameter[]]]]] begin[{] return[literal[null]] else begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=longValue, postfix_operators=[], prefix_operators=[], qualifier=primitiveData, selectors=[], type_arguments=None), MemberReference(member=location, 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=IntegerNode, sub_type=None))] end[}] else begin[{] if[binary_operation[member[.primitiveData], instanceof, type[FloatData]]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=floatValue, postfix_operators=[], prefix_operators=[], qualifier=primitiveData, selectors=[], type_arguments=None), MemberReference(member=location, 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=FloatNode, sub_type=None))] else begin[{] if[binary_operation[member[.primitiveData], instanceof, type[NullData]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=location, 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=NullNode, sub_type=None))] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] end[}] end[}] end[}] end[}] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[PrimitiveNode] identifier[convertPrimitiveDataToExpr] operator[SEP] identifier[PrimitiveData] identifier[primitiveData] , identifier[SourceLocation] identifier[location] operator[SEP] { Keyword[if] operator[SEP] identifier[primitiveData] Keyword[instanceof] identifier[StringData] operator[SEP] { Keyword[return] Keyword[new] identifier[StringNode] operator[SEP] identifier[primitiveData] operator[SEP] identifier[stringValue] operator[SEP] operator[SEP] , identifier[QuoteStyle] operator[SEP] identifier[SINGLE] , identifier[location] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[primitiveData] Keyword[instanceof] identifier[BooleanData] operator[SEP] { Keyword[return] Keyword[new] identifier[BooleanNode] operator[SEP] identifier[primitiveData] operator[SEP] identifier[booleanValue] operator[SEP] operator[SEP] , identifier[location] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[primitiveData] Keyword[instanceof] identifier[IntegerData] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[IntegerNode] operator[SEP] identifier[isInRange] operator[SEP] identifier[primitiveData] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[return] Keyword[new] identifier[IntegerNode] operator[SEP] identifier[primitiveData] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] , identifier[location] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[primitiveData] Keyword[instanceof] identifier[FloatData] operator[SEP] { Keyword[return] Keyword[new] identifier[FloatNode] operator[SEP] identifier[primitiveData] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] , identifier[location] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[primitiveData] Keyword[instanceof] identifier[NullData] operator[SEP] { Keyword[return] Keyword[new] identifier[NullNode] operator[SEP] identifier[location] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] operator[SEP] operator[SEP] } }
private String getIdForLocale(String locale) { return CmsContentDefinition.uuidToEntityId(CmsContentDefinition.entityIdToUuid(m_entityId), locale); }
class class_name[name] begin[{] method[getIdForLocale, return_type[type[String]], modifier[private], parameter[locale]] begin[{] return[call[CmsContentDefinition.uuidToEntityId, parameter[call[CmsContentDefinition.entityIdToUuid, parameter[member[.m_entityId]]], member[.locale]]]] end[}] END[}]
Keyword[private] identifier[String] identifier[getIdForLocale] operator[SEP] identifier[String] identifier[locale] operator[SEP] { Keyword[return] identifier[CmsContentDefinition] operator[SEP] identifier[uuidToEntityId] operator[SEP] identifier[CmsContentDefinition] operator[SEP] identifier[entityIdToUuid] operator[SEP] identifier[m_entityId] operator[SEP] , identifier[locale] operator[SEP] operator[SEP] }
public Object call(Collection coll, Closure c) { return jsonBuilder.call(coll, c); }
class class_name[name] begin[{] method[call, return_type[type[Object]], modifier[public], parameter[coll, c]] begin[{] return[call[jsonBuilder.call, parameter[member[.coll], member[.c]]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[call] operator[SEP] identifier[Collection] identifier[coll] , identifier[Closure] identifier[c] operator[SEP] { Keyword[return] identifier[jsonBuilder] operator[SEP] identifier[call] operator[SEP] identifier[coll] , identifier[c] operator[SEP] operator[SEP] }
public static String getMd5Hash(String topic, String[] partitions) { ArrayList<String> elements = new ArrayList<String>(); elements.add(topic); for (String partition : partitions) { elements.add(partition); } String pathPrefix = StringUtils.join(elements, "/"); try { final MessageDigest messageDigest = MessageDigest.getInstance("MD5"); byte[] md5Bytes = messageDigest.digest(pathPrefix.getBytes("UTF-8")); return getHexEncode(md5Bytes).substring(0, 4); } catch (NoSuchAlgorithmException e) { LOG.error(e.getMessage()); } catch (UnsupportedEncodingException e) { LOG.error(e.getMessage()); } return ""; }
class class_name[name] begin[{] method[getMd5Hash, return_type[type[String]], modifier[public static], parameter[topic, partitions]] begin[{] local_variable[type[ArrayList], elements] call[elements.add, parameter[member[.topic]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=partition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=partitions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=partition)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) local_variable[type[String], pathPrefix] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="MD5")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=MessageDigest, selectors=[], type_arguments=None), name=messageDigest)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=MessageDigest, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=pathPrefix, selectors=[], type_arguments=None)], member=digest, postfix_operators=[], prefix_operators=[], qualifier=messageDigest, selectors=[], type_arguments=None), name=md5Bytes)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=md5Bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getHexEncode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoSuchAlgorithmException'])), 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=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None) return[literal[""]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getMd5Hash] operator[SEP] identifier[String] identifier[topic] , identifier[String] operator[SEP] operator[SEP] identifier[partitions] operator[SEP] { identifier[ArrayList] operator[<] identifier[String] operator[>] identifier[elements] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[elements] operator[SEP] identifier[add] operator[SEP] identifier[topic] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[partition] operator[:] identifier[partitions] operator[SEP] { identifier[elements] operator[SEP] identifier[add] operator[SEP] identifier[partition] operator[SEP] operator[SEP] } identifier[String] identifier[pathPrefix] operator[=] identifier[StringUtils] operator[SEP] identifier[join] operator[SEP] identifier[elements] , literal[String] operator[SEP] operator[SEP] Keyword[try] { Keyword[final] identifier[MessageDigest] identifier[messageDigest] operator[=] identifier[MessageDigest] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[md5Bytes] operator[=] identifier[messageDigest] operator[SEP] identifier[digest] operator[SEP] identifier[pathPrefix] operator[SEP] identifier[getBytes] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[getHexEncode] operator[SEP] identifier[md5Bytes] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[4] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NoSuchAlgorithmException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[String] operator[SEP] }
public static /*@pure@*/ int maxIndex(int[] ints) { int maximum = 0; int maxIndex = 0; for (int i = 0; i < ints.length; i++) { if ((i == 0) || (ints[i] > maximum)) { maxIndex = i; maximum = ints[i]; } } return maxIndex; }
class class_name[name] begin[{] method[maxIndex, return_type[type[int]], modifier[public static], parameter[ints]] begin[{] local_variable[type[int], maximum] local_variable[type[int], maxIndex] ForStatement(body=BlockStatement(label=None, statements=[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=0), operator===), operandr=BinaryOperation(operandl=MemberReference(member=ints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=maximum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=maximum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ints, 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[.maxIndex]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[maxIndex] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[ints] operator[SEP] { Keyword[int] identifier[maximum] operator[=] Other[0] operator[SEP] Keyword[int] identifier[maxIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ints] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[i] operator[==] Other[0] operator[SEP] operator[||] operator[SEP] identifier[ints] operator[SEP] identifier[i] operator[SEP] operator[>] identifier[maximum] operator[SEP] operator[SEP] { identifier[maxIndex] operator[=] identifier[i] operator[SEP] identifier[maximum] operator[=] identifier[ints] operator[SEP] identifier[i] operator[SEP] operator[SEP] } } Keyword[return] identifier[maxIndex] operator[SEP] }
void resetTail(long index) { for (SegmentedJournalReader reader : readers) { if (reader.getNextIndex() >= index) { reader.reset(index); } } }
class class_name[name] begin[{] method[resetTail, return_type[void], modifier[default], parameter[index]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNextIndex, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), operandr=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reset, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=readers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=reader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SegmentedJournalReader, sub_type=None))), label=None) end[}] END[}]
Keyword[void] identifier[resetTail] operator[SEP] Keyword[long] identifier[index] operator[SEP] { Keyword[for] operator[SEP] identifier[SegmentedJournalReader] identifier[reader] operator[:] identifier[readers] operator[SEP] { Keyword[if] operator[SEP] identifier[reader] operator[SEP] identifier[getNextIndex] operator[SEP] operator[SEP] operator[>=] identifier[index] operator[SEP] { identifier[reader] operator[SEP] identifier[reset] operator[SEP] identifier[index] operator[SEP] operator[SEP] } } }
public List<Extensions> getOrCreate() { // Create tables geoPackage.createGriddedCoverageTable(); geoPackage.createGriddedTileTable(); List<Extensions> extensionList = new ArrayList<>(); Extensions coverage = getOrCreate(EXTENSION_NAME, GriddedCoverage.TABLE_NAME, null, EXTENSION_DEFINITION, ExtensionScopeType.READ_WRITE); Extensions tile = getOrCreate(EXTENSION_NAME, GriddedTile.TABLE_NAME, null, EXTENSION_DEFINITION, ExtensionScopeType.READ_WRITE); Extensions table = getOrCreate(EXTENSION_NAME, tileMatrixSet.getTableName(), TileTable.COLUMN_TILE_DATA, EXTENSION_DEFINITION, ExtensionScopeType.READ_WRITE); extensionList.add(coverage); extensionList.add(tile); extensionList.add(table); return extensionList; }
class class_name[name] begin[{] method[getOrCreate, return_type[type[List]], modifier[public], parameter[]] begin[{] call[geoPackage.createGriddedCoverageTable, parameter[]] call[geoPackage.createGriddedTileTable, parameter[]] local_variable[type[List], extensionList] local_variable[type[Extensions], coverage] local_variable[type[Extensions], tile] local_variable[type[Extensions], table] call[extensionList.add, parameter[member[.coverage]]] call[extensionList.add, parameter[member[.tile]]] call[extensionList.add, parameter[member[.table]]] return[member[.extensionList]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[Extensions] operator[>] identifier[getOrCreate] operator[SEP] operator[SEP] { identifier[geoPackage] operator[SEP] identifier[createGriddedCoverageTable] operator[SEP] operator[SEP] operator[SEP] identifier[geoPackage] operator[SEP] identifier[createGriddedTileTable] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Extensions] operator[>] identifier[extensionList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Extensions] identifier[coverage] operator[=] identifier[getOrCreate] operator[SEP] identifier[EXTENSION_NAME] , identifier[GriddedCoverage] operator[SEP] identifier[TABLE_NAME] , Other[null] , identifier[EXTENSION_DEFINITION] , identifier[ExtensionScopeType] operator[SEP] identifier[READ_WRITE] operator[SEP] operator[SEP] identifier[Extensions] identifier[tile] operator[=] identifier[getOrCreate] operator[SEP] identifier[EXTENSION_NAME] , identifier[GriddedTile] operator[SEP] identifier[TABLE_NAME] , Other[null] , identifier[EXTENSION_DEFINITION] , identifier[ExtensionScopeType] operator[SEP] identifier[READ_WRITE] operator[SEP] operator[SEP] identifier[Extensions] identifier[table] operator[=] identifier[getOrCreate] operator[SEP] identifier[EXTENSION_NAME] , identifier[tileMatrixSet] operator[SEP] identifier[getTableName] operator[SEP] operator[SEP] , identifier[TileTable] operator[SEP] identifier[COLUMN_TILE_DATA] , identifier[EXTENSION_DEFINITION] , identifier[ExtensionScopeType] operator[SEP] identifier[READ_WRITE] operator[SEP] operator[SEP] identifier[extensionList] operator[SEP] identifier[add] operator[SEP] identifier[coverage] operator[SEP] operator[SEP] identifier[extensionList] operator[SEP] identifier[add] operator[SEP] identifier[tile] operator[SEP] operator[SEP] identifier[extensionList] operator[SEP] identifier[add] operator[SEP] identifier[table] operator[SEP] operator[SEP] Keyword[return] identifier[extensionList] operator[SEP] }
public static FlowSpec.Builder builder(URI catalogURI, Properties flowProps) { String name = flowProps.getProperty(ConfigurationKeys.FLOW_NAME_KEY); String group = flowProps.getProperty(ConfigurationKeys.FLOW_GROUP_KEY, "default"); try { URI flowURI = new URI(catalogURI.getScheme(), catalogURI.getAuthority(), "/" + group + "/" + name, null); FlowSpec.Builder builder = new FlowSpec.Builder(flowURI).withConfigAsProperties(flowProps); String descr = flowProps.getProperty(ConfigurationKeys.FLOW_DESCRIPTION_KEY, null); if (null != descr) { builder = builder.withDescription(descr); } return builder; } catch (URISyntaxException e) { throw new RuntimeException("Unable to create a FlowSpec URI: " + e, e); } }
class class_name[name] begin[{] method[builder, return_type[type[FlowSpec]], modifier[public static], parameter[catalogURI, flowProps]] begin[{] local_variable[type[String], name] local_variable[type[String], group] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getScheme, postfix_operators=[], prefix_operators=[], qualifier=catalogURI, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getAuthority, postfix_operators=[], prefix_operators=[], qualifier=catalogURI, selectors=[], type_arguments=None), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operandr=MemberReference(member=group, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URI, sub_type=None)), name=flowURI)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=URI, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=flowURI, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=flowProps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withConfigAsProperties, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=FlowSpec, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None))), name=builder)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FlowSpec, sub_type=ReferenceType(arguments=None, dimensions=None, name=Builder, sub_type=None))), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=FLOW_DESCRIPTION_KEY, postfix_operators=[], prefix_operators=[], qualifier=ConfigurationKeys, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=flowProps, selectors=[], type_arguments=None), name=descr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=descr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=descr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withDescription, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None)), label=None)])), ReturnStatement(expression=MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to create a FlowSpec URI: "), operandr=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[FlowSpec] operator[SEP] identifier[Builder] identifier[builder] operator[SEP] identifier[URI] identifier[catalogURI] , identifier[Properties] identifier[flowProps] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[flowProps] operator[SEP] identifier[getProperty] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[FLOW_NAME_KEY] operator[SEP] operator[SEP] identifier[String] identifier[group] operator[=] identifier[flowProps] operator[SEP] identifier[getProperty] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[FLOW_GROUP_KEY] , literal[String] operator[SEP] operator[SEP] Keyword[try] { identifier[URI] identifier[flowURI] operator[=] Keyword[new] identifier[URI] operator[SEP] identifier[catalogURI] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] , identifier[catalogURI] operator[SEP] identifier[getAuthority] operator[SEP] operator[SEP] , literal[String] operator[+] identifier[group] operator[+] literal[String] operator[+] identifier[name] , Other[null] operator[SEP] operator[SEP] identifier[FlowSpec] operator[SEP] identifier[Builder] identifier[builder] operator[=] Keyword[new] identifier[FlowSpec] operator[SEP] identifier[Builder] operator[SEP] identifier[flowURI] operator[SEP] operator[SEP] identifier[withConfigAsProperties] operator[SEP] identifier[flowProps] operator[SEP] operator[SEP] identifier[String] identifier[descr] operator[=] identifier[flowProps] operator[SEP] identifier[getProperty] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[FLOW_DESCRIPTION_KEY] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[descr] operator[SEP] { identifier[builder] operator[=] identifier[builder] operator[SEP] identifier[withDescription] operator[SEP] identifier[descr] operator[SEP] operator[SEP] } Keyword[return] identifier[builder] operator[SEP] } Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[+] identifier[e] , identifier[e] operator[SEP] operator[SEP] } }
protected RequestConfig createConfig() { if (proxy == null && socketTimeout < 0 && connectTimeout < 0) { return null; } Builder builder = RequestConfig.custom(); if (proxy != null) { builder.setProxy(proxy); } if (socketTimeout >= 0) { builder.setSocketTimeout(socketTimeout); } if (connectTimeout >= 0) { builder.setConnectTimeout(connectTimeout); } return builder.build(); }
class class_name[name] begin[{] method[createConfig, return_type[type[RequestConfig]], modifier[protected], parameter[]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.proxy], ==, literal[null]], &&, binary_operation[member[.socketTimeout], <, literal[0]]], &&, binary_operation[member[.connectTimeout], <, literal[0]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[Builder], builder] if[binary_operation[member[.proxy], !=, literal[null]]] begin[{] call[builder.setProxy, parameter[member[.proxy]]] else begin[{] None end[}] if[binary_operation[member[.socketTimeout], >=, literal[0]]] begin[{] call[builder.setSocketTimeout, parameter[member[.socketTimeout]]] else begin[{] None end[}] if[binary_operation[member[.connectTimeout], >=, literal[0]]] begin[{] call[builder.setConnectTimeout, parameter[member[.connectTimeout]]] else begin[{] None end[}] return[call[builder.build, parameter[]]] end[}] END[}]
Keyword[protected] identifier[RequestConfig] identifier[createConfig] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[proxy] operator[==] Other[null] operator[&&] identifier[socketTimeout] operator[<] Other[0] operator[&&] identifier[connectTimeout] operator[<] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[Builder] identifier[builder] operator[=] identifier[RequestConfig] operator[SEP] identifier[custom] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[proxy] operator[!=] Other[null] operator[SEP] { identifier[builder] operator[SEP] identifier[setProxy] operator[SEP] identifier[proxy] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[socketTimeout] operator[>=] Other[0] operator[SEP] { identifier[builder] operator[SEP] identifier[setSocketTimeout] operator[SEP] identifier[socketTimeout] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[connectTimeout] operator[>=] Other[0] operator[SEP] { identifier[builder] operator[SEP] identifier[setConnectTimeout] operator[SEP] identifier[connectTimeout] operator[SEP] operator[SEP] } Keyword[return] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] }
public ColumnType getType(int column) { if (column < 0 || column >= columnMetaData.size()) throw new IllegalArgumentException( "Invalid column number. " + column + "only " + columnMetaData.size() + "present."); return columnMetaData.get(column).getColumnType(); }
class class_name[name] begin[{] method[getType, return_type[type[ColumnType]], modifier[public], parameter[column]] begin[{] if[binary_operation[binary_operation[member[.column], <, literal[0]], ||, binary_operation[member[.column], >=, call[columnMetaData.size, parameter[]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid column number. "), operandr=MemberReference(member=column, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="only "), operator=+), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=columnMetaData, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="present."), 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[columnMetaData.get, parameter[member[.column]]]] end[}] END[}]
Keyword[public] identifier[ColumnType] identifier[getType] operator[SEP] Keyword[int] identifier[column] operator[SEP] { Keyword[if] operator[SEP] identifier[column] operator[<] Other[0] operator[||] identifier[column] operator[>=] identifier[columnMetaData] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[column] operator[+] literal[String] operator[+] identifier[columnMetaData] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[columnMetaData] operator[SEP] identifier[get] operator[SEP] identifier[column] operator[SEP] operator[SEP] identifier[getColumnType] operator[SEP] operator[SEP] operator[SEP] }
public static void setExpires(@NotNull HttpServletResponse response, @Nullable Date date) { if (date == null) { response.setHeader(HEADER_EXPIRES, "-1"); } else { response.setHeader(HEADER_EXPIRES, formatDate(date)); } }
class class_name[name] begin[{] method[setExpires, return_type[void], modifier[public static], parameter[response, date]] begin[{] if[binary_operation[member[.date], ==, literal[null]]] begin[{] call[response.setHeader, parameter[member[.HEADER_EXPIRES], literal["-1"]]] else begin[{] call[response.setHeader, parameter[member[.HEADER_EXPIRES], call[.formatDate, parameter[member[.date]]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setExpires] operator[SEP] annotation[@] identifier[NotNull] identifier[HttpServletResponse] identifier[response] , annotation[@] identifier[Nullable] identifier[Date] identifier[date] operator[SEP] { Keyword[if] operator[SEP] identifier[date] operator[==] Other[null] operator[SEP] { identifier[response] operator[SEP] identifier[setHeader] operator[SEP] identifier[HEADER_EXPIRES] , literal[String] operator[SEP] operator[SEP] } Keyword[else] { identifier[response] operator[SEP] identifier[setHeader] operator[SEP] identifier[HEADER_EXPIRES] , identifier[formatDate] operator[SEP] identifier[date] operator[SEP] operator[SEP] operator[SEP] } }
@Nonnull public final Maybe<A> find(@Nonnull F<A, Boolean> f) { ImmutableList<A> self = this; while (self instanceof NonEmptyImmutableList) { NonEmptyImmutableList<A> selfNel = (NonEmptyImmutableList<A>) self; boolean result = f.apply(selfNel.head); if (result) { return Maybe.of(selfNel.head); } self = selfNel.tail(); } return Maybe.empty(); }
class class_name[name] begin[{] method[find, return_type[type[Maybe]], modifier[final public], parameter[f]] begin[{] local_variable[type[ImmutableList], self] while[binary_operation[member[.self], instanceof, type[NonEmptyImmutableList]]] begin[{] local_variable[type[NonEmptyImmutableList], selfNel] local_variable[type[boolean], result] if[member[.result]] begin[{] return[call[Maybe.of, parameter[member[selfNel.head]]]] else begin[{] None end[}] assign[member[.self], call[selfNel.tail, parameter[]]] end[}] return[call[Maybe.empty, parameter[]]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[final] identifier[Maybe] operator[<] identifier[A] operator[>] identifier[find] operator[SEP] annotation[@] identifier[Nonnull] identifier[F] operator[<] identifier[A] , identifier[Boolean] operator[>] identifier[f] operator[SEP] { identifier[ImmutableList] operator[<] identifier[A] operator[>] identifier[self] operator[=] Keyword[this] operator[SEP] Keyword[while] operator[SEP] identifier[self] Keyword[instanceof] identifier[NonEmptyImmutableList] operator[SEP] { identifier[NonEmptyImmutableList] operator[<] identifier[A] operator[>] identifier[selfNel] operator[=] operator[SEP] identifier[NonEmptyImmutableList] operator[<] identifier[A] operator[>] operator[SEP] identifier[self] operator[SEP] Keyword[boolean] identifier[result] operator[=] identifier[f] operator[SEP] identifier[apply] operator[SEP] identifier[selfNel] operator[SEP] identifier[head] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] { Keyword[return] identifier[Maybe] operator[SEP] identifier[of] operator[SEP] identifier[selfNel] operator[SEP] identifier[head] operator[SEP] operator[SEP] } identifier[self] operator[=] identifier[selfNel] operator[SEP] identifier[tail] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[Maybe] operator[SEP] identifier[empty] operator[SEP] operator[SEP] operator[SEP] }
@Override public void addSubClassInfo(Content classInfoTree) { if (utils.isClass(typeElement)) { if (typeElement.getQualifiedName().toString().equals("java.lang.Object") || typeElement.getQualifiedName().toString().equals("org.omg.CORBA.Object")) { return; // Don't generate the list, too huge } Set<TypeElement> subclasses = classtree.directSubClasses(typeElement, false); if (!subclasses.isEmpty()) { Content label = contents.subclassesLabel; Content dt = HtmlTree.DT(label); Content dl = HtmlTree.DL(dt); dl.addContent(getClassLinks(LinkInfoImpl.Kind.SUBCLASSES, subclasses)); classInfoTree.addContent(dl); } } }
class class_name[name] begin[{] method[addSubClassInfo, return_type[void], modifier[public], parameter[classInfoTree]] begin[{] if[call[utils.isClass, parameter[member[.typeElement]]]] begin[{] if[binary_operation[call[typeElement.getQualifiedName, parameter[]], ||, call[typeElement.getQualifiedName, parameter[]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[Set], subclasses] if[call[subclasses.isEmpty, parameter[]]] begin[{] local_variable[type[Content], label] local_variable[type[Content], dt] local_variable[type[Content], dl] call[dl.addContent, parameter[call[.getClassLinks, parameter[member[LinkInfoImpl.Kind.SUBCLASSES], member[.subclasses]]]]] call[classInfoTree.addContent, parameter[member[.dl]]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addSubClassInfo] operator[SEP] identifier[Content] identifier[classInfoTree] operator[SEP] { Keyword[if] operator[SEP] identifier[utils] operator[SEP] identifier[isClass] operator[SEP] identifier[typeElement] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[typeElement] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[typeElement] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[Set] operator[<] identifier[TypeElement] operator[>] identifier[subclasses] operator[=] identifier[classtree] operator[SEP] identifier[directSubClasses] operator[SEP] identifier[typeElement] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[subclasses] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[Content] identifier[label] operator[=] identifier[contents] operator[SEP] identifier[subclassesLabel] operator[SEP] identifier[Content] identifier[dt] operator[=] identifier[HtmlTree] operator[SEP] identifier[DT] operator[SEP] identifier[label] operator[SEP] operator[SEP] identifier[Content] identifier[dl] operator[=] identifier[HtmlTree] operator[SEP] identifier[DL] operator[SEP] identifier[dt] operator[SEP] operator[SEP] identifier[dl] operator[SEP] identifier[addContent] operator[SEP] identifier[getClassLinks] operator[SEP] identifier[LinkInfoImpl] operator[SEP] identifier[Kind] operator[SEP] identifier[SUBCLASSES] , identifier[subclasses] operator[SEP] operator[SEP] operator[SEP] identifier[classInfoTree] operator[SEP] identifier[addContent] operator[SEP] identifier[dl] operator[SEP] operator[SEP] } } }
public static String getMimeType(String fileUrl) { FileNameMap fileNameMap = URLConnection.getFileNameMap(); String type = fileNameMap.getContentTypeFor(fileUrl); return type; }
class class_name[name] begin[{] method[getMimeType, return_type[type[String]], modifier[public static], parameter[fileUrl]] begin[{] local_variable[type[FileNameMap], fileNameMap] local_variable[type[String], type] return[member[.type]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getMimeType] operator[SEP] identifier[String] identifier[fileUrl] operator[SEP] { identifier[FileNameMap] identifier[fileNameMap] operator[=] identifier[URLConnection] operator[SEP] identifier[getFileNameMap] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[type] operator[=] identifier[fileNameMap] operator[SEP] identifier[getContentTypeFor] operator[SEP] identifier[fileUrl] operator[SEP] operator[SEP] Keyword[return] identifier[type] operator[SEP] }
public void addNodeSelectField(final String fieldLabel, final SiteNode value, final boolean editable, final boolean allowRoot) { validateNotTabbed(); final ZapTextField text = new ZapTextField(); text.setEditable(editable); if (value != null) { text.setText(getNodeText(value)); } JButton selectButton = new JButton(Constant.messages.getString("all.button.select")); selectButton.setIcon(new ImageIcon(View.class.getResource("/resource/icon/16/094.png"))); // Globe icon selectButton.addActionListener(new java.awt.event.ActionListener() { // Keep a local copy so that we can always select the last node chosen SiteNode node = value; @Override public void actionPerformed(java.awt.event.ActionEvent e) { NodeSelectDialog nsd = new NodeSelectDialog(StandardFieldsDialog.this); nsd.setAllowRoot(allowRoot); SiteNode node = nsd.showDialog(this.node); if (node != null) { text.setText(getNodeText(node)); this.node = node; siteNodeSelected(fieldLabel, node); } } }); JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); panel.add(text, LayoutHelper.getGBC(0, 0, 1, 1.0D, 0.0D, GridBagConstraints.BOTH, new Insets(4,4,4,4))); panel.add(selectButton, LayoutHelper.getGBC(1, 0, 1, 0.0D, 0.0D, GridBagConstraints.BOTH, new Insets(4,4,4,4))); this.addField(fieldLabel, text, panel, 0.0D); }
class class_name[name] begin[{] method[addNodeSelectField, return_type[void], modifier[public], parameter[fieldLabel, value, editable, allowRoot]] begin[{] call[.validateNotTabbed, parameter[]] local_variable[type[ZapTextField], text] call[text.setEditable, parameter[member[.editable]]] if[binary_operation[member[.value], !=, literal[null]]] begin[{] call[text.setText, parameter[call[.getNodeText, parameter[member[.value]]]]] else begin[{] None end[}] local_variable[type[JButton], selectButton] call[selectButton.setIcon, parameter[ClassCreator(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/resource/icon/16/094.png")], member=getResource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=View, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ImageIcon, sub_type=None))]] call[selectButton.addActionListener, parameter[ClassCreator(arguments=[], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=node)], documentation=None, modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SiteNode, sub_type=None)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=StandardFieldsDialog, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NodeSelectDialog, sub_type=None)), name=nsd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeSelectDialog, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=allowRoot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAllowRoot, postfix_operators=[], prefix_operators=[], qualifier=nsd, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=node, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=showDialog, postfix_operators=[], prefix_operators=[], qualifier=nsd, selectors=[], type_arguments=None), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SiteNode, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getNodeText, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=setText, postfix_operators=[], prefix_operators=[], qualifier=text, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=node, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fieldLabel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=siteNodeSelected, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=actionPerformed, parameters=[FormalParameter(annotations=[], modifiers=set(), name=e, type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=ActionEvent, sub_type=None)))), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=awt, sub_type=ReferenceType(arguments=None, dimensions=None, name=event, sub_type=ReferenceType(arguments=None, dimensions=None, name=ActionListener, sub_type=None)))))]] local_variable[type[JPanel], panel] call[panel.setLayout, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GridBagLayout, sub_type=None))]] call[panel.add, parameter[member[.text], call[LayoutHelper.getGBC, parameter[literal[0], literal[0], literal[1], literal[1.0D], literal[0.0D], member[GridBagConstraints.BOTH], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Insets, sub_type=None))]]]] call[panel.add, parameter[member[.selectButton], call[LayoutHelper.getGBC, parameter[literal[1], literal[0], literal[1], literal[0.0D], literal[0.0D], member[GridBagConstraints.BOTH], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Insets, sub_type=None))]]]] THIS[call[None.addField, parameter[member[.fieldLabel], member[.text], member[.panel], literal[0.0D]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addNodeSelectField] operator[SEP] Keyword[final] identifier[String] identifier[fieldLabel] , Keyword[final] identifier[SiteNode] identifier[value] , Keyword[final] Keyword[boolean] identifier[editable] , Keyword[final] Keyword[boolean] identifier[allowRoot] operator[SEP] { identifier[validateNotTabbed] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ZapTextField] identifier[text] operator[=] Keyword[new] identifier[ZapTextField] operator[SEP] operator[SEP] operator[SEP] identifier[text] operator[SEP] identifier[setEditable] operator[SEP] identifier[editable] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { identifier[text] operator[SEP] identifier[setText] operator[SEP] identifier[getNodeText] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] } identifier[JButton] identifier[selectButton] operator[=] Keyword[new] identifier[JButton] operator[SEP] identifier[Constant] operator[SEP] identifier[messages] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[selectButton] operator[SEP] identifier[setIcon] operator[SEP] Keyword[new] identifier[ImageIcon] operator[SEP] identifier[View] operator[SEP] Keyword[class] operator[SEP] identifier[getResource] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[selectButton] operator[SEP] identifier[addActionListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionListener] operator[SEP] operator[SEP] { identifier[SiteNode] identifier[node] operator[=] identifier[value] operator[SEP] annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[actionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[e] operator[SEP] { identifier[NodeSelectDialog] identifier[nsd] operator[=] Keyword[new] identifier[NodeSelectDialog] operator[SEP] identifier[StandardFieldsDialog] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[nsd] operator[SEP] identifier[setAllowRoot] operator[SEP] identifier[allowRoot] operator[SEP] operator[SEP] identifier[SiteNode] identifier[node] operator[=] identifier[nsd] operator[SEP] identifier[showDialog] operator[SEP] Keyword[this] operator[SEP] identifier[node] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] operator[!=] Other[null] operator[SEP] { identifier[text] operator[SEP] identifier[setText] operator[SEP] identifier[getNodeText] operator[SEP] identifier[node] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[node] operator[=] identifier[node] operator[SEP] identifier[siteNodeSelected] operator[SEP] identifier[fieldLabel] , identifier[node] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] identifier[JPanel] identifier[panel] operator[=] Keyword[new] identifier[JPanel] operator[SEP] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[setLayout] operator[SEP] Keyword[new] identifier[GridBagLayout] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[add] operator[SEP] identifier[text] , identifier[LayoutHelper] operator[SEP] identifier[getGBC] operator[SEP] Other[0] , Other[0] , Other[1] , literal[Float] , literal[Float] , identifier[GridBagConstraints] operator[SEP] identifier[BOTH] , Keyword[new] identifier[Insets] operator[SEP] Other[4] , Other[4] , Other[4] , Other[4] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[panel] operator[SEP] identifier[add] operator[SEP] identifier[selectButton] , identifier[LayoutHelper] operator[SEP] identifier[getGBC] operator[SEP] Other[1] , Other[0] , Other[1] , literal[Float] , literal[Float] , identifier[GridBagConstraints] operator[SEP] identifier[BOTH] , Keyword[new] identifier[Insets] operator[SEP] Other[4] , Other[4] , Other[4] , Other[4] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[addField] operator[SEP] identifier[fieldLabel] , identifier[text] , identifier[panel] , literal[Float] operator[SEP] operator[SEP] }
public static final Parser<BigDecimal> instance() { // NOPMD it's thread save! if (PercentBigDecimalParser.instanceParser == null) { synchronized (PercentBigDecimalParser.class) { if (PercentBigDecimalParser.instanceParser == null) { PercentBigDecimalParser.instanceParser = new PercentBigDecimalParser(); } } } return PercentBigDecimalParser.instanceParser; }
class class_name[name] begin[{] method[instance, return_type[type[Parser]], modifier[final public static], parameter[]] begin[{] if[binary_operation[member[PercentBigDecimalParser.instanceParser], ==, literal[null]]] begin[{] SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PercentBigDecimalParser, sub_type=None))] BEGIN[{] if[binary_operation[member[PercentBigDecimalParser.instanceParser], ==, literal[null]]] begin[{] assign[member[PercentBigDecimalParser.instanceParser], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PercentBigDecimalParser, sub_type=None))] else begin[{] None end[}] END[}] else begin[{] None end[}] return[member[PercentBigDecimalParser.instanceParser]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] identifier[Parser] operator[<] identifier[BigDecimal] operator[>] identifier[instance] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[PercentBigDecimalParser] operator[SEP] identifier[instanceParser] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[PercentBigDecimalParser] operator[SEP] Keyword[class] operator[SEP] { Keyword[if] operator[SEP] identifier[PercentBigDecimalParser] operator[SEP] identifier[instanceParser] operator[==] Other[null] operator[SEP] { identifier[PercentBigDecimalParser] operator[SEP] identifier[instanceParser] operator[=] Keyword[new] identifier[PercentBigDecimalParser] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] identifier[PercentBigDecimalParser] operator[SEP] identifier[instanceParser] operator[SEP] }
private Decl.FunctionOrMethod parseFunctionOrMethodDeclaration(Tuple<Modifier> modifiers, boolean isFunction) { int start = index; // Create appropriate enclosing scope EnclosingScope scope = new EnclosingScope(); // if (isFunction) { match(Function); } else { match(Method); } Identifier name = parseIdentifier(); // Parse template parameters Tuple<Template.Variable> template = parseOptionalTemplate(scope); // Parse function or method parameters Tuple<Decl.Variable> parameters = parseParameters(scope,RightBrace); // Parse (optional) return type Tuple<Decl.Variable> returns; // if (tryAndMatch(true, MinusGreater) != null) { // Explicit return type is given, so parse it! We first clone the // environent and create a special one only for use within ensures // clauses, since these are the only expressions which may refer to // variables declared in the return type. returns = parseOptionalParameters(scope); } else { // No returns provided returns = new Tuple<>(); } // Parse optional requires/ensures clauses Tuple<Expr> requires = parseInvariant(scope,Requires); Tuple<Expr> ensures = parseInvariant(scope,Ensures); // Parse function or method body (if not native) Stmt.Block body; int end; if(modifiers.match(Modifier.Native.class) == null) { // Not native function or method match(Colon); end = index; matchEndLine(); scope.declareThisLifetime(); body = parseBlock(scope, false); } else { end = index; matchEndLine(); // FIXME: having empty block seems wasteful body = new Stmt.Block(); } // WyilFile.Decl.FunctionOrMethod declaration; if (isFunction) { declaration = new Decl.Function(modifiers, name, template, parameters, returns, requires, ensures, body); } else { declaration = new Decl.Method(modifiers, name, template, parameters, returns, requires, ensures, body); } return annotateSourceLocation(declaration,start,end-1); }
class class_name[name] begin[{] method[parseFunctionOrMethodDeclaration, return_type[type[Decl]], modifier[private], parameter[modifiers, isFunction]] begin[{] local_variable[type[int], start] local_variable[type[EnclosingScope], scope] if[member[.isFunction]] begin[{] call[.match, parameter[member[.Function]]] else begin[{] call[.match, parameter[member[.Method]]] end[}] local_variable[type[Identifier], name] local_variable[type[Tuple], template] local_variable[type[Tuple], parameters] local_variable[type[Tuple], returns] if[binary_operation[call[.tryAndMatch, parameter[literal[true], member[.MinusGreater]]], !=, literal[null]]] begin[{] assign[member[.returns], call[.parseOptionalParameters, parameter[member[.scope]]]] else begin[{] assign[member[.returns], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Tuple, sub_type=None))] end[}] local_variable[type[Tuple], requires] local_variable[type[Tuple], ensures] local_variable[type[Stmt], body] local_variable[type[int], end] if[binary_operation[call[modifiers.match, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=Modifier, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Native, sub_type=None))]], ==, literal[null]]] begin[{] call[.match, parameter[member[.Colon]]] assign[member[.end], member[.index]] call[.matchEndLine, parameter[]] call[scope.declareThisLifetime, parameter[]] assign[member[.body], call[.parseBlock, parameter[member[.scope], literal[false]]]] else begin[{] assign[member[.end], member[.index]] call[.matchEndLine, parameter[]] assign[member[.body], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Stmt, sub_type=ReferenceType(arguments=None, dimensions=None, name=Block, sub_type=None)))] end[}] local_variable[type[WyilFile], declaration] if[member[.isFunction]] begin[{] assign[member[.declaration], ClassCreator(arguments=[MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=returns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=requires, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ensures, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=body, 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=Decl, sub_type=ReferenceType(arguments=None, dimensions=None, name=Function, sub_type=None)))] else begin[{] assign[member[.declaration], ClassCreator(arguments=[MemberReference(member=modifiers, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=returns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=requires, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ensures, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=body, 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=Decl, sub_type=ReferenceType(arguments=None, dimensions=None, name=Method, sub_type=None)))] end[}] return[call[.annotateSourceLocation, parameter[member[.declaration], member[.start], binary_operation[member[.end], -, literal[1]]]]] end[}] END[}]
Keyword[private] identifier[Decl] operator[SEP] identifier[FunctionOrMethod] identifier[parseFunctionOrMethodDeclaration] operator[SEP] identifier[Tuple] operator[<] identifier[Modifier] operator[>] identifier[modifiers] , Keyword[boolean] identifier[isFunction] operator[SEP] { Keyword[int] identifier[start] operator[=] identifier[index] operator[SEP] identifier[EnclosingScope] identifier[scope] operator[=] Keyword[new] identifier[EnclosingScope] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isFunction] operator[SEP] { identifier[match] operator[SEP] identifier[Function] operator[SEP] operator[SEP] } Keyword[else] { identifier[match] operator[SEP] identifier[Method] operator[SEP] operator[SEP] } identifier[Identifier] identifier[name] operator[=] identifier[parseIdentifier] operator[SEP] operator[SEP] operator[SEP] identifier[Tuple] operator[<] identifier[Template] operator[SEP] identifier[Variable] operator[>] identifier[template] operator[=] identifier[parseOptionalTemplate] operator[SEP] identifier[scope] operator[SEP] operator[SEP] identifier[Tuple] operator[<] identifier[Decl] operator[SEP] identifier[Variable] operator[>] identifier[parameters] operator[=] identifier[parseParameters] operator[SEP] identifier[scope] , identifier[RightBrace] operator[SEP] operator[SEP] identifier[Tuple] operator[<] identifier[Decl] operator[SEP] identifier[Variable] operator[>] identifier[returns] operator[SEP] Keyword[if] operator[SEP] identifier[tryAndMatch] operator[SEP] literal[boolean] , identifier[MinusGreater] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[returns] operator[=] identifier[parseOptionalParameters] operator[SEP] identifier[scope] operator[SEP] operator[SEP] } Keyword[else] { identifier[returns] operator[=] Keyword[new] identifier[Tuple] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[Tuple] operator[<] identifier[Expr] operator[>] identifier[requires] operator[=] identifier[parseInvariant] operator[SEP] identifier[scope] , identifier[Requires] operator[SEP] operator[SEP] identifier[Tuple] operator[<] identifier[Expr] operator[>] identifier[ensures] operator[=] identifier[parseInvariant] operator[SEP] identifier[scope] , identifier[Ensures] operator[SEP] operator[SEP] identifier[Stmt] operator[SEP] identifier[Block] identifier[body] operator[SEP] Keyword[int] identifier[end] operator[SEP] Keyword[if] operator[SEP] identifier[modifiers] operator[SEP] identifier[match] operator[SEP] identifier[Modifier] operator[SEP] identifier[Native] operator[SEP] Keyword[class] operator[SEP] operator[==] Other[null] operator[SEP] { identifier[match] operator[SEP] identifier[Colon] operator[SEP] operator[SEP] identifier[end] operator[=] identifier[index] operator[SEP] identifier[matchEndLine] operator[SEP] operator[SEP] operator[SEP] identifier[scope] operator[SEP] identifier[declareThisLifetime] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[=] identifier[parseBlock] operator[SEP] identifier[scope] , literal[boolean] operator[SEP] operator[SEP] } Keyword[else] { identifier[end] operator[=] identifier[index] operator[SEP] identifier[matchEndLine] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[=] Keyword[new] identifier[Stmt] operator[SEP] identifier[Block] operator[SEP] operator[SEP] operator[SEP] } identifier[WyilFile] operator[SEP] identifier[Decl] operator[SEP] identifier[FunctionOrMethod] identifier[declaration] operator[SEP] Keyword[if] operator[SEP] identifier[isFunction] operator[SEP] { identifier[declaration] operator[=] Keyword[new] identifier[Decl] operator[SEP] identifier[Function] operator[SEP] identifier[modifiers] , identifier[name] , identifier[template] , identifier[parameters] , identifier[returns] , identifier[requires] , identifier[ensures] , identifier[body] operator[SEP] operator[SEP] } Keyword[else] { identifier[declaration] operator[=] Keyword[new] identifier[Decl] operator[SEP] identifier[Method] operator[SEP] identifier[modifiers] , identifier[name] , identifier[template] , identifier[parameters] , identifier[returns] , identifier[requires] , identifier[ensures] , identifier[body] operator[SEP] operator[SEP] } Keyword[return] identifier[annotateSourceLocation] operator[SEP] identifier[declaration] , identifier[start] , identifier[end] operator[-] Other[1] operator[SEP] operator[SEP] }
public static sslpolicylabel get(nitro_service service, String labelname) throws Exception{ sslpolicylabel obj = new sslpolicylabel(); obj.set_labelname(labelname); sslpolicylabel response = (sslpolicylabel) obj.get_resource(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[sslpolicylabel]], modifier[public static], parameter[service, labelname]] begin[{] local_variable[type[sslpolicylabel], obj] call[obj.set_labelname, parameter[member[.labelname]]] local_variable[type[sslpolicylabel], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[sslpolicylabel] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[labelname] operator[SEP] Keyword[throws] identifier[Exception] { identifier[sslpolicylabel] identifier[obj] operator[=] Keyword[new] identifier[sslpolicylabel] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_labelname] operator[SEP] identifier[labelname] operator[SEP] operator[SEP] identifier[sslpolicylabel] identifier[response] operator[=] operator[SEP] identifier[sslpolicylabel] operator[SEP] identifier[obj] operator[SEP] identifier[get_resource] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
public ScreenParent makeScreen(ScreenLoc itsLocation, ComponentParent parentScreen, int iDocMode, Map<String, Object> properties) { iDocMode = iDocMode | ScreenConstants.MAINT_MODE; // Control files are always forms. return super.makeScreen(itsLocation, parentScreen, iDocMode, properties); }
class class_name[name] begin[{] method[makeScreen, return_type[type[ScreenParent]], modifier[public], parameter[itsLocation, parentScreen, iDocMode, properties]] begin[{] assign[member[.iDocMode], binary_operation[member[.iDocMode], |, member[ScreenConstants.MAINT_MODE]]] return[SuperMethodInvocation(arguments=[MemberReference(member=itsLocation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentScreen, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iDocMode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=makeScreen, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
Keyword[public] identifier[ScreenParent] identifier[makeScreen] operator[SEP] identifier[ScreenLoc] identifier[itsLocation] , identifier[ComponentParent] identifier[parentScreen] , Keyword[int] identifier[iDocMode] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[SEP] { identifier[iDocMode] operator[=] identifier[iDocMode] operator[|] identifier[ScreenConstants] operator[SEP] identifier[MAINT_MODE] operator[SEP] Keyword[return] Keyword[super] operator[SEP] identifier[makeScreen] operator[SEP] identifier[itsLocation] , identifier[parentScreen] , identifier[iDocMode] , identifier[properties] operator[SEP] operator[SEP] }
private List<MtasTokenString> getPrefixFilteredObjects( List<MtasTreeHit<?>> hits, List<String> prefixes) throws IOException { ArrayList<MtasTokenString> tokens = new ArrayList<>(); IndexInput inObject = indexInputList.get("object"); IndexInput inTerm = indexInputList.get("term"); for (MtasTreeHit<?> hit : hits) { MtasTokenString token = MtasCodecPostingsFormat.getToken(inObject, inTerm, hit.ref); if (token != null) { if (prefixes != null && !prefixes.isEmpty()) { if (prefixes.contains(token.getPrefix())) { tokens.add(token); } } else { tokens.add(token); } } } return tokens; }
class class_name[name] begin[{] method[getPrefixFilteredObjects, return_type[type[List]], modifier[private], parameter[hits, prefixes]] begin[{] local_variable[type[ArrayList], tokens] local_variable[type[IndexInput], inObject] local_variable[type[IndexInput], inTerm] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=inObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inTerm, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ref, postfix_operators=[], prefix_operators=[], qualifier=hit, selectors=[])], member=getToken, postfix_operators=[], prefix_operators=[], qualifier=MtasCodecPostingsFormat, selectors=[], type_arguments=None), name=token)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MtasTokenString, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=token, 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=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=prefixes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=prefixes, selectors=[], type_arguments=None), operator=&&), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPrefix, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=prefixes, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=tokens, selectors=[], type_arguments=None), label=None)]))]))]))]), control=EnhancedForControl(iterable=MemberReference(member=hits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=hit)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=MtasTreeHit, sub_type=None))), label=None) return[member[.tokens]] end[}] END[}]
Keyword[private] identifier[List] operator[<] identifier[MtasTokenString] operator[>] identifier[getPrefixFilteredObjects] operator[SEP] identifier[List] operator[<] identifier[MtasTreeHit] operator[<] operator[?] operator[>] operator[>] identifier[hits] , identifier[List] operator[<] identifier[String] operator[>] identifier[prefixes] operator[SEP] Keyword[throws] identifier[IOException] { identifier[ArrayList] operator[<] identifier[MtasTokenString] operator[>] identifier[tokens] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[IndexInput] identifier[inObject] operator[=] identifier[indexInputList] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[IndexInput] identifier[inTerm] operator[=] identifier[indexInputList] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[MtasTreeHit] operator[<] operator[?] operator[>] identifier[hit] operator[:] identifier[hits] operator[SEP] { identifier[MtasTokenString] identifier[token] operator[=] identifier[MtasCodecPostingsFormat] operator[SEP] identifier[getToken] operator[SEP] identifier[inObject] , identifier[inTerm] , identifier[hit] operator[SEP] identifier[ref] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[token] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[prefixes] operator[!=] Other[null] operator[&&] operator[!] identifier[prefixes] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[prefixes] operator[SEP] identifier[contains] operator[SEP] identifier[token] operator[SEP] identifier[getPrefix] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[tokens] operator[SEP] identifier[add] operator[SEP] identifier[token] operator[SEP] operator[SEP] } } Keyword[else] { identifier[tokens] operator[SEP] identifier[add] operator[SEP] identifier[token] operator[SEP] operator[SEP] } } } Keyword[return] identifier[tokens] operator[SEP] }
public static <K> NumberMap<K, Integer> newIntegerMap() { return new NumberMap<K, Integer>() { @Override public void add(K key, Integer addend) { put(key, containsKey(key) ? (get(key) + addend) : addend); } @Override public void sub(K key, Integer subtrahend) { put(key, (containsKey(key) ? get(key) : 0) - subtrahend); } }; }
class class_name[name] begin[{] method[newIntegerMap, return_type[type[NumberMap]], modifier[public static], parameter[]] begin[{] return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=MemberReference(member=addend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=MemberReference(member=addend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))], member=put, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=add, parameters=[FormalParameter(annotations=[], modifiers=set(), name=key, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=addend, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), operandr=MemberReference(member=subtrahend, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-)], member=put, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=sub, parameters=[FormalParameter(annotations=[], modifiers=set(), name=key, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=subtrahend, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=NumberMap, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[K] operator[>] identifier[NumberMap] operator[<] identifier[K] , identifier[Integer] operator[>] identifier[newIntegerMap] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[NumberMap] operator[<] identifier[K] , identifier[Integer] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[add] operator[SEP] identifier[K] identifier[key] , identifier[Integer] identifier[addend] operator[SEP] { identifier[put] operator[SEP] identifier[key] , identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[?] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[+] identifier[addend] operator[SEP] operator[:] identifier[addend] operator[SEP] operator[SEP] } annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[sub] operator[SEP] identifier[K] identifier[key] , identifier[Integer] identifier[subtrahend] operator[SEP] { identifier[put] operator[SEP] identifier[key] , operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[?] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[:] Other[0] operator[SEP] operator[-] identifier[subtrahend] operator[SEP] operator[SEP] } } operator[SEP] }
private void enterBinop(String name, Type left, Type right, Type res, int opcode1, int opcode2) { enterBinop( name, left, right, res, (opcode1 << ByteCodes.preShift) | opcode2); }
class class_name[name] begin[{] method[enterBinop, return_type[void], modifier[private], parameter[name, left, right, res, opcode1, opcode2]] begin[{] call[.enterBinop, parameter[member[.name], member[.left], member[.right], member[.res], binary_operation[binary_operation[member[.opcode1], <<, member[ByteCodes.preShift]], |, member[.opcode2]]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[enterBinop] operator[SEP] identifier[String] identifier[name] , identifier[Type] identifier[left] , identifier[Type] identifier[right] , identifier[Type] identifier[res] , Keyword[int] identifier[opcode1] , Keyword[int] identifier[opcode2] operator[SEP] { identifier[enterBinop] operator[SEP] identifier[name] , identifier[left] , identifier[right] , identifier[res] , operator[SEP] identifier[opcode1] operator[<<] identifier[ByteCodes] operator[SEP] identifier[preShift] operator[SEP] operator[|] identifier[opcode2] operator[SEP] operator[SEP] }
public void marshall(RedshiftDatabase redshiftDatabase, ProtocolMarshaller protocolMarshaller) { if (redshiftDatabase == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(redshiftDatabase.getDatabaseName(), DATABASENAME_BINDING); protocolMarshaller.marshall(redshiftDatabase.getClusterIdentifier(), CLUSTERIDENTIFIER_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[redshiftDatabase, protocolMarshaller]] begin[{] if[binary_operation[member[.redshiftDatabase], ==, 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=getDatabaseName, postfix_operators=[], prefix_operators=[], qualifier=redshiftDatabase, selectors=[], type_arguments=None), MemberReference(member=DATABASENAME_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=getClusterIdentifier, postfix_operators=[], prefix_operators=[], qualifier=redshiftDatabase, selectors=[], type_arguments=None), MemberReference(member=CLUSTERIDENTIFIER_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[RedshiftDatabase] identifier[redshiftDatabase] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[redshiftDatabase] 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[redshiftDatabase] operator[SEP] identifier[getDatabaseName] operator[SEP] operator[SEP] , identifier[DATABASENAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[redshiftDatabase] operator[SEP] identifier[getClusterIdentifier] operator[SEP] operator[SEP] , identifier[CLUSTERIDENTIFIER_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] } }
@Override public Processor newProcessor(Processor p) { AMRulesRegressorProcessor oldProcessor = (AMRulesRegressorProcessor) p; Builder builder = new Builder(oldProcessor); AMRulesRegressorProcessor newProcessor = builder.build(); newProcessor.resultStream = oldProcessor.resultStream; return newProcessor; }
class class_name[name] begin[{] method[newProcessor, return_type[type[Processor]], modifier[public], parameter[p]] begin[{] local_variable[type[AMRulesRegressorProcessor], oldProcessor] local_variable[type[Builder], builder] local_variable[type[AMRulesRegressorProcessor], newProcessor] assign[member[newProcessor.resultStream], member[oldProcessor.resultStream]] return[member[.newProcessor]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Processor] identifier[newProcessor] operator[SEP] identifier[Processor] identifier[p] operator[SEP] { identifier[AMRulesRegressorProcessor] identifier[oldProcessor] operator[=] operator[SEP] identifier[AMRulesRegressorProcessor] operator[SEP] identifier[p] operator[SEP] identifier[Builder] identifier[builder] operator[=] Keyword[new] identifier[Builder] operator[SEP] identifier[oldProcessor] operator[SEP] operator[SEP] identifier[AMRulesRegressorProcessor] identifier[newProcessor] operator[=] identifier[builder] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[newProcessor] operator[SEP] identifier[resultStream] operator[=] identifier[oldProcessor] operator[SEP] identifier[resultStream] operator[SEP] Keyword[return] identifier[newProcessor] operator[SEP] }
@TaskAction public void deployAction() throws AppEngineException { gcloud .newDeployment(CloudSdkOperations.getDefaultHandler(getLogger())) .deployQueue(deployExtension.toDeployProjectConfigurationConfiguration()); }
class class_name[name] begin[{] method[deployAction, return_type[void], modifier[public], parameter[]] begin[{] call[gcloud.newDeployment, parameter[call[CloudSdkOperations.getDefaultHandler, parameter[call[.getLogger, parameter[]]]]]] end[}] END[}]
annotation[@] identifier[TaskAction] Keyword[public] Keyword[void] identifier[deployAction] operator[SEP] operator[SEP] Keyword[throws] identifier[AppEngineException] { identifier[gcloud] operator[SEP] identifier[newDeployment] operator[SEP] identifier[CloudSdkOperations] operator[SEP] identifier[getDefaultHandler] operator[SEP] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[deployQueue] operator[SEP] identifier[deployExtension] operator[SEP] identifier[toDeployProjectConfigurationConfiguration] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Nonnull public IMimeType getMimeTypeFromString (@Nullable final String s, @Nonnull final Charset aCharset) { return getMimeTypeFromString (s, aCharset, DEFAULT_MIME_TYPE); }
class class_name[name] begin[{] method[getMimeTypeFromString, return_type[type[IMimeType]], modifier[public], parameter[s, aCharset]] begin[{] return[call[.getMimeTypeFromString, parameter[member[.s], member[.aCharset], member[.DEFAULT_MIME_TYPE]]]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] identifier[IMimeType] identifier[getMimeTypeFromString] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[s] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Charset] identifier[aCharset] operator[SEP] { Keyword[return] identifier[getMimeTypeFromString] operator[SEP] identifier[s] , identifier[aCharset] , identifier[DEFAULT_MIME_TYPE] operator[SEP] operator[SEP] }
@Override public int compareTo(AbstractPersistable other) { return new CompareToBuilder() .append(getClass().getName(), other.getClass().getName()) .append(id, other.id) .toComparison(); }
class class_name[name] begin[{] method[compareTo, return_type[type[int]], modifier[public], parameter[other]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=other, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toComparison, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=CompareToBuilder, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compareTo] operator[SEP] identifier[AbstractPersistable] identifier[other] operator[SEP] { Keyword[return] Keyword[new] identifier[CompareToBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[other] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[id] , identifier[other] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[toComparison] operator[SEP] operator[SEP] operator[SEP] }
@Override public List<CommerceNotificationQueueEntry> findByLtS(Date sentDate, int start, int end) { return findByLtS(sentDate, start, end, null); }
class class_name[name] begin[{] method[findByLtS, return_type[type[List]], modifier[public], parameter[sentDate, start, end]] begin[{] return[call[.findByLtS, parameter[member[.sentDate], member[.start], member[.end], literal[null]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CommerceNotificationQueueEntry] operator[>] identifier[findByLtS] operator[SEP] identifier[Date] identifier[sentDate] , Keyword[int] identifier[start] , Keyword[int] identifier[end] operator[SEP] { Keyword[return] identifier[findByLtS] operator[SEP] identifier[sentDate] , identifier[start] , identifier[end] , Other[null] operator[SEP] operator[SEP] }
public static <T extends QueryResult> OneQuery<T> one(Class<T> clazz, int sqlResId, Object... sqlArgs) { String sql = Utils.readRawText(sqlResId); return one(clazz, sql, sqlArgs); }
class class_name[name] begin[{] method[one, return_type[type[OneQuery]], modifier[public static], parameter[clazz, sqlResId, sqlArgs]] begin[{] local_variable[type[String], sql] return[call[.one, parameter[member[.clazz], member[.sql], member[.sqlArgs]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[QueryResult] operator[>] identifier[OneQuery] operator[<] identifier[T] operator[>] identifier[one] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[clazz] , Keyword[int] identifier[sqlResId] , identifier[Object] operator[...] identifier[sqlArgs] operator[SEP] { identifier[String] identifier[sql] operator[=] identifier[Utils] operator[SEP] identifier[readRawText] operator[SEP] identifier[sqlResId] operator[SEP] operator[SEP] Keyword[return] identifier[one] operator[SEP] identifier[clazz] , identifier[sql] , identifier[sqlArgs] operator[SEP] operator[SEP] }
@Override public String getBhRestToken() { String bhRestToken = null; try { bhRestToken = restSession.getBhRestToken(); } catch (RestApiException e) { log.error("Error getting bhRestToken! ", e); } return bhRestToken; }
class class_name[name] begin[{] method[getBhRestToken, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[String], bhRestToken] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=bhRestToken, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getBhRestToken, postfix_operators=[], prefix_operators=[], qualifier=restSession, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error getting bhRestToken! "), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RestApiException']))], finally_block=None, label=None, resources=None) return[member[.bhRestToken]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getBhRestToken] operator[SEP] operator[SEP] { identifier[String] identifier[bhRestToken] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[bhRestToken] operator[=] identifier[restSession] operator[SEP] identifier[getBhRestToken] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[RestApiException] identifier[e] operator[SEP] { identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] identifier[bhRestToken] operator[SEP] }
@CheckReturnValue @NonNull @SchedulerSupport(SchedulerSupport.NONE) public static <T> Completable fromMaybe(final MaybeSource<T> maybe) { ObjectHelper.requireNonNull(maybe, "maybe is null"); return RxJavaPlugins.onAssembly(new MaybeIgnoreElementCompletable<T>(maybe)); }
class class_name[name] begin[{] method[fromMaybe, return_type[type[Completable]], modifier[public static], parameter[maybe]] begin[{] call[ObjectHelper.requireNonNull, parameter[member[.maybe], literal["maybe is null"]]] return[call[RxJavaPlugins.onAssembly, parameter[ClassCreator(arguments=[MemberReference(member=maybe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=MaybeIgnoreElementCompletable, sub_type=None))]]] end[}] END[}]
annotation[@] identifier[CheckReturnValue] annotation[@] identifier[NonNull] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Completable] identifier[fromMaybe] operator[SEP] Keyword[final] identifier[MaybeSource] operator[<] identifier[T] operator[>] identifier[maybe] operator[SEP] { identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[maybe] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[RxJavaPlugins] operator[SEP] identifier[onAssembly] operator[SEP] Keyword[new] identifier[MaybeIgnoreElementCompletable] operator[<] identifier[T] operator[>] operator[SEP] identifier[maybe] operator[SEP] operator[SEP] operator[SEP] }
public static Schema keySchema(Schema schema, PartitionStrategy strategy) { List<Schema.Field> partitionFields = new ArrayList<Schema.Field>(); for (FieldPartitioner<?, ?> fp : Accessor.getDefault().getFieldPartitioners(strategy)) { partitionFields.add(partitionField(fp, schema)); } Schema keySchema = Schema.createRecord( schema.getName() + "KeySchema", null, null, false); keySchema.setFields(partitionFields); return keySchema; }
class class_name[name] begin[{] method[keySchema, return_type[type[Schema]], modifier[public static], parameter[schema, strategy]] begin[{] local_variable[type[List], partitionFields] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=fp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=schema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=partitionField, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=partitionFields, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=Accessor, selectors=[MethodInvocation(arguments=[MemberReference(member=strategy, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getFieldPartitioners, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fp)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=FieldPartitioner, sub_type=None))), label=None) local_variable[type[Schema], keySchema] call[keySchema.setFields, parameter[member[.partitionFields]]] return[member[.keySchema]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Schema] identifier[keySchema] operator[SEP] identifier[Schema] identifier[schema] , identifier[PartitionStrategy] identifier[strategy] operator[SEP] { identifier[List] operator[<] identifier[Schema] operator[SEP] identifier[Field] operator[>] identifier[partitionFields] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Schema] operator[SEP] identifier[Field] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[FieldPartitioner] operator[<] operator[?] , operator[?] operator[>] identifier[fp] operator[:] identifier[Accessor] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[getFieldPartitioners] operator[SEP] identifier[strategy] operator[SEP] operator[SEP] { identifier[partitionFields] operator[SEP] identifier[add] operator[SEP] identifier[partitionField] operator[SEP] identifier[fp] , identifier[schema] operator[SEP] operator[SEP] operator[SEP] } identifier[Schema] identifier[keySchema] operator[=] identifier[Schema] operator[SEP] identifier[createRecord] operator[SEP] identifier[schema] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] , Other[null] , Other[null] , literal[boolean] operator[SEP] operator[SEP] identifier[keySchema] operator[SEP] identifier[setFields] operator[SEP] identifier[partitionFields] operator[SEP] operator[SEP] Keyword[return] identifier[keySchema] operator[SEP] }
public void registerGraph(long graphId, @NonNull SameDiff graph, ExecutorConfiguration configuration) { val g = graph.asFlatGraph(graphId, configuration); val v = blockingStub.registerGraph(g); if (v.status() != 0) throw new ND4JIllegalStateException("registerGraph() gRPC call failed"); }
class class_name[name] begin[{] method[registerGraph, return_type[void], modifier[public], parameter[graphId, graph, configuration]] begin[{] local_variable[type[val], g] local_variable[type[val], v] if[binary_operation[call[v.status, parameter[]], !=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="registerGraph() gRPC call failed")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ND4JIllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerGraph] operator[SEP] Keyword[long] identifier[graphId] , annotation[@] identifier[NonNull] identifier[SameDiff] identifier[graph] , identifier[ExecutorConfiguration] identifier[configuration] operator[SEP] { identifier[val] identifier[g] operator[=] identifier[graph] operator[SEP] identifier[asFlatGraph] operator[SEP] identifier[graphId] , identifier[configuration] operator[SEP] operator[SEP] identifier[val] identifier[v] operator[=] identifier[blockingStub] operator[SEP] identifier[registerGraph] operator[SEP] identifier[g] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[SEP] identifier[status] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[ND4JIllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] }
@Override @SuppressWarnings("unchecked") public TemporalDataModelIF<Long, Long> run(final RUN_OPTIONS opts) throws RecommenderException { if (isAlreadyRecommended()) { return null; } File trainingFile = new File(getProperties().getProperty(RecommendationRunner.TRAINING_SET)); File testFile = new File(getProperties().getProperty(RecommendationRunner.TEST_SET)); try { Configuration confTraining = new Configuration(); confTraining.set(Configured.CONF_DATA_INPUT_PATH, trainingFile.getAbsolutePath()); confTraining.set(Configured.CONF_DATA_COLUMN_FORMAT, "UIR"); confTraining.set("data.model.splitter", "ratio"); confTraining.set("data.splitter.trainset.ratio", "0.999"); confTraining.set("data.splitter.ratio", "rating"); DataModel training = new TextDataModel(confTraining); training.buildDataModel(); Configuration confTest = new Configuration(); confTest.set(Configured.CONF_DATA_INPUT_PATH, testFile.getAbsolutePath()); confTest.set(Configured.CONF_DATA_COLUMN_FORMAT, "UIR"); confTest.set("data.model.splitter", "ratio"); confTest.set("data.splitter.trainset.ratio", "0.999"); confTest.set("data.splitter.ratio", "rating"); DataModel test = new TextDataModel(confTest); test.buildDataModel(); return runLibrecRecommender(opts, training, test); } catch (LibrecException e) { e.printStackTrace(); throw new RecommenderException(e.getMessage()); } }
class class_name[name] begin[{] method[run, return_type[type[TemporalDataModelIF]], modifier[public], parameter[opts]] begin[{] if[call[.isAlreadyRecommended, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[File], trainingFile] local_variable[type[File], testFile] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Configuration, sub_type=None)), name=confTraining)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Configuration, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CONF_DATA_INPUT_PATH, postfix_operators=[], prefix_operators=[], qualifier=Configured, selectors=[]), MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=trainingFile, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=confTraining, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CONF_DATA_COLUMN_FORMAT, postfix_operators=[], prefix_operators=[], qualifier=Configured, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UIR")], member=set, postfix_operators=[], prefix_operators=[], qualifier=confTraining, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data.model.splitter"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ratio")], member=set, postfix_operators=[], prefix_operators=[], qualifier=confTraining, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data.splitter.trainset.ratio"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0.999")], member=set, postfix_operators=[], prefix_operators=[], qualifier=confTraining, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data.splitter.ratio"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rating")], member=set, postfix_operators=[], prefix_operators=[], qualifier=confTraining, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=confTraining, 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=TextDataModel, sub_type=None)), name=training)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataModel, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=buildDataModel, postfix_operators=[], prefix_operators=[], qualifier=training, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Configuration, sub_type=None)), name=confTest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Configuration, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CONF_DATA_INPUT_PATH, postfix_operators=[], prefix_operators=[], qualifier=Configured, selectors=[]), MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=[], prefix_operators=[], qualifier=testFile, selectors=[], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=confTest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=CONF_DATA_COLUMN_FORMAT, postfix_operators=[], prefix_operators=[], qualifier=Configured, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UIR")], member=set, postfix_operators=[], prefix_operators=[], qualifier=confTest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data.model.splitter"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ratio")], member=set, postfix_operators=[], prefix_operators=[], qualifier=confTest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data.splitter.trainset.ratio"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="0.999")], member=set, postfix_operators=[], prefix_operators=[], qualifier=confTest, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="data.splitter.ratio"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="rating")], member=set, postfix_operators=[], prefix_operators=[], qualifier=confTest, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=confTest, 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=TextDataModel, sub_type=None)), name=test)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DataModel, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=buildDataModel, postfix_operators=[], prefix_operators=[], qualifier=test, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=opts, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=training, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=test, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=runLibrecRecommender, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RecommenderException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['LibrecException']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[TemporalDataModelIF] operator[<] identifier[Long] , identifier[Long] operator[>] identifier[run] operator[SEP] Keyword[final] identifier[RUN_OPTIONS] identifier[opts] operator[SEP] Keyword[throws] identifier[RecommenderException] { Keyword[if] operator[SEP] identifier[isAlreadyRecommended] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[File] identifier[trainingFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[TRAINING_SET] operator[SEP] operator[SEP] operator[SEP] identifier[File] identifier[testFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[getProperties] operator[SEP] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] identifier[RecommendationRunner] operator[SEP] identifier[TEST_SET] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Configuration] identifier[confTraining] operator[=] Keyword[new] identifier[Configuration] operator[SEP] operator[SEP] operator[SEP] identifier[confTraining] operator[SEP] identifier[set] operator[SEP] identifier[Configured] operator[SEP] identifier[CONF_DATA_INPUT_PATH] , identifier[trainingFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[confTraining] operator[SEP] identifier[set] operator[SEP] identifier[Configured] operator[SEP] identifier[CONF_DATA_COLUMN_FORMAT] , literal[String] operator[SEP] operator[SEP] identifier[confTraining] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[confTraining] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[confTraining] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[DataModel] identifier[training] operator[=] Keyword[new] identifier[TextDataModel] operator[SEP] identifier[confTraining] operator[SEP] operator[SEP] identifier[training] operator[SEP] identifier[buildDataModel] operator[SEP] operator[SEP] operator[SEP] identifier[Configuration] identifier[confTest] operator[=] Keyword[new] identifier[Configuration] operator[SEP] operator[SEP] operator[SEP] identifier[confTest] operator[SEP] identifier[set] operator[SEP] identifier[Configured] operator[SEP] identifier[CONF_DATA_INPUT_PATH] , identifier[testFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[confTest] operator[SEP] identifier[set] operator[SEP] identifier[Configured] operator[SEP] identifier[CONF_DATA_COLUMN_FORMAT] , literal[String] operator[SEP] operator[SEP] identifier[confTest] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[confTest] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[confTest] operator[SEP] identifier[set] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[DataModel] identifier[test] operator[=] Keyword[new] identifier[TextDataModel] operator[SEP] identifier[confTest] operator[SEP] operator[SEP] identifier[test] operator[SEP] identifier[buildDataModel] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[runLibrecRecommender] operator[SEP] identifier[opts] , identifier[training] , identifier[test] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[LibrecException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RecommenderException] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public Map<String, Boolean> mapTenants(final User user, Set<String> roles) { return this.tenantHolder.mapTenants(user, roles); }
class class_name[name] begin[{] method[mapTenants, return_type[type[Map]], modifier[public], parameter[user, roles]] begin[{] return[THIS[member[None.tenantHolder]call[None.mapTenants, parameter[member[.user], member[.roles]]]]] end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Boolean] operator[>] identifier[mapTenants] operator[SEP] Keyword[final] identifier[User] identifier[user] , identifier[Set] operator[<] identifier[String] operator[>] identifier[roles] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] identifier[tenantHolder] operator[SEP] identifier[mapTenants] operator[SEP] identifier[user] , identifier[roles] operator[SEP] operator[SEP] }
public static boolean isStepOnRequest(final Request request) { String val = request.getParameter(Environment.STEP_VARIABLE); return val != null; }
class class_name[name] begin[{] method[isStepOnRequest, return_type[type[boolean]], modifier[public static], parameter[request]] begin[{] local_variable[type[String], val] return[binary_operation[member[.val], !=, literal[null]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isStepOnRequest] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] { identifier[String] identifier[val] operator[=] identifier[request] operator[SEP] identifier[getParameter] operator[SEP] identifier[Environment] operator[SEP] identifier[STEP_VARIABLE] operator[SEP] operator[SEP] Keyword[return] identifier[val] operator[!=] Other[null] operator[SEP] }
protected synchronized C loadNetTimeConfiguration() { ServiceLoader<C> sl = ServiceLoader.load(this.getConfigurationType()); C loaded = null; for (C cfg : sl) { if (cfg != null) { loaded = cfg; break; } } if (loaded == null) { loaded = this.defaultNTC; } String addr = loaded.getTimeServerAddress(); int port = loaded.getTimeServerPort(); if ( (addr == null) || addr.trim().isEmpty() ) { throw new IllegalStateException("Missing time server address."); } else if (loaded.getConnectionTimeout() < 0) { throw new IllegalStateException("Negative time out."); } else if ((port < 0) || (port > 65536)) { throw new IllegalStateException("Port out of range: " + port); } else if (loaded.getClockShiftWindow() < 0) { throw new IllegalStateException("Clock shift window is negative."); } return loaded; }
class class_name[name] begin[{] method[loadNetTimeConfiguration, return_type[type[C]], modifier[synchronized protected], parameter[]] begin[{] local_variable[type[ServiceLoader], sl] local_variable[type[C], loaded] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cfg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=loaded, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=cfg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=sl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cfg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None))), label=None) if[binary_operation[member[.loaded], ==, literal[null]]] begin[{] assign[member[.loaded], THIS[member[None.defaultNTC]]] else begin[{] None end[}] local_variable[type[String], addr] local_variable[type[int], port] if[binary_operation[binary_operation[member[.addr], ==, literal[null]], ||, call[addr.trim, parameter[]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing time server address.")], 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[{] if[binary_operation[call[loaded.getConnectionTimeout, parameter[]], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Negative time out.")], 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[{] if[binary_operation[binary_operation[member[.port], <, literal[0]], ||, binary_operation[member[.port], >, literal[65536]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Port out of range: "), operandr=MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] if[binary_operation[call[loaded.getClockShiftWindow, parameter[]], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Clock shift window is negative.")], 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[}] end[}] end[}] end[}] return[member[.loaded]] end[}] END[}]
Keyword[protected] Keyword[synchronized] identifier[C] identifier[loadNetTimeConfiguration] operator[SEP] operator[SEP] { identifier[ServiceLoader] operator[<] identifier[C] operator[>] identifier[sl] operator[=] identifier[ServiceLoader] operator[SEP] identifier[load] operator[SEP] Keyword[this] operator[SEP] identifier[getConfigurationType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[C] identifier[loaded] operator[=] Other[null] operator[SEP] Keyword[for] operator[SEP] identifier[C] identifier[cfg] operator[:] identifier[sl] operator[SEP] { Keyword[if] operator[SEP] identifier[cfg] operator[!=] Other[null] operator[SEP] { identifier[loaded] operator[=] identifier[cfg] operator[SEP] Keyword[break] operator[SEP] } } Keyword[if] operator[SEP] identifier[loaded] operator[==] Other[null] operator[SEP] { identifier[loaded] operator[=] Keyword[this] operator[SEP] identifier[defaultNTC] operator[SEP] } identifier[String] identifier[addr] operator[=] identifier[loaded] operator[SEP] identifier[getTimeServerAddress] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[port] operator[=] identifier[loaded] operator[SEP] identifier[getTimeServerPort] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[addr] operator[==] Other[null] operator[SEP] operator[||] identifier[addr] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[loaded] operator[SEP] identifier[getConnectionTimeout] operator[SEP] operator[SEP] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[port] operator[<] Other[0] operator[SEP] operator[||] operator[SEP] identifier[port] operator[>] Other[65536] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[port] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[loaded] operator[SEP] identifier[getClockShiftWindow] operator[SEP] operator[SEP] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[loaded] operator[SEP] }
public void addPropertyItemRule(ItemRule propertyItemRule) { if (propertyItemRuleMap == null) { propertyItemRuleMap = new ItemRuleMap(); } propertyItemRuleMap.putItemRule(propertyItemRule); }
class class_name[name] begin[{] method[addPropertyItemRule, return_type[void], modifier[public], parameter[propertyItemRule]] begin[{] if[binary_operation[member[.propertyItemRuleMap], ==, literal[null]]] begin[{] assign[member[.propertyItemRuleMap], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ItemRuleMap, sub_type=None))] else begin[{] None end[}] call[propertyItemRuleMap.putItemRule, parameter[member[.propertyItemRule]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addPropertyItemRule] operator[SEP] identifier[ItemRule] identifier[propertyItemRule] operator[SEP] { Keyword[if] operator[SEP] identifier[propertyItemRuleMap] operator[==] Other[null] operator[SEP] { identifier[propertyItemRuleMap] operator[=] Keyword[new] identifier[ItemRuleMap] operator[SEP] operator[SEP] operator[SEP] } identifier[propertyItemRuleMap] operator[SEP] identifier[putItemRule] operator[SEP] identifier[propertyItemRule] operator[SEP] operator[SEP] }
public static SoundManager createSoundManager (RunQueue rqueue) { if (_soundmgr != null) { throw new IllegalStateException("A sound manager has already been created."); } _soundmgr = new SoundManager(rqueue); return _soundmgr; }
class class_name[name] begin[{] method[createSoundManager, return_type[type[SoundManager]], modifier[public static], parameter[rqueue]] begin[{] if[binary_operation[member[._soundmgr], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="A sound manager has already been created.")], 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[}] assign[member[._soundmgr], ClassCreator(arguments=[MemberReference(member=rqueue, 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=SoundManager, sub_type=None))] return[member[._soundmgr]] end[}] END[}]
Keyword[public] Keyword[static] identifier[SoundManager] identifier[createSoundManager] operator[SEP] identifier[RunQueue] identifier[rqueue] operator[SEP] { Keyword[if] operator[SEP] identifier[_soundmgr] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[_soundmgr] operator[=] Keyword[new] identifier[SoundManager] operator[SEP] identifier[rqueue] operator[SEP] operator[SEP] Keyword[return] identifier[_soundmgr] operator[SEP] }
@Nonnull public QValue getQValueOfMimeType (@Nonnull final IMimeType aMimeType) { ValueEnforcer.notNull (aMimeType, "MimeType"); // Extract only the real MIME type, without any parameters! final IMimeType aRealMimeType = aMimeType.getCopyWithoutParameters (); QValue aQuality = m_aMap.get (aRealMimeType); if (aQuality == null) { // Check for "contenttype/*" aQuality = m_aMap.get (aRealMimeType.getContentType ().buildMimeType ("*")); if (aQuality == null) { // If not explicitly given, check for "*" aQuality = m_aMap.get (AcceptMimeTypeHandler.ANY_MIMETYPE); if (aQuality == null) { // Neither charset nor "*" nor "*/*" is present return QValue.MIN_QVALUE; } } } return aQuality; }
class class_name[name] begin[{] method[getQValueOfMimeType, return_type[type[QValue]], modifier[public], parameter[aMimeType]] begin[{] call[ValueEnforcer.notNull, parameter[member[.aMimeType], literal["MimeType"]]] local_variable[type[IMimeType], aRealMimeType] local_variable[type[QValue], aQuality] if[binary_operation[member[.aQuality], ==, literal[null]]] begin[{] assign[member[.aQuality], call[m_aMap.get, parameter[call[aRealMimeType.getContentType, parameter[]]]]] if[binary_operation[member[.aQuality], ==, literal[null]]] begin[{] assign[member[.aQuality], call[m_aMap.get, parameter[member[AcceptMimeTypeHandler.ANY_MIMETYPE]]]] if[binary_operation[member[.aQuality], ==, literal[null]]] begin[{] return[member[QValue.MIN_QVALUE]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] return[member[.aQuality]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] identifier[QValue] identifier[getQValueOfMimeType] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[IMimeType] identifier[aMimeType] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aMimeType] , literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[IMimeType] identifier[aRealMimeType] operator[=] identifier[aMimeType] operator[SEP] identifier[getCopyWithoutParameters] operator[SEP] operator[SEP] operator[SEP] identifier[QValue] identifier[aQuality] operator[=] identifier[m_aMap] operator[SEP] identifier[get] operator[SEP] identifier[aRealMimeType] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aQuality] operator[==] Other[null] operator[SEP] { identifier[aQuality] operator[=] identifier[m_aMap] operator[SEP] identifier[get] operator[SEP] identifier[aRealMimeType] operator[SEP] identifier[getContentType] operator[SEP] operator[SEP] operator[SEP] identifier[buildMimeType] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aQuality] operator[==] Other[null] operator[SEP] { identifier[aQuality] operator[=] identifier[m_aMap] operator[SEP] identifier[get] operator[SEP] identifier[AcceptMimeTypeHandler] operator[SEP] identifier[ANY_MIMETYPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aQuality] operator[==] Other[null] operator[SEP] { Keyword[return] identifier[QValue] operator[SEP] identifier[MIN_QVALUE] operator[SEP] } } } Keyword[return] identifier[aQuality] operator[SEP] }
public static sslcrl_binding get(nitro_service service, String crlname) throws Exception{ sslcrl_binding obj = new sslcrl_binding(); obj.set_crlname(crlname); sslcrl_binding response = (sslcrl_binding) obj.get_resource(service); return response; }
class class_name[name] begin[{] method[get, return_type[type[sslcrl_binding]], modifier[public static], parameter[service, crlname]] begin[{] local_variable[type[sslcrl_binding], obj] call[obj.set_crlname, parameter[member[.crlname]]] local_variable[type[sslcrl_binding], response] return[member[.response]] end[}] END[}]
Keyword[public] Keyword[static] identifier[sslcrl_binding] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[crlname] operator[SEP] Keyword[throws] identifier[Exception] { identifier[sslcrl_binding] identifier[obj] operator[=] Keyword[new] identifier[sslcrl_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_crlname] operator[SEP] identifier[crlname] operator[SEP] operator[SEP] identifier[sslcrl_binding] identifier[response] operator[=] operator[SEP] identifier[sslcrl_binding] operator[SEP] identifier[obj] operator[SEP] identifier[get_resource] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP] }
private static Integer safeInteger(String input) { try { return Integer.valueOf(input); } catch (Exception e) { return null; } }
class class_name[name] begin[{] method[safeInteger, return_type[type[Integer]], modifier[private static], parameter[input]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[static] identifier[Integer] identifier[safeInteger] operator[SEP] identifier[String] identifier[input] operator[SEP] { Keyword[try] { Keyword[return] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[input] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } }
public static String getStatusCodeReply(byte[] buf) { final byte[] resp = (byte[]) RedisProtocol.read(new RedisInputStream(new ByteArrayInputStream(buf))); if (null == resp) { return null; } else { return SafeEncoder.encode(resp); } }
class class_name[name] begin[{] method[getStatusCodeReply, return_type[type[String]], modifier[public static], parameter[buf]] begin[{] local_variable[type[byte], resp] if[binary_operation[literal[null], ==, member[.resp]]] begin[{] return[literal[null]] else begin[{] return[call[SafeEncoder.encode, parameter[member[.resp]]]] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getStatusCodeReply] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[SEP] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[resp] operator[=] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[RedisProtocol] operator[SEP] identifier[read] operator[SEP] Keyword[new] identifier[RedisInputStream] operator[SEP] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[buf] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[resp] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[return] identifier[SafeEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[resp] operator[SEP] operator[SEP] } }
public String createGemVersion( String mavenVersion ) throws NullPointerException { if ( mavenVersion == null || mavenVersion.trim().length() == 0 ) { throw new NullPointerException( "The passed in mavenVersion cannot be empty!" ); } if ( dummyGemVersionPattern.matcher( mavenVersion ).matches() ) { if ( goodVersionPattern.matcher( mavenVersion ).matches() ) { return createGemVersion( DUMMY_PREFIX + mavenVersion ); } else { return DUMMY_VERSION; } } else if ( numbersOnlyGemVersionPattern.matcher( mavenVersion ).matches() ) { // has at least two dots !!! return mavenVersion; } // make all lowercase for rubygems 1.3.5 mavenVersion = mavenVersion.toLowerCase(); // first transform the main part (everything before the first '-' or '_' // to follow the pattern "major.minor.build" // motivation: 1.0-2 should be lower then 1.0.1, i.e. the first one is variant of 1.0.0 String mainPart = mavenVersion.replaceAll( "[\\-_].*", "" ); String extraPart = mavenVersion.substring( mainPart.length() ).replaceAll( "[_-][_-]", "-" ); StringBuilder version = new StringBuilder( mainPart ); // TODO maybe it is better to stick to what is given instead of padding it to three parts if ( majorOnlyPattern.matcher( mainPart ).matches() ) { version.append( ".0.0" ); } else if ( majorMinorOnlyPattern.matcher( mainPart ).matches() ) { version.append( ".0" ); } version.append( extraPart ); // now the remaining transformations return version.toString() // split alphanumeric parts in numeric parts and alphabetic parts .replaceAll( "([0-9]+)([a-z]+)", "$1.$2" ).replaceAll( "([a-z]+)([0-9]+)", "$1.$2" ) // "-"/"_" to "." .replaceAll( "-|_", "." ) // shorten predefined qualifiers or replace aliases // TODO SNAPSHOT", "final", "ga" are missing and do not sort correctly .replaceAll( "alpha", "a" ).replaceAll( "beta", "b" ).replaceAll( "gamma", "g" ).replaceAll( "cr", "r" ).replaceAll( "rc", "r" ).replaceAll( "sp", "s" ).replaceAll( "milestone", "m" ); }
class class_name[name] begin[{] method[createGemVersion, return_type[type[String]], modifier[public], parameter[mavenVersion]] begin[{] if[binary_operation[binary_operation[member[.mavenVersion], ==, literal[null]], ||, binary_operation[call[mavenVersion.trim, parameter[]], ==, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The passed in mavenVersion cannot be empty!")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] if[call[dummyGemVersionPattern.matcher, parameter[member[.mavenVersion]]]] begin[{] if[call[goodVersionPattern.matcher, parameter[member[.mavenVersion]]]] begin[{] return[call[.createGemVersion, parameter[binary_operation[member[.DUMMY_PREFIX], +, member[.mavenVersion]]]]] else begin[{] return[member[.DUMMY_VERSION]] end[}] else begin[{] if[call[numbersOnlyGemVersionPattern.matcher, parameter[member[.mavenVersion]]]] begin[{] return[member[.mavenVersion]] else begin[{] None end[}] end[}] assign[member[.mavenVersion], call[mavenVersion.toLowerCase, parameter[]]] local_variable[type[String], mainPart] local_variable[type[String], extraPart] local_variable[type[StringBuilder], version] if[call[majorOnlyPattern.matcher, parameter[member[.mainPart]]]] begin[{] call[version.append, parameter[literal[".0.0"]]] else begin[{] if[call[majorMinorOnlyPattern.matcher, parameter[member[.mainPart]]]] begin[{] call[version.append, parameter[literal[".0"]]] else begin[{] None end[}] end[}] call[version.append, parameter[member[.extraPart]]] return[call[version.toString, parameter[]]] end[}] END[}]
Keyword[public] identifier[String] identifier[createGemVersion] operator[SEP] identifier[String] identifier[mavenVersion] operator[SEP] Keyword[throws] identifier[NullPointerException] { Keyword[if] operator[SEP] identifier[mavenVersion] operator[==] Other[null] operator[||] identifier[mavenVersion] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[dummyGemVersionPattern] operator[SEP] identifier[matcher] operator[SEP] identifier[mavenVersion] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[goodVersionPattern] operator[SEP] identifier[matcher] operator[SEP] identifier[mavenVersion] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[createGemVersion] operator[SEP] identifier[DUMMY_PREFIX] operator[+] identifier[mavenVersion] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[DUMMY_VERSION] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[numbersOnlyGemVersionPattern] operator[SEP] identifier[matcher] operator[SEP] identifier[mavenVersion] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[mavenVersion] operator[SEP] } identifier[mavenVersion] operator[=] identifier[mavenVersion] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[mainPart] operator[=] identifier[mavenVersion] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[extraPart] operator[=] identifier[mavenVersion] operator[SEP] identifier[substring] operator[SEP] identifier[mainPart] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[StringBuilder] identifier[version] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[mainPart] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[majorOnlyPattern] operator[SEP] identifier[matcher] operator[SEP] identifier[mainPart] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { identifier[version] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[majorMinorOnlyPattern] operator[SEP] identifier[matcher] operator[SEP] identifier[mainPart] operator[SEP] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { identifier[version] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[version] operator[SEP] identifier[append] operator[SEP] identifier[extraPart] operator[SEP] operator[SEP] Keyword[return] identifier[version] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") public Iterable<Obj> asObjSeq(@Nullable Arr arr) { if (arr != null) { return (Iterable<Obj>)(Iterable<?>)arr; } return Collections.emptyIterable(); }
class class_name[name] begin[{] method[asObjSeq, return_type[type[Iterable]], modifier[public], parameter[arr]] begin[{] if[binary_operation[member[.arr], !=, literal[null]]] begin[{] return[Cast(expression=Cast(expression=MemberReference(member=arr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Iterable, sub_type=None)), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Obj, sub_type=None))], dimensions=[], name=Iterable, sub_type=None))] else begin[{] None end[}] return[call[Collections.emptyIterable, parameter[]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Iterable] operator[<] identifier[Obj] operator[>] identifier[asObjSeq] operator[SEP] annotation[@] identifier[Nullable] identifier[Arr] identifier[arr] operator[SEP] { Keyword[if] operator[SEP] identifier[arr] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] identifier[Iterable] operator[<] identifier[Obj] operator[>] operator[SEP] operator[SEP] identifier[Iterable] operator[<] operator[?] operator[>] operator[SEP] identifier[arr] operator[SEP] } Keyword[return] identifier[Collections] operator[SEP] identifier[emptyIterable] operator[SEP] operator[SEP] operator[SEP] }
private String getKeyPairs(String key, Object value) { if (value != null) { return "&" + key + "=" + value.toString(); } else { return ""; } }
class class_name[name] begin[{] method[getKeyPairs, return_type[type[String]], modifier[private], parameter[key, value]] begin[{] if[binary_operation[member[.value], !=, literal[null]]] begin[{] return[binary_operation[binary_operation[binary_operation[literal["&"], +, member[.key]], +, literal["="]], +, call[value.toString, parameter[]]]] else begin[{] return[literal[""]] end[}] end[}] END[}]
Keyword[private] identifier[String] identifier[getKeyPairs] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] { Keyword[return] literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] literal[String] operator[SEP] } }
private static boolean serialClassInclude(ClassDoc cd) { if (cd.isEnum()) { return false; } try { cd.superclassType(); } catch (NullPointerException e) { //Workaround for null pointer bug in ClassDoc.superclassType(). return false; } if (cd.isSerializable()) { if (cd.tags("serial").length > 0) { return serialDocInclude(cd); } else if (cd.isPublic() || cd.isProtected()) { return true; } else { return false; } } return false; }
class class_name[name] begin[{] method[serialClassInclude, return_type[type[boolean]], modifier[private static], parameter[cd]] begin[{] if[call[cd.isEnum, parameter[]]] begin[{] return[literal[false]] else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=superclassType, postfix_operators=[], prefix_operators=[], qualifier=cd, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NullPointerException']))], finally_block=None, label=None, resources=None) if[call[cd.isSerializable, parameter[]]] begin[{] if[binary_operation[call[cd.tags, parameter[literal["serial"]]], >, literal[0]]] begin[{] return[call[.serialDocInclude, parameter[member[.cd]]]] else begin[{] if[binary_operation[call[cd.isPublic, parameter[]], ||, call[cd.isProtected, parameter[]]]] begin[{] return[literal[true]] else begin[{] return[literal[false]] end[}] end[}] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[serialClassInclude] operator[SEP] identifier[ClassDoc] identifier[cd] operator[SEP] { Keyword[if] operator[SEP] identifier[cd] operator[SEP] identifier[isEnum] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[try] { identifier[cd] operator[SEP] identifier[superclassType] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[NullPointerException] identifier[e] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[cd] operator[SEP] identifier[isSerializable] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[cd] operator[SEP] identifier[tags] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] { Keyword[return] identifier[serialDocInclude] operator[SEP] identifier[cd] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[cd] operator[SEP] identifier[isPublic] operator[SEP] operator[SEP] operator[||] identifier[cd] operator[SEP] identifier[isProtected] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
void showCrumbs(boolean show) { if (show) { m_crumbs.removeStyleName(OpenCmsTheme.HIDDEN); CmsAppWorkplaceUi.get().enableGlobalShortcuts(); } else { m_crumbs.addStyleName(OpenCmsTheme.HIDDEN); CmsAppWorkplaceUi.get().disableGlobalShortcuts(); } }
class class_name[name] begin[{] method[showCrumbs, return_type[void], modifier[default], parameter[show]] begin[{] if[member[.show]] begin[{] call[m_crumbs.removeStyleName, parameter[member[OpenCmsTheme.HIDDEN]]] call[CmsAppWorkplaceUi.get, parameter[]] else begin[{] call[m_crumbs.addStyleName, parameter[member[OpenCmsTheme.HIDDEN]]] call[CmsAppWorkplaceUi.get, parameter[]] end[}] end[}] END[}]
Keyword[void] identifier[showCrumbs] operator[SEP] Keyword[boolean] identifier[show] operator[SEP] { Keyword[if] operator[SEP] identifier[show] operator[SEP] { identifier[m_crumbs] operator[SEP] identifier[removeStyleName] operator[SEP] identifier[OpenCmsTheme] operator[SEP] identifier[HIDDEN] operator[SEP] operator[SEP] identifier[CmsAppWorkplaceUi] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[enableGlobalShortcuts] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[m_crumbs] operator[SEP] identifier[addStyleName] operator[SEP] identifier[OpenCmsTheme] operator[SEP] identifier[HIDDEN] operator[SEP] operator[SEP] identifier[CmsAppWorkplaceUi] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[disableGlobalShortcuts] operator[SEP] operator[SEP] operator[SEP] } }
public static <T extends ImageGray<T>> InterpolatePixelMB<Planar<T>> createPixelPL(InterpolatePixelS<T> singleBand) { return new InterpolatePixel_PL_using_SB<>(singleBand); }
class class_name[name] begin[{] method[createPixelPL, return_type[type[InterpolatePixelMB]], modifier[public static], parameter[singleBand]] begin[{] return[ClassCreator(arguments=[MemberReference(member=singleBand, 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=InterpolatePixel_PL_using_SB, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[ImageGray] operator[<] identifier[T] operator[>] operator[>] identifier[InterpolatePixelMB] operator[<] identifier[Planar] operator[<] identifier[T] operator[>] operator[>] identifier[createPixelPL] operator[SEP] identifier[InterpolatePixelS] operator[<] identifier[T] operator[>] identifier[singleBand] operator[SEP] { Keyword[return] Keyword[new] identifier[InterpolatePixel_PL_using_SB] operator[<] operator[>] operator[SEP] identifier[singleBand] operator[SEP] operator[SEP] }