code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public void setOffsetMinutes(int theZoneOffsetMinutes) { int offsetAbs = Math.abs(theZoneOffsetMinutes); int mins = offsetAbs % 60; int hours = offsetAbs / 60; if (theZoneOffsetMinutes < 0) { setTimeZone(TimeZone.getTimeZone("GMT-" + hours + ":" + mins)); } else { setTimeZone(TimeZone.getTimeZone("GMT+" + hours + ":" + mins)); } }
class class_name[name] begin[{] method[setOffsetMinutes, return_type[void], modifier[public], parameter[theZoneOffsetMinutes]] begin[{] local_variable[type[int], offsetAbs] local_variable[type[int], mins] local_variable[type[int], hours] if[binary_operation[member[.theZoneOffsetMinutes], <, literal[0]]] begin[{] call[.setTimeZone, parameter[call[TimeZone.getTimeZone, parameter[binary_operation[binary_operation[binary_operation[literal["GMT-"], +, member[.hours]], +, literal[":"]], +, member[.mins]]]]]] else begin[{] call[.setTimeZone, parameter[call[TimeZone.getTimeZone, parameter[binary_operation[binary_operation[binary_operation[literal["GMT+"], +, member[.hours]], +, literal[":"]], +, member[.mins]]]]]] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setOffsetMinutes] operator[SEP] Keyword[int] identifier[theZoneOffsetMinutes] operator[SEP] { Keyword[int] identifier[offsetAbs] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[theZoneOffsetMinutes] operator[SEP] operator[SEP] Keyword[int] identifier[mins] operator[=] identifier[offsetAbs] operator[%] Other[60] operator[SEP] Keyword[int] identifier[hours] operator[=] identifier[offsetAbs] operator[/] Other[60] operator[SEP] Keyword[if] operator[SEP] identifier[theZoneOffsetMinutes] operator[<] Other[0] operator[SEP] { identifier[setTimeZone] operator[SEP] identifier[TimeZone] operator[SEP] identifier[getTimeZone] operator[SEP] literal[String] operator[+] identifier[hours] operator[+] literal[String] operator[+] identifier[mins] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[setTimeZone] operator[SEP] identifier[TimeZone] operator[SEP] identifier[getTimeZone] operator[SEP] literal[String] operator[+] identifier[hours] operator[+] literal[String] operator[+] identifier[mins] operator[SEP] operator[SEP] operator[SEP] } }
public String getSymbolicLinkTarget(String linkpath) throws SftpStatusException, SshException { if (version < 3) { throw new SftpStatusException( SftpStatusException.SSH_FX_OP_UNSUPPORTED, "Symbolic links are not supported by the server SFTP version " + String.valueOf(version)); } try { UnsignedInteger32 requestId = nextRequestId(); Packet msg = createPacket(); msg.write(SSH_FXP_READLINK); msg.writeInt(requestId.longValue()); msg.writeString(linkpath, CHARSET_ENCODING); sendMessage(msg); SftpFile[] files = extractFiles(getResponse(requestId), null); return files[0].getAbsolutePath(); } catch (SshIOException ex) { throw ex.getRealException(); } catch (IOException ex) { throw new SshException(ex); } }
class class_name[name] begin[{] method[getSymbolicLinkTarget, return_type[type[String]], modifier[public], parameter[linkpath]] begin[{] if[binary_operation[member[.version], <, literal[3]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=SSH_FX_OP_UNSUPPORTED, postfix_operators=[], prefix_operators=[], qualifier=SftpStatusException, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Symbolic links are not supported by the server SFTP version "), operandr=MethodInvocation(arguments=[MemberReference(member=version, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SftpStatusException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=nextRequestId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=requestId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UnsignedInteger32, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=createPacket, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Packet, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SSH_FXP_READLINK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=longValue, postfix_operators=[], prefix_operators=[], qualifier=requestId, selectors=[], type_arguments=None)], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=linkpath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=CHARSET_ENCODING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendMessage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=requestId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResponse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=extractFiles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=files)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=SftpFile, sub_type=None)), ReturnStatement(expression=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MethodInvocation(arguments=[], member=getAbsolutePath, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[], member=getRealException, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['SshIOException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SshException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[String] identifier[getSymbolicLinkTarget] operator[SEP] identifier[String] identifier[linkpath] operator[SEP] Keyword[throws] identifier[SftpStatusException] , identifier[SshException] { Keyword[if] operator[SEP] identifier[version] operator[<] Other[3] operator[SEP] { Keyword[throw] Keyword[new] identifier[SftpStatusException] operator[SEP] identifier[SftpStatusException] operator[SEP] identifier[SSH_FX_OP_UNSUPPORTED] , literal[String] operator[+] identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[version] operator[SEP] operator[SEP] operator[SEP] } Keyword[try] { identifier[UnsignedInteger32] identifier[requestId] operator[=] identifier[nextRequestId] operator[SEP] operator[SEP] operator[SEP] identifier[Packet] identifier[msg] operator[=] identifier[createPacket] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[write] operator[SEP] identifier[SSH_FXP_READLINK] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[writeInt] operator[SEP] identifier[requestId] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[writeString] operator[SEP] identifier[linkpath] , identifier[CHARSET_ENCODING] operator[SEP] operator[SEP] identifier[sendMessage] operator[SEP] identifier[msg] operator[SEP] operator[SEP] identifier[SftpFile] operator[SEP] operator[SEP] identifier[files] operator[=] identifier[extractFiles] operator[SEP] identifier[getResponse] operator[SEP] identifier[requestId] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[files] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SshIOException] identifier[ex] operator[SEP] { Keyword[throw] identifier[ex] operator[SEP] identifier[getRealException] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[SshException] operator[SEP] identifier[ex] operator[SEP] operator[SEP] } }
protected Graphics2D getGraphics(BufferedImage image) { Graphics2D graphics = image.createGraphics(); graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); return graphics; }
class class_name[name] begin[{] method[getGraphics, return_type[type[Graphics2D]], modifier[protected], parameter[image]] begin[{] local_variable[type[Graphics2D], graphics] call[graphics.setRenderingHint, parameter[member[RenderingHints.KEY_ANTIALIASING], member[RenderingHints.VALUE_ANTIALIAS_ON]]] return[member[.graphics]] end[}] END[}]
Keyword[protected] identifier[Graphics2D] identifier[getGraphics] operator[SEP] identifier[BufferedImage] identifier[image] operator[SEP] { identifier[Graphics2D] identifier[graphics] operator[=] identifier[image] operator[SEP] identifier[createGraphics] operator[SEP] operator[SEP] operator[SEP] identifier[graphics] operator[SEP] identifier[setRenderingHint] operator[SEP] identifier[RenderingHints] operator[SEP] identifier[KEY_ANTIALIASING] , identifier[RenderingHints] operator[SEP] identifier[VALUE_ANTIALIAS_ON] operator[SEP] operator[SEP] Keyword[return] identifier[graphics] operator[SEP] }
public void undeleteTable(String datasetId) throws InterruptedException { generateTableWithDdl(datasetId, "oops_undelete_me"); // [START bigquery_undelete_table] // String datasetId = "my_dataset"; String tableId = "oops_undelete_me"; // Record the current time. We'll use this as the snapshot time // for recovering the table. long snapTime = Instant.now().toEpochMilli(); // "Accidentally" delete the table. bigquery.delete(TableId.of(datasetId, tableId)); // Construct the restore-from tableID using a snapshot decorator. String snapshotTableId = String.format("%s@%d", tableId, snapTime); // Choose a new table ID for the recovered table data. String recoverTableId = String.format("%s_recovered", tableId); // Construct and run a copy job. CopyJobConfiguration configuration = CopyJobConfiguration.newBuilder( TableId.of(datasetId, recoverTableId), TableId.of(datasetId, snapshotTableId)) .build(); Job job = bigquery.create(JobInfo.of(configuration)); job = job.waitFor(); // Check the table StandardTableDefinition table = bigquery.getTable(TableId.of(datasetId, recoverTableId)).getDefinition(); System.out.println("State: " + job.getStatus().getState()); System.out.printf("Recovered %d rows.\n", table.getNumRows()); // [END bigquery_undelete_table] }
class class_name[name] begin[{] method[undeleteTable, return_type[void], modifier[public], parameter[datasetId]] begin[{] call[.generateTableWithDdl, parameter[member[.datasetId], literal["oops_undelete_me"]]] local_variable[type[String], tableId] local_variable[type[long], snapTime] call[bigquery.delete, parameter[call[TableId.of, parameter[member[.datasetId], member[.tableId]]]]] local_variable[type[String], snapshotTableId] local_variable[type[String], recoverTableId] local_variable[type[CopyJobConfiguration], configuration] local_variable[type[Job], job] assign[member[.job], call[job.waitFor, parameter[]]] local_variable[type[StandardTableDefinition], table] call[System.out.println, parameter[binary_operation[literal["State: "], +, call[job.getStatus, parameter[]]]]] call[System.out.printf, parameter[literal["Recovered %d rows.\n"], call[table.getNumRows, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[undeleteTable] operator[SEP] identifier[String] identifier[datasetId] operator[SEP] Keyword[throws] identifier[InterruptedException] { identifier[generateTableWithDdl] operator[SEP] identifier[datasetId] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[tableId] operator[=] literal[String] operator[SEP] Keyword[long] identifier[snapTime] operator[=] identifier[Instant] operator[SEP] identifier[now] operator[SEP] operator[SEP] operator[SEP] identifier[toEpochMilli] operator[SEP] operator[SEP] operator[SEP] identifier[bigquery] operator[SEP] identifier[delete] operator[SEP] identifier[TableId] operator[SEP] identifier[of] operator[SEP] identifier[datasetId] , identifier[tableId] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[snapshotTableId] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[tableId] , identifier[snapTime] operator[SEP] operator[SEP] identifier[String] identifier[recoverTableId] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[tableId] operator[SEP] operator[SEP] identifier[CopyJobConfiguration] identifier[configuration] operator[=] identifier[CopyJobConfiguration] operator[SEP] identifier[newBuilder] operator[SEP] identifier[TableId] operator[SEP] identifier[of] operator[SEP] identifier[datasetId] , identifier[recoverTableId] operator[SEP] , identifier[TableId] operator[SEP] identifier[of] operator[SEP] identifier[datasetId] , identifier[snapshotTableId] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[Job] identifier[job] operator[=] identifier[bigquery] operator[SEP] identifier[create] operator[SEP] identifier[JobInfo] operator[SEP] identifier[of] operator[SEP] identifier[configuration] operator[SEP] operator[SEP] operator[SEP] identifier[job] operator[=] identifier[job] operator[SEP] identifier[waitFor] operator[SEP] operator[SEP] operator[SEP] identifier[StandardTableDefinition] identifier[table] operator[=] identifier[bigquery] operator[SEP] identifier[getTable] operator[SEP] identifier[TableId] operator[SEP] identifier[of] operator[SEP] identifier[datasetId] , identifier[recoverTableId] operator[SEP] operator[SEP] operator[SEP] identifier[getDefinition] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[job] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[printf] operator[SEP] literal[String] , identifier[table] operator[SEP] identifier[getNumRows] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static HttpSession session() { HttpServletRequest httpServletRequest = request.get(); return (httpServletRequest == null) ? null : httpServletRequest.getSession(); }
class class_name[name] begin[{] method[session, return_type[type[HttpSession]], modifier[public static], parameter[]] begin[{] local_variable[type[HttpServletRequest], httpServletRequest] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=httpServletRequest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getSession, postfix_operators=[], prefix_operators=[], qualifier=httpServletRequest, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] Keyword[static] identifier[HttpSession] identifier[session] operator[SEP] operator[SEP] { identifier[HttpServletRequest] identifier[httpServletRequest] operator[=] identifier[request] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[httpServletRequest] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[httpServletRequest] operator[SEP] identifier[getSession] operator[SEP] operator[SEP] operator[SEP] }
private void cleanupErrorFile(Watcher watcher) { File file = getErrorFileForWatcher(watcher); FileUtils.deleteQuietly(file); }
class class_name[name] begin[{] method[cleanupErrorFile, return_type[void], modifier[private], parameter[watcher]] begin[{] local_variable[type[File], file] call[FileUtils.deleteQuietly, parameter[member[.file]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[cleanupErrorFile] operator[SEP] identifier[Watcher] identifier[watcher] operator[SEP] { identifier[File] identifier[file] operator[=] identifier[getErrorFileForWatcher] operator[SEP] identifier[watcher] operator[SEP] operator[SEP] identifier[FileUtils] operator[SEP] identifier[deleteQuietly] operator[SEP] identifier[file] operator[SEP] operator[SEP] }
private JSONArray executeStatementToJson( PreparedStatement stmt, List<SelectedColumn> selectFields) throws Exception { //logger.info("about to execute: " + stmt.toString()); if( stmt.execute() ) { // There's a ResultSet to be had ResultSet rs = stmt.getResultSet(); JSONArray array = new JSONArray(); try { Map<Integer,JSONObject> contributorMap = new HashMap<Integer,JSONObject>(); while (rs.next()) { JSONObject obj = new JSONObject(); int index = 1; for(int loop=0; loop<selectFields.size(); ++loop) { SelectedColumn selCol = selectFields.get(loop); //logger.info("field: " + selCol.getName() + " (" + selCol.getType() + ")"); if (! "contributor_id".equalsIgnoreCase(selCol.getName())) { if( SelectedColumn.Type.INTEGER == selCol.getType() ) { obj.put(selCol.getName(),rs.getInt(index)); ++index; } else if( SelectedColumn.Type.STRING == selCol.getType() ) { obj.put(selCol.getName(),rs.getString(index)); ++index; } else if ( SelectedColumn.Type.DATE == selCol.getType() ) { Date date = rs.getDate(index); if (null != date) { String dateString = dateFormatter.format(date); obj.put(selCol.getName(), dateString); } ++index; } else { throw new Exception("Unkown selected column type"); } } else { // Convert contributor id into user info int contribId = rs.getInt(index); JSONObject userInfo = fetchContributorFromIdWithCache( contribId, contributorMap); if (null != userInfo) { obj.put("contributor", userInfo); } ++index; } } array.put(obj); } } catch (Exception je) { throw new ServletException("Error while executing statement",je); } return array; } else { // indicates an update count or no results - this must be no results throw new Exception("Query returned no results"); } }
class class_name[name] begin[{] method[executeStatementToJson, return_type[type[JSONArray]], modifier[private], parameter[stmt, selectFields]] begin[{] if[call[stmt.execute, parameter[]]] begin[{] local_variable[type[ResultSet], rs] local_variable[type[JSONArray], array] 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=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None))], dimensions=None, name=HashMap, sub_type=None)), name=contributorMap)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None))], dimensions=[], name=Map, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JSONObject, sub_type=None)), name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=loop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=selectFields, selectors=[], type_arguments=None), name=selCol)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SelectedColumn, sub_type=None)), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=selCol, selectors=[], type_arguments=None)], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="contributor_id"), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=contribId)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=contribId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contributorMap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fetchContributorFromIdWithCache, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=userInfo)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JSONObject, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=userInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="contributor"), MemberReference(member=userInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MemberReference(member=index, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=INTEGER, postfix_operators=[], prefix_operators=[], qualifier=SelectedColumn.Type, selectors=[]), operandr=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=selCol, selectors=[], type_arguments=None), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=STRING, postfix_operators=[], prefix_operators=[], qualifier=SelectedColumn.Type, selectors=[]), operandr=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=selCol, selectors=[], type_arguments=None), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=DATE, postfix_operators=[], prefix_operators=[], qualifier=SelectedColumn.Type, selectors=[]), operandr=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=selCol, selectors=[], type_arguments=None), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unkown selected column type")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDate, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), name=date)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Date, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=dateFormatter, selectors=[], type_arguments=None), name=dateString)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=selCol, selectors=[], type_arguments=None), MemberReference(member=dateString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MemberReference(member=index, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=selCol, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getString, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=index, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=selCol, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInt, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=index, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[]), label=None)]))]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=loop, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=selectFields, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=loop)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=loop, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=array, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=rs, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while executing statement"), MemberReference(member=je, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServletException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=je, types=['Exception']))], finally_block=None, label=None, resources=None) return[member[.array]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Query returned no results")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None) end[}] end[}] END[}]
Keyword[private] identifier[JSONArray] identifier[executeStatementToJson] operator[SEP] identifier[PreparedStatement] identifier[stmt] , identifier[List] operator[<] identifier[SelectedColumn] operator[>] identifier[selectFields] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[if] operator[SEP] identifier[stmt] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] { identifier[ResultSet] identifier[rs] operator[=] identifier[stmt] operator[SEP] identifier[getResultSet] operator[SEP] operator[SEP] operator[SEP] identifier[JSONArray] identifier[array] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Map] operator[<] identifier[Integer] , identifier[JSONObject] operator[>] identifier[contributorMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Integer] , identifier[JSONObject] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] { identifier[JSONObject] identifier[obj] operator[=] Keyword[new] identifier[JSONObject] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[loop] operator[=] Other[0] operator[SEP] identifier[loop] operator[<] identifier[selectFields] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[loop] operator[SEP] { identifier[SelectedColumn] identifier[selCol] operator[=] identifier[selectFields] operator[SEP] identifier[get] operator[SEP] identifier[loop] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[selCol] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[SelectedColumn] operator[SEP] identifier[Type] operator[SEP] identifier[INTEGER] operator[==] identifier[selCol] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] { identifier[obj] operator[SEP] identifier[put] operator[SEP] identifier[selCol] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[rs] operator[SEP] identifier[getInt] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[index] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[SelectedColumn] operator[SEP] identifier[Type] operator[SEP] identifier[STRING] operator[==] identifier[selCol] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] { identifier[obj] operator[SEP] identifier[put] operator[SEP] identifier[selCol] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[rs] operator[SEP] identifier[getString] operator[SEP] identifier[index] operator[SEP] operator[SEP] operator[SEP] operator[++] identifier[index] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[SelectedColumn] operator[SEP] identifier[Type] operator[SEP] identifier[DATE] operator[==] identifier[selCol] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] { identifier[Date] identifier[date] operator[=] identifier[rs] operator[SEP] identifier[getDate] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[date] operator[SEP] { identifier[String] identifier[dateString] operator[=] identifier[dateFormatter] operator[SEP] identifier[format] operator[SEP] identifier[date] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[put] operator[SEP] identifier[selCol] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[dateString] operator[SEP] operator[SEP] } operator[++] identifier[index] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[int] identifier[contribId] operator[=] identifier[rs] operator[SEP] identifier[getInt] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[JSONObject] identifier[userInfo] operator[=] identifier[fetchContributorFromIdWithCache] operator[SEP] identifier[contribId] , identifier[contributorMap] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[userInfo] operator[SEP] { identifier[obj] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[userInfo] operator[SEP] operator[SEP] } operator[++] identifier[index] operator[SEP] } } identifier[array] operator[SEP] identifier[put] operator[SEP] identifier[obj] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[je] operator[SEP] { Keyword[throw] Keyword[new] identifier[ServletException] operator[SEP] literal[String] , identifier[je] operator[SEP] operator[SEP] } Keyword[return] identifier[array] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] literal[String] operator[SEP] operator[SEP] } }
public void verifyMessageSize(int maxMessageSize) { Iterator<MessageAndOffset> shallowIter = internalIterator(true); while(shallowIter.hasNext()) { MessageAndOffset messageAndOffset = shallowIter.next(); int payloadSize = messageAndOffset.message.payloadSize(); if(payloadSize > maxMessageSize) { throw new MessageSizeTooLargeException("payload size of " + payloadSize + " larger than " + maxMessageSize); } } }
class class_name[name] begin[{] method[verifyMessageSize, return_type[void], modifier[public], parameter[maxMessageSize]] begin[{] local_variable[type[Iterator], shallowIter] while[call[shallowIter.hasNext, parameter[]]] begin[{] local_variable[type[MessageAndOffset], messageAndOffset] local_variable[type[int], payloadSize] if[binary_operation[member[.payloadSize], >, member[.maxMessageSize]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="payload size of "), operandr=MemberReference(member=payloadSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" larger than "), operator=+), operandr=MemberReference(member=maxMessageSize, 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=MessageSizeTooLargeException, sub_type=None)), label=None) else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[verifyMessageSize] operator[SEP] Keyword[int] identifier[maxMessageSize] operator[SEP] { identifier[Iterator] operator[<] identifier[MessageAndOffset] operator[>] identifier[shallowIter] operator[=] identifier[internalIterator] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[shallowIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[MessageAndOffset] identifier[messageAndOffset] operator[=] identifier[shallowIter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[payloadSize] operator[=] identifier[messageAndOffset] operator[SEP] identifier[message] operator[SEP] identifier[payloadSize] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[payloadSize] operator[>] identifier[maxMessageSize] operator[SEP] { Keyword[throw] Keyword[new] identifier[MessageSizeTooLargeException] operator[SEP] literal[String] operator[+] identifier[payloadSize] operator[+] literal[String] operator[+] identifier[maxMessageSize] operator[SEP] operator[SEP] } } }
private static Matrix execute(Matrix dataMatrix, MatrixFile affMatrixFile, int dims) throws IOException { // Write the input matrix to a file for Matlab/Octave to use File mInput = File.createTempFile("lpp-input-data-matrix",".dat"); mInput.deleteOnExit(); MatrixIO.writeMatrix(dataMatrix, mInput, MatrixIO.Format.MATLAB_SPARSE); // Create an output matrix to hold the results of the computation from // Matlab until they can be read back into memory File output = File.createTempFile("lpp-output-matrix",".dat"); // Exceute the LPP code execute(mInput, affMatrixFile.getFile(), dims, output); // Upon finishing, read the matrix back into memory. return MatrixIO.readMatrix(output, MatrixIO.Format.DENSE_TEXT); }
class class_name[name] begin[{] method[execute, return_type[type[Matrix]], modifier[private static], parameter[dataMatrix, affMatrixFile, dims]] begin[{] local_variable[type[File], mInput] call[mInput.deleteOnExit, parameter[]] call[MatrixIO.writeMatrix, parameter[member[.dataMatrix], member[.mInput], member[MatrixIO.Format.MATLAB_SPARSE]]] local_variable[type[File], output] call[.execute, parameter[member[.mInput], call[affMatrixFile.getFile, parameter[]], member[.dims], member[.output]]] return[call[MatrixIO.readMatrix, parameter[member[.output], member[MatrixIO.Format.DENSE_TEXT]]]] end[}] END[}]
Keyword[private] Keyword[static] identifier[Matrix] identifier[execute] operator[SEP] identifier[Matrix] identifier[dataMatrix] , identifier[MatrixFile] identifier[affMatrixFile] , Keyword[int] identifier[dims] operator[SEP] Keyword[throws] identifier[IOException] { identifier[File] identifier[mInput] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[mInput] operator[SEP] identifier[deleteOnExit] operator[SEP] operator[SEP] operator[SEP] identifier[MatrixIO] operator[SEP] identifier[writeMatrix] operator[SEP] identifier[dataMatrix] , identifier[mInput] , identifier[MatrixIO] operator[SEP] identifier[Format] operator[SEP] identifier[MATLAB_SPARSE] operator[SEP] operator[SEP] identifier[File] identifier[output] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[execute] operator[SEP] identifier[mInput] , identifier[affMatrixFile] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] , identifier[dims] , identifier[output] operator[SEP] operator[SEP] Keyword[return] identifier[MatrixIO] operator[SEP] identifier[readMatrix] operator[SEP] identifier[output] , identifier[MatrixIO] operator[SEP] identifier[Format] operator[SEP] identifier[DENSE_TEXT] operator[SEP] operator[SEP] }
public static IProcessingInstructionProcessor wrap(final IProcessingInstructionProcessor processor, final IProcessorDialect dialect) { Validate.notNull(dialect, "Dialect cannot be null"); if (processor == null) { return null; } return new ProcessingInstructionProcessorWrapper(processor, dialect); }
class class_name[name] begin[{] method[wrap, return_type[type[IProcessingInstructionProcessor]], modifier[public static], parameter[processor, dialect]] begin[{] call[Validate.notNull, parameter[member[.dialect], literal["Dialect cannot be null"]]] if[binary_operation[member[.processor], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=processor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dialect, 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=ProcessingInstructionProcessorWrapper, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[IProcessingInstructionProcessor] identifier[wrap] operator[SEP] Keyword[final] identifier[IProcessingInstructionProcessor] identifier[processor] , Keyword[final] identifier[IProcessorDialect] identifier[dialect] operator[SEP] { identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[dialect] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[processor] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] Keyword[new] identifier[ProcessingInstructionProcessorWrapper] operator[SEP] identifier[processor] , identifier[dialect] operator[SEP] operator[SEP] }
public static Type newArrayType(Type componentType) { if (componentType instanceof Class<?>) { return newArrayType((Class<?>) componentType); } final TypeVariable<?> var = TypeVariableGenerator.freshTypeVariable("E"); return new TypeResolver().where(var, componentType).resolveType(new GenericArrayType() { @Override public Type getGenericComponentType() { return var; } }); }
class class_name[name] begin[{] method[newArrayType, return_type[type[Type]], modifier[public static], parameter[componentType]] begin[{] if[binary_operation[member[.componentType], instanceof, type[Class]]] begin[{] return[call[.newArrayType, parameter[Cast(expression=MemberReference(member=componentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))]]] else begin[{] None end[}] local_variable[type[TypeVariable], var] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=componentType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=where, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MemberReference(member=var, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=getGenericComponentType, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Type, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GenericArrayType, sub_type=None))], member=resolveType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TypeResolver, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Type] identifier[newArrayType] operator[SEP] identifier[Type] identifier[componentType] operator[SEP] { Keyword[if] operator[SEP] identifier[componentType] Keyword[instanceof] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] { Keyword[return] identifier[newArrayType] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] identifier[componentType] operator[SEP] operator[SEP] } Keyword[final] identifier[TypeVariable] operator[<] operator[?] operator[>] identifier[var] operator[=] identifier[TypeVariableGenerator] operator[SEP] identifier[freshTypeVariable] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[TypeResolver] operator[SEP] operator[SEP] operator[SEP] identifier[where] operator[SEP] identifier[var] , identifier[componentType] operator[SEP] operator[SEP] identifier[resolveType] operator[SEP] Keyword[new] identifier[GenericArrayType] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Type] identifier[getGenericComponentType] operator[SEP] operator[SEP] { Keyword[return] identifier[var] operator[SEP] } } operator[SEP] operator[SEP] }
@CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <B> Observable<List<T>> buffer(Callable<? extends ObservableSource<B>> boundarySupplier) { return buffer(boundarySupplier, ArrayListSupplier.<T>asCallable()); }
class class_name[name] begin[{] method[buffer, return_type[type[Observable]], modifier[final public], parameter[boundarySupplier]] begin[{] return[call[.buffer, parameter[member[.boundarySupplier], call[.ArrayListSupplier, parameter[]]]]] end[}] END[}]
annotation[@] identifier[CheckReturnValue] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[final] operator[<] identifier[B] operator[>] identifier[Observable] operator[<] identifier[List] operator[<] identifier[T] operator[>] operator[>] identifier[buffer] operator[SEP] identifier[Callable] operator[<] operator[?] Keyword[extends] identifier[ObservableSource] operator[<] identifier[B] operator[>] operator[>] identifier[boundarySupplier] operator[SEP] { Keyword[return] identifier[buffer] operator[SEP] identifier[boundarySupplier] , identifier[ArrayListSupplier] operator[SEP] operator[<] identifier[T] operator[>] identifier[asCallable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void prepareRender() { lightRenderedLastFrame = 0; Gdx.gl.glDepthMask(false); Gdx.gl.glEnable(GL20.GL_BLEND); simpleBlendFunc.apply(); boolean useLightMap = (shadows || blur); if (useLightMap) { lightMap.frameBuffer.begin(); Gdx.gl.glClearColor(0f, 0f, 0f, 0f); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); } ShaderProgram shader = customLightShader != null ? customLightShader : lightShader; shader.begin(); { shader.setUniformMatrix("u_projTrans", combined); if (customLightShader != null) updateLightShader(); for (Light light : lightList) { if (customLightShader != null) updateLightShaderPerLight(light); light.render(); } } shader.end(); if (useLightMap) { if (customViewport) { lightMap.frameBuffer.end( viewportX, viewportY, viewportWidth, viewportHeight); } else { lightMap.frameBuffer.end(); } boolean needed = lightRenderedLastFrame > 0; // this way lot less binding if (needed && blur) lightMap.gaussianBlur(); } }
class class_name[name] begin[{] method[prepareRender, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.lightRenderedLastFrame], literal[0]] call[Gdx.gl.glDepthMask, parameter[literal[false]]] call[Gdx.gl.glEnable, parameter[member[GL20.GL_BLEND]]] call[simpleBlendFunc.apply, parameter[]] local_variable[type[boolean], useLightMap] if[member[.useLightMap]] begin[{] call[lightMap.frameBuffer.begin, parameter[]] call[Gdx.gl.glClearColor, parameter[literal[0f], literal[0f], literal[0f], literal[0f]]] call[Gdx.gl.glClear, parameter[member[GL20.GL_COLOR_BUFFER_BIT]]] else begin[{] None end[}] local_variable[type[ShaderProgram], shader] call[shader.begin, parameter[]] call[shader.setUniformMatrix, parameter[literal["u_projTrans"], member[.combined]]] if[binary_operation[member[.customLightShader], !=, literal[null]]] begin[{] call[.updateLightShader, parameter[]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=customLightShader, 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=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=light, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=updateLightShaderPerLight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=render, postfix_operators=[], prefix_operators=[], qualifier=light, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=lightList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=light)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Light, sub_type=None))), label=None) call[shader.end, parameter[]] if[member[.useLightMap]] begin[{] if[member[.customViewport]] begin[{] call[lightMap.frameBuffer.end, parameter[member[.viewportX], member[.viewportY], member[.viewportWidth], member[.viewportHeight]]] else begin[{] call[lightMap.frameBuffer.end, parameter[]] end[}] local_variable[type[boolean], needed] if[binary_operation[member[.needed], &&, member[.blur]]] begin[{] call[lightMap.gaussianBlur, parameter[]] else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[prepareRender] operator[SEP] operator[SEP] { identifier[lightRenderedLastFrame] operator[=] Other[0] operator[SEP] identifier[Gdx] operator[SEP] identifier[gl] operator[SEP] identifier[glDepthMask] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[Gdx] operator[SEP] identifier[gl] operator[SEP] identifier[glEnable] operator[SEP] identifier[GL20] operator[SEP] identifier[GL_BLEND] operator[SEP] operator[SEP] identifier[simpleBlendFunc] operator[SEP] identifier[apply] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[useLightMap] operator[=] operator[SEP] identifier[shadows] operator[||] identifier[blur] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[useLightMap] operator[SEP] { identifier[lightMap] operator[SEP] identifier[frameBuffer] operator[SEP] identifier[begin] operator[SEP] operator[SEP] operator[SEP] identifier[Gdx] operator[SEP] identifier[gl] operator[SEP] identifier[glClearColor] operator[SEP] literal[Float] , literal[Float] , literal[Float] , literal[Float] operator[SEP] operator[SEP] identifier[Gdx] operator[SEP] identifier[gl] operator[SEP] identifier[glClear] operator[SEP] identifier[GL20] operator[SEP] identifier[GL_COLOR_BUFFER_BIT] operator[SEP] operator[SEP] } identifier[ShaderProgram] identifier[shader] operator[=] identifier[customLightShader] operator[!=] Other[null] operator[?] identifier[customLightShader] operator[:] identifier[lightShader] operator[SEP] identifier[shader] operator[SEP] identifier[begin] operator[SEP] operator[SEP] operator[SEP] { identifier[shader] operator[SEP] identifier[setUniformMatrix] operator[SEP] literal[String] , identifier[combined] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[customLightShader] operator[!=] Other[null] operator[SEP] identifier[updateLightShader] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Light] identifier[light] operator[:] identifier[lightList] operator[SEP] { Keyword[if] operator[SEP] identifier[customLightShader] operator[!=] Other[null] operator[SEP] identifier[updateLightShaderPerLight] operator[SEP] identifier[light] operator[SEP] operator[SEP] identifier[light] operator[SEP] identifier[render] operator[SEP] operator[SEP] operator[SEP] } } identifier[shader] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[useLightMap] operator[SEP] { Keyword[if] operator[SEP] identifier[customViewport] operator[SEP] { identifier[lightMap] operator[SEP] identifier[frameBuffer] operator[SEP] identifier[end] operator[SEP] identifier[viewportX] , identifier[viewportY] , identifier[viewportWidth] , identifier[viewportHeight] operator[SEP] operator[SEP] } Keyword[else] { identifier[lightMap] operator[SEP] identifier[frameBuffer] operator[SEP] identifier[end] operator[SEP] operator[SEP] operator[SEP] } Keyword[boolean] identifier[needed] operator[=] identifier[lightRenderedLastFrame] operator[>] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[needed] operator[&&] identifier[blur] operator[SEP] identifier[lightMap] operator[SEP] identifier[gaussianBlur] operator[SEP] operator[SEP] operator[SEP] } }
public final void initActor(String path, ActorContext context, Mailbox mailbox) { this.path = path; this.context = context; this.mailbox = mailbox; }
class class_name[name] begin[{] method[initActor, return_type[void], modifier[final public], parameter[path, context, mailbox]] begin[{] assign[THIS[member[None.path]], member[.path]] assign[THIS[member[None.context]], member[.context]] assign[THIS[member[None.mailbox]], member[.mailbox]] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[initActor] operator[SEP] identifier[String] identifier[path] , identifier[ActorContext] identifier[context] , identifier[Mailbox] identifier[mailbox] operator[SEP] { Keyword[this] operator[SEP] identifier[path] operator[=] identifier[path] operator[SEP] Keyword[this] operator[SEP] identifier[context] operator[=] identifier[context] operator[SEP] Keyword[this] operator[SEP] identifier[mailbox] operator[=] identifier[mailbox] operator[SEP] }
public static String convertCase(Match.CaseConversion conversion, String s, String sample, Language lang) { if (StringTools.isEmpty(s)) { return s; } String token = s; switch (conversion) { case NONE: break; case PRESERVE: if (StringTools.startsWithUppercase(sample)) { if (StringTools.isAllUppercase(sample)) { token = token.toUpperCase(Locale.ENGLISH); } else { token = StringTools.uppercaseFirstChar(token, lang); } } break; case STARTLOWER: token = token.substring(0, 1).toLowerCase() + token.substring(1); break; case STARTUPPER: token = StringTools.uppercaseFirstChar(token, lang); break; case ALLUPPER: token = token.toUpperCase(Locale.ENGLISH); break; case ALLLOWER: token = token.toLowerCase(); break; default: break; } return token; }
class class_name[name] begin[{] method[convertCase, return_type[type[String]], modifier[public static], parameter[conversion, s, sample, lang]] begin[{] if[call[StringTools.isEmpty, parameter[member[.s]]]] begin[{] return[member[.s]] else begin[{] None end[}] local_variable[type[String], token] SwitchStatement(cases=[SwitchStatementCase(case=['NONE'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['PRESERVE'], statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sample, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=startsWithUppercase, postfix_operators=[], prefix_operators=[], qualifier=StringTools, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=sample, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAllUppercase, postfix_operators=[], prefix_operators=[], qualifier=StringTools, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lang, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=uppercaseFirstChar, postfix_operators=[], prefix_operators=[], qualifier=StringTools, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ENGLISH, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[])], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None)), label=None)]))])), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['STARTLOWER'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None), operator=+)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['STARTUPPER'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lang, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=uppercaseFirstChar, postfix_operators=[], prefix_operators=[], qualifier=StringTools, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ALLUPPER'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ENGLISH, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[])], member=toUpperCase, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['ALLLOWER'], statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=token, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=toLowerCase, postfix_operators=[], prefix_operators=[], qualifier=token, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[BreakStatement(goto=None, label=None)])], expression=MemberReference(member=conversion, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[member[.token]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[convertCase] operator[SEP] identifier[Match] operator[SEP] identifier[CaseConversion] identifier[conversion] , identifier[String] identifier[s] , identifier[String] identifier[sample] , identifier[Language] identifier[lang] operator[SEP] { Keyword[if] operator[SEP] identifier[StringTools] operator[SEP] identifier[isEmpty] operator[SEP] identifier[s] operator[SEP] operator[SEP] { Keyword[return] identifier[s] operator[SEP] } identifier[String] identifier[token] operator[=] identifier[s] operator[SEP] Keyword[switch] operator[SEP] identifier[conversion] operator[SEP] { Keyword[case] identifier[NONE] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[PRESERVE] operator[:] Keyword[if] operator[SEP] identifier[StringTools] operator[SEP] identifier[startsWithUppercase] operator[SEP] identifier[sample] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[StringTools] operator[SEP] identifier[isAllUppercase] operator[SEP] identifier[sample] operator[SEP] operator[SEP] { identifier[token] operator[=] identifier[token] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] operator[SEP] operator[SEP] } Keyword[else] { identifier[token] operator[=] identifier[StringTools] operator[SEP] identifier[uppercaseFirstChar] operator[SEP] identifier[token] , identifier[lang] operator[SEP] operator[SEP] } } Keyword[break] operator[SEP] Keyword[case] identifier[STARTLOWER] operator[:] identifier[token] operator[=] identifier[token] operator[SEP] identifier[substring] operator[SEP] Other[0] , Other[1] operator[SEP] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[+] identifier[token] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[STARTUPPER] operator[:] identifier[token] operator[=] identifier[StringTools] operator[SEP] identifier[uppercaseFirstChar] operator[SEP] identifier[token] , identifier[lang] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ALLUPPER] operator[:] identifier[token] operator[=] identifier[token] operator[SEP] identifier[toUpperCase] operator[SEP] identifier[Locale] operator[SEP] identifier[ENGLISH] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[ALLLOWER] operator[:] identifier[token] operator[=] identifier[token] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[break] operator[SEP] } Keyword[return] identifier[token] operator[SEP] }
private static boolean versionMatches(AddOn addOn, AddOnDep dependency) { if (addOn.version.matches(dependency.getVersion())) { return true; } if (addOn.semVer != null && addOn.semVer.matches(dependency.getVersion())) { return true; } return false; }
class class_name[name] begin[{] method[versionMatches, return_type[type[boolean]], modifier[private static], parameter[addOn, dependency]] begin[{] if[call[addOn.version.matches, parameter[call[dependency.getVersion, parameter[]]]]] begin[{] return[literal[true]] else begin[{] None end[}] if[binary_operation[binary_operation[member[addOn.semVer], !=, literal[null]], &&, call[addOn.semVer.matches, parameter[call[dependency.getVersion, parameter[]]]]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[versionMatches] operator[SEP] identifier[AddOn] identifier[addOn] , identifier[AddOnDep] identifier[dependency] operator[SEP] { Keyword[if] operator[SEP] identifier[addOn] operator[SEP] identifier[version] operator[SEP] identifier[matches] operator[SEP] identifier[dependency] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[addOn] operator[SEP] identifier[semVer] operator[!=] Other[null] operator[&&] identifier[addOn] operator[SEP] identifier[semVer] operator[SEP] identifier[matches] operator[SEP] identifier[dependency] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
private void copyToCache(SchemaConcept schemaConcept) { schemaConcept.subs().forEach(concept -> keyspaceCache.cacheLabel(concept.label(), concept.labelId())); }
class class_name[name] begin[{] method[copyToCache, return_type[void], modifier[private], parameter[schemaConcept]] begin[{] call[schemaConcept.subs, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[copyToCache] operator[SEP] identifier[SchemaConcept] identifier[schemaConcept] operator[SEP] { identifier[schemaConcept] operator[SEP] identifier[subs] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[concept] operator[->] identifier[keyspaceCache] operator[SEP] identifier[cacheLabel] operator[SEP] identifier[concept] operator[SEP] identifier[label] operator[SEP] operator[SEP] , identifier[concept] operator[SEP] identifier[labelId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@NonNull public static <T, V> HashMap<T, V> hashMapBetween(final Class<T> keyClass, final Class<V> valueClass) { assertIsNotParameterized(keyClass, "generic key types are not allowed for this method."); assertIsNotParameterized(valueClass, "generic value types are not allowed for this method."); return HashMap.ofAll(Any.mapBetween(keyClass, valueClass)); }
class class_name[name] begin[{] method[hashMapBetween, return_type[type[HashMap]], modifier[public static], parameter[keyClass, valueClass]] begin[{] call[.assertIsNotParameterized, parameter[member[.keyClass], literal["generic key types are not allowed for this method."]]] call[.assertIsNotParameterized, parameter[member[.valueClass], literal["generic value types are not allowed for this method."]]] return[call[HashMap.ofAll, parameter[call[Any.mapBetween, parameter[member[.keyClass], member[.valueClass]]]]]] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[V] operator[>] identifier[HashMap] operator[<] identifier[T] , identifier[V] operator[>] identifier[hashMapBetween] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[keyClass] , Keyword[final] identifier[Class] operator[<] identifier[V] operator[>] identifier[valueClass] operator[SEP] { identifier[assertIsNotParameterized] operator[SEP] identifier[keyClass] , literal[String] operator[SEP] operator[SEP] identifier[assertIsNotParameterized] operator[SEP] identifier[valueClass] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[HashMap] operator[SEP] identifier[ofAll] operator[SEP] identifier[Any] operator[SEP] identifier[mapBetween] operator[SEP] identifier[keyClass] , identifier[valueClass] operator[SEP] operator[SEP] operator[SEP] }
protected LoggersModel toLoggersModel(Logger[] loggerAnnotations, KnowledgeNamespace knowledgeNamespace) { if (loggerAnnotations == null || loggerAnnotations.length == 0) { return null; } LoggersModel loggersModel = new V1LoggersModel(knowledgeNamespace.uri()); for (Logger loggerAnnotation : loggerAnnotations) { LoggerModel loggerModel = new V1LoggerModel(knowledgeNamespace.uri()); int interval = loggerAnnotation.interval(); if (interval > -1) { loggerModel.setInterval(interval); } String log = loggerAnnotation.log(); if (!UNDEFINED.equals(log)) { loggerModel.setLog(log); } LoggerType loggerType = loggerAnnotation.type(); if (!LoggerType.THREADED_FILE.equals(loggerType)) { loggerModel.setType(loggerType); } loggersModel.addLogger(loggerModel); } return loggersModel; }
class class_name[name] begin[{] method[toLoggersModel, return_type[type[LoggersModel]], modifier[protected], parameter[loggerAnnotations, knowledgeNamespace]] begin[{] if[binary_operation[binary_operation[member[.loggerAnnotations], ==, literal[null]], ||, binary_operation[member[loggerAnnotations.length], ==, literal[0]]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[LoggersModel], loggersModel] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=uri, postfix_operators=[], prefix_operators=[], qualifier=knowledgeNamespace, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=V1LoggerModel, sub_type=None)), name=loggerModel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LoggerModel, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=interval, postfix_operators=[], prefix_operators=[], qualifier=loggerAnnotation, selectors=[], type_arguments=None), name=interval)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=interval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=interval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInterval, postfix_operators=[], prefix_operators=[], qualifier=loggerModel, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=log, postfix_operators=[], prefix_operators=[], qualifier=loggerAnnotation, selectors=[], type_arguments=None), name=log)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=UNDEFINED, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=log, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setLog, postfix_operators=[], prefix_operators=[], qualifier=loggerModel, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=type, postfix_operators=[], prefix_operators=[], qualifier=loggerAnnotation, selectors=[], type_arguments=None), name=loggerType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=LoggerType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=loggerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=LoggerType.THREADED_FILE, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=loggerType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setType, postfix_operators=[], prefix_operators=[], qualifier=loggerModel, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=loggerModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addLogger, postfix_operators=[], prefix_operators=[], qualifier=loggersModel, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=loggerAnnotations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=loggerAnnotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Logger, sub_type=None))), label=None) return[member[.loggersModel]] end[}] END[}]
Keyword[protected] identifier[LoggersModel] identifier[toLoggersModel] operator[SEP] identifier[Logger] operator[SEP] operator[SEP] identifier[loggerAnnotations] , identifier[KnowledgeNamespace] identifier[knowledgeNamespace] operator[SEP] { Keyword[if] operator[SEP] identifier[loggerAnnotations] operator[==] Other[null] operator[||] identifier[loggerAnnotations] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[LoggersModel] identifier[loggersModel] operator[=] Keyword[new] identifier[V1LoggersModel] operator[SEP] identifier[knowledgeNamespace] operator[SEP] identifier[uri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Logger] identifier[loggerAnnotation] operator[:] identifier[loggerAnnotations] operator[SEP] { identifier[LoggerModel] identifier[loggerModel] operator[=] Keyword[new] identifier[V1LoggerModel] operator[SEP] identifier[knowledgeNamespace] operator[SEP] identifier[uri] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[interval] operator[=] identifier[loggerAnnotation] operator[SEP] identifier[interval] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[interval] operator[>] operator[-] Other[1] operator[SEP] { identifier[loggerModel] operator[SEP] identifier[setInterval] operator[SEP] identifier[interval] operator[SEP] operator[SEP] } identifier[String] identifier[log] operator[=] identifier[loggerAnnotation] operator[SEP] identifier[log] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[UNDEFINED] operator[SEP] identifier[equals] operator[SEP] identifier[log] operator[SEP] operator[SEP] { identifier[loggerModel] operator[SEP] identifier[setLog] operator[SEP] identifier[log] operator[SEP] operator[SEP] } identifier[LoggerType] identifier[loggerType] operator[=] identifier[loggerAnnotation] operator[SEP] identifier[type] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[LoggerType] operator[SEP] identifier[THREADED_FILE] operator[SEP] identifier[equals] operator[SEP] identifier[loggerType] operator[SEP] operator[SEP] { identifier[loggerModel] operator[SEP] identifier[setType] operator[SEP] identifier[loggerType] operator[SEP] operator[SEP] } identifier[loggersModel] operator[SEP] identifier[addLogger] operator[SEP] identifier[loggerModel] operator[SEP] operator[SEP] } Keyword[return] identifier[loggersModel] operator[SEP] }
@Override public Observable<String> helloUserStream(final String name, final int repeats) { return interval(100, TimeUnit.MILLISECONDS).map(i -> "Hello, " + name + "! (#" + i + ")").take(repeats); }
class class_name[name] begin[{] method[helloUserStream, return_type[type[Observable]], modifier[public], parameter[name, repeats]] begin[{] return[call[.interval, parameter[literal[100], member[TimeUnit.MILLISECONDS]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[String] operator[>] identifier[helloUserStream] operator[SEP] Keyword[final] identifier[String] identifier[name] , Keyword[final] Keyword[int] identifier[repeats] operator[SEP] { Keyword[return] identifier[interval] operator[SEP] Other[100] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[i] operator[->] literal[String] operator[+] identifier[name] operator[+] literal[String] operator[+] identifier[i] operator[+] literal[String] operator[SEP] operator[SEP] identifier[take] operator[SEP] identifier[repeats] operator[SEP] operator[SEP] }
public InetAddress getRemoteAddress() { final Channel channel; try { channel = strategy.getChannel(); } catch (IOException e) { return null; } final Connection connection = channel.getConnection(); final InetSocketAddress peerAddress = connection.getPeerAddress(InetSocketAddress.class); return peerAddress == null ? null : peerAddress.getAddress(); }
class class_name[name] begin[{] method[getRemoteAddress, return_type[type[InetAddress]], modifier[public], parameter[]] begin[{] local_variable[type[Channel], channel] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=channel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=strategy, 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=['IOException']))], finally_block=None, label=None, resources=None) local_variable[type[Connection], connection] local_variable[type[InetSocketAddress], peerAddress] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=peerAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getAddress, postfix_operators=[], prefix_operators=[], qualifier=peerAddress, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[InetAddress] identifier[getRemoteAddress] operator[SEP] operator[SEP] { Keyword[final] identifier[Channel] identifier[channel] operator[SEP] Keyword[try] { identifier[channel] operator[=] identifier[strategy] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[final] identifier[Connection] identifier[connection] operator[=] identifier[channel] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[InetSocketAddress] identifier[peerAddress] operator[=] identifier[connection] operator[SEP] identifier[getPeerAddress] operator[SEP] identifier[InetSocketAddress] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[peerAddress] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[peerAddress] operator[SEP] identifier[getAddress] operator[SEP] operator[SEP] operator[SEP] }
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; labelFilenameMask = new javax.swing.JLabel(); textFieldMask = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); listFoundFiles = new javax.swing.JList<>(); setLayout(new java.awt.GridBagLayout()); labelFilenameMask.setText("File Name prefix (wildcards: ? and *)"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 8, 0); add(labelFilenameMask, gridBagConstraints); textFieldMask.addKeyListener(new java.awt.event.KeyAdapter() { public void keyPressed(java.awt.event.KeyEvent evt) { textFieldMaskKeyPressed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.weightx = 1000.0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 8, 0); add(textFieldMask, gridBagConstraints); listFoundFiles.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); listFoundFiles.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { listFoundFilesMouseMoved(evt); } }); listFoundFiles.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { listFoundFilesMouseClicked(evt); } }); jScrollPane1.setViewportView(listFoundFiles); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.weightx = 1000.0; gridBagConstraints.weighty = 1000.0; add(jScrollPane1, gridBagConstraints); }
class class_name[name] begin[{] method[initComponents, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[java], gridBagConstraints] assign[member[.labelFilenameMask], 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))))] assign[member[.textFieldMask], 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=JTextField, sub_type=None))))] assign[member[.jScrollPane1], 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=JScrollPane, sub_type=None))))] assign[member[.listFoundFiles], 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=[], dimensions=None, name=JList, sub_type=None))))] call[.setLayout, parameter[ClassCreator(arguments=[], 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=GridBagLayout, sub_type=None))))]] call[labelFilenameMask.setText, parameter[literal["File Name prefix (wildcards: ? and *)"]]] assign[member[.gridBagConstraints], ClassCreator(arguments=[], 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=GridBagConstraints, sub_type=None))))] assign[member[gridBagConstraints.gridx], literal[0]] assign[member[gridBagConstraints.gridy], literal[0]] assign[member[gridBagConstraints.anchor], member[java.awt.GridBagConstraints.WEST]] assign[member[gridBagConstraints.insets], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], 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=Insets, sub_type=None))))] call[.add, parameter[member[.labelFilenameMask], member[.gridBagConstraints]]] call[textFieldMask.addKeyListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=textFieldMaskKeyPressed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=keyPressed, 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=KeyEvent, 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=KeyAdapter, sub_type=None)))))]] assign[member[.gridBagConstraints], ClassCreator(arguments=[], 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=GridBagConstraints, sub_type=None))))] assign[member[gridBagConstraints.gridx], literal[0]] assign[member[gridBagConstraints.gridy], literal[1]] assign[member[gridBagConstraints.fill], member[java.awt.GridBagConstraints.HORIZONTAL]] assign[member[gridBagConstraints.weightx], literal[1000.0]] assign[member[gridBagConstraints.insets], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], 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=Insets, sub_type=None))))] call[.add, parameter[member[.textFieldMask], member[.gridBagConstraints]]] call[listFoundFiles.setSelectionMode, parameter[member[javax.swing.ListSelectionModel.SINGLE_SELECTION]]] call[listFoundFiles.addMouseMotionListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listFoundFilesMouseMoved, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=mouseMoved, 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=MouseEvent, 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=MouseMotionAdapter, sub_type=None)))))]] call[listFoundFiles.addMouseListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=evt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listFoundFilesMouseClicked, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=mouseClicked, 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=MouseEvent, 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=MouseAdapter, sub_type=None)))))]] call[jScrollPane1.setViewportView, parameter[member[.listFoundFiles]]] assign[member[.gridBagConstraints], ClassCreator(arguments=[], 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=GridBagConstraints, sub_type=None))))] assign[member[gridBagConstraints.gridx], literal[0]] assign[member[gridBagConstraints.gridy], literal[2]] assign[member[gridBagConstraints.fill], member[java.awt.GridBagConstraints.BOTH]] assign[member[gridBagConstraints.weightx], literal[1000.0]] assign[member[gridBagConstraints.weighty], literal[1000.0]] call[.add, parameter[member[.jScrollPane1], member[.gridBagConstraints]]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[void] identifier[initComponents] operator[SEP] operator[SEP] { identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[GridBagConstraints] identifier[gridBagConstraints] operator[SEP] identifier[labelFilenameMask] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JLabel] operator[SEP] operator[SEP] operator[SEP] identifier[textFieldMask] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JTextField] operator[SEP] operator[SEP] operator[SEP] identifier[jScrollPane1] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JScrollPane] operator[SEP] operator[SEP] operator[SEP] identifier[listFoundFiles] operator[=] Keyword[new] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[JList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[setLayout] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[GridBagLayout] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[labelFilenameMask] operator[SEP] identifier[setText] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[gridBagConstraints] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[GridBagConstraints] operator[SEP] operator[SEP] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[gridx] operator[=] Other[0] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[gridy] operator[=] Other[0] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[anchor] operator[=] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[GridBagConstraints] operator[SEP] identifier[WEST] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[insets] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Insets] operator[SEP] Other[0] , Other[0] , Other[8] , Other[0] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[labelFilenameMask] , identifier[gridBagConstraints] operator[SEP] operator[SEP] identifier[textFieldMask] operator[SEP] identifier[addKeyListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[KeyAdapter] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[keyPressed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[KeyEvent] identifier[evt] operator[SEP] { identifier[textFieldMaskKeyPressed] operator[SEP] identifier[evt] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[gridBagConstraints] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[GridBagConstraints] operator[SEP] operator[SEP] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[gridx] operator[=] Other[0] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[gridy] operator[=] Other[1] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[fill] operator[=] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[GridBagConstraints] operator[SEP] identifier[HORIZONTAL] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[weightx] operator[=] literal[Float] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[insets] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Insets] operator[SEP] Other[0] , Other[0] , Other[8] , Other[0] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[textFieldMask] , identifier[gridBagConstraints] operator[SEP] operator[SEP] identifier[listFoundFiles] operator[SEP] identifier[setSelectionMode] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[ListSelectionModel] operator[SEP] identifier[SINGLE_SELECTION] operator[SEP] operator[SEP] identifier[listFoundFiles] operator[SEP] identifier[addMouseMotionListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[MouseMotionAdapter] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[mouseMoved] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[MouseEvent] identifier[evt] operator[SEP] { identifier[listFoundFilesMouseMoved] operator[SEP] identifier[evt] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[listFoundFiles] operator[SEP] identifier[addMouseListener] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[MouseAdapter] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[mouseClicked] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[MouseEvent] identifier[evt] operator[SEP] { identifier[listFoundFilesMouseClicked] operator[SEP] identifier[evt] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[jScrollPane1] operator[SEP] identifier[setViewportView] operator[SEP] identifier[listFoundFiles] operator[SEP] operator[SEP] identifier[gridBagConstraints] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[GridBagConstraints] operator[SEP] operator[SEP] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[gridx] operator[=] Other[0] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[gridy] operator[=] Other[2] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[fill] operator[=] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[GridBagConstraints] operator[SEP] identifier[BOTH] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[weightx] operator[=] literal[Float] operator[SEP] identifier[gridBagConstraints] operator[SEP] identifier[weighty] operator[=] literal[Float] operator[SEP] identifier[add] operator[SEP] identifier[jScrollPane1] , identifier[gridBagConstraints] operator[SEP] operator[SEP] }
private Object populateEntityFromDataFrame(EntityMetadata m, Map<String, Integer> columnIndexMap, Row row) { try { // create entity instance Object entity = KunderaCoreUtils.createNewInstance(m.getEntityClazz()); // handle relations Map<String, Object> relations = new HashMap<String, Object>(); if (entity.getClass().isAssignableFrom(EnhanceEntity.class)) { relations = ((EnhanceEntity) entity).getRelations(); entity = ((EnhanceEntity) entity).getEntity(); } // get a Set of attributes MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel( m.getPersistenceUnit()); EntityType entityType = metaModel.entity(m.getEntityClazz()); Set<Attribute> attributes = ((AbstractManagedType) entityType).getAttributes(); // iterate over attributes and find its value for (Attribute attribute : attributes) { String columnName = getColumnName(attribute); Object columnValue = row.get(columnIndexMap.get(columnName)); if (columnValue != null) { Object value = PropertyAccessorHelper.fromSourceToTargetClass(attribute.getJavaType(), columnValue.getClass(), columnValue); PropertyAccessorHelper.set(entity, (Field) attribute.getJavaMember(), value); } } // find the value of @Id field for EnhanceEntity SingularAttribute attrib = m.getIdAttribute(); Object rowKey = PropertyAccessorHelper.getObject(entity, (Field) attrib.getJavaMember()); if (!relations.isEmpty()) { return new EnhanceEntity(entity, rowKey, relations); } return entity; } catch (PropertyAccessException e1) { throw new RuntimeException(e1); } }
class class_name[name] begin[{] method[populateEntityFromDataFrame, return_type[type[Object]], modifier[private], parameter[m, columnIndexMap, row]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEntityClazz, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=createNewInstance, postfix_operators=[], prefix_operators=[], qualifier=KunderaCoreUtils, selectors=[], type_arguments=None), name=entity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=HashMap, sub_type=None)), name=relations)], modifiers=set(), 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=[], name=Map, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=entity, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EnhanceEntity, sub_type=None))], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=relations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EnhanceEntity, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=EnhanceEntity, sub_type=None))), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getApplicationMetadata, postfix_operators=[], prefix_operators=[], qualifier=kunderaMetadata, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPersistenceUnit, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=getMetamodel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=MetamodelImpl, sub_type=None)), name=metaModel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MetamodelImpl, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEntityClazz, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=entity, postfix_operators=[], prefix_operators=[], qualifier=metaModel, selectors=[], type_arguments=None), name=entityType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EntityType, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=entityType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractManagedType, sub_type=None)), name=attributes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=columnName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=columnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnIndexMap, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=row, selectors=[], type_arguments=None), name=columnValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=columnValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getJavaType, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=columnValue, selectors=[], type_arguments=None), MemberReference(member=columnValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromSourceToTargetClass, postfix_operators=[], prefix_operators=[], qualifier=PropertyAccessorHelper, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MethodInvocation(arguments=[], member=getJavaMember, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None)), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=PropertyAccessorHelper, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=attributes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=attribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getIdAttribute, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), name=attrib)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SingularAttribute, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MethodInvocation(arguments=[], member=getJavaMember, postfix_operators=[], prefix_operators=[], qualifier=attrib, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=PropertyAccessorHelper, selectors=[], type_arguments=None), name=rowKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=relations, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rowKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=relations, 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=EnhanceEntity, sub_type=None)), label=None)])), ReturnStatement(expression=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['PropertyAccessException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] identifier[Object] identifier[populateEntityFromDataFrame] operator[SEP] identifier[EntityMetadata] identifier[m] , identifier[Map] operator[<] identifier[String] , identifier[Integer] operator[>] identifier[columnIndexMap] , identifier[Row] identifier[row] operator[SEP] { Keyword[try] { identifier[Object] identifier[entity] operator[=] identifier[KunderaCoreUtils] operator[SEP] identifier[createNewInstance] operator[SEP] identifier[m] operator[SEP] identifier[getEntityClazz] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[relations] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entity] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[EnhanceEntity] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { identifier[relations] operator[=] operator[SEP] operator[SEP] identifier[EnhanceEntity] operator[SEP] identifier[entity] operator[SEP] operator[SEP] identifier[getRelations] operator[SEP] operator[SEP] operator[SEP] identifier[entity] operator[=] operator[SEP] operator[SEP] identifier[EnhanceEntity] operator[SEP] identifier[entity] operator[SEP] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] } identifier[MetamodelImpl] identifier[metaModel] operator[=] operator[SEP] identifier[MetamodelImpl] operator[SEP] identifier[kunderaMetadata] operator[SEP] identifier[getApplicationMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[getMetamodel] operator[SEP] identifier[m] operator[SEP] identifier[getPersistenceUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[EntityType] identifier[entityType] operator[=] identifier[metaModel] operator[SEP] identifier[entity] operator[SEP] identifier[m] operator[SEP] identifier[getEntityClazz] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Attribute] operator[>] identifier[attributes] operator[=] operator[SEP] operator[SEP] identifier[AbstractManagedType] operator[SEP] identifier[entityType] operator[SEP] operator[SEP] identifier[getAttributes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Attribute] identifier[attribute] operator[:] identifier[attributes] operator[SEP] { identifier[String] identifier[columnName] operator[=] identifier[getColumnName] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] identifier[Object] identifier[columnValue] operator[=] identifier[row] operator[SEP] identifier[get] operator[SEP] identifier[columnIndexMap] operator[SEP] identifier[get] operator[SEP] identifier[columnName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[columnValue] operator[!=] Other[null] operator[SEP] { identifier[Object] identifier[value] operator[=] identifier[PropertyAccessorHelper] operator[SEP] identifier[fromSourceToTargetClass] operator[SEP] identifier[attribute] operator[SEP] identifier[getJavaType] operator[SEP] operator[SEP] , identifier[columnValue] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] , identifier[columnValue] operator[SEP] operator[SEP] identifier[PropertyAccessorHelper] operator[SEP] identifier[set] operator[SEP] identifier[entity] , operator[SEP] identifier[Field] operator[SEP] identifier[attribute] operator[SEP] identifier[getJavaMember] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP] } } identifier[SingularAttribute] identifier[attrib] operator[=] identifier[m] operator[SEP] identifier[getIdAttribute] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[rowKey] operator[=] identifier[PropertyAccessorHelper] operator[SEP] identifier[getObject] operator[SEP] identifier[entity] , operator[SEP] identifier[Field] operator[SEP] identifier[attrib] operator[SEP] identifier[getJavaMember] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[relations] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[EnhanceEntity] operator[SEP] identifier[entity] , identifier[rowKey] , identifier[relations] operator[SEP] operator[SEP] } Keyword[return] identifier[entity] operator[SEP] } Keyword[catch] operator[SEP] identifier[PropertyAccessException] identifier[e1] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e1] operator[SEP] operator[SEP] } }
@Pure public static List<UUID> getAttributeUUIDs(Node document, boolean caseSensitive, String... path) { assert document != null : AssertMessages.notNullParameter(0); final List<UUID> ids = new ArrayList<>(); final String v = getAttributeValue(document, caseSensitive, 0, path); if (v != null && !v.isEmpty()) { for (final String id : v.split(COLUMN_SEPARATOR)) { try { ids.add(UUID.fromString(id)); } catch (Exception e) { // } } } return ids; }
class class_name[name] begin[{] method[getAttributeUUIDs, return_type[type[List]], modifier[public static], parameter[document, caseSensitive, path]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=document, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=notNullParameter, postfix_operators=[], prefix_operators=[], qualifier=AssertMessages, selectors=[], type_arguments=None)) local_variable[type[List], ids] local_variable[type[String], v] if[binary_operation[binary_operation[member[.v], !=, literal[null]], &&, call[v.isEmpty, parameter[]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromString, postfix_operators=[], prefix_operators=[], qualifier=UUID, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=ids, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=COLUMN_SEPARATOR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=split, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) else begin[{] None end[}] return[member[.ids]] end[}] END[}]
annotation[@] identifier[Pure] Keyword[public] Keyword[static] identifier[List] operator[<] identifier[UUID] operator[>] identifier[getAttributeUUIDs] operator[SEP] identifier[Node] identifier[document] , Keyword[boolean] identifier[caseSensitive] , identifier[String] operator[...] identifier[path] operator[SEP] { Keyword[assert] identifier[document] operator[!=] Other[null] operator[:] identifier[AssertMessages] operator[SEP] identifier[notNullParameter] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[UUID] operator[>] identifier[ids] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[v] operator[=] identifier[getAttributeValue] operator[SEP] identifier[document] , identifier[caseSensitive] , Other[0] , identifier[path] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[v] operator[!=] Other[null] operator[&&] operator[!] identifier[v] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[id] operator[:] identifier[v] operator[SEP] identifier[split] operator[SEP] identifier[COLUMN_SEPARATOR] operator[SEP] operator[SEP] { Keyword[try] { identifier[ids] operator[SEP] identifier[add] operator[SEP] identifier[UUID] operator[SEP] identifier[fromString] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { } } } Keyword[return] identifier[ids] operator[SEP] }
@Override public IRenderingElement generate(IAtomContainer container, RendererModel model) { double[] minMax = GeometryUtil.getMinMax(container); return new RectangleElement(minMax[0], minMax[1], minMax[2], minMax[3], new Color(.7f, .7f, 1.0f)); }
class class_name[name] begin[{] method[generate, return_type[type[IRenderingElement]], modifier[public], parameter[container, model]] begin[{] local_variable[type[double], minMax] return[ClassCreator(arguments=[MemberReference(member=minMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=minMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), MemberReference(member=minMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), MemberReference(member=minMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3))]), ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=.7f), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=.7f), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.0f)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Color, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RectangleElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[IRenderingElement] identifier[generate] operator[SEP] identifier[IAtomContainer] identifier[container] , identifier[RendererModel] identifier[model] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] identifier[minMax] operator[=] identifier[GeometryUtil] operator[SEP] identifier[getMinMax] operator[SEP] identifier[container] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[RectangleElement] operator[SEP] identifier[minMax] operator[SEP] Other[0] operator[SEP] , identifier[minMax] operator[SEP] Other[1] operator[SEP] , identifier[minMax] operator[SEP] Other[2] operator[SEP] , identifier[minMax] operator[SEP] Other[3] operator[SEP] , Keyword[new] identifier[Color] operator[SEP] literal[Float] , literal[Float] , literal[Float] operator[SEP] operator[SEP] operator[SEP] }
public static OptimizeEngine newInstance(final ShardingRule shardingRule, final SQLStatement sqlStatement, final List<Object> parameters, final GeneratedKey generatedKey) { if (sqlStatement instanceof InsertStatement) { return new InsertOptimizeEngine(shardingRule, (InsertStatement) sqlStatement, parameters, generatedKey); } if (sqlStatement instanceof SelectStatement || sqlStatement instanceof DMLStatement) { return new QueryOptimizeEngine(sqlStatement.getRouteConditions().getOrCondition(), parameters); } // TODO do with DDL and DAL return new QueryOptimizeEngine(sqlStatement.getRouteConditions().getOrCondition(), parameters); }
class class_name[name] begin[{] method[newInstance, return_type[type[OptimizeEngine]], modifier[public static], parameter[shardingRule, sqlStatement, parameters, generatedKey]] begin[{] if[binary_operation[member[.sqlStatement], instanceof, type[InsertStatement]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=shardingRule, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=sqlStatement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=InsertStatement, sub_type=None)), MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=generatedKey, 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=InsertOptimizeEngine, sub_type=None))] else begin[{] None end[}] if[binary_operation[binary_operation[member[.sqlStatement], instanceof, type[SelectStatement]], ||, binary_operation[member[.sqlStatement], instanceof, type[DMLStatement]]]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getRouteConditions, postfix_operators=[], prefix_operators=[], qualifier=sqlStatement, selectors=[MethodInvocation(arguments=[], member=getOrCondition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=parameters, 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=QueryOptimizeEngine, sub_type=None))] else begin[{] None end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getRouteConditions, postfix_operators=[], prefix_operators=[], qualifier=sqlStatement, selectors=[MethodInvocation(arguments=[], member=getOrCondition, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=parameters, 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=QueryOptimizeEngine, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[OptimizeEngine] identifier[newInstance] operator[SEP] Keyword[final] identifier[ShardingRule] identifier[shardingRule] , Keyword[final] identifier[SQLStatement] identifier[sqlStatement] , Keyword[final] identifier[List] operator[<] identifier[Object] operator[>] identifier[parameters] , Keyword[final] identifier[GeneratedKey] identifier[generatedKey] operator[SEP] { Keyword[if] operator[SEP] identifier[sqlStatement] Keyword[instanceof] identifier[InsertStatement] operator[SEP] { Keyword[return] Keyword[new] identifier[InsertOptimizeEngine] operator[SEP] identifier[shardingRule] , operator[SEP] identifier[InsertStatement] operator[SEP] identifier[sqlStatement] , identifier[parameters] , identifier[generatedKey] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[sqlStatement] Keyword[instanceof] identifier[SelectStatement] operator[||] identifier[sqlStatement] Keyword[instanceof] identifier[DMLStatement] operator[SEP] { Keyword[return] Keyword[new] identifier[QueryOptimizeEngine] operator[SEP] identifier[sqlStatement] operator[SEP] identifier[getRouteConditions] operator[SEP] operator[SEP] operator[SEP] identifier[getOrCondition] operator[SEP] operator[SEP] , identifier[parameters] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[QueryOptimizeEngine] operator[SEP] identifier[sqlStatement] operator[SEP] identifier[getRouteConditions] operator[SEP] operator[SEP] operator[SEP] identifier[getOrCondition] operator[SEP] operator[SEP] , identifier[parameters] operator[SEP] operator[SEP] }
private byte[] getAsByteArray(String template) throws IOException { if (isTemplateGivenAsAnAbsoluteFile(template)) { throw new IllegalArgumentException("Template " + template + " should not be given as an absolute file"); } if (!containsTemplate(template)) { throw new IllegalArgumentException("Template " + template + " is not a template"); } java.io.InputStream is = null; try { is = new FileInputStream(getAbsoluteTemplate(template)); return toByteArray(is); } finally { closeQuietly(is); } }
class class_name[name] begin[{] method[getAsByteArray, return_type[type[byte]], modifier[private], parameter[template]] begin[{] if[call[.isTemplateGivenAsAnAbsoluteFile, parameter[member[.template]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Template "), operandr=MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" should not be given as an absolute file"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[call[.containsTemplate, parameter[member[.template]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Template "), operandr=MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is not a template"), 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[java], is] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAbsoluteTemplate, 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=FileInputStream, sub_type=None))), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[byte] operator[SEP] operator[SEP] identifier[getAsByteArray] operator[SEP] identifier[String] identifier[template] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[isTemplateGivenAsAnAbsoluteFile] operator[SEP] identifier[template] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[template] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[containsTemplate] operator[SEP] identifier[template] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[template] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[InputStream] identifier[is] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[is] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[getAbsoluteTemplate] operator[SEP] identifier[template] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[toByteArray] operator[SEP] identifier[is] operator[SEP] operator[SEP] } Keyword[finally] { identifier[closeQuietly] operator[SEP] identifier[is] operator[SEP] operator[SEP] } }
public void setName(String name) { synchronized(Pool.class) { if(isStarted()) { if((name==null&&_pool.getPoolName()!=null)||(name!=null&&!name.equals(_pool.getPoolName()))) throw new IllegalStateException("started"); return; } if(name==null) { if(_pool.getPoolName()!=null) { _pool=new Pool(); _pool.setPoolName(getName()); } } else if (!name.equals(getName())) { Pool pool=Pool.getPool(name); if(pool==null) _pool.setPoolName(name); else _pool=pool; } } }
class class_name[name] begin[{] method[setName, return_type[void], modifier[public], parameter[name]] begin[{] SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Pool, sub_type=None))] BEGIN[{] if[call[.isStarted, parameter[]]] begin[{] if[binary_operation[binary_operation[binary_operation[member[.name], ==, literal[null]], &&, binary_operation[call[_pool.getPoolName, parameter[]], !=, literal[null]]], ||, binary_operation[binary_operation[member[.name], !=, literal[null]], &&, call[name.equals, parameter[call[_pool.getPoolName, parameter[]]]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="started")], 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[None] else begin[{] None end[}] if[binary_operation[member[.name], ==, literal[null]]] begin[{] if[binary_operation[call[_pool.getPoolName, parameter[]], !=, literal[null]]] begin[{] assign[member[._pool], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Pool, sub_type=None))] call[_pool.setPoolName, parameter[call[.getName, parameter[]]]] else begin[{] None end[}] else begin[{] if[call[name.equals, parameter[call[.getName, parameter[]]]]] begin[{] local_variable[type[Pool], pool] if[binary_operation[member[.pool], ==, literal[null]]] begin[{] call[_pool.setPoolName, parameter[member[.name]]] else begin[{] assign[member[._pool], member[.pool]] end[}] else begin[{] None end[}] end[}] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setName] operator[SEP] identifier[String] identifier[name] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[Pool] operator[SEP] Keyword[class] operator[SEP] { Keyword[if] operator[SEP] identifier[isStarted] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[SEP] identifier[name] operator[==] Other[null] operator[&&] identifier[_pool] operator[SEP] identifier[getPoolName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[||] operator[SEP] identifier[name] operator[!=] Other[null] operator[&&] operator[!] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[_pool] operator[SEP] identifier[getPoolName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[name] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[_pool] operator[SEP] identifier[getPoolName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[_pool] operator[=] Keyword[new] identifier[Pool] operator[SEP] operator[SEP] operator[SEP] identifier[_pool] operator[SEP] identifier[setPoolName] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Pool] identifier[pool] operator[=] identifier[Pool] operator[SEP] identifier[getPool] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pool] operator[==] Other[null] operator[SEP] identifier[_pool] operator[SEP] identifier[setPoolName] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[else] identifier[_pool] operator[=] identifier[pool] operator[SEP] } } }
public Description describe() { String defined_in_id = "IR"; if (defined_in instanceof org.omg.CORBA.ContainedOperations) defined_in_id = ((org.omg.CORBA.ContainedOperations) defined_in).id(); ValueDescription md = new ValueDescription(name, id, is_abstract, is_custom, defined_in_id, version, supported_interfaces, abstract_base_valuetypes, false, baseValue); Any any = getORB().create_any(); ValueDescriptionHelper.insert(any, md); return new Description(DefinitionKind.dk_Value, any); }
class class_name[name] begin[{] method[describe, return_type[type[Description]], modifier[public], parameter[]] begin[{] local_variable[type[String], defined_in_id] if[binary_operation[member[.defined_in], instanceof, type[org]]] begin[{] assign[member[.defined_in_id], Cast(expression=MemberReference(member=defined_in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=org, sub_type=ReferenceType(arguments=None, dimensions=None, name=omg, sub_type=ReferenceType(arguments=None, dimensions=None, name=CORBA, sub_type=ReferenceType(arguments=None, dimensions=None, name=ContainedOperations, sub_type=None)))))] else begin[{] None end[}] local_variable[type[ValueDescription], md] local_variable[type[Any], any] call[ValueDescriptionHelper.insert, parameter[member[.any], member[.md]]] return[ClassCreator(arguments=[MemberReference(member=dk_Value, postfix_operators=[], prefix_operators=[], qualifier=DefinitionKind, selectors=[]), MemberReference(member=any, 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=Description, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Description] identifier[describe] operator[SEP] operator[SEP] { identifier[String] identifier[defined_in_id] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[defined_in] Keyword[instanceof] identifier[org] operator[SEP] identifier[omg] operator[SEP] identifier[CORBA] operator[SEP] identifier[ContainedOperations] operator[SEP] identifier[defined_in_id] operator[=] operator[SEP] operator[SEP] identifier[org] operator[SEP] identifier[omg] operator[SEP] identifier[CORBA] operator[SEP] identifier[ContainedOperations] operator[SEP] identifier[defined_in] operator[SEP] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] identifier[ValueDescription] identifier[md] operator[=] Keyword[new] identifier[ValueDescription] operator[SEP] identifier[name] , identifier[id] , identifier[is_abstract] , identifier[is_custom] , identifier[defined_in_id] , identifier[version] , identifier[supported_interfaces] , identifier[abstract_base_valuetypes] , literal[boolean] , identifier[baseValue] operator[SEP] operator[SEP] identifier[Any] identifier[any] operator[=] identifier[getORB] operator[SEP] operator[SEP] operator[SEP] identifier[create_any] operator[SEP] operator[SEP] operator[SEP] identifier[ValueDescriptionHelper] operator[SEP] identifier[insert] operator[SEP] identifier[any] , identifier[md] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Description] operator[SEP] identifier[DefinitionKind] operator[SEP] identifier[dk_Value] , identifier[any] operator[SEP] operator[SEP] }
private String getUserKey( AppInfo appInfo, String userId ) { if ( userId == null ) { throw new IllegalArgumentException( "userId should not be null" ); } return String.format( "%s%s", getAppPrefix( appInfo ), userId ); }
class class_name[name] begin[{] method[getUserKey, return_type[type[String]], modifier[private], parameter[appInfo, userId]] begin[{] if[binary_operation[member[.userId], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="userId should not be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] return[call[String.format, parameter[literal["%s%s"], call[.getAppPrefix, parameter[member[.appInfo]]], member[.userId]]]] end[}] END[}]
Keyword[private] identifier[String] identifier[getUserKey] operator[SEP] identifier[AppInfo] identifier[appInfo] , identifier[String] identifier[userId] operator[SEP] { Keyword[if] operator[SEP] identifier[userId] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[getAppPrefix] operator[SEP] identifier[appInfo] operator[SEP] , identifier[userId] operator[SEP] operator[SEP] }
public AggregatorData getData(Aggregator aggregator) { Utils.checkState(started, "Not started"); Utils.checkState(!stopped, "Already stopped"); Utils.checkNotNull(aggregator, "aggregator"); Utils.checkArgument( aggregators.contains(aggregator), Utils.formatL("Aggregator {} is not registered to provider", aggregator) ); return data.get(aggregator); }
class class_name[name] begin[{] method[getData, return_type[type[AggregatorData]], modifier[public], parameter[aggregator]] begin[{] call[Utils.checkState, parameter[member[.started], literal["Not started"]]] call[Utils.checkState, parameter[member[.stopped], literal["Already stopped"]]] call[Utils.checkNotNull, parameter[member[.aggregator], literal["aggregator"]]] call[Utils.checkArgument, parameter[call[aggregators.contains, parameter[member[.aggregator]]], call[Utils.formatL, parameter[literal["Aggregator {} is not registered to provider"], member[.aggregator]]]]] return[call[data.get, parameter[member[.aggregator]]]] end[}] END[}]
Keyword[public] identifier[AggregatorData] identifier[getData] operator[SEP] identifier[Aggregator] identifier[aggregator] operator[SEP] { identifier[Utils] operator[SEP] identifier[checkState] operator[SEP] identifier[started] , literal[String] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[checkState] operator[SEP] operator[!] identifier[stopped] , literal[String] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[aggregator] , literal[String] operator[SEP] operator[SEP] identifier[Utils] operator[SEP] identifier[checkArgument] operator[SEP] identifier[aggregators] operator[SEP] identifier[contains] operator[SEP] identifier[aggregator] operator[SEP] , identifier[Utils] operator[SEP] identifier[formatL] operator[SEP] literal[String] , identifier[aggregator] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[data] operator[SEP] identifier[get] operator[SEP] identifier[aggregator] operator[SEP] operator[SEP] }
protected void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException { this.appRandom = random; engineInitSign(privateKey); }
class class_name[name] begin[{] method[engineInitSign, return_type[void], modifier[protected], parameter[privateKey, random]] begin[{] assign[THIS[member[None.appRandom]], member[.random]] call[.engineInitSign, parameter[member[.privateKey]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[engineInitSign] operator[SEP] identifier[PrivateKey] identifier[privateKey] , identifier[SecureRandom] identifier[random] operator[SEP] Keyword[throws] identifier[InvalidKeyException] { Keyword[this] operator[SEP] identifier[appRandom] operator[=] identifier[random] operator[SEP] identifier[engineInitSign] operator[SEP] identifier[privateKey] operator[SEP] operator[SEP] }
public static Optional<String> getStringAsOptWithFilePath( String filePath, String charsetName) { return JMOptional .getOptional(JMFiles.readString(filePath, charsetName)); }
class class_name[name] begin[{] method[getStringAsOptWithFilePath, return_type[type[Optional]], modifier[public static], parameter[filePath, charsetName]] begin[{] return[call[JMOptional.getOptional, parameter[call[JMFiles.readString, parameter[member[.filePath], member[.charsetName]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Optional] operator[<] identifier[String] operator[>] identifier[getStringAsOptWithFilePath] operator[SEP] identifier[String] identifier[filePath] , identifier[String] identifier[charsetName] operator[SEP] { Keyword[return] identifier[JMOptional] operator[SEP] identifier[getOptional] operator[SEP] identifier[JMFiles] operator[SEP] identifier[readString] operator[SEP] identifier[filePath] , identifier[charsetName] operator[SEP] operator[SEP] operator[SEP] }
protected String getTextEx(int position, int len) { try { return getDocument().getText(position, len); } catch (BadLocationException e) { e.printStackTrace(); return ""; } }
class class_name[name] begin[{] method[getTextEx, return_type[type[String]], modifier[protected], parameter[position, len]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getDocument, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getText, 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=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['BadLocationException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] identifier[String] identifier[getTextEx] operator[SEP] Keyword[int] identifier[position] , Keyword[int] identifier[len] operator[SEP] { Keyword[try] { Keyword[return] identifier[getDocument] operator[SEP] operator[SEP] operator[SEP] identifier[getText] operator[SEP] identifier[position] , identifier[len] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[BadLocationException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[String] operator[SEP] } }
private String resourcesToString(Iterable<CmsResource> resources) { StringBuffer buffer = new StringBuffer(); boolean first = true; buffer.append("["); for (CmsResource res : resources) { if (!first) { buffer.append(", "); } first = false; buffer.append(res.getRootPath()); buffer.append("!"); buffer.append(res.getState().getAbbreviation()); } buffer.append("]"); return buffer.toString(); }
class class_name[name] begin[{] method[resourcesToString, return_type[type[String]], modifier[private], parameter[resources]] begin[{] local_variable[type[StringBuffer], buffer] local_variable[type[boolean], first] call[buffer.append, parameter[literal["["]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=first, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", ")], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=first, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, 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=buffer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getState, postfix_operators=[], prefix_operators=[], qualifier=res, selectors=[MethodInvocation(arguments=[], member=getAbbreviation, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=res)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsResource, sub_type=None))), label=None) call[buffer.append, parameter[literal["]"]]] return[call[buffer.toString, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[resourcesToString] operator[SEP] identifier[Iterable] operator[<] identifier[CmsResource] operator[>] identifier[resources] operator[SEP] { identifier[StringBuffer] identifier[buffer] operator[=] Keyword[new] identifier[StringBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[boolean] identifier[first] operator[=] literal[boolean] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CmsResource] identifier[res] operator[:] identifier[resources] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[first] operator[SEP] { identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[first] operator[=] literal[boolean] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[res] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[append] operator[SEP] identifier[res] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] identifier[getAbbreviation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[buffer] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[buffer] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void transition (Class<?> clazz, String name, Transition trans) throws PersistenceException { if (!isTransitionApplied(clazz, name) && noteTransition(clazz, name)) { try { trans.run(); } catch (PersistenceException e) { try { clearTransition(clazz, name); } catch (PersistenceException pe) { log.warning("Failed to clear failed transition", "class", clazz, "name", name, pe); } throw e; } catch (RuntimeException rte) { try { clearTransition(clazz, name); } catch (PersistenceException pe) { log.warning("Failed to clear failed transition", "class", clazz, "name", name, pe); } throw rte; } } }
class class_name[name] begin[{] method[transition, return_type[void], modifier[public], parameter[clazz, name, trans]] begin[{] if[binary_operation[call[.isTransitionApplied, parameter[member[.clazz], member[.name]]], &&, call[.noteTransition, parameter[member[.clazz], member[.name]]]]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=trans, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=clearTransition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to clear failed transition"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="class"), MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warning, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=pe, types=['PersistenceException']))], finally_block=None, label=None, resources=None), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['PersistenceException'])), CatchClause(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=clearTransition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to clear failed transition"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="class"), MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name"), MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warning, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=pe, types=['PersistenceException']))], finally_block=None, label=None, resources=None), ThrowStatement(expression=MemberReference(member=rte, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=rte, types=['RuntimeException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[transition] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] , identifier[String] identifier[name] , identifier[Transition] identifier[trans] operator[SEP] Keyword[throws] identifier[PersistenceException] { Keyword[if] operator[SEP] operator[!] identifier[isTransitionApplied] operator[SEP] identifier[clazz] , identifier[name] operator[SEP] operator[&&] identifier[noteTransition] operator[SEP] identifier[clazz] , identifier[name] operator[SEP] operator[SEP] { Keyword[try] { identifier[trans] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[PersistenceException] identifier[e] operator[SEP] { Keyword[try] { identifier[clearTransition] operator[SEP] identifier[clazz] , identifier[name] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[PersistenceException] identifier[pe] operator[SEP] { identifier[log] operator[SEP] identifier[warning] operator[SEP] literal[String] , literal[String] , identifier[clazz] , literal[String] , identifier[name] , identifier[pe] operator[SEP] operator[SEP] } Keyword[throw] identifier[e] operator[SEP] } Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[rte] operator[SEP] { Keyword[try] { identifier[clearTransition] operator[SEP] identifier[clazz] , identifier[name] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[PersistenceException] identifier[pe] operator[SEP] { identifier[log] operator[SEP] identifier[warning] operator[SEP] literal[String] , literal[String] , identifier[clazz] , literal[String] , identifier[name] , identifier[pe] operator[SEP] operator[SEP] } Keyword[throw] identifier[rte] operator[SEP] } } }
public static Pinyin convertSingle(String single) { Pinyin pinyin = map.get(single); if (pinyin == null) return Pinyin.none5; return pinyin; }
class class_name[name] begin[{] method[convertSingle, return_type[type[Pinyin]], modifier[public static], parameter[single]] begin[{] local_variable[type[Pinyin], pinyin] if[binary_operation[member[.pinyin], ==, literal[null]]] begin[{] return[member[Pinyin.none5]] else begin[{] None end[}] return[member[.pinyin]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Pinyin] identifier[convertSingle] operator[SEP] identifier[String] identifier[single] operator[SEP] { identifier[Pinyin] identifier[pinyin] operator[=] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[single] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pinyin] operator[==] Other[null] operator[SEP] Keyword[return] identifier[Pinyin] operator[SEP] identifier[none5] operator[SEP] Keyword[return] identifier[pinyin] operator[SEP] }
@Override public JsonElement serialize(ExpandableField<?> src, Type typeOfSrc, JsonSerializationContext context) { if (src.isExpanded()) { return context.serialize(src.getExpanded()); } else if (src.getId() != null) { return new JsonPrimitive(src.getId()); } else { return null; } }
class class_name[name] begin[{] method[serialize, return_type[type[JsonElement]], modifier[public], parameter[src, typeOfSrc, context]] begin[{] if[call[src.isExpanded, parameter[]]] begin[{] return[call[context.serialize, parameter[call[src.getExpanded, parameter[]]]]] else begin[{] if[binary_operation[call[src.getId, parameter[]], !=, literal[null]]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonPrimitive, sub_type=None))] else begin[{] return[literal[null]] end[}] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[JsonElement] identifier[serialize] operator[SEP] identifier[ExpandableField] operator[<] operator[?] operator[>] identifier[src] , identifier[Type] identifier[typeOfSrc] , identifier[JsonSerializationContext] identifier[context] operator[SEP] { Keyword[if] operator[SEP] identifier[src] operator[SEP] identifier[isExpanded] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[context] operator[SEP] identifier[serialize] operator[SEP] identifier[src] operator[SEP] identifier[getExpanded] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[src] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[JsonPrimitive] operator[SEP] identifier[src] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] Other[null] operator[SEP] } }
public JWTPayload setType(String type) { this.type = type; this.put(PayloadConstants.TYPE, type); return this; }
class class_name[name] begin[{] method[setType, return_type[type[JWTPayload]], modifier[public], parameter[type]] begin[{] assign[THIS[member[None.type]], member[.type]] THIS[call[None.put, parameter[member[PayloadConstants.TYPE], member[.type]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[JWTPayload] identifier[setType] operator[SEP] identifier[String] identifier[type] operator[SEP] { Keyword[this] operator[SEP] identifier[type] operator[=] identifier[type] operator[SEP] Keyword[this] operator[SEP] identifier[put] operator[SEP] identifier[PayloadConstants] operator[SEP] identifier[TYPE] , identifier[type] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
@Override public InputStream getResourceAsStream(String resourceName, boolean processingBundle) throws ResourceNotFoundException { if (ThreadLocalJawrContext.isInterruptingProcessingBundle()) { throw new InterruptBundlingProcessException(); } generatorRegistry.loadGeneratorIfNeeded(resourceName); InputStream is = null; String resourceExtension = FileNameUtils.getExtension(resourceName); boolean generatedPath = generatorRegistry.isPathGenerated(resourceName); if (generatedPath || allowedExtensions.contains(resourceExtension.toLowerCase())) { List<StreamResourceReader> list = new ArrayList<>(); list.addAll(streamResourceReaders); for (StreamResourceReader rsReader : list) { if (!(rsReader instanceof ResourceGenerator) || ((ResourceGenerator) rsReader).getResolver().matchPath(resourceName)) { try { is = rsReader.getResourceAsStream(resourceName); } catch (Exception e) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("An exception occured while trying to read resource '" + resourceName + "'. Continuing with other readers. Error : ", e); } else if (LOGGER.isInfoEnabled()) { LOGGER.info("An exception occured while trying to read resource '" + resourceName + "'. Continuing with other readers. Error : " + e.getMessage()); } } if (is != null) { break; } } } } else { LOGGER.warn("The resource '" + resourceName + "' will not be read as its extension is not an allowed one."); } if (is == null) { throw new ResourceNotFoundException(resourceName); } return is; }
class class_name[name] begin[{] method[getResourceAsStream, return_type[type[InputStream]], modifier[public], parameter[resourceName, processingBundle]] begin[{] if[call[ThreadLocalJawrContext.isInterruptingProcessingBundle, parameter[]]] 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=InterruptBundlingProcessException, sub_type=None)), label=None) else begin[{] None end[}] call[generatorRegistry.loadGeneratorIfNeeded, parameter[member[.resourceName]]] local_variable[type[InputStream], is] local_variable[type[String], resourceExtension] local_variable[type[boolean], generatedPath] if[binary_operation[member[.generatedPath], ||, call[allowedExtensions.contains, parameter[call[resourceExtension.toLowerCase, parameter[]]]]]] begin[{] local_variable[type[List], list] call[list.addAll, parameter[member[.streamResourceReaders]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rsReader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ResourceGenerator, sub_type=None), operator=instanceof), operandr=Cast(expression=MemberReference(member=rsReader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ResourceGenerator, sub_type=None)), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResourceAsStream, postfix_operators=[], prefix_operators=[], qualifier=rsReader, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=isInfoEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An exception occured while trying to read resource '"), operandr=MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'. Continuing with other readers. Error : "), operator=+), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=info, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An exception occured while trying to read resource '"), operandr=MemberReference(member=resourceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'. Continuing with other readers. Error : "), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=is, 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=[BreakStatement(goto=None, label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=rsReader)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StreamResourceReader, sub_type=None))), label=None) else begin[{] call[LOGGER.warn, parameter[binary_operation[binary_operation[literal["The resource '"], +, member[.resourceName]], +, literal["' will not be read as its extension is not an allowed one."]]]] end[}] if[binary_operation[member[.is], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=resourceName, 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=ResourceNotFoundException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.is]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[InputStream] identifier[getResourceAsStream] operator[SEP] identifier[String] identifier[resourceName] , Keyword[boolean] identifier[processingBundle] operator[SEP] Keyword[throws] identifier[ResourceNotFoundException] { Keyword[if] operator[SEP] identifier[ThreadLocalJawrContext] operator[SEP] identifier[isInterruptingProcessingBundle] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[InterruptBundlingProcessException] operator[SEP] operator[SEP] operator[SEP] } identifier[generatorRegistry] operator[SEP] identifier[loadGeneratorIfNeeded] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] identifier[InputStream] identifier[is] operator[=] Other[null] operator[SEP] identifier[String] identifier[resourceExtension] operator[=] identifier[FileNameUtils] operator[SEP] identifier[getExtension] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] Keyword[boolean] identifier[generatedPath] operator[=] identifier[generatorRegistry] operator[SEP] identifier[isPathGenerated] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[generatedPath] operator[||] identifier[allowedExtensions] operator[SEP] identifier[contains] operator[SEP] identifier[resourceExtension] operator[SEP] identifier[toLowerCase] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[StreamResourceReader] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[addAll] operator[SEP] identifier[streamResourceReaders] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[StreamResourceReader] identifier[rsReader] operator[:] identifier[list] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[rsReader] Keyword[instanceof] identifier[ResourceGenerator] operator[SEP] operator[||] operator[SEP] operator[SEP] identifier[ResourceGenerator] operator[SEP] identifier[rsReader] operator[SEP] operator[SEP] identifier[getResolver] operator[SEP] operator[SEP] operator[SEP] identifier[matchPath] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] { Keyword[try] { identifier[is] operator[=] identifier[rsReader] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[resourceName] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[LOGGER] operator[SEP] identifier[isInfoEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[resourceName] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[is] operator[!=] Other[null] operator[SEP] { Keyword[break] operator[SEP] } } } } Keyword[else] { identifier[LOGGER] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[resourceName] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[is] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[ResourceNotFoundException] operator[SEP] identifier[resourceName] operator[SEP] operator[SEP] } Keyword[return] identifier[is] operator[SEP] }
@Override public final void restart() { if (DynamicTasks.getTaskQueuingContext() != null) { doRestart(ConfigBag.EMPTY); } else { Task<?> task = Tasks.builder().name("restart").body(new Runnable() { public void run() { doRestart(ConfigBag.EMPTY); } }).build(); Entities.submit(this, task).getUnchecked(); } }
class class_name[name] begin[{] method[restart, return_type[void], modifier[final public], parameter[]] begin[{] if[binary_operation[call[DynamicTasks.getTaskQueuingContext, parameter[]], !=, literal[null]]] begin[{] call[.doRestart, parameter[member[ConfigBag.EMPTY]]] else begin[{] local_variable[type[Task], task] call[Entities.submit, parameter[THIS[], member[.task]]] end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[restart] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[DynamicTasks] operator[SEP] identifier[getTaskQueuingContext] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[doRestart] operator[SEP] identifier[ConfigBag] operator[SEP] identifier[EMPTY] operator[SEP] operator[SEP] } Keyword[else] { identifier[Task] operator[<] operator[?] operator[>] identifier[task] operator[=] identifier[Tasks] operator[SEP] identifier[builder] operator[SEP] operator[SEP] operator[SEP] identifier[name] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[body] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] { Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] { identifier[doRestart] operator[SEP] identifier[ConfigBag] operator[SEP] identifier[EMPTY] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[Entities] operator[SEP] identifier[submit] operator[SEP] Keyword[this] , identifier[task] operator[SEP] operator[SEP] identifier[getUnchecked] operator[SEP] operator[SEP] operator[SEP] } }
public JavaWriter emitAnnotation(String annotation, Map<String, ?> attributes) throws IOException { indent(); out.write("@"); emitCompressedType(annotation); switch (attributes.size()) { case 0: break; case 1: Entry<String, ?> onlyEntry = attributes.entrySet().iterator().next(); out.write("("); if (!"value".equals(onlyEntry.getKey())) { out.write(onlyEntry.getKey()); out.write(" = "); } emitAnnotationValue(onlyEntry.getValue()); out.write(")"); break; default: boolean split = attributes.size() > MAX_SINGLE_LINE_ATTRIBUTES || containsArray(attributes.values()); out.write("("); scopes.push(Scope.ANNOTATION_ATTRIBUTE); String separator = split ? "\n" : ""; for (Entry<String, ?> entry : attributes.entrySet()) { out.write(separator); separator = split ? ",\n" : ", "; if (split) { indent(); } out.write(entry.getKey()); out.write(" = "); Object value = entry.getValue(); emitAnnotationValue(value); } popScope(Scope.ANNOTATION_ATTRIBUTE); if (split) { out.write("\n"); indent(); } out.write(")"); break; } out.write("\n"); return this; }
class class_name[name] begin[{] method[emitAnnotation, return_type[type[JavaWriter]], modifier[public], parameter[annotation, attributes]] begin[{] call[.indent, parameter[]] call[out.write, parameter[literal["@"]]] call[.emitCompressedType, parameter[member[.annotation]]] SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=next, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=onlyEntry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Entry, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), IfStatement(condition=Literal(postfix_operators=[], prefix_operators=['!'], qualifier=None, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=onlyEntry, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], value="value"), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=onlyEntry, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" = ")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=onlyEntry, selectors=[], type_arguments=None)], member=emitAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), operandr=MemberReference(member=MAX_SINGLE_LINE_ATTRIBUTES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None)], member=containsArray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=||), name=split)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ANNOTATION_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=Scope, selectors=[])], member=push, postfix_operators=[], prefix_operators=[], qualifier=scopes, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=TernaryExpression(condition=MemberReference(member=split, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")), name=separator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=separator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=MemberReference(member=split, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", "), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=",\n"))), label=None), IfStatement(condition=MemberReference(member=split, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=indent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" = ")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=emitAnnotationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Entry, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ANNOTATION_ATTRIBUTE, postfix_operators=[], prefix_operators=[], qualifier=Scope, selectors=[])], member=popScope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=split, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=indent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")")], member=write, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=attributes, selectors=[], type_arguments=None), label=None) call[out.write, parameter[literal["\n"]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[JavaWriter] identifier[emitAnnotation] operator[SEP] identifier[String] identifier[annotation] , identifier[Map] operator[<] identifier[String] , operator[?] operator[>] identifier[attributes] operator[SEP] Keyword[throws] identifier[IOException] { identifier[indent] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[emitCompressedType] operator[SEP] identifier[annotation] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[attributes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] { Keyword[case] Other[0] operator[:] Keyword[break] operator[SEP] Keyword[case] Other[1] operator[:] identifier[Entry] operator[<] identifier[String] , operator[?] operator[>] identifier[onlyEntry] operator[=] identifier[attributes] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[onlyEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[onlyEntry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[emitAnnotationValue] operator[SEP] identifier[onlyEntry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[boolean] identifier[split] operator[=] identifier[attributes] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] identifier[MAX_SINGLE_LINE_ATTRIBUTES] operator[||] identifier[containsArray] operator[SEP] identifier[attributes] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[scopes] operator[SEP] identifier[push] operator[SEP] identifier[Scope] operator[SEP] identifier[ANNOTATION_ATTRIBUTE] operator[SEP] operator[SEP] identifier[String] identifier[separator] operator[=] identifier[split] operator[?] literal[String] operator[:] literal[String] operator[SEP] Keyword[for] operator[SEP] identifier[Entry] operator[<] identifier[String] , operator[?] operator[>] identifier[entry] operator[:] identifier[attributes] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] { identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[separator] operator[SEP] operator[SEP] identifier[separator] operator[=] identifier[split] operator[?] literal[String] operator[:] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[split] operator[SEP] { identifier[indent] operator[SEP] operator[SEP] operator[SEP] } identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[emitAnnotationValue] operator[SEP] identifier[value] operator[SEP] operator[SEP] } identifier[popScope] operator[SEP] identifier[Scope] operator[SEP] identifier[ANNOTATION_ATTRIBUTE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[split] operator[SEP] { identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[indent] operator[SEP] operator[SEP] operator[SEP] } identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } identifier[out] operator[SEP] identifier[write] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public static Server getServer(final Object instance, final String bindAddress, final int port, final int numHandlers) throws IOException { return new Server(instance, bindAddress, port, numHandlers); }
class class_name[name] begin[{] method[getServer, return_type[type[Server]], modifier[public static], parameter[instance, bindAddress, port, numHandlers]] begin[{] return[ClassCreator(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bindAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=port, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numHandlers, 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))] end[}] END[}]
Keyword[public] Keyword[static] identifier[Server] identifier[getServer] operator[SEP] Keyword[final] identifier[Object] identifier[instance] , Keyword[final] identifier[String] identifier[bindAddress] , Keyword[final] Keyword[int] identifier[port] , Keyword[final] Keyword[int] identifier[numHandlers] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[return] Keyword[new] identifier[Server] operator[SEP] identifier[instance] , identifier[bindAddress] , identifier[port] , identifier[numHandlers] operator[SEP] operator[SEP] }
@Override public List<String> getCalendarNames() throws JobPersistenceException { return doWithLock(new LockCallback<List<String>>() { @Override public List<String> doWithLock(JedisCommands jedis) throws JobPersistenceException { return storage.getCalendarNames(jedis); } }, "Could not retrieve calendar names."); }
class class_name[name] begin[{] method[getCalendarNames, return_type[type[List]], modifier[public], parameter[]] begin[{] return[call[.doWithLock, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=jedis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCalendarNames, postfix_operators=[], prefix_operators=[], qualifier=storage, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=doWithLock, parameters=[FormalParameter(annotations=[], modifiers=set(), name=jedis, type=ReferenceType(arguments=None, dimensions=[], name=JedisCommands, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None), throws=['JobPersistenceException'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=None, name=LockCallback, sub_type=None)), literal["Could not retrieve calendar names."]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getCalendarNames] operator[SEP] operator[SEP] Keyword[throws] identifier[JobPersistenceException] { Keyword[return] identifier[doWithLock] operator[SEP] Keyword[new] identifier[LockCallback] operator[<] identifier[List] operator[<] identifier[String] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[doWithLock] operator[SEP] identifier[JedisCommands] identifier[jedis] operator[SEP] Keyword[throws] identifier[JobPersistenceException] { Keyword[return] identifier[storage] operator[SEP] identifier[getCalendarNames] operator[SEP] identifier[jedis] operator[SEP] operator[SEP] } } , literal[String] operator[SEP] operator[SEP] }
public static String getSystemProperty(String property, String def) { Check.notNull(property); try { return System.getProperty(property, def); } catch (final SecurityException exception) { Verbose.exception(exception, new StringBuilder(Constant.HUNDRED).append(ERROR_PROPERTY) .append(property) .append(" (") .append(exception.getClass().getName()) .append(')') .toString()); return def; } }
class class_name[name] begin[{] method[getSystemProperty, return_type[type[String]], modifier[public static], parameter[property, def]] begin[{] call[Check.notNull, parameter[member[.property]]] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=HUNDRED, postfix_operators=[], prefix_operators=[], qualifier=Constant, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=ERROR_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=property, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" (")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=exception, 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=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=')')], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None))], member=exception, postfix_operators=[], prefix_operators=[], qualifier=Verbose, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=def, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['SecurityException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getSystemProperty] operator[SEP] identifier[String] identifier[property] , identifier[String] identifier[def] operator[SEP] { identifier[Check] operator[SEP] identifier[notNull] operator[SEP] identifier[property] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[property] , identifier[def] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[SecurityException] identifier[exception] operator[SEP] { identifier[Verbose] operator[SEP] identifier[exception] operator[SEP] identifier[exception] , Keyword[new] identifier[StringBuilder] operator[SEP] identifier[Constant] operator[SEP] identifier[HUNDRED] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[ERROR_PROPERTY] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[exception] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[def] operator[SEP] } }
public void marshall(CreateDirectConnectGatewayRequest createDirectConnectGatewayRequest, ProtocolMarshaller protocolMarshaller) { if (createDirectConnectGatewayRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createDirectConnectGatewayRequest.getDirectConnectGatewayName(), DIRECTCONNECTGATEWAYNAME_BINDING); protocolMarshaller.marshall(createDirectConnectGatewayRequest.getAmazonSideAsn(), AMAZONSIDEASN_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[createDirectConnectGatewayRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.createDirectConnectGatewayRequest], ==, 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=getDirectConnectGatewayName, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayRequest, selectors=[], type_arguments=None), MemberReference(member=DIRECTCONNECTGATEWAYNAME_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=getAmazonSideAsn, postfix_operators=[], prefix_operators=[], qualifier=createDirectConnectGatewayRequest, selectors=[], type_arguments=None), MemberReference(member=AMAZONSIDEASN_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[CreateDirectConnectGatewayRequest] identifier[createDirectConnectGatewayRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[createDirectConnectGatewayRequest] 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[createDirectConnectGatewayRequest] operator[SEP] identifier[getDirectConnectGatewayName] operator[SEP] operator[SEP] , identifier[DIRECTCONNECTGATEWAYNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[createDirectConnectGatewayRequest] operator[SEP] identifier[getAmazonSideAsn] operator[SEP] operator[SEP] , identifier[AMAZONSIDEASN_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
@Nonnull public static <T> List<Callable<T>> unwraps(@Nullable Collection<? extends Callable<T>> tasks) { if (null == tasks) return Collections.emptyList(); List<Callable<T>> copy = new ArrayList<Callable<T>>(); for (Callable<T> task : tasks) { if (!(task instanceof TtlCallable)) copy.add(task); else copy.add(((TtlCallable<T>) task).getCallable()); } return copy; }
class class_name[name] begin[{] method[unwraps, return_type[type[List]], modifier[public static], parameter[tasks]] begin[{] if[binary_operation[literal[null], ==, member[.tasks]]] begin[{] return[call[Collections.emptyList, parameter[]]] else begin[{] None end[}] local_variable[type[List], copy] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=task, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=TtlCallable, sub_type=None), operator=instanceof), else_statement=StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=task, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=TtlCallable, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=copy, selectors=[], type_arguments=None), label=None), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=task, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=copy, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=tasks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=task)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=Callable, sub_type=None))), label=None) return[member[.copy]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[Callable] operator[<] identifier[T] operator[>] operator[>] identifier[unwraps] operator[SEP] annotation[@] identifier[Nullable] identifier[Collection] operator[<] operator[?] Keyword[extends] identifier[Callable] operator[<] identifier[T] operator[>] operator[>] identifier[tasks] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[tasks] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[emptyList] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Callable] operator[<] identifier[T] operator[>] operator[>] identifier[copy] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Callable] operator[<] identifier[T] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Callable] operator[<] identifier[T] operator[>] identifier[task] operator[:] identifier[tasks] operator[SEP] { Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[task] Keyword[instanceof] identifier[TtlCallable] operator[SEP] operator[SEP] identifier[copy] operator[SEP] identifier[add] operator[SEP] identifier[task] operator[SEP] operator[SEP] Keyword[else] identifier[copy] operator[SEP] identifier[add] operator[SEP] operator[SEP] operator[SEP] identifier[TtlCallable] operator[<] identifier[T] operator[>] operator[SEP] identifier[task] operator[SEP] operator[SEP] identifier[getCallable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[copy] operator[SEP] }
@Override public void start(LeaderRetrievalListener listener) { checkNotNull(listener, "Listener must not be null."); synchronized (startStopLock) { checkState(!started, "StandaloneLeaderRetrievalService can only be started once."); started = true; // directly notify the listener, because we already know the leading JobManager's address listener.notifyLeaderAddress(leaderAddress, leaderId); } }
class class_name[name] begin[{] method[start, return_type[void], modifier[public], parameter[listener]] begin[{] call[.checkNotNull, parameter[member[.listener], literal["Listener must not be null."]]] SYNCHRONIZED[member[.startStopLock]] BEGIN[{] call[.checkState, parameter[member[.started], literal["StandaloneLeaderRetrievalService can only be started once."]]] assign[member[.started], literal[true]] call[listener.notifyLeaderAddress, parameter[member[.leaderAddress], member[.leaderId]]] END[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[start] operator[SEP] identifier[LeaderRetrievalListener] identifier[listener] operator[SEP] { identifier[checkNotNull] operator[SEP] identifier[listener] , literal[String] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[startStopLock] operator[SEP] { identifier[checkState] operator[SEP] operator[!] identifier[started] , literal[String] operator[SEP] operator[SEP] identifier[started] operator[=] literal[boolean] operator[SEP] identifier[listener] operator[SEP] identifier[notifyLeaderAddress] operator[SEP] identifier[leaderAddress] , identifier[leaderId] operator[SEP] operator[SEP] } }
public static int parseLocalPort(final Channel channel) { if (null == channel) { return -1; } final InetSocketAddress local = (InetSocketAddress) channel.localAddress(); if (local != null) { return local.getPort(); } return -1; }
class class_name[name] begin[{] method[parseLocalPort, return_type[type[int]], modifier[public static], parameter[channel]] begin[{] if[binary_operation[literal[null], ==, member[.channel]]] begin[{] return[literal[1]] else begin[{] None end[}] local_variable[type[InetSocketAddress], local] if[binary_operation[member[.local], !=, literal[null]]] begin[{] return[call[local.getPort, parameter[]]] else begin[{] None end[}] return[literal[1]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[parseLocalPort] operator[SEP] Keyword[final] identifier[Channel] identifier[channel] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[channel] operator[SEP] { Keyword[return] operator[-] Other[1] operator[SEP] } Keyword[final] identifier[InetSocketAddress] identifier[local] operator[=] operator[SEP] identifier[InetSocketAddress] operator[SEP] identifier[channel] operator[SEP] identifier[localAddress] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[local] operator[!=] Other[null] operator[SEP] { Keyword[return] identifier[local] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[-] Other[1] operator[SEP] }
public static <E extends Enum<E>> EnumSet<E> processBitVectors(final Class<E> enumClass, final long... values) { final EnumSet<E> results = EnumSet.noneOf(asEnum(enumClass)); final long[] lvalues = ArrayUtils.clone(Validate.notNull(values)); ArrayUtils.reverse(lvalues); for (final E constant : enumClass.getEnumConstants()) { final int block = constant.ordinal() / Long.SIZE; if (block < lvalues.length && (lvalues[block] & 1L << (constant.ordinal() % Long.SIZE)) != 0) { results.add(constant); } } return results; }
class class_name[name] begin[{] method[processBitVectors, return_type[type[EnumSet]], modifier[public static], parameter[enumClass, values]] begin[{] local_variable[type[EnumSet], results] local_variable[type[long], lvalues] call[ArrayUtils.reverse, parameter[member[.lvalues]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=constant, selectors=[], type_arguments=None), operandr=MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), operator=/), name=block)], modifiers={'final'}, type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=lvalues, selectors=[]), operator=<), operandr=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=lvalues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=block, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1L), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=ordinal, postfix_operators=[], prefix_operators=[], qualifier=constant, selectors=[], type_arguments=None), operandr=MemberReference(member=SIZE, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[]), operator=%), operator=<<), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=constant, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=results, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getEnumConstants, postfix_operators=[], prefix_operators=[], qualifier=enumClass, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=constant)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))), label=None) return[member[.results]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] Keyword[extends] identifier[Enum] operator[<] identifier[E] operator[>] operator[>] identifier[EnumSet] operator[<] identifier[E] operator[>] identifier[processBitVectors] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[E] operator[>] identifier[enumClass] , Keyword[final] Keyword[long] operator[...] identifier[values] operator[SEP] { Keyword[final] identifier[EnumSet] operator[<] identifier[E] operator[>] identifier[results] operator[=] identifier[EnumSet] operator[SEP] identifier[noneOf] operator[SEP] identifier[asEnum] operator[SEP] identifier[enumClass] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] operator[SEP] operator[SEP] identifier[lvalues] operator[=] identifier[ArrayUtils] operator[SEP] identifier[clone] operator[SEP] identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[ArrayUtils] operator[SEP] identifier[reverse] operator[SEP] identifier[lvalues] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[E] identifier[constant] operator[:] identifier[enumClass] operator[SEP] identifier[getEnumConstants] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[int] identifier[block] operator[=] identifier[constant] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[/] identifier[Long] operator[SEP] identifier[SIZE] operator[SEP] Keyword[if] operator[SEP] identifier[block] operator[<] identifier[lvalues] operator[SEP] identifier[length] operator[&&] operator[SEP] identifier[lvalues] operator[SEP] identifier[block] operator[SEP] operator[&] Other[1L] operator[<<] operator[SEP] identifier[constant] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[%] identifier[Long] operator[SEP] identifier[SIZE] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] { identifier[results] operator[SEP] identifier[add] operator[SEP] identifier[constant] operator[SEP] operator[SEP] } } Keyword[return] identifier[results] operator[SEP] }
public boolean containsAll(final IntHashSet other) { final IntIterator iterator = other.iterator(); while (iterator.hasNext()) { if (!contains(iterator.nextValue())) { return false; } } return true; }
class class_name[name] begin[{] method[containsAll, return_type[type[boolean]], modifier[public], parameter[other]] begin[{] local_variable[type[IntIterator], iterator] while[call[iterator.hasNext, parameter[]]] begin[{] if[call[.contains, parameter[call[iterator.nextValue, parameter[]]]]] begin[{] return[literal[false]] else begin[{] None end[}] end[}] return[literal[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[containsAll] operator[SEP] Keyword[final] identifier[IntHashSet] identifier[other] operator[SEP] { Keyword[final] identifier[IntIterator] identifier[iterator] operator[=] identifier[other] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[contains] operator[SEP] identifier[iterator] operator[SEP] identifier[nextValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public ComputeNodeGetRemoteLoginSettingsResult getRemoteLoginSettings(String poolId, String nodeId) { return getRemoteLoginSettingsWithServiceResponseAsync(poolId, nodeId).toBlocking().single().body(); }
class class_name[name] begin[{] method[getRemoteLoginSettings, return_type[type[ComputeNodeGetRemoteLoginSettingsResult]], modifier[public], parameter[poolId, nodeId]] begin[{] return[call[.getRemoteLoginSettingsWithServiceResponseAsync, parameter[member[.poolId], member[.nodeId]]]] end[}] END[}]
Keyword[public] identifier[ComputeNodeGetRemoteLoginSettingsResult] identifier[getRemoteLoginSettings] operator[SEP] identifier[String] identifier[poolId] , identifier[String] identifier[nodeId] operator[SEP] { Keyword[return] identifier[getRemoteLoginSettingsWithServiceResponseAsync] operator[SEP] identifier[poolId] , identifier[nodeId] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
public void pop(AbstractDrawer drawer, AjaxRequestTarget target) { Iterator<ListItem> iter = drawers.iterator(); while (iter.hasNext()) { ListItem item = iter.next(); item.drawer.setAllowClose(true); target.appendJavaScript("$('#"+item.item.getMarkupId()+"').modaldrawer('hide');"); if (item.drawer==drawer) { break; } } }
class class_name[name] begin[{] method[pop, return_type[void], modifier[public], parameter[drawer, target]] begin[{] local_variable[type[Iterator], iter] while[call[iter.hasNext, parameter[]]] begin[{] local_variable[type[ListItem], item] call[item.drawer.setAllowClose, parameter[literal[true]]] call[target.appendJavaScript, parameter[binary_operation[binary_operation[literal["$('#"], +, call[item.item.getMarkupId, parameter[]]], +, literal["').modaldrawer('hide');"]]]] if[binary_operation[member[item.drawer], ==, member[.drawer]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[pop] operator[SEP] identifier[AbstractDrawer] identifier[drawer] , identifier[AjaxRequestTarget] identifier[target] operator[SEP] { identifier[Iterator] operator[<] identifier[ListItem] operator[>] identifier[iter] operator[=] identifier[drawers] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[ListItem] identifier[item] operator[=] identifier[iter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[drawer] operator[SEP] identifier[setAllowClose] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[target] operator[SEP] identifier[appendJavaScript] operator[SEP] literal[String] operator[+] identifier[item] operator[SEP] identifier[item] operator[SEP] identifier[getMarkupId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[drawer] operator[==] identifier[drawer] operator[SEP] { Keyword[break] operator[SEP] } } }
public void refreshBitmapShader() { shader = new BitmapShader(Bitmap.createScaledBitmap(image, canvasSize, canvasSize, false), Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); }
class class_name[name] begin[{] method[refreshBitmapShader, return_type[void], modifier[public], parameter[]] begin[{] assign[member[.shader], ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=image, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=canvasSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=canvasSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=createScaledBitmap, postfix_operators=[], prefix_operators=[], qualifier=Bitmap, selectors=[], type_arguments=None), MemberReference(member=CLAMP, postfix_operators=[], prefix_operators=[], qualifier=Shader.TileMode, selectors=[]), MemberReference(member=CLAMP, postfix_operators=[], prefix_operators=[], qualifier=Shader.TileMode, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BitmapShader, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[void] identifier[refreshBitmapShader] operator[SEP] operator[SEP] { identifier[shader] operator[=] Keyword[new] identifier[BitmapShader] operator[SEP] identifier[Bitmap] operator[SEP] identifier[createScaledBitmap] operator[SEP] identifier[image] , identifier[canvasSize] , identifier[canvasSize] , literal[boolean] operator[SEP] , identifier[Shader] operator[SEP] identifier[TileMode] operator[SEP] identifier[CLAMP] , identifier[Shader] operator[SEP] identifier[TileMode] operator[SEP] identifier[CLAMP] operator[SEP] operator[SEP] }
@Override public double[] transform(double[] x) { if (x.length != scale.length) { throw new IllegalArgumentException(String.format("Invalid vector size %d, expected %d", x.length, scale.length)); } double[] y = copy ? new double[x.length] : x; for (int i = 0; i < x.length; i++) { y[i] = x[i] / scale[i]; } return y; }
class class_name[name] begin[{] method[transform, return_type[type[double]], modifier[public], parameter[x]] begin[{] if[binary_operation[member[x.length], !=, member[scale.length]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid vector size %d, expected %d"), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=x, selectors=[]), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=scale, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[double], y] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=scale, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=/)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=x, 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[.y]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[double] operator[SEP] operator[SEP] identifier[transform] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[x] operator[SEP] { Keyword[if] operator[SEP] identifier[x] operator[SEP] identifier[length] operator[!=] identifier[scale] operator[SEP] identifier[length] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[x] operator[SEP] identifier[length] , identifier[scale] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[double] operator[SEP] operator[SEP] identifier[y] operator[=] identifier[copy] operator[?] Keyword[new] Keyword[double] operator[SEP] identifier[x] operator[SEP] identifier[length] operator[SEP] operator[:] identifier[x] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[x] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[y] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[x] operator[SEP] identifier[i] operator[SEP] operator[/] identifier[scale] operator[SEP] identifier[i] operator[SEP] operator[SEP] } Keyword[return] identifier[y] operator[SEP] }
@SuppressWarnings("unchecked") private final int checkNodeDirectory() throws ClusterInfoException { try { // get all of the nodes in the nodeDir and set one for this node if it's not already set. final Collection<String> nodeDirs; if (nodeDirectory == null) { nodeDirectory = utils.session.recursiveMkdir(utils.nodesDir + "/node_", thisNode, DirMode.PERSISTENT, DirMode.EPHEMERAL_SEQUENTIAL); nodeDirs = session.getSubdirs(utils.nodesDir, this); } else nodeDirs = utils.persistentGetSubdir(utils.nodesDir, null); // what node am I? int nodeRank = -1; int index = 0; final String nodeSubdir = new File(nodeDirectory).getName(); for (final String cur : nodeDirs) { if (nodeSubdir.equals(cur)) { nodeRank = index; break; } index++; } // If I couldn't find me, there's a problem. if (nodeRank == -1) { // drop the node directory since it clearly doesn't exist anymore nodeDirectory = null; throw new ClusterInfoException( "Node " + thisNode + " was registered at " + nodeSubdir + " but it wasn't found as a subdirectory."); } // verify the container address is correct. C curDest = (C) session.getData(nodeDirectory, null); if (curDest == null) // this really can't be null session.setData(nodeDirectory, thisNode); else if (!thisNode.equals(curDest)) { // wth? final String tmp = nodeDirectory; nodeDirectory = null; throw new ClusterInfoException("Impossible! The Node directory " + tmp + " contains the destination for " + curDest + " but should have " + thisNode); } // Check to make sure that THIS node is only in one place. If we find it in a node directory // that's not THIS node directory then this is something we should clean up. for (final String subdir : nodeDirs) { final String fullPathToSubdir = utils.nodesDir + "/" + subdir; curDest = (C) session.getData(fullPathToSubdir, null); if (thisNode.equals(curDest) && !fullPathToSubdir.equals(nodeDirectory)) // this is bad .. clean up session.rmdir(fullPathToSubdir); } return nodeRank; } catch (final ClusterInfoException cie) { cleanupAfterExceptionDuringNodeDirCheck(); throw cie; } catch (final RuntimeException re) { cleanupAfterExceptionDuringNodeDirCheck(); throw re; } catch (final Throwable th) { cleanupAfterExceptionDuringNodeDirCheck(); throw new RuntimeException("Unknown exception!", th); } }
class class_name[name] begin[{] method[checkNodeDirectory, return_type[type[int]], modifier[final private], parameter[]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=nodeDirs)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Collection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nodeDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=nodeDirs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=nodesDir, postfix_operators=[], prefix_operators=[], qualifier=utils, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=persistentGetSubdir, postfix_operators=[], prefix_operators=[], qualifier=utils, selectors=[], type_arguments=None)), label=None), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nodeDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=nodesDir, postfix_operators=[], prefix_operators=[], qualifier=utils, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/node_"), operator=+), MemberReference(member=thisNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=PERSISTENT, postfix_operators=[], prefix_operators=[], qualifier=DirMode, selectors=[]), MemberReference(member=EPHEMERAL_SEQUENTIAL, postfix_operators=[], prefix_operators=[], qualifier=DirMode, selectors=[])], member=recursiveMkdir, postfix_operators=[], prefix_operators=[], qualifier=utils.session, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nodeDirs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=nodesDir, postfix_operators=[], prefix_operators=[], qualifier=utils, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=getSubdirs, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=nodeRank)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=nodeDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=nodeSubdir)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=cur, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=nodeSubdir, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nodeRank, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), BreakStatement(goto=None, label=None)])), StatementExpression(expression=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=nodeDirs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cur)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=nodeRank, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=nodeDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Node "), operandr=MemberReference(member=thisNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" was registered at "), operator=+), operandr=MemberReference(member=nodeSubdir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" but it wasn't found as a subdirectory."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClusterInfoException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=nodeDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getData, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None)), name=curDest)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=curDest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=curDest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=thisNode, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=nodeDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=tmp)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=nodeDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Impossible! The Node directory "), operandr=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" contains the destination for "), operator=+), operandr=MemberReference(member=curDest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" but should have "), operator=+), operandr=MemberReference(member=thisNode, 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=ClusterInfoException, sub_type=None)), label=None)])), label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nodeDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=thisNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setData, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=nodesDir, postfix_operators=[], prefix_operators=[], qualifier=utils, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/"), operator=+), operandr=MemberReference(member=subdir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=fullPathToSubdir)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=curDest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=fullPathToSubdir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getData, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=C, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=curDest, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=thisNode, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=nodeDirectory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=fullPathToSubdir, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fullPathToSubdir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rmdir, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=nodeDirs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subdir)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), ReturnStatement(expression=MemberReference(member=nodeRank, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=cleanupAfterExceptionDuringNodeDirCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=cie, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cie, types=['ClusterInfoException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=cleanupAfterExceptionDuringNodeDirCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RuntimeException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=cleanupAfterExceptionDuringNodeDirCheck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown exception!"), MemberReference(member=th, 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=th, types=['Throwable']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[private] Keyword[final] Keyword[int] identifier[checkNodeDirectory] operator[SEP] operator[SEP] Keyword[throws] identifier[ClusterInfoException] { Keyword[try] { Keyword[final] identifier[Collection] operator[<] identifier[String] operator[>] identifier[nodeDirs] operator[SEP] Keyword[if] operator[SEP] identifier[nodeDirectory] operator[==] Other[null] operator[SEP] { identifier[nodeDirectory] operator[=] identifier[utils] operator[SEP] identifier[session] operator[SEP] identifier[recursiveMkdir] operator[SEP] identifier[utils] operator[SEP] identifier[nodesDir] operator[+] literal[String] , identifier[thisNode] , identifier[DirMode] operator[SEP] identifier[PERSISTENT] , identifier[DirMode] operator[SEP] identifier[EPHEMERAL_SEQUENTIAL] operator[SEP] operator[SEP] identifier[nodeDirs] operator[=] identifier[session] operator[SEP] identifier[getSubdirs] operator[SEP] identifier[utils] operator[SEP] identifier[nodesDir] , Keyword[this] operator[SEP] operator[SEP] } Keyword[else] identifier[nodeDirs] operator[=] identifier[utils] operator[SEP] identifier[persistentGetSubdir] operator[SEP] identifier[utils] operator[SEP] identifier[nodesDir] , Other[null] operator[SEP] operator[SEP] Keyword[int] identifier[nodeRank] operator[=] operator[-] Other[1] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[final] identifier[String] identifier[nodeSubdir] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[nodeDirectory] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[cur] operator[:] identifier[nodeDirs] operator[SEP] { Keyword[if] operator[SEP] identifier[nodeSubdir] operator[SEP] identifier[equals] operator[SEP] identifier[cur] operator[SEP] operator[SEP] { identifier[nodeRank] operator[=] identifier[index] operator[SEP] Keyword[break] operator[SEP] } identifier[index] operator[++] operator[SEP] } Keyword[if] operator[SEP] identifier[nodeRank] operator[==] operator[-] Other[1] operator[SEP] { identifier[nodeDirectory] operator[=] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[ClusterInfoException] operator[SEP] literal[String] operator[+] identifier[thisNode] operator[+] literal[String] operator[+] identifier[nodeSubdir] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[C] identifier[curDest] operator[=] operator[SEP] identifier[C] operator[SEP] identifier[session] operator[SEP] identifier[getData] operator[SEP] identifier[nodeDirectory] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[curDest] operator[==] Other[null] operator[SEP] identifier[session] operator[SEP] identifier[setData] operator[SEP] identifier[nodeDirectory] , identifier[thisNode] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[thisNode] operator[SEP] identifier[equals] operator[SEP] identifier[curDest] operator[SEP] operator[SEP] { Keyword[final] identifier[String] identifier[tmp] operator[=] identifier[nodeDirectory] operator[SEP] identifier[nodeDirectory] operator[=] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[ClusterInfoException] operator[SEP] literal[String] operator[+] identifier[tmp] operator[+] literal[String] operator[+] identifier[curDest] operator[+] literal[String] operator[+] identifier[thisNode] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[subdir] operator[:] identifier[nodeDirs] operator[SEP] { Keyword[final] identifier[String] identifier[fullPathToSubdir] operator[=] identifier[utils] operator[SEP] identifier[nodesDir] operator[+] literal[String] operator[+] identifier[subdir] operator[SEP] identifier[curDest] operator[=] operator[SEP] identifier[C] operator[SEP] identifier[session] operator[SEP] identifier[getData] operator[SEP] identifier[fullPathToSubdir] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[thisNode] operator[SEP] identifier[equals] operator[SEP] identifier[curDest] operator[SEP] operator[&&] operator[!] identifier[fullPathToSubdir] operator[SEP] identifier[equals] operator[SEP] identifier[nodeDirectory] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[rmdir] operator[SEP] identifier[fullPathToSubdir] operator[SEP] operator[SEP] } Keyword[return] identifier[nodeRank] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[ClusterInfoException] identifier[cie] operator[SEP] { identifier[cleanupAfterExceptionDuringNodeDirCheck] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[cie] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[RuntimeException] identifier[re] operator[SEP] { identifier[cleanupAfterExceptionDuringNodeDirCheck] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[re] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[Throwable] identifier[th] operator[SEP] { identifier[cleanupAfterExceptionDuringNodeDirCheck] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[th] operator[SEP] operator[SEP] } }
private String getAppFileName(MavenProject project) { String name = project.getBuild().getFinalName() + "." + project.getPackaging(); if (project.getPackaging().equals("liberty-assembly")) { name = project.getBuild().getFinalName() + ".war"; } if (stripVersion) { name = stripVersionFromName(name, project.getVersion()); } return name; }
class class_name[name] begin[{] method[getAppFileName, return_type[type[String]], modifier[private], parameter[project]] begin[{] local_variable[type[String], name] if[call[project.getPackaging, parameter[]]] begin[{] assign[member[.name], binary_operation[call[project.getBuild, parameter[]], +, literal[".war"]]] else begin[{] None end[}] if[member[.stripVersion]] begin[{] assign[member[.name], call[.stripVersionFromName, parameter[member[.name], call[project.getVersion, parameter[]]]]] else begin[{] None end[}] return[member[.name]] end[}] END[}]
Keyword[private] identifier[String] identifier[getAppFileName] operator[SEP] identifier[MavenProject] identifier[project] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[project] operator[SEP] identifier[getBuild] operator[SEP] operator[SEP] operator[SEP] identifier[getFinalName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[project] operator[SEP] identifier[getPackaging] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[project] operator[SEP] identifier[getPackaging] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[name] operator[=] identifier[project] operator[SEP] identifier[getBuild] operator[SEP] operator[SEP] operator[SEP] identifier[getFinalName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] } Keyword[if] operator[SEP] identifier[stripVersion] operator[SEP] { identifier[name] operator[=] identifier[stripVersionFromName] operator[SEP] identifier[name] , identifier[project] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[name] operator[SEP] }
public int convertStringToIndex(String tempString) { String tempChar = tempString; if (tempChar.length() == 0) tempChar = " "; if ((tempChar.charAt(0) == 'Y') || (tempChar.charAt(0) == 'y')) return 1; else return 0; }
class class_name[name] begin[{] method[convertStringToIndex, return_type[type[int]], modifier[public], parameter[tempString]] begin[{] local_variable[type[String], tempChar] if[binary_operation[call[tempChar.length, parameter[]], ==, literal[0]]] begin[{] assign[member[.tempChar], literal[" "]] else begin[{] None end[}] if[binary_operation[binary_operation[call[tempChar.charAt, parameter[literal[0]]], ==, literal['Y']], ||, binary_operation[call[tempChar.charAt, parameter[literal[0]]], ==, literal['y']]]] begin[{] return[literal[1]] else begin[{] return[literal[0]] end[}] end[}] END[}]
Keyword[public] Keyword[int] identifier[convertStringToIndex] operator[SEP] identifier[String] identifier[tempString] operator[SEP] { identifier[String] identifier[tempChar] operator[=] identifier[tempString] operator[SEP] Keyword[if] operator[SEP] identifier[tempChar] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] identifier[tempChar] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[tempChar] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] operator[||] operator[SEP] identifier[tempChar] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[SEP] operator[SEP] Keyword[return] Other[1] operator[SEP] Keyword[else] Keyword[return] Other[0] operator[SEP] }
public static Counter counter(String name, String... tags) { return globalRegistry.counter(name, tags); }
class class_name[name] begin[{] method[counter, return_type[type[Counter]], modifier[public static], parameter[name, tags]] begin[{] return[call[globalRegistry.counter, parameter[member[.name], member[.tags]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Counter] identifier[counter] operator[SEP] identifier[String] identifier[name] , identifier[String] operator[...] identifier[tags] operator[SEP] { Keyword[return] identifier[globalRegistry] operator[SEP] identifier[counter] operator[SEP] identifier[name] , identifier[tags] operator[SEP] operator[SEP] }
public Assignment mkAssignment(TopologyAssignEvent event) throws Exception { String topologyId = event.getTopologyId(); LOG.info("Determining assignment for " + topologyId); TopologyAssignContext context = prepareTopologyAssign(event); Set<ResourceWorkerSlot> assignments; if (!StormConfig.local_mode(nimbusData.getConf())) { IToplogyScheduler scheduler = schedulers.get(DEFAULT_SCHEDULER_NAME); assignments = scheduler.assignTasks(context); } else { assignments = mkLocalAssignment(context); } Assignment assignment = null; if (assignments != null && assignments.size() > 0) { Map<String, String> nodeHost = getTopologyNodeHost( context.getCluster(), context.getOldAssignment(), assignments); Map<Integer, Integer> startTimes = getTaskStartTimes( context, nimbusData, topologyId, context.getOldAssignment(), assignments); String codeDir = (String) nimbusData.getConf().get(Config.STORM_LOCAL_DIR); assignment = new Assignment(codeDir, assignments, nodeHost, startTimes); // the topology binary changed. if (event.isScaleTopology()) { assignment.setAssignmentType(Assignment.AssignmentType.ScaleTopology); } StormClusterState stormClusterState = nimbusData.getStormClusterState(); stormClusterState.set_assignment(topologyId, assignment); // update task heartbeat's start time NimbusUtils.updateTaskHbStartTime(nimbusData, assignment, topologyId); // Update metrics information in ZK when rebalance or reassignment // Only update metrics monitor status when creating topology // if (context.getAssignType() == // TopologyAssignContext.ASSIGN_TYPE_REBALANCE // || context.getAssignType() == // TopologyAssignContext.ASSIGN_TYPE_MONITOR) // NimbusUtils.updateMetricsInfo(nimbusData, topologyId, assignment); NimbusUtils.updateTopologyTaskTimeout(nimbusData, topologyId); LOG.info("Successfully make assignment for topology id " + topologyId + ": " + assignment); } return assignment; }
class class_name[name] begin[{] method[mkAssignment, return_type[type[Assignment]], modifier[public], parameter[event]] begin[{] local_variable[type[String], topologyId] call[LOG.info, parameter[binary_operation[literal["Determining assignment for "], +, member[.topologyId]]]] local_variable[type[TopologyAssignContext], context] local_variable[type[Set], assignments] if[call[StormConfig.local_mode, parameter[call[nimbusData.getConf, parameter[]]]]] begin[{] local_variable[type[IToplogyScheduler], scheduler] assign[member[.assignments], call[scheduler.assignTasks, parameter[member[.context]]]] else begin[{] assign[member[.assignments], call[.mkLocalAssignment, parameter[member[.context]]]] end[}] local_variable[type[Assignment], assignment] if[binary_operation[binary_operation[member[.assignments], !=, literal[null]], &&, binary_operation[call[assignments.size, parameter[]], >, literal[0]]]] begin[{] local_variable[type[Map], nodeHost] local_variable[type[Map], startTimes] local_variable[type[String], codeDir] assign[member[.assignment], ClassCreator(arguments=[MemberReference(member=codeDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=assignments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=nodeHost, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=startTimes, 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=Assignment, sub_type=None))] if[call[event.isScaleTopology, parameter[]]] begin[{] call[assignment.setAssignmentType, parameter[member[Assignment.AssignmentType.ScaleTopology]]] else begin[{] None end[}] local_variable[type[StormClusterState], stormClusterState] call[stormClusterState.set_assignment, parameter[member[.topologyId], member[.assignment]]] call[NimbusUtils.updateTaskHbStartTime, parameter[member[.nimbusData], member[.assignment], member[.topologyId]]] call[NimbusUtils.updateTopologyTaskTimeout, parameter[member[.nimbusData], member[.topologyId]]] call[LOG.info, parameter[binary_operation[binary_operation[binary_operation[literal["Successfully make assignment for topology id "], +, member[.topologyId]], +, literal[": "]], +, member[.assignment]]]] else begin[{] None end[}] return[member[.assignment]] end[}] END[}]
Keyword[public] identifier[Assignment] identifier[mkAssignment] operator[SEP] identifier[TopologyAssignEvent] identifier[event] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[topologyId] operator[=] identifier[event] operator[SEP] identifier[getTopologyId] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[topologyId] operator[SEP] operator[SEP] identifier[TopologyAssignContext] identifier[context] operator[=] identifier[prepareTopologyAssign] operator[SEP] identifier[event] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[ResourceWorkerSlot] operator[>] identifier[assignments] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[StormConfig] operator[SEP] identifier[local_mode] operator[SEP] identifier[nimbusData] operator[SEP] identifier[getConf] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[IToplogyScheduler] identifier[scheduler] operator[=] identifier[schedulers] operator[SEP] identifier[get] operator[SEP] identifier[DEFAULT_SCHEDULER_NAME] operator[SEP] operator[SEP] identifier[assignments] operator[=] identifier[scheduler] operator[SEP] identifier[assignTasks] operator[SEP] identifier[context] operator[SEP] operator[SEP] } Keyword[else] { identifier[assignments] operator[=] identifier[mkLocalAssignment] operator[SEP] identifier[context] operator[SEP] operator[SEP] } identifier[Assignment] identifier[assignment] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[assignments] operator[!=] Other[null] operator[&&] identifier[assignments] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[nodeHost] operator[=] identifier[getTopologyNodeHost] operator[SEP] identifier[context] operator[SEP] identifier[getCluster] operator[SEP] operator[SEP] , identifier[context] operator[SEP] identifier[getOldAssignment] operator[SEP] operator[SEP] , identifier[assignments] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[startTimes] operator[=] identifier[getTaskStartTimes] operator[SEP] identifier[context] , identifier[nimbusData] , identifier[topologyId] , identifier[context] operator[SEP] identifier[getOldAssignment] operator[SEP] operator[SEP] , identifier[assignments] operator[SEP] operator[SEP] identifier[String] identifier[codeDir] operator[=] operator[SEP] identifier[String] operator[SEP] identifier[nimbusData] operator[SEP] identifier[getConf] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[Config] operator[SEP] identifier[STORM_LOCAL_DIR] operator[SEP] operator[SEP] identifier[assignment] operator[=] Keyword[new] identifier[Assignment] operator[SEP] identifier[codeDir] , identifier[assignments] , identifier[nodeHost] , identifier[startTimes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[isScaleTopology] operator[SEP] operator[SEP] operator[SEP] { identifier[assignment] operator[SEP] identifier[setAssignmentType] operator[SEP] identifier[Assignment] operator[SEP] identifier[AssignmentType] operator[SEP] identifier[ScaleTopology] operator[SEP] operator[SEP] } identifier[StormClusterState] identifier[stormClusterState] operator[=] identifier[nimbusData] operator[SEP] identifier[getStormClusterState] operator[SEP] operator[SEP] operator[SEP] identifier[stormClusterState] operator[SEP] identifier[set_assignment] operator[SEP] identifier[topologyId] , identifier[assignment] operator[SEP] operator[SEP] identifier[NimbusUtils] operator[SEP] identifier[updateTaskHbStartTime] operator[SEP] identifier[nimbusData] , identifier[assignment] , identifier[topologyId] operator[SEP] operator[SEP] identifier[NimbusUtils] operator[SEP] identifier[updateTopologyTaskTimeout] operator[SEP] identifier[nimbusData] , identifier[topologyId] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] operator[+] identifier[topologyId] operator[+] literal[String] operator[+] identifier[assignment] operator[SEP] operator[SEP] } Keyword[return] identifier[assignment] operator[SEP] }
public static String Decryptor(String str) throws Exception { byte[] buff = EncrypDES.hexStr2ByteArr(str); // 根据密钥,对Cipher对象进行初始化,DECRYPT_MODE表示加密模式 Cipher c = getCipher(); c.init(Cipher.DECRYPT_MODE, deskey); byte[] cipherByte = c.doFinal(buff); return new String(cipherByte); }
class class_name[name] begin[{] method[Decryptor, return_type[type[String]], modifier[public static], parameter[str]] begin[{] local_variable[type[byte], buff] local_variable[type[Cipher], c] call[c.init, parameter[member[Cipher.DECRYPT_MODE], member[.deskey]]] local_variable[type[byte], cipherByte] return[ClassCreator(arguments=[MemberReference(member=cipherByte, 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=String, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[Decryptor] operator[SEP] identifier[String] identifier[str] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[byte] operator[SEP] operator[SEP] identifier[buff] operator[=] identifier[EncrypDES] operator[SEP] identifier[hexStr2ByteArr] operator[SEP] identifier[str] operator[SEP] operator[SEP] identifier[Cipher] identifier[c] operator[=] identifier[getCipher] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[SEP] identifier[init] operator[SEP] identifier[Cipher] operator[SEP] identifier[DECRYPT_MODE] , identifier[deskey] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[cipherByte] operator[=] identifier[c] operator[SEP] identifier[doFinal] operator[SEP] identifier[buff] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[cipherByte] operator[SEP] operator[SEP] }
public ObjectStat statObject(String bucketName, String objectName) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException { HttpResponse response = executeHead(bucketName, objectName); ResponseHeader header = response.header(); Map<String,List<String>> httpHeaders = response.httpHeaders(); ObjectStat objectStat = new ObjectStat(bucketName, objectName, header, httpHeaders); return objectStat; }
class class_name[name] begin[{] method[statObject, return_type[type[ObjectStat]], modifier[public], parameter[bucketName, objectName]] begin[{] local_variable[type[HttpResponse], response] local_variable[type[ResponseHeader], header] local_variable[type[Map], httpHeaders] local_variable[type[ObjectStat], objectStat] return[member[.objectStat]] end[}] END[}]
Keyword[public] identifier[ObjectStat] identifier[statObject] operator[SEP] identifier[String] identifier[bucketName] , identifier[String] identifier[objectName] operator[SEP] Keyword[throws] identifier[InvalidBucketNameException] , identifier[NoSuchAlgorithmException] , identifier[InsufficientDataException] , identifier[IOException] , identifier[InvalidKeyException] , identifier[NoResponseException] , identifier[XmlPullParserException] , identifier[ErrorResponseException] , identifier[InternalException] { identifier[HttpResponse] identifier[response] operator[=] identifier[executeHead] operator[SEP] identifier[bucketName] , identifier[objectName] operator[SEP] operator[SEP] identifier[ResponseHeader] identifier[header] operator[=] identifier[response] operator[SEP] identifier[header] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[httpHeaders] operator[=] identifier[response] operator[SEP] identifier[httpHeaders] operator[SEP] operator[SEP] operator[SEP] identifier[ObjectStat] identifier[objectStat] operator[=] Keyword[new] identifier[ObjectStat] operator[SEP] identifier[bucketName] , identifier[objectName] , identifier[header] , identifier[httpHeaders] operator[SEP] operator[SEP] Keyword[return] identifier[objectStat] operator[SEP] }
public static String decode(String content, String secret) { try { //1.构造密钥生成器,指定为AES算法,不区分大小写 KeyGenerator keygen = KeyGenerator.getInstance("AES"); //2.根据encodeRules规则初始化密钥生成器 //生成一个256位的随机源,根据传入的字节数组 keygen.init(256, new SecureRandom(secret.getBytes())); //3.产生原始对称密钥 SecretKey original_key = keygen.generateKey(); //4.获得原始对称密钥的字节数组 byte[] raw = original_key.getEncoded(); //5.根据字节数组生成AES密钥 SecretKey key = new SecretKeySpec(raw, "AES"); //6.根据指定算法AES自成密码器 Cipher cipher = Cipher.getInstance("AES"); //7.初始化密码器,第一个参数为加密(Encrypt_mode)或者解密(Decrypt_mode)操作,第二个参数为使用的KEY cipher.init(Cipher.DECRYPT_MODE, key); //8.将加密并编码后的内容解码成字节数组 byte[] byte_content = new BASE64Decoder().decodeBuffer(content); byte[] byte_decode = cipher.doFinal(byte_content); return new String(byte_decode, StandardCharsets.UTF_8); } catch (Exception e) { e.printStackTrace(); } //如果有错就返加null return null; }
class class_name[name] begin[{] method[decode, return_type[type[String]], modifier[public static], parameter[content, secret]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AES")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=KeyGenerator, selectors=[], type_arguments=None), name=keygen)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KeyGenerator, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=256), ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBytes, postfix_operators=[], prefix_operators=[], qualifier=secret, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecureRandom, sub_type=None))], member=init, postfix_operators=[], prefix_operators=[], qualifier=keygen, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=generateKey, postfix_operators=[], prefix_operators=[], qualifier=keygen, selectors=[], type_arguments=None), name=original_key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SecretKey, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getEncoded, postfix_operators=[], prefix_operators=[], qualifier=original_key, selectors=[], type_arguments=None), name=raw)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=raw, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AES")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SecretKeySpec, sub_type=None)), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SecretKey, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="AES")], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Cipher, selectors=[], type_arguments=None), name=cipher)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Cipher, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DECRYPT_MODE, postfix_operators=[], prefix_operators=[], qualifier=Cipher, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=cipher, 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=[MethodInvocation(arguments=[MemberReference(member=content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=decodeBuffer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BASE64Decoder, sub_type=None)), name=byte_content)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=byte_content, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doFinal, postfix_operators=[], prefix_operators=[], qualifier=cipher, selectors=[], type_arguments=None), name=byte_decode)], modifiers=set(), type=BasicType(dimensions=[None], name=byte)), ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=byte_decode, 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)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[decode] operator[SEP] identifier[String] identifier[content] , identifier[String] identifier[secret] operator[SEP] { Keyword[try] { identifier[KeyGenerator] identifier[keygen] operator[=] identifier[KeyGenerator] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[keygen] operator[SEP] identifier[init] operator[SEP] Other[256] , Keyword[new] identifier[SecureRandom] operator[SEP] identifier[secret] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[SecretKey] identifier[original_key] operator[=] identifier[keygen] operator[SEP] identifier[generateKey] operator[SEP] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[raw] operator[=] identifier[original_key] operator[SEP] identifier[getEncoded] operator[SEP] operator[SEP] operator[SEP] identifier[SecretKey] identifier[key] operator[=] Keyword[new] identifier[SecretKeySpec] operator[SEP] identifier[raw] , literal[String] operator[SEP] operator[SEP] identifier[Cipher] identifier[cipher] operator[=] identifier[Cipher] operator[SEP] identifier[getInstance] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[cipher] operator[SEP] identifier[init] operator[SEP] identifier[Cipher] operator[SEP] identifier[DECRYPT_MODE] , identifier[key] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[byte_content] operator[=] Keyword[new] identifier[BASE64Decoder] operator[SEP] operator[SEP] operator[SEP] identifier[decodeBuffer] operator[SEP] identifier[content] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[byte_decode] operator[=] identifier[cipher] operator[SEP] identifier[doFinal] operator[SEP] identifier[byte_content] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[byte_decode] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Other[null] operator[SEP] }
private int toModifierFlags (int mods) { return modifierFlags((mods & GLFW_MOD_ALT) != 0, (mods & GLFW_MOD_CONTROL) != 0, (mods & GLFW_MOD_SUPER) != 0, (mods & GLFW_MOD_SHIFT) != 0); }
class class_name[name] begin[{] method[toModifierFlags, return_type[type[int]], modifier[private], parameter[mods]] begin[{] return[call[.modifierFlags, parameter[binary_operation[binary_operation[member[.mods], &, member[.GLFW_MOD_ALT]], !=, literal[0]], binary_operation[binary_operation[member[.mods], &, member[.GLFW_MOD_CONTROL]], !=, literal[0]], binary_operation[binary_operation[member[.mods], &, member[.GLFW_MOD_SUPER]], !=, literal[0]], binary_operation[binary_operation[member[.mods], &, member[.GLFW_MOD_SHIFT]], !=, literal[0]]]]] end[}] END[}]
Keyword[private] Keyword[int] identifier[toModifierFlags] operator[SEP] Keyword[int] identifier[mods] operator[SEP] { Keyword[return] identifier[modifierFlags] operator[SEP] operator[SEP] identifier[mods] operator[&] identifier[GLFW_MOD_ALT] operator[SEP] operator[!=] Other[0] , operator[SEP] identifier[mods] operator[&] identifier[GLFW_MOD_CONTROL] operator[SEP] operator[!=] Other[0] , operator[SEP] identifier[mods] operator[&] identifier[GLFW_MOD_SUPER] operator[SEP] operator[!=] Other[0] , operator[SEP] identifier[mods] operator[&] identifier[GLFW_MOD_SHIFT] operator[SEP] operator[!=] Other[0] operator[SEP] operator[SEP] }
public void updateLockingValues(Object obj) throws PersistenceBrokerException { FieldDescriptor[] fields = getLockingFields(); for (int i = 0; i < fields.length; i++) { FieldDescriptor fmd = fields[i]; if (fmd.isUpdateLock()) { PersistentField f = fmd.getPersistentField(); Object cv = f.get(obj); // int if ((f.getType() == int.class) || (f.getType() == Integer.class)) { int newCv = 0; if (cv != null) { newCv = ((Number) cv).intValue(); } newCv++; f.set(obj, new Integer(newCv)); } // long else if ((f.getType() == long.class) || (f.getType() == Long.class)) { long newCv = 0; if (cv != null) { newCv = ((Number) cv).longValue(); } newCv++; f.set(obj, new Long(newCv)); } // Timestamp else if (f.getType() == Timestamp.class) { long newCv = System.currentTimeMillis(); f.set(obj, new Timestamp(newCv)); } } } }
class class_name[name] begin[{] method[updateLockingValues, return_type[void], modifier[public], parameter[obj]] begin[{] local_variable[type[FieldDescriptor], fields] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=fmd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FieldDescriptor, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isUpdateLock, postfix_operators=[], prefix_operators=[], qualifier=fmd, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPersistentField, postfix_operators=[], prefix_operators=[], qualifier=fmd, selectors=[], type_arguments=None), name=f)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PersistentField, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), name=cv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int)), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), operator===), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=long)), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None)), operator===), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Timestamp, sub_type=None)), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), name=newCv)], modifiers=set(), type=BasicType(dimensions=[], name=long)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=newCv, 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=Timestamp, sub_type=None))], member=set, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=newCv)], modifiers=set(), type=BasicType(dimensions=[], name=long)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cv, 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=newCv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=cv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))), label=None)])), StatementExpression(expression=MemberReference(member=newCv, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=newCv, 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=Long, sub_type=None))], member=set, postfix_operators=[], prefix_operators=[], qualifier=f, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=newCv)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=cv, 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=newCv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=cv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))), label=None)])), StatementExpression(expression=MemberReference(member=newCv, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[MemberReference(member=newCv, 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=Integer, sub_type=None))], member=set, postfix_operators=[], prefix_operators=[], qualifier=f, 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=fields, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[updateLockingValues] operator[SEP] identifier[Object] identifier[obj] operator[SEP] Keyword[throws] identifier[PersistenceBrokerException] { identifier[FieldDescriptor] operator[SEP] operator[SEP] identifier[fields] operator[=] identifier[getLockingFields] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[fields] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[FieldDescriptor] identifier[fmd] operator[=] identifier[fields] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[fmd] operator[SEP] identifier[isUpdateLock] operator[SEP] operator[SEP] operator[SEP] { identifier[PersistentField] identifier[f] operator[=] identifier[fmd] operator[SEP] identifier[getPersistentField] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[cv] operator[=] identifier[f] operator[SEP] identifier[get] operator[SEP] identifier[obj] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] Keyword[int] operator[SEP] Keyword[class] operator[SEP] operator[||] operator[SEP] identifier[f] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[int] identifier[newCv] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[cv] operator[!=] Other[null] operator[SEP] { identifier[newCv] operator[=] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[cv] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] } identifier[newCv] operator[++] operator[SEP] identifier[f] operator[SEP] identifier[set] operator[SEP] identifier[obj] , Keyword[new] identifier[Integer] operator[SEP] identifier[newCv] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] Keyword[long] operator[SEP] Keyword[class] operator[SEP] operator[||] operator[SEP] identifier[f] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[long] identifier[newCv] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[cv] operator[!=] Other[null] operator[SEP] { identifier[newCv] operator[=] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[cv] operator[SEP] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] } identifier[newCv] operator[++] operator[SEP] identifier[f] operator[SEP] identifier[set] operator[SEP] identifier[obj] , Keyword[new] identifier[Long] operator[SEP] identifier[newCv] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[f] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[Timestamp] operator[SEP] Keyword[class] operator[SEP] { Keyword[long] identifier[newCv] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[f] operator[SEP] identifier[set] operator[SEP] identifier[obj] , Keyword[new] identifier[Timestamp] operator[SEP] identifier[newCv] operator[SEP] operator[SEP] operator[SEP] } } } }
public void addProtocol(String productString, ChannelListener<? super StreamConnection> openListener) { addProtocol(productString, openListener, null); }
class class_name[name] begin[{] method[addProtocol, return_type[void], modifier[public], parameter[productString, openListener]] begin[{] call[.addProtocol, parameter[member[.productString], member[.openListener], literal[null]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addProtocol] operator[SEP] identifier[String] identifier[productString] , identifier[ChannelListener] operator[<] operator[?] Keyword[super] identifier[StreamConnection] operator[>] identifier[openListener] operator[SEP] { identifier[addProtocol] operator[SEP] identifier[productString] , identifier[openListener] , Other[null] operator[SEP] operator[SEP] }
public void loadJarClassifier(String modelName, Properties props) { Timing.startDoing("Loading JAR-internal classifier " + modelName); try { InputStream is = getClass().getResourceAsStream(modelName); if (modelName.endsWith(".gz")) { is = new GZIPInputStream(is); } is = new BufferedInputStream(is); loadClassifier(is, props); is.close(); Timing.endDoing(); } catch (Exception e) { String msg = "Error loading classifier from jar file (most likely you are not running this code from a jar file or the named classifier is not stored in the jar file)"; throw new RuntimeException(msg, e); } }
class class_name[name] begin[{] method[loadJarClassifier, return_type[void], modifier[public], parameter[modelName, props]] begin[{] call[Timing.startDoing, parameter[binary_operation[literal["Loading JAR-internal classifier "], +, member[.modelName]]]] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=modelName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getResourceAsStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=is)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".gz")], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=modelName, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=is, 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=GZIPInputStream, sub_type=None))), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=is, 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=BufferedInputStream, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=is, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=props, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClassifier, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=endDoing, postfix_operators=[], prefix_operators=[], qualifier=Timing, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error loading classifier from jar file (most likely you are not running this code from a jar file or the named classifier is not stored in the jar file)"), name=msg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, 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[loadJarClassifier] operator[SEP] identifier[String] identifier[modelName] , identifier[Properties] identifier[props] operator[SEP] { identifier[Timing] operator[SEP] identifier[startDoing] operator[SEP] literal[String] operator[+] identifier[modelName] operator[SEP] operator[SEP] Keyword[try] { identifier[InputStream] identifier[is] operator[=] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getResourceAsStream] operator[SEP] identifier[modelName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[modelName] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[is] operator[=] Keyword[new] identifier[GZIPInputStream] operator[SEP] identifier[is] operator[SEP] operator[SEP] } identifier[is] operator[=] Keyword[new] identifier[BufferedInputStream] operator[SEP] identifier[is] operator[SEP] operator[SEP] identifier[loadClassifier] operator[SEP] identifier[is] , identifier[props] operator[SEP] operator[SEP] identifier[is] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[Timing] operator[SEP] identifier[endDoing] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[String] identifier[msg] operator[=] literal[String] operator[SEP] Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[msg] , identifier[e] operator[SEP] operator[SEP] } }
String join(Dialect d, boolean isTopLevel, DialectSqlItem function, DialectSqlItem[] items) {//NOSONAR int pos = 0; for (DialectSqlItem item : items) { if (item.subItems != null) { String value; if (pos > 0 && items[pos - 1] != null && items[pos - 1].type == 'F') // join as parameters value = join(d, false, items[pos - 1], item.subItems); else value = join(d, false, null, item.subItems); // join as // string item.type = 'S'; item.value = value; item.subItems = null; } pos++; } // now there is no subItems if (function != null) { List<String> l = new ArrayList<String>(); for (DialectSqlItem item : items) { if (item.type != '0') l.add((String) item.value); } return renderFunction(d, function, l.toArray(new String[l.size()])); } StringBuilder sb = new StringBuilder(); if (!isTopLevel) sb.append("("); for (DialectSqlItem item : items) if (item.type != '0') { sb.append(item.value); } if (!isTopLevel) sb.append(")"); return sb.toString(); }
class class_name[name] begin[{] method[join, return_type[type[String]], modifier[default], parameter[d, isTopLevel, function, items]] begin[{] local_variable[type[int], pos] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=subItems, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=items, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=items, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), MemberReference(member=type, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='F'), operator===), operator=&&), else_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), MemberReference(member=subItems, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=items, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))]), MemberReference(member=subItems, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='S')), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[]), type==, value=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=subItems, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)])), StatementExpression(expression=MemberReference(member=pos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=items, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DialectSqlItem, sub_type=None))), label=None) if[binary_operation[member[.function], !=, literal[null]]] begin[{] local_variable[type[List], l] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=!=), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None))]), control=EnhancedForControl(iterable=MemberReference(member=items, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DialectSqlItem, sub_type=None))), label=None) return[call[.renderFunction, parameter[member[.d], member[.function], call[l.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]]] else begin[{] None end[}] local_variable[type[StringBuilder], sb] if[member[.isTopLevel]] begin[{] call[sb.append, parameter[literal["("]]] else begin[{] None end[}] ForStatement(body=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=item, 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=value, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), control=EnhancedForControl(iterable=MemberReference(member=items, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=item)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DialectSqlItem, sub_type=None))), label=None) if[member[.isTopLevel]] begin[{] call[sb.append, parameter[literal[")"]]] else begin[{] None end[}] return[call[sb.toString, parameter[]]] end[}] END[}]
identifier[String] identifier[join] operator[SEP] identifier[Dialect] identifier[d] , Keyword[boolean] identifier[isTopLevel] , identifier[DialectSqlItem] identifier[function] , identifier[DialectSqlItem] operator[SEP] operator[SEP] identifier[items] operator[SEP] { Keyword[int] identifier[pos] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[DialectSqlItem] identifier[item] operator[:] identifier[items] operator[SEP] { Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[subItems] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[value] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[>] Other[0] operator[&&] identifier[items] operator[SEP] identifier[pos] operator[-] Other[1] operator[SEP] operator[!=] Other[null] operator[&&] identifier[items] operator[SEP] identifier[pos] operator[-] Other[1] operator[SEP] operator[SEP] identifier[type] operator[==] literal[String] operator[SEP] identifier[value] operator[=] identifier[join] operator[SEP] identifier[d] , literal[boolean] , identifier[items] operator[SEP] identifier[pos] operator[-] Other[1] operator[SEP] , identifier[item] operator[SEP] identifier[subItems] operator[SEP] operator[SEP] Keyword[else] identifier[value] operator[=] identifier[join] operator[SEP] identifier[d] , literal[boolean] , Other[null] , identifier[item] operator[SEP] identifier[subItems] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[type] operator[=] literal[String] operator[SEP] identifier[item] operator[SEP] identifier[value] operator[=] identifier[value] operator[SEP] identifier[item] operator[SEP] identifier[subItems] operator[=] Other[null] operator[SEP] } identifier[pos] operator[++] operator[SEP] } Keyword[if] operator[SEP] identifier[function] operator[!=] Other[null] operator[SEP] { identifier[List] operator[<] identifier[String] operator[>] identifier[l] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DialectSqlItem] identifier[item] operator[:] identifier[items] operator[SEP] { Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[type] operator[!=] literal[String] operator[SEP] identifier[l] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[item] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[return] identifier[renderFunction] operator[SEP] identifier[d] , identifier[function] , identifier[l] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[l] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isTopLevel] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DialectSqlItem] identifier[item] operator[:] identifier[items] operator[SEP] Keyword[if] operator[SEP] identifier[item] operator[SEP] identifier[type] operator[!=] literal[String] operator[SEP] { identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[item] operator[SEP] identifier[value] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[isTopLevel] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static final int parseField(byte[] bytes, int startPos, int length, char delimiter) { if (length <= 0) { throw new NumberFormatException("Invalid input: Empty string"); } long val = 0; boolean neg = false; if (bytes[startPos] == '-') { neg = true; startPos++; length--; if (length == 0 || bytes[startPos] == delimiter) { throw new NumberFormatException("Orphaned minus sign."); } } for (; length > 0; startPos++, length--) { if (bytes[startPos] == delimiter) { return (int) (neg ? -val : val); } if (bytes[startPos] < 48 || bytes[startPos] > 57) { throw new NumberFormatException("Invalid character."); } val *= 10; val += bytes[startPos] - 48; if (val > OVERFLOW_BOUND && (!neg || val > UNDERFLOW_BOUND)) { throw new NumberFormatException("Value overflow/underflow"); } } return (int) (neg ? -val : val); }
class class_name[name] begin[{] method[parseField, return_type[type[int]], modifier[final public static], parameter[bytes, startPos, length, delimiter]] begin[{] if[binary_operation[member[.length], <=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid input: Empty string")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NumberFormatException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[long], val] local_variable[type[boolean], neg] if[binary_operation[member[.bytes], ==, literal['-']]] begin[{] assign[member[.neg], literal[true]] member[.startPos] member[.length] if[binary_operation[binary_operation[member[.length], ==, literal[0]], ||, binary_operation[member[.bytes], ==, member[.delimiter]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Orphaned minus sign.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NumberFormatException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=startPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=delimiter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=TernaryExpression(condition=MemberReference(member=neg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=val, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[])), type=BasicType(dimensions=[], name=int)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=startPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=48), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=startPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=57), operator=>), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid character.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NumberFormatException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=*=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=MemberReference(member=bytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=startPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=48), operator=-)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=OVERFLOW_BOUND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=neg, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=UNDERFLOW_BOUND, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), operator=||), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Value overflow/underflow")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NumberFormatException, sub_type=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), init=None, update=[MemberReference(member=startPos, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=length, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[Cast(expression=TernaryExpression(condition=MemberReference(member=neg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MemberReference(member=val, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=val, postfix_operators=[], prefix_operators=['-'], qualifier=, selectors=[])), type=BasicType(dimensions=[], name=int))] end[}] END[}]
Keyword[public] Keyword[static] Keyword[final] Keyword[int] identifier[parseField] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] , Keyword[int] identifier[startPos] , Keyword[int] identifier[length] , Keyword[char] identifier[delimiter] operator[SEP] { Keyword[if] operator[SEP] identifier[length] operator[<=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[NumberFormatException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[long] identifier[val] operator[=] Other[0] operator[SEP] Keyword[boolean] identifier[neg] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[bytes] operator[SEP] identifier[startPos] operator[SEP] operator[==] literal[String] operator[SEP] { identifier[neg] operator[=] literal[boolean] operator[SEP] identifier[startPos] operator[++] operator[SEP] identifier[length] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[length] operator[==] Other[0] operator[||] identifier[bytes] operator[SEP] identifier[startPos] operator[SEP] operator[==] identifier[delimiter] operator[SEP] { Keyword[throw] Keyword[new] identifier[NumberFormatException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[for] operator[SEP] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] identifier[startPos] operator[++] , identifier[length] operator[--] operator[SEP] { Keyword[if] operator[SEP] identifier[bytes] operator[SEP] identifier[startPos] operator[SEP] operator[==] identifier[delimiter] operator[SEP] { Keyword[return] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[neg] operator[?] operator[-] identifier[val] operator[:] identifier[val] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[bytes] operator[SEP] identifier[startPos] operator[SEP] operator[<] Other[48] operator[||] identifier[bytes] operator[SEP] identifier[startPos] operator[SEP] operator[>] Other[57] operator[SEP] { Keyword[throw] Keyword[new] identifier[NumberFormatException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[val] operator[*=] Other[10] operator[SEP] identifier[val] operator[+=] identifier[bytes] operator[SEP] identifier[startPos] operator[SEP] operator[-] Other[48] operator[SEP] Keyword[if] operator[SEP] identifier[val] operator[>] identifier[OVERFLOW_BOUND] operator[&&] operator[SEP] operator[!] identifier[neg] operator[||] identifier[val] operator[>] identifier[UNDERFLOW_BOUND] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[NumberFormatException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[return] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[neg] operator[?] operator[-] identifier[val] operator[:] identifier[val] operator[SEP] operator[SEP] }
public static int[] getMatrixMultiplyShape(int[] left, int[] right) { if(Shape.shapeIsScalar(left)) { return right; } if(Shape.shapeIsScalar(right)) { return left; } if (left.length != 2 && right.length != 2) { throw new IllegalArgumentException("Illegal shapes for matrix multiply. Must be of length 2. Left shape: " + Arrays.toString(left) + ", right shape: " + Arrays.toString(right)); } for(int i = 0; i < left.length; i++) { if(left[i] < 1) throw new ND4JIllegalStateException("Left shape contained value < 0 at index " + i + " - left shape " + Arrays.toString(left)); } for(int i = 0; i < right.length; i++) { if(right[i] < 1) throw new ND4JIllegalStateException("Right shape contained value < 0 at index " + i + " - right shape " + Arrays.toString(right)); } if (left.length > 1 && left[1] != right[0]) throw new IllegalArgumentException("Columns of left not equal to rows of right: left shape " + Arrays.toString(left) + ", right shape " + Arrays.toString(right)); if(left.length < right.length) { if(left[0] == right[0]) { return new int[] {1, right[1]}; } } int[] shape = {left[0], right[1]}; return shape; }
class class_name[name] begin[{] method[getMatrixMultiplyShape, return_type[type[int]], modifier[public static], parameter[left, right]] begin[{] if[call[Shape.shapeIsScalar, parameter[member[.left]]]] begin[{] return[member[.right]] else begin[{] None end[}] if[call[Shape.shapeIsScalar, parameter[member[.right]]]] begin[{] return[member[.left]] else begin[{] None end[}] if[binary_operation[binary_operation[member[left.length], !=, literal[2]], &&, binary_operation[member[right.length], !=, literal[2]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Illegal shapes for matrix multiply. Must be of length 2. Left shape: "), operandr=MethodInvocation(arguments=[MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", right shape: "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Left shape contained value < 0 at index "), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - left shape "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ND4JIllegalStateException, sub_type=None)), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=left, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Right shape contained value < 0 at index "), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" - right shape "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ND4JIllegalStateException, sub_type=None)), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=right, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) if[binary_operation[binary_operation[member[left.length], >, literal[1]], &&, binary_operation[member[.left], !=, member[.right]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Columns of left not equal to rows of right: left shape "), operandr=MethodInvocation(arguments=[MemberReference(member=left, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", right shape "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[left.length], <, member[right.length]]] begin[{] if[binary_operation[member[.left], ==, member[.right]]] begin[{] return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=right, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))] else begin[{] None end[}] else begin[{] None end[}] local_variable[type[int], shape] return[member[.shape]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] operator[SEP] operator[SEP] identifier[getMatrixMultiplyShape] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[left] , Keyword[int] operator[SEP] operator[SEP] identifier[right] operator[SEP] { Keyword[if] operator[SEP] identifier[Shape] operator[SEP] identifier[shapeIsScalar] operator[SEP] identifier[left] operator[SEP] operator[SEP] { Keyword[return] identifier[right] operator[SEP] } Keyword[if] operator[SEP] identifier[Shape] operator[SEP] identifier[shapeIsScalar] operator[SEP] identifier[right] operator[SEP] operator[SEP] { Keyword[return] identifier[left] operator[SEP] } Keyword[if] operator[SEP] identifier[left] operator[SEP] identifier[length] operator[!=] Other[2] operator[&&] identifier[right] operator[SEP] identifier[length] operator[!=] Other[2] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[left] operator[SEP] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[right] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[left] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[left] operator[SEP] identifier[i] operator[SEP] operator[<] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[ND4JIllegalStateException] operator[SEP] literal[String] operator[+] identifier[i] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[left] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[right] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[right] operator[SEP] identifier[i] operator[SEP] operator[<] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[ND4JIllegalStateException] operator[SEP] literal[String] operator[+] identifier[i] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[right] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[left] operator[SEP] identifier[length] operator[>] Other[1] operator[&&] identifier[left] operator[SEP] Other[1] operator[SEP] operator[!=] identifier[right] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[left] operator[SEP] operator[+] literal[String] operator[+] identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[right] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[left] operator[SEP] identifier[length] operator[<] identifier[right] operator[SEP] identifier[length] operator[SEP] { Keyword[if] operator[SEP] identifier[left] operator[SEP] Other[0] operator[SEP] operator[==] identifier[right] operator[SEP] Other[0] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] Keyword[int] operator[SEP] operator[SEP] { Other[1] , identifier[right] operator[SEP] Other[1] operator[SEP] } operator[SEP] } } Keyword[int] operator[SEP] operator[SEP] identifier[shape] operator[=] { identifier[left] operator[SEP] Other[0] operator[SEP] , identifier[right] operator[SEP] Other[1] operator[SEP] } operator[SEP] Keyword[return] identifier[shape] operator[SEP] }
public Map<String, String> fetchTokenKeys() { try { return extractTokenKeys(this.restTemplate .getForObject(getUaaUrl() + "/token_keys", Map.class)); } catch (HttpStatusCodeException ex) { throw new CloudFoundryAuthorizationException(Reason.SERVICE_UNAVAILABLE, "UAA not reachable"); } }
class class_name[name] begin[{] method[fetchTokenKeys, return_type[type[Map]], modifier[public], parameter[]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=restTemplate, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getUaaUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/token_keys"), operator=+), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None))], member=getForObject, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=extractTokenKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=SERVICE_UNAVAILABLE, postfix_operators=[], prefix_operators=[], qualifier=Reason, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UAA not reachable")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloudFoundryAuthorizationException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['HttpStatusCodeException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[fetchTokenKeys] operator[SEP] operator[SEP] { Keyword[try] { Keyword[return] identifier[extractTokenKeys] operator[SEP] Keyword[this] operator[SEP] identifier[restTemplate] operator[SEP] identifier[getForObject] operator[SEP] identifier[getUaaUrl] operator[SEP] operator[SEP] operator[+] literal[String] , identifier[Map] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[HttpStatusCodeException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[CloudFoundryAuthorizationException] operator[SEP] identifier[Reason] operator[SEP] identifier[SERVICE_UNAVAILABLE] , literal[String] operator[SEP] operator[SEP] } }
public static ClientTransport getReverseClientTransport(String container, AbstractChannel channel) { if (REVERSE_CLIENT_TRANSPORT_MAP == null) { // 初始化 synchronized (ClientTransportFactory.class) { if (REVERSE_CLIENT_TRANSPORT_MAP == null) { REVERSE_CLIENT_TRANSPORT_MAP = new ConcurrentHashMap<String, ClientTransport>(); } } } String key = NetUtils.channelToString(channel.remoteAddress(), channel.localAddress()); ClientTransport transport = REVERSE_CLIENT_TRANSPORT_MAP.get(key); if (transport == null) { synchronized (ClientTransportFactory.class) { transport = REVERSE_CLIENT_TRANSPORT_MAP.get(key); if (transport == null) { ClientTransportConfig config = new ClientTransportConfig() .setProviderInfo(new ProviderInfo().setHost(channel.remoteAddress().getHostName()) .setPort(channel.remoteAddress().getPort())) .setContainer(container); transport = ExtensionLoaderFactory.getExtensionLoader(ClientTransport.class) .getExtension(config.getContainer(), new Class[] { ClientTransportConfig.class }, new Object[] { config }); transport.setChannel(channel); REVERSE_CLIENT_TRANSPORT_MAP.put(key, transport); // 保存唯一长连接 } } } return transport; }
class class_name[name] begin[{] method[getReverseClientTransport, return_type[type[ClientTransport]], modifier[public static], parameter[container, channel]] begin[{] if[binary_operation[member[.REVERSE_CLIENT_TRANSPORT_MAP], ==, literal[null]]] begin[{] SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClientTransportFactory, sub_type=None))] BEGIN[{] if[binary_operation[member[.REVERSE_CLIENT_TRANSPORT_MAP], ==, literal[null]]] begin[{] assign[member[.REVERSE_CLIENT_TRANSPORT_MAP], 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=ClientTransport, sub_type=None))], dimensions=None, name=ConcurrentHashMap, sub_type=None))] else begin[{] None end[}] END[}] else begin[{] None end[}] local_variable[type[String], key] local_variable[type[ClientTransport], transport] if[binary_operation[member[.transport], ==, literal[null]]] begin[{] SYNCHRONIZED[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClientTransportFactory, sub_type=None))] BEGIN[{] assign[member[.transport], call[REVERSE_CLIENT_TRANSPORT_MAP.get, parameter[member[.key]]]] if[binary_operation[member[.transport], ==, literal[null]]] begin[{] local_variable[type[ClientTransportConfig], config] assign[member[.transport], call[ExtensionLoaderFactory.getExtensionLoader, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClientTransport, sub_type=None))]]] call[transport.setChannel, parameter[member[.channel]]] call[REVERSE_CLIENT_TRANSPORT_MAP.put, parameter[member[.key], member[.transport]]] else begin[{] None end[}] END[}] else begin[{] None end[}] return[member[.transport]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ClientTransport] identifier[getReverseClientTransport] operator[SEP] identifier[String] identifier[container] , identifier[AbstractChannel] identifier[channel] operator[SEP] { Keyword[if] operator[SEP] identifier[REVERSE_CLIENT_TRANSPORT_MAP] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[ClientTransportFactory] operator[SEP] Keyword[class] operator[SEP] { Keyword[if] operator[SEP] identifier[REVERSE_CLIENT_TRANSPORT_MAP] operator[==] Other[null] operator[SEP] { identifier[REVERSE_CLIENT_TRANSPORT_MAP] operator[=] Keyword[new] identifier[ConcurrentHashMap] operator[<] identifier[String] , identifier[ClientTransport] operator[>] operator[SEP] operator[SEP] operator[SEP] } } } identifier[String] identifier[key] operator[=] identifier[NetUtils] operator[SEP] identifier[channelToString] operator[SEP] identifier[channel] operator[SEP] identifier[remoteAddress] operator[SEP] operator[SEP] , identifier[channel] operator[SEP] identifier[localAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ClientTransport] identifier[transport] operator[=] identifier[REVERSE_CLIENT_TRANSPORT_MAP] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transport] operator[==] Other[null] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[ClientTransportFactory] operator[SEP] Keyword[class] operator[SEP] { identifier[transport] operator[=] identifier[REVERSE_CLIENT_TRANSPORT_MAP] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[transport] operator[==] Other[null] operator[SEP] { identifier[ClientTransportConfig] identifier[config] operator[=] Keyword[new] identifier[ClientTransportConfig] operator[SEP] operator[SEP] operator[SEP] identifier[setProviderInfo] operator[SEP] Keyword[new] identifier[ProviderInfo] operator[SEP] operator[SEP] operator[SEP] identifier[setHost] operator[SEP] identifier[channel] operator[SEP] identifier[remoteAddress] operator[SEP] operator[SEP] operator[SEP] identifier[getHostName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setPort] operator[SEP] identifier[channel] operator[SEP] identifier[remoteAddress] operator[SEP] operator[SEP] operator[SEP] identifier[getPort] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[setContainer] operator[SEP] identifier[container] operator[SEP] operator[SEP] identifier[transport] operator[=] identifier[ExtensionLoaderFactory] operator[SEP] identifier[getExtensionLoader] operator[SEP] identifier[ClientTransport] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[getExtension] operator[SEP] identifier[config] operator[SEP] identifier[getContainer] operator[SEP] operator[SEP] , Keyword[new] identifier[Class] operator[SEP] operator[SEP] { identifier[ClientTransportConfig] operator[SEP] Keyword[class] } , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[config] } operator[SEP] operator[SEP] identifier[transport] operator[SEP] identifier[setChannel] operator[SEP] identifier[channel] operator[SEP] operator[SEP] identifier[REVERSE_CLIENT_TRANSPORT_MAP] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[transport] operator[SEP] operator[SEP] } } } Keyword[return] identifier[transport] operator[SEP] }
private Table getTable(String name) { Table table = m_tables.get(name); if (table == null) { table = EMPTY_TABLE; } return table; }
class class_name[name] begin[{] method[getTable, return_type[type[Table]], modifier[private], parameter[name]] begin[{] local_variable[type[Table], table] if[binary_operation[member[.table], ==, literal[null]]] begin[{] assign[member[.table], member[.EMPTY_TABLE]] else begin[{] None end[}] return[member[.table]] end[}] END[}]
Keyword[private] identifier[Table] identifier[getTable] operator[SEP] identifier[String] identifier[name] operator[SEP] { identifier[Table] identifier[table] operator[=] identifier[m_tables] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[table] operator[==] Other[null] operator[SEP] { identifier[table] operator[=] identifier[EMPTY_TABLE] operator[SEP] } Keyword[return] identifier[table] operator[SEP] }
public void putClientMetrics(String hostname, String clientId, List<Metric> metrics) { if (metrics.isEmpty()) { return; } LOG.debug("Removing metrics for id {} to replace with {}", clientId, metrics); synchronized (mClientMetrics) { mClientMetrics.removeByField(ID_INDEX, getFullInstanceId(hostname, clientId)); for (Metric metric : metrics) { if (metric.getHostname() == null) { continue; // ignore metrics whose hostname is null } mClientMetrics.add(metric); } } }
class class_name[name] begin[{] method[putClientMetrics, return_type[void], modifier[public], parameter[hostname, clientId, metrics]] begin[{] if[call[metrics.isEmpty, parameter[]]] begin[{] return[None] else begin[{] None end[}] call[LOG.debug, parameter[literal["Removing metrics for id {} to replace with {}"], member[.clientId], member[.metrics]]] SYNCHRONIZED[member[.mClientMetrics]] BEGIN[{] call[mClientMetrics.removeByField, parameter[member[.ID_INDEX], call[.getFullInstanceId, parameter[member[.hostname], member[.clientId]]]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getHostname, postfix_operators=[], prefix_operators=[], qualifier=metric, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=metric, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=mClientMetrics, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=metrics, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=metric)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Metric, sub_type=None))), label=None) END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[putClientMetrics] operator[SEP] identifier[String] identifier[hostname] , identifier[String] identifier[clientId] , identifier[List] operator[<] identifier[Metric] operator[>] identifier[metrics] operator[SEP] { Keyword[if] operator[SEP] identifier[metrics] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[clientId] , identifier[metrics] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] identifier[mClientMetrics] operator[SEP] { identifier[mClientMetrics] operator[SEP] identifier[removeByField] operator[SEP] identifier[ID_INDEX] , identifier[getFullInstanceId] operator[SEP] identifier[hostname] , identifier[clientId] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Metric] identifier[metric] operator[:] identifier[metrics] operator[SEP] { Keyword[if] operator[SEP] identifier[metric] operator[SEP] identifier[getHostname] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[continue] operator[SEP] } identifier[mClientMetrics] operator[SEP] identifier[add] operator[SEP] identifier[metric] operator[SEP] operator[SEP] } } }
private IContainer getActualTarget(IResource mouseTarget) { /* if cursor is on a file, return the parent */ if (mouseTarget.getType() == IResource.FILE) { return mouseTarget.getParent(); } /* otherwise the mouseTarget is the real target */ return (IContainer) mouseTarget; }
class class_name[name] begin[{] method[getActualTarget, return_type[type[IContainer]], modifier[private], parameter[mouseTarget]] begin[{] if[binary_operation[call[mouseTarget.getType, parameter[]], ==, member[IResource.FILE]]] begin[{] return[call[mouseTarget.getParent, parameter[]]] else begin[{] None end[}] return[Cast(expression=MemberReference(member=mouseTarget, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IContainer, sub_type=None))] end[}] END[}]
Keyword[private] identifier[IContainer] identifier[getActualTarget] operator[SEP] identifier[IResource] identifier[mouseTarget] operator[SEP] { Keyword[if] operator[SEP] identifier[mouseTarget] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[IResource] operator[SEP] identifier[FILE] operator[SEP] { Keyword[return] identifier[mouseTarget] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] identifier[IContainer] operator[SEP] identifier[mouseTarget] operator[SEP] }
public void showTrajectoryAndSpline(){ if(t.getDimension()==2){ double[] xData = new double[rotatedTrajectory.size()]; double[] yData = new double[rotatedTrajectory.size()]; for(int i = 0; i < rotatedTrajectory.size(); i++){ xData[i] = rotatedTrajectory.get(i).x; yData[i] = rotatedTrajectory.get(i).y; } // Create Chart Chart chart = QuickChart.getChart("Spline+Track", "X", "Y", "y(x)", xData, yData); //Add spline support points double[] subxData = new double[splineSupportPoints.size()]; double[] subyData = new double[splineSupportPoints.size()]; for(int i = 0; i < splineSupportPoints.size(); i++){ subxData[i] = splineSupportPoints.get(i).x; subyData[i] = splineSupportPoints.get(i).y; } Series s = chart.addSeries("Spline Support Points", subxData, subyData); s.setLineStyle(SeriesLineStyle.NONE); s.setSeriesType(SeriesType.Line); //ADd spline points int numberInterpolatedPointsPerSegment = 20; int numberOfSplines = spline.getN(); double[] sxData = new double[numberInterpolatedPointsPerSegment*numberOfSplines]; double[] syData = new double[numberInterpolatedPointsPerSegment*numberOfSplines]; double[] knots = spline.getKnots(); for(int i = 0; i < numberOfSplines; i++){ double x = knots[i]; double stopx = knots[i+1]; double dx = (stopx-x)/numberInterpolatedPointsPerSegment; for(int j = 0; j < numberInterpolatedPointsPerSegment; j++){ sxData[i*numberInterpolatedPointsPerSegment+j] = x; syData[i*numberInterpolatedPointsPerSegment+j] = spline.value(x); x += dx; } } s = chart.addSeries("Spline", sxData, syData); s.setLineStyle(SeriesLineStyle.DASH_DASH); s.setMarker(SeriesMarker.NONE); s.setSeriesType(SeriesType.Line); //Show it new SwingWrapper(chart).displayChart(); } }
class class_name[name] begin[{] method[showTrajectoryAndSpline, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[call[t.getDimension, parameter[]], ==, literal[2]]] begin[{] local_variable[type[double], xData] local_variable[type[double], yData] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=xData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=rotatedTrajectory, selectors=[MemberReference(member=x, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=yData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=rotatedTrajectory, selectors=[MemberReference(member=y, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=rotatedTrajectory, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[Chart], chart] local_variable[type[double], subxData] local_variable[type[double], subyData] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=subxData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=splineSupportPoints, selectors=[MemberReference(member=x, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=subyData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=splineSupportPoints, selectors=[MemberReference(member=y, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=splineSupportPoints, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) local_variable[type[Series], s] call[s.setLineStyle, parameter[member[SeriesLineStyle.NONE]]] call[s.setSeriesType, parameter[member[SeriesType.Line]]] local_variable[type[int], numberInterpolatedPointsPerSegment] local_variable[type[int], numberOfSplines] local_variable[type[double], sxData] local_variable[type[double], syData] local_variable[type[double], knots] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=knots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=knots, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), name=stopx)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=stopx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=numberInterpolatedPointsPerSegment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), name=dx)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=sxData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberInterpolatedPointsPerSegment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=syData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberInterpolatedPointsPerSegment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+))]), type==, value=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=value, postfix_operators=[], prefix_operators=[], qualifier=spline, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MemberReference(member=dx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberInterpolatedPointsPerSegment, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numberOfSplines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) assign[member[.s], call[chart.addSeries, parameter[literal["Spline"], member[.sxData], member[.syData]]]] call[s.setLineStyle, parameter[member[SeriesLineStyle.DASH_DASH]]] call[s.setMarker, parameter[member[SeriesMarker.NONE]]] call[s.setSeriesType, parameter[member[SeriesType.Line]]] ClassCreator(arguments=[MemberReference(member=chart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=displayChart, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SwingWrapper, sub_type=None)) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[showTrajectoryAndSpline] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[t] operator[SEP] identifier[getDimension] operator[SEP] operator[SEP] operator[==] Other[2] operator[SEP] { Keyword[double] operator[SEP] operator[SEP] identifier[xData] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[rotatedTrajectory] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[yData] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[rotatedTrajectory] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[rotatedTrajectory] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[xData] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[rotatedTrajectory] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[x] operator[SEP] identifier[yData] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[rotatedTrajectory] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[y] operator[SEP] } identifier[Chart] identifier[chart] operator[=] identifier[QuickChart] operator[SEP] identifier[getChart] operator[SEP] literal[String] , literal[String] , literal[String] , literal[String] , identifier[xData] , identifier[yData] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[subxData] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[splineSupportPoints] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[subyData] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[splineSupportPoints] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[splineSupportPoints] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[subxData] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[splineSupportPoints] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[x] operator[SEP] identifier[subyData] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[splineSupportPoints] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[y] operator[SEP] } identifier[Series] identifier[s] operator[=] identifier[chart] operator[SEP] identifier[addSeries] operator[SEP] literal[String] , identifier[subxData] , identifier[subyData] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[setLineStyle] operator[SEP] identifier[SeriesLineStyle] operator[SEP] identifier[NONE] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[setSeriesType] operator[SEP] identifier[SeriesType] operator[SEP] identifier[Line] operator[SEP] operator[SEP] Keyword[int] identifier[numberInterpolatedPointsPerSegment] operator[=] Other[20] operator[SEP] Keyword[int] identifier[numberOfSplines] operator[=] identifier[spline] operator[SEP] identifier[getN] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[sxData] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numberInterpolatedPointsPerSegment] operator[*] identifier[numberOfSplines] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[syData] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[numberInterpolatedPointsPerSegment] operator[*] identifier[numberOfSplines] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[knots] operator[=] identifier[spline] operator[SEP] identifier[getKnots] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numberOfSplines] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[double] identifier[x] operator[=] identifier[knots] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[double] identifier[stopx] operator[=] identifier[knots] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[double] identifier[dx] operator[=] operator[SEP] identifier[stopx] operator[-] identifier[x] operator[SEP] operator[/] identifier[numberInterpolatedPointsPerSegment] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[numberInterpolatedPointsPerSegment] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[sxData] operator[SEP] identifier[i] operator[*] identifier[numberInterpolatedPointsPerSegment] operator[+] identifier[j] operator[SEP] operator[=] identifier[x] operator[SEP] identifier[syData] operator[SEP] identifier[i] operator[*] identifier[numberInterpolatedPointsPerSegment] operator[+] identifier[j] operator[SEP] operator[=] identifier[spline] operator[SEP] identifier[value] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[x] operator[+=] identifier[dx] operator[SEP] } } identifier[s] operator[=] identifier[chart] operator[SEP] identifier[addSeries] operator[SEP] literal[String] , identifier[sxData] , identifier[syData] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[setLineStyle] operator[SEP] identifier[SeriesLineStyle] operator[SEP] identifier[DASH_DASH] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[setMarker] operator[SEP] identifier[SeriesMarker] operator[SEP] identifier[NONE] operator[SEP] operator[SEP] identifier[s] operator[SEP] identifier[setSeriesType] operator[SEP] identifier[SeriesType] operator[SEP] identifier[Line] operator[SEP] operator[SEP] Keyword[new] identifier[SwingWrapper] operator[SEP] identifier[chart] operator[SEP] operator[SEP] identifier[displayChart] operator[SEP] operator[SEP] operator[SEP] } }
public void addProcessor(ItemProcessor processor) { if (processors == null) { processors = new ArrayList<>(); } processors.add(processor); }
class class_name[name] begin[{] method[addProcessor, return_type[void], modifier[public], parameter[processor]] begin[{] if[binary_operation[member[.processors], ==, literal[null]]] begin[{] assign[member[.processors], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))] else begin[{] None end[}] call[processors.add, parameter[member[.processor]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[addProcessor] operator[SEP] identifier[ItemProcessor] identifier[processor] operator[SEP] { Keyword[if] operator[SEP] identifier[processors] operator[==] Other[null] operator[SEP] { identifier[processors] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] } identifier[processors] operator[SEP] identifier[add] operator[SEP] identifier[processor] operator[SEP] operator[SEP] }
@Override synchronized public void sendResponse(ReplyHeader h, Record r, String tag) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Make space for length BinaryOutputArchive bos = BinaryOutputArchive.getArchive(baos); try { baos.write(fourBytes); bos.writeRecord(h, "header"); if (r != null) { bos.writeRecord(r, tag); } baos.close(); } catch (IOException e) { LOG.error("Error serializing response"); } byte b[] = baos.toByteArray(); ByteBuffer bb = ByteBuffer.wrap(b); bb.putInt(b.length - 4).rewind(); sendBuffer(bb); if (h.getXid() > 0) { synchronized(this){ outstandingRequests--; } // check throttling synchronized (this.factory) { if (zk.getInProcess() < factory.outstandingLimit || outstandingRequests < 1) { sk.selector().wakeup(); enableRecv(); } } } } catch(Exception e) { LOG.warn("Unexpected exception. Destruction averted.", e); } }
class class_name[name] begin[{] method[sendResponse, return_type[void], modifier[synchronized public], parameter[h, r, tag]] begin[{] 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=ByteArrayOutputStream, sub_type=None)), name=baos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteArrayOutputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=baos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getArchive, postfix_operators=[], prefix_operators=[], qualifier=BinaryOutputArchive, selectors=[], type_arguments=None), name=bos)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BinaryOutputArchive, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=fourBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=baos, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=h, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="header")], member=writeRecord, postfix_operators=[], prefix_operators=[], qualifier=bos, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=r, 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=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeRecord, postfix_operators=[], prefix_operators=[], qualifier=bos, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=baos, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error serializing response")], 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=['IOException']))], finally_block=None, label=None, resources=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[None], initializer=MethodInvocation(arguments=[], member=toByteArray, postfix_operators=[], prefix_operators=[], qualifier=baos, selectors=[], type_arguments=None), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=byte)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=wrap, postfix_operators=[], prefix_operators=[], qualifier=ByteBuffer, selectors=[], type_arguments=None), name=bb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ByteBuffer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=-)], member=putInt, postfix_operators=[], prefix_operators=[], qualifier=bb, selectors=[MethodInvocation(arguments=[], member=rewind, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=bb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sendBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getXid, postfix_operators=[], prefix_operators=[], qualifier=h, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[SynchronizedStatement(block=[StatementExpression(expression=MemberReference(member=outstandingRequests, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, lock=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])), SynchronizedStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getInProcess, postfix_operators=[], prefix_operators=[], qualifier=zk, selectors=[], type_arguments=None), operandr=MemberReference(member=outstandingLimit, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[]), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=outstandingRequests, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=selector, postfix_operators=[], prefix_operators=[], qualifier=sk, selectors=[MethodInvocation(arguments=[], member=wakeup, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=enableRecv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, lock=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=factory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected exception. Destruction averted."), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[synchronized] Keyword[public] Keyword[void] identifier[sendResponse] operator[SEP] identifier[ReplyHeader] identifier[h] , identifier[Record] identifier[r] , identifier[String] identifier[tag] operator[SEP] { Keyword[try] { identifier[ByteArrayOutputStream] identifier[baos] operator[=] Keyword[new] identifier[ByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[BinaryOutputArchive] identifier[bos] operator[=] identifier[BinaryOutputArchive] operator[SEP] identifier[getArchive] operator[SEP] identifier[baos] operator[SEP] operator[SEP] Keyword[try] { identifier[baos] operator[SEP] identifier[write] operator[SEP] identifier[fourBytes] operator[SEP] operator[SEP] identifier[bos] operator[SEP] identifier[writeRecord] operator[SEP] identifier[h] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[!=] Other[null] operator[SEP] { identifier[bos] operator[SEP] identifier[writeRecord] operator[SEP] identifier[r] , identifier[tag] operator[SEP] operator[SEP] } identifier[baos] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[byte] identifier[b] operator[SEP] operator[SEP] operator[=] identifier[baos] operator[SEP] identifier[toByteArray] operator[SEP] operator[SEP] operator[SEP] identifier[ByteBuffer] identifier[bb] operator[=] identifier[ByteBuffer] operator[SEP] identifier[wrap] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[bb] operator[SEP] identifier[putInt] operator[SEP] identifier[b] operator[SEP] identifier[length] operator[-] Other[4] operator[SEP] operator[SEP] identifier[rewind] operator[SEP] operator[SEP] operator[SEP] identifier[sendBuffer] operator[SEP] identifier[bb] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[h] operator[SEP] identifier[getXid] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] { identifier[outstandingRequests] operator[--] operator[SEP] } Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[factory] operator[SEP] { Keyword[if] operator[SEP] identifier[zk] operator[SEP] identifier[getInProcess] operator[SEP] operator[SEP] operator[<] identifier[factory] operator[SEP] identifier[outstandingLimit] operator[||] identifier[outstandingRequests] operator[<] Other[1] operator[SEP] { identifier[sk] operator[SEP] identifier[selector] operator[SEP] operator[SEP] operator[SEP] identifier[wakeup] operator[SEP] operator[SEP] operator[SEP] identifier[enableRecv] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public Observable<Void> pauseAsync(String resourceGroupName, String serverName, String databaseName) { return pauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
class class_name[name] begin[{] method[pauseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, serverName, databaseName]] begin[{] return[call[.pauseWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serverName], member[.databaseName]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Void] operator[>] identifier[pauseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serverName] , identifier[String] identifier[databaseName] operator[SEP] { Keyword[return] identifier[pauseWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[databaseName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] , identifier[Void] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Void] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Void] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
private String saveCertificateAsPEMFile(Object x509Certificate, String filename, boolean deleteOnExit) throws IOException { File pemFile = File.createTempFile(filename, null); try (FileWriter pemfileWriter = new FileWriter(pemFile)) { try (JcaPEMWriter jcaPEMWriter = new JcaPEMWriter(pemfileWriter)) { jcaPEMWriter.writeObject(x509Certificate); } } if (deleteOnExit) { pemFile.deleteOnExit(); } return pemFile.getAbsolutePath(); }
class class_name[name] begin[{] method[saveCertificateAsPEMFile, return_type[type[String]], modifier[private], parameter[x509Certificate, filename, deleteOnExit]] begin[{] local_variable[type[File], pemFile] TryStatement(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x509Certificate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=jcaPEMWriter, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=jcaPEMWriter, type=ReferenceType(arguments=None, dimensions=[], name=JcaPEMWriter, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=pemfileWriter, 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=JcaPEMWriter, sub_type=None)))])], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=pemfileWriter, type=ReferenceType(arguments=None, dimensions=[], name=FileWriter, sub_type=None), value=ClassCreator(arguments=[MemberReference(member=pemFile, 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=FileWriter, sub_type=None)))]) if[member[.deleteOnExit]] begin[{] call[pemFile.deleteOnExit, parameter[]] else begin[{] None end[}] return[call[pemFile.getAbsolutePath, parameter[]]] end[}] END[}]
Keyword[private] identifier[String] identifier[saveCertificateAsPEMFile] operator[SEP] identifier[Object] identifier[x509Certificate] , identifier[String] identifier[filename] , Keyword[boolean] identifier[deleteOnExit] operator[SEP] Keyword[throws] identifier[IOException] { identifier[File] identifier[pemFile] operator[=] identifier[File] operator[SEP] identifier[createTempFile] operator[SEP] identifier[filename] , Other[null] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[FileWriter] identifier[pemfileWriter] operator[=] Keyword[new] identifier[FileWriter] operator[SEP] identifier[pemFile] operator[SEP] operator[SEP] { Keyword[try] operator[SEP] identifier[JcaPEMWriter] identifier[jcaPEMWriter] operator[=] Keyword[new] identifier[JcaPEMWriter] operator[SEP] identifier[pemfileWriter] operator[SEP] operator[SEP] { identifier[jcaPEMWriter] operator[SEP] identifier[writeObject] operator[SEP] identifier[x509Certificate] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[deleteOnExit] operator[SEP] { identifier[pemFile] operator[SEP] identifier[deleteOnExit] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[pemFile] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] }
public Object getValue() { String text = getAsText(); BlockingMode mode = BlockingMode.toBlockingMode(text); return mode; }
class class_name[name] begin[{] method[getValue, return_type[type[Object]], modifier[public], parameter[]] begin[{] local_variable[type[String], text] local_variable[type[BlockingMode], mode] return[member[.mode]] end[}] END[}]
Keyword[public] identifier[Object] identifier[getValue] operator[SEP] operator[SEP] { identifier[String] identifier[text] operator[=] identifier[getAsText] operator[SEP] operator[SEP] operator[SEP] identifier[BlockingMode] identifier[mode] operator[=] identifier[BlockingMode] operator[SEP] identifier[toBlockingMode] operator[SEP] identifier[text] operator[SEP] operator[SEP] Keyword[return] identifier[mode] operator[SEP] }
public Object execute( String... args ) throws Exception { result = new Result( expectation ); try { result.setActual( message.send( mergeInputsWith( args ) ) ); } catch (SystemUnderDevelopmentException e) { if(logger.isDebugEnabled()){ logger.debug("Error while executing specifications", e.getCause()); } result.exceptionOccured( e.getCause() ); } dispatchForHandling( result ); return result.getActual(); }
class class_name[name] begin[{] method[execute, return_type[type[Object]], modifier[public], parameter[args]] begin[{] assign[member[.result], ClassCreator(arguments=[MemberReference(member=expectation, 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=Result, sub_type=None))] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mergeInputsWith, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=send, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None)], member=setActual, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error while executing specifications"), MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=exceptionOccured, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SystemUnderDevelopmentException']))], finally_block=None, label=None, resources=None) call[.dispatchForHandling, parameter[member[.result]]] return[call[result.getActual, parameter[]]] end[}] END[}]
Keyword[public] identifier[Object] identifier[execute] operator[SEP] identifier[String] operator[...] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] { identifier[result] operator[=] Keyword[new] identifier[Result] operator[SEP] identifier[expectation] operator[SEP] operator[SEP] Keyword[try] { identifier[result] operator[SEP] identifier[setActual] operator[SEP] identifier[message] operator[SEP] identifier[send] operator[SEP] identifier[mergeInputsWith] operator[SEP] identifier[args] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SystemUnderDevelopmentException] identifier[e] operator[SEP] { Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[result] operator[SEP] identifier[exceptionOccured] operator[SEP] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[dispatchForHandling] operator[SEP] identifier[result] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] identifier[getActual] operator[SEP] operator[SEP] operator[SEP] }
@Override public boolean isValid() { if (!_isValid && com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) { //only log this if it is invalid String s = _isValid + appNameAndIdString; LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "isValid", s); } return _isValid; }
class class_name[name] begin[{] method[isValid, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[binary_operation[member[._isValid], &&, call[com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled, parameter[]]], &&, call[LoggingUtil.SESSION_LOGGER_CORE.isLoggable, parameter[member[Level.FINE]]]]] begin[{] local_variable[type[String], s] call[LoggingUtil.SESSION_LOGGER_CORE.logp, parameter[member[Level.FINE], member[.methodClassName], literal["isValid"], member[.s]]] else begin[{] None end[}] return[member[._isValid]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isValid] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[_isValid] operator[&&] 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[String] identifier[s] operator[=] identifier[_isValid] operator[+] identifier[appNameAndIdString] operator[SEP] identifier[LoggingUtil] operator[SEP] identifier[SESSION_LOGGER_CORE] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[methodClassName] , literal[String] , identifier[s] operator[SEP] operator[SEP] } Keyword[return] identifier[_isValid] operator[SEP] }
private ClassInfo parseClassInfo() throws Exception { String className = acceptString(input.readByte()); Class<?> type = SerTypeMapper.decodeType(className, settings, overrideBasePackage, null); int propertyCount = acceptArray(input.readByte()); if (propertyCount < 0) { throw new IllegalArgumentException("Invalid binary data: Expected array with 0 to many elements, but was: " + propertyCount); } MetaProperty<?>[] metaProperties = new MetaProperty<?>[propertyCount]; if (ImmutableBean.class.isAssignableFrom(type)) { SerDeserializer deser = settings.getDeserializers().findDeserializer(type); MetaBean metaBean = deser.findMetaBean(type); for (int i = 0; i < propertyCount; i++) { String propertyName = acceptString(input.readByte()); metaProperties[i] = deser.findMetaProperty(type, metaBean, propertyName); } } else if (propertyCount != 0) { throw new IllegalArgumentException("Invalid binary data: Found non immutable bean class that has meta properties defined: " + type.getName() + ", " + propertyCount + " properties"); } return new ClassInfo(type, metaProperties); }
class class_name[name] begin[{] method[parseClassInfo, return_type[type[ClassInfo]], modifier[private], parameter[]] begin[{] local_variable[type[String], className] local_variable[type[Class], type] local_variable[type[int], propertyCount] if[binary_operation[member[.propertyCount], <, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid binary data: Expected array with 0 to many elements, but was: "), operandr=MemberReference(member=propertyCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[MetaProperty], metaProperties] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ImmutableBean, sub_type=None))] begin[{] local_variable[type[SerDeserializer], deser] local_variable[type[MetaBean], metaBean] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=readByte, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)], member=acceptString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=propertyName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=metaProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metaBean, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findMetaProperty, postfix_operators=[], prefix_operators=[], qualifier=deser, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=propertyCount, 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) else begin[{] if[binary_operation[member[.propertyCount], !=, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid binary data: Found non immutable bean class that has meta properties defined: "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", "), operator=+), operandr=MemberReference(member=propertyCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" properties"), 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[}] end[}] return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=metaProperties, 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=ClassInfo, sub_type=None))] end[}] END[}]
Keyword[private] identifier[ClassInfo] identifier[parseClassInfo] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[String] identifier[className] operator[=] identifier[acceptString] operator[SEP] identifier[input] operator[SEP] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[SerTypeMapper] operator[SEP] identifier[decodeType] operator[SEP] identifier[className] , identifier[settings] , identifier[overrideBasePackage] , Other[null] operator[SEP] operator[SEP] Keyword[int] identifier[propertyCount] operator[=] identifier[acceptArray] operator[SEP] identifier[input] operator[SEP] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[propertyCount] operator[<] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[propertyCount] operator[SEP] operator[SEP] } identifier[MetaProperty] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[metaProperties] operator[=] Keyword[new] identifier[MetaProperty] operator[<] operator[?] operator[>] operator[SEP] identifier[propertyCount] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ImmutableBean] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[type] operator[SEP] operator[SEP] { identifier[SerDeserializer] identifier[deser] operator[=] identifier[settings] operator[SEP] identifier[getDeserializers] operator[SEP] operator[SEP] operator[SEP] identifier[findDeserializer] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[MetaBean] identifier[metaBean] operator[=] identifier[deser] operator[SEP] identifier[findMetaBean] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[propertyCount] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[String] identifier[propertyName] operator[=] identifier[acceptString] operator[SEP] identifier[input] operator[SEP] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[metaProperties] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[deser] operator[SEP] identifier[findMetaProperty] operator[SEP] identifier[type] , identifier[metaBean] , identifier[propertyName] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[propertyCount] operator[!=] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[type] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[propertyCount] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[ClassInfo] operator[SEP] identifier[type] , identifier[metaProperties] operator[SEP] operator[SEP] }
public String getIconPath(CmsListItem item) { try { CmsUser user = getCms().readUser((String)item.get(LIST_COLUMN_LOGIN)); if (user.getOuFqn().equals(getParamOufqn())) { return A_CmsUsersList.PATH_BUTTONS + "user.png"; } else { return A_CmsUsersList.PATH_BUTTONS + "user_other_ou.png"; } } catch (CmsException e) { return A_CmsUsersList.PATH_BUTTONS + "user.png"; } }
class class_name[name] begin[{] method[getIconPath, return_type[type[String]], modifier[public], parameter[item]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getCms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[MemberReference(member=LIST_COLUMN_LOGIN, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=item, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=readUser, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=user)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsUser, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=getOuFqn, postfix_operators=[], prefix_operators=[], qualifier=user, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getParamOufqn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=PATH_BUTTONS, postfix_operators=[], prefix_operators=[], qualifier=A_CmsUsersList, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user_other_ou.png"), operator=+), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=PATH_BUTTONS, postfix_operators=[], prefix_operators=[], qualifier=A_CmsUsersList, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user.png"), operator=+), label=None)]))], catches=[CatchClause(block=[ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=PATH_BUTTONS, postfix_operators=[], prefix_operators=[], qualifier=A_CmsUsersList, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="user.png"), operator=+), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[String] identifier[getIconPath] operator[SEP] identifier[CmsListItem] identifier[item] operator[SEP] { Keyword[try] { identifier[CmsUser] identifier[user] operator[=] identifier[getCms] operator[SEP] operator[SEP] operator[SEP] identifier[readUser] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[item] operator[SEP] identifier[get] operator[SEP] identifier[LIST_COLUMN_LOGIN] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[user] operator[SEP] identifier[getOuFqn] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[getParamOufqn] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[A_CmsUsersList] operator[SEP] identifier[PATH_BUTTONS] operator[+] literal[String] operator[SEP] } Keyword[else] { Keyword[return] identifier[A_CmsUsersList] operator[SEP] identifier[PATH_BUTTONS] operator[+] literal[String] operator[SEP] } } Keyword[catch] operator[SEP] identifier[CmsException] identifier[e] operator[SEP] { Keyword[return] identifier[A_CmsUsersList] operator[SEP] identifier[PATH_BUTTONS] operator[+] literal[String] operator[SEP] } }
public void moveSourceToDest(LineNumberReader reader, PrintWriter dataOut) { m_bSkipTag = false; m_bSkipTemplate = false; m_setMatches = new HashSet<String>(); m_setNames = new HashSet<String>(); try { this.scanTemplates(reader); reader.close(); FileInputStream fileIn = new FileInputStream(m_fileSource); InputStreamReader inStream = new InputStreamReader(fileIn); reader = new LineNumberReader(inStream); } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } super.moveSourceToDest(reader, dataOut); }
class class_name[name] begin[{] method[moveSourceToDest, return_type[void], modifier[public], parameter[reader, dataOut]] begin[{] assign[member[.m_bSkipTag], literal[false]] assign[member[.m_bSkipTemplate], literal[false]] assign[member[.m_setMatches], 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))] assign[member[.m_setNames], 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))] TryStatement(block=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=scanTemplates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=m_fileSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileInputStream, sub_type=None)), name=fileIn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=FileInputStream, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=fileIn, 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=InputStreamReader, sub_type=None)), name=inStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InputStreamReader, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=inStream, 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=LineNumberReader, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['FileNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['IOException']))], finally_block=None, label=None, resources=None) SuperMethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dataOut, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=moveSourceToDest, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[moveSourceToDest] operator[SEP] identifier[LineNumberReader] identifier[reader] , identifier[PrintWriter] identifier[dataOut] operator[SEP] { identifier[m_bSkipTag] operator[=] literal[boolean] operator[SEP] identifier[m_bSkipTemplate] operator[=] literal[boolean] operator[SEP] identifier[m_setMatches] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[m_setNames] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[this] operator[SEP] identifier[scanTemplates] operator[SEP] identifier[reader] operator[SEP] operator[SEP] identifier[reader] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[FileInputStream] identifier[fileIn] operator[=] Keyword[new] identifier[FileInputStream] operator[SEP] identifier[m_fileSource] operator[SEP] operator[SEP] identifier[InputStreamReader] identifier[inStream] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[fileIn] operator[SEP] operator[SEP] identifier[reader] operator[=] Keyword[new] identifier[LineNumberReader] operator[SEP] identifier[inStream] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[FileNotFoundException] identifier[ex] operator[SEP] { identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[ex] operator[SEP] { identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } Keyword[super] operator[SEP] identifier[moveSourceToDest] operator[SEP] identifier[reader] , identifier[dataOut] operator[SEP] operator[SEP] }
void discardUnusedTail() { // we guard this with the OpOrdering instead of synchronised due to potential dead-lock with CLSM.advanceAllocatingFrom() // this actually isn't strictly necessary, as currently all calls to discardUnusedTail occur within a block // already protected by this OpOrdering, but to prevent future potential mistakes, we duplicate the protection here // so that the contract between discardUnusedTail() and sync() is more explicit. try (OpOrder.Group group = appendOrder.start()) { while (true) { int prev = allocatePosition.get(); // we set allocatePosition past buffer.capacity() to make sure we always set discardedTailFrom int next = buffer.capacity() + 1; if (prev == next) return; if (allocatePosition.compareAndSet(prev, next)) { discardedTailFrom = prev; return; } } } }
class class_name[name] begin[{] method[discardUnusedTail, return_type[void], modifier[default], parameter[]] begin[{] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=allocatePosition, selectors=[], type_arguments=None), name=prev)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=capacity, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), name=next)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=ReturnStatement(expression=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compareAndSet, postfix_operators=[], prefix_operators=[], qualifier=allocatePosition, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=discardedTailFrom, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), ReturnStatement(expression=None, label=None)]))]), condition=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=group, type=ReferenceType(arguments=None, dimensions=[], name=OpOrder, sub_type=ReferenceType(arguments=None, dimensions=None, name=Group, sub_type=None)), value=MethodInvocation(arguments=[], member=start, postfix_operators=[], prefix_operators=[], qualifier=appendOrder, selectors=[], type_arguments=None))]) end[}] END[}]
Keyword[void] identifier[discardUnusedTail] operator[SEP] operator[SEP] { Keyword[try] operator[SEP] identifier[OpOrder] operator[SEP] identifier[Group] identifier[group] operator[=] identifier[appendOrder] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] { Keyword[while] operator[SEP] literal[boolean] operator[SEP] { Keyword[int] identifier[prev] operator[=] identifier[allocatePosition] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[next] operator[=] identifier[buffer] operator[SEP] identifier[capacity] operator[SEP] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[prev] operator[==] identifier[next] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[allocatePosition] operator[SEP] identifier[compareAndSet] operator[SEP] identifier[prev] , identifier[next] operator[SEP] operator[SEP] { identifier[discardedTailFrom] operator[=] identifier[prev] operator[SEP] Keyword[return] operator[SEP] } } } }
@Override public boolean isSendAllowed() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isSendAllowed"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "isSendAllowed", new Boolean(_isSendAllowed)); return _isSendAllowed; }
class class_name[name] begin[{] method[isSendAllowed, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.entry, parameter[member[.tc], literal["isSendAllowed"]]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[SibTr.exit, parameter[member[.tc], literal["isSendAllowed"], ClassCreator(arguments=[MemberReference(member=_isSendAllowed, 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=Boolean, sub_type=None))]] else begin[{] None end[}] return[member[._isSendAllowed]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isSendAllowed] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Boolean] operator[SEP] identifier[_isSendAllowed] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[_isSendAllowed] operator[SEP] }
public void setBillableRevenueOverride(com.google.api.ads.admanager.axis.v201808.Money billableRevenueOverride) { this.billableRevenueOverride = billableRevenueOverride; }
class class_name[name] begin[{] method[setBillableRevenueOverride, return_type[void], modifier[public], parameter[billableRevenueOverride]] begin[{] assign[THIS[member[None.billableRevenueOverride]], member[.billableRevenueOverride]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setBillableRevenueOverride] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[api] operator[SEP] identifier[ads] operator[SEP] identifier[admanager] operator[SEP] identifier[axis] operator[SEP] identifier[v201808] operator[SEP] identifier[Money] identifier[billableRevenueOverride] operator[SEP] { Keyword[this] operator[SEP] identifier[billableRevenueOverride] operator[=] identifier[billableRevenueOverride] operator[SEP] }
public Observable<Domain> getDomainAsync(UUID domainId) { return getDomainWithServiceResponseAsync(domainId).map(new Func1<ServiceResponse<Domain>, Domain>() { @Override public Domain call(ServiceResponse<Domain> response) { return response.body(); } }); }
class class_name[name] begin[{] method[getDomainAsync, return_type[type[Observable]], modifier[public], parameter[domainId]] begin[{] return[call[.getDomainWithServiceResponseAsync, parameter[member[.domainId]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[Domain] operator[>] identifier[getDomainAsync] operator[SEP] identifier[UUID] identifier[domainId] operator[SEP] { Keyword[return] identifier[getDomainWithServiceResponseAsync] operator[SEP] identifier[domainId] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[Domain] operator[>] , identifier[Domain] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Domain] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[Domain] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
@XmlElementDecl(namespace = "urn:FaxWS", name = "DIDList", scope = ConcordAccount.class) public JAXBElement<DIDList> createConcordAccountDIDList(DIDList value) { return new JAXBElement<DIDList>(_ConcordAccountDIDList_QNAME, DIDList.class, ConcordAccount.class, value); }
class class_name[name] begin[{] method[createConcordAccountDIDList, return_type[type[JAXBElement]], modifier[public], parameter[value]] begin[{] return[ClassCreator(arguments=[MemberReference(member=_ConcordAccountDIDList_QNAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DIDList, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConcordAccount, sub_type=None)), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DIDList, sub_type=None))], dimensions=None, name=JAXBElement, sub_type=None))] end[}] END[}]
annotation[@] identifier[XmlElementDecl] operator[SEP] identifier[namespace] operator[=] literal[String] , identifier[name] operator[=] literal[String] , identifier[scope] operator[=] identifier[ConcordAccount] operator[SEP] Keyword[class] operator[SEP] Keyword[public] identifier[JAXBElement] operator[<] identifier[DIDList] operator[>] identifier[createConcordAccountDIDList] operator[SEP] identifier[DIDList] identifier[value] operator[SEP] { Keyword[return] Keyword[new] identifier[JAXBElement] operator[<] identifier[DIDList] operator[>] operator[SEP] identifier[_ConcordAccountDIDList_QNAME] , identifier[DIDList] operator[SEP] Keyword[class] , identifier[ConcordAccount] operator[SEP] Keyword[class] , identifier[value] operator[SEP] operator[SEP] }
public final int getIdleCount(IdleStatus status) { if (getConfig().getIdleTime(status) == 0) { if (status == IdleStatus.BOTH_IDLE) { idleCountForBoth.set(0); } if (status == IdleStatus.READER_IDLE) { idleCountForRead.set(0); } if (status == IdleStatus.WRITER_IDLE) { idleCountForWrite.set(0); } } if (status == IdleStatus.BOTH_IDLE) { return idleCountForBoth.get(); } if (status == IdleStatus.READER_IDLE) { return idleCountForRead.get(); } if (status == IdleStatus.WRITER_IDLE) { return idleCountForWrite.get(); } throw new IllegalArgumentException("Unknown idle status: " + status); }
class class_name[name] begin[{] method[getIdleCount, return_type[type[int]], modifier[final public], parameter[status]] begin[{] if[binary_operation[call[.getConfig, parameter[]], ==, literal[0]]] begin[{] if[binary_operation[member[.status], ==, member[IdleStatus.BOTH_IDLE]]] begin[{] call[idleCountForBoth.set, parameter[literal[0]]] else begin[{] None end[}] if[binary_operation[member[.status], ==, member[IdleStatus.READER_IDLE]]] begin[{] call[idleCountForRead.set, parameter[literal[0]]] else begin[{] None end[}] if[binary_operation[member[.status], ==, member[IdleStatus.WRITER_IDLE]]] begin[{] call[idleCountForWrite.set, parameter[literal[0]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[member[.status], ==, member[IdleStatus.BOTH_IDLE]]] begin[{] return[call[idleCountForBoth.get, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.status], ==, member[IdleStatus.READER_IDLE]]] begin[{] return[call[idleCountForRead.get, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.status], ==, member[IdleStatus.WRITER_IDLE]]] begin[{] return[call[idleCountForWrite.get, parameter[]]] else begin[{] None end[}] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown idle status: "), operandr=MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) end[}] END[}]
Keyword[public] Keyword[final] Keyword[int] identifier[getIdleCount] operator[SEP] identifier[IdleStatus] identifier[status] operator[SEP] { Keyword[if] operator[SEP] identifier[getConfig] operator[SEP] operator[SEP] operator[SEP] identifier[getIdleTime] operator[SEP] identifier[status] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[status] operator[==] identifier[IdleStatus] operator[SEP] identifier[BOTH_IDLE] operator[SEP] { identifier[idleCountForBoth] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[status] operator[==] identifier[IdleStatus] operator[SEP] identifier[READER_IDLE] operator[SEP] { identifier[idleCountForRead] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[status] operator[==] identifier[IdleStatus] operator[SEP] identifier[WRITER_IDLE] operator[SEP] { identifier[idleCountForWrite] operator[SEP] identifier[set] operator[SEP] Other[0] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[status] operator[==] identifier[IdleStatus] operator[SEP] identifier[BOTH_IDLE] operator[SEP] { Keyword[return] identifier[idleCountForBoth] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[status] operator[==] identifier[IdleStatus] operator[SEP] identifier[READER_IDLE] operator[SEP] { Keyword[return] identifier[idleCountForRead] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[status] operator[==] identifier[IdleStatus] operator[SEP] identifier[WRITER_IDLE] operator[SEP] { Keyword[return] identifier[idleCountForWrite] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] } Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[status] operator[SEP] operator[SEP] }
protected void convertToPointerRepresentation(ArrayDBIDs ids, DoubleLongHeap heap, WritableDBIDDataStore pi, WritableDoubleDataStore lambda) { final Logging LOG = getLogger(); // Initialize parent array: for(DBIDArrayIter iter = ids.iter(); iter.valid(); iter.advance()) { pi.put(iter, iter); // Initialize } DBIDVar p = DBIDUtil.newVar(), q = DBIDUtil.newVar(), n = DBIDUtil.newVar(); FiniteProgress pprog = LOG.isVerbose() ? new FiniteProgress("Converting MST to pointer representation", heap.size(), LOG) : null; while(!heap.isEmpty()) { final double dist = heap.peekKey(); final long pair = heap.peekValue(); final int i = (int) (pair >>> 31), j = (int) (pair & 0x7FFFFFFFL); ids.assignVar(i, p); // Follow p to its parent. while(!DBIDUtil.equal(p, pi.assignVar(p, n))) { p.set(n); } // Follow q to its parent. ids.assignVar(j, q); while(!DBIDUtil.equal(q, pi.assignVar(q, n))) { q.set(n); } // By definition of the pointer representation, the largest element in // each cluster is the cluster lead. // The extraction methods currently rely on this! int c = DBIDUtil.compare(p, q); if(c < 0) { // p joins q: pi.put(p, q); lambda.put(p, dist); } else { assert (c != 0) : "This should never happen!"; // q joins p: pi.put(q, p); lambda.put(q, dist); } heap.poll(); LOG.incrementProcessed(pprog); } LOG.ensureCompleted(pprog); // Hack to ensure a valid pointer representation: // If distances are tied, the heap may return edges such that the n-way join // does not fulfill the property that the last element has the largest id. for(DBIDArrayIter iter = ids.iter(); iter.valid(); iter.advance()) { double d = lambda.doubleValue(iter); // Parent: pi.assignVar(iter, p); q.set(p); // Follow parent while tied. while(d >= lambda.doubleValue(q) && !DBIDUtil.equal(q, pi.assignVar(q, n))) { q.set(n); } if(!DBIDUtil.equal(p, q)) { if(LOG.isDebuggingFinest()) { LOG.finest("Correcting parent: " + p + " -> " + q); } pi.put(iter, q); } } }
class class_name[name] begin[{] method[convertToPointerRepresentation, return_type[void], modifier[protected], parameter[ids, heap, pi, lambda]] begin[{] local_variable[type[Logging], LOG] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=pi, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=valid, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iter, postfix_operators=[], prefix_operators=[], qualifier=ids, selectors=[], type_arguments=None), name=iter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DBIDArrayIter, sub_type=None)), update=[MethodInvocation(arguments=[], member=advance, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None)]), label=None) local_variable[type[DBIDVar], p] local_variable[type[FiniteProgress], pprog] while[call[heap.isEmpty, parameter[]]] begin[{] local_variable[type[double], dist] local_variable[type[long], pair] local_variable[type[int], i] call[ids.assignVar, parameter[member[.i], member[.p]]] while[call[DBIDUtil.equal, parameter[member[.p], call[pi.assignVar, parameter[member[.p], member[.n]]]]]] begin[{] call[p.set, parameter[member[.n]]] end[}] call[ids.assignVar, parameter[member[.j], member[.q]]] while[call[DBIDUtil.equal, parameter[member[.q], call[pi.assignVar, parameter[member[.q], member[.n]]]]]] begin[{] call[q.set, parameter[member[.n]]] end[}] local_variable[type[int], c] if[binary_operation[member[.c], <, literal[0]]] begin[{] call[pi.put, parameter[member[.p], member[.q]]] call[lambda.put, parameter[member[.p], member[.dist]]] else begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=!=), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="This should never happen!")) call[pi.put, parameter[member[.q], member[.p]]] call[lambda.put, parameter[member[.q], member[.dist]]] end[}] call[heap.poll, parameter[]] call[LOG.incrementProcessed, parameter[member[.pprog]]] end[}] call[LOG.ensureCompleted, parameter[member[.pprog]]] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=lambda, selectors=[], type_arguments=None), name=d)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=assignVar, postfix_operators=[], prefix_operators=[], qualifier=pi, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=q, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=q, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doubleValue, postfix_operators=[], prefix_operators=[], qualifier=lambda, selectors=[], type_arguments=None), operator=>=), operandr=MethodInvocation(arguments=[MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=assignVar, postfix_operators=[], prefix_operators=[], qualifier=pi, selectors=[], type_arguments=None)], member=equal, postfix_operators=[], prefix_operators=['!'], qualifier=DBIDUtil, selectors=[], type_arguments=None), operator=&&), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equal, postfix_operators=[], prefix_operators=['!'], qualifier=DBIDUtil, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebuggingFinest, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Correcting parent: "), operandr=MemberReference(member=p, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" -> "), operator=+), operandr=MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=finest, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=iter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=q, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=pi, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=MethodInvocation(arguments=[], member=valid, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=iter, postfix_operators=[], prefix_operators=[], qualifier=ids, selectors=[], type_arguments=None), name=iter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DBIDArrayIter, sub_type=None)), update=[MethodInvocation(arguments=[], member=advance, postfix_operators=[], prefix_operators=[], qualifier=iter, selectors=[], type_arguments=None)]), label=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[convertToPointerRepresentation] operator[SEP] identifier[ArrayDBIDs] identifier[ids] , identifier[DoubleLongHeap] identifier[heap] , identifier[WritableDBIDDataStore] identifier[pi] , identifier[WritableDoubleDataStore] identifier[lambda] operator[SEP] { Keyword[final] identifier[Logging] identifier[LOG] operator[=] identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DBIDArrayIter] identifier[iter] operator[=] identifier[ids] operator[SEP] identifier[iter] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[valid] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[advance] operator[SEP] operator[SEP] operator[SEP] { identifier[pi] operator[SEP] identifier[put] operator[SEP] identifier[iter] , identifier[iter] operator[SEP] operator[SEP] } identifier[DBIDVar] identifier[p] operator[=] identifier[DBIDUtil] operator[SEP] identifier[newVar] operator[SEP] operator[SEP] , identifier[q] operator[=] identifier[DBIDUtil] operator[SEP] identifier[newVar] operator[SEP] operator[SEP] , identifier[n] operator[=] identifier[DBIDUtil] operator[SEP] identifier[newVar] operator[SEP] operator[SEP] operator[SEP] identifier[FiniteProgress] identifier[pprog] operator[=] identifier[LOG] operator[SEP] identifier[isVerbose] operator[SEP] operator[SEP] operator[?] Keyword[new] identifier[FiniteProgress] operator[SEP] literal[String] , identifier[heap] operator[SEP] identifier[size] operator[SEP] operator[SEP] , identifier[LOG] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[heap] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] Keyword[double] identifier[dist] operator[=] identifier[heap] operator[SEP] identifier[peekKey] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[pair] operator[=] identifier[heap] operator[SEP] identifier[peekValue] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[i] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[pair] operator[>] operator[>] operator[>] Other[31] operator[SEP] , identifier[j] operator[=] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[pair] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[ids] operator[SEP] identifier[assignVar] operator[SEP] identifier[i] , identifier[p] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[DBIDUtil] operator[SEP] identifier[equal] operator[SEP] identifier[p] , identifier[pi] operator[SEP] identifier[assignVar] operator[SEP] identifier[p] , identifier[n] operator[SEP] operator[SEP] operator[SEP] { identifier[p] operator[SEP] identifier[set] operator[SEP] identifier[n] operator[SEP] operator[SEP] } identifier[ids] operator[SEP] identifier[assignVar] operator[SEP] identifier[j] , identifier[q] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[!] identifier[DBIDUtil] operator[SEP] identifier[equal] operator[SEP] identifier[q] , identifier[pi] operator[SEP] identifier[assignVar] operator[SEP] identifier[q] , identifier[n] operator[SEP] operator[SEP] operator[SEP] { identifier[q] operator[SEP] identifier[set] operator[SEP] identifier[n] operator[SEP] operator[SEP] } Keyword[int] identifier[c] operator[=] identifier[DBIDUtil] operator[SEP] identifier[compare] operator[SEP] identifier[p] , identifier[q] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[<] Other[0] operator[SEP] { identifier[pi] operator[SEP] identifier[put] operator[SEP] identifier[p] , identifier[q] operator[SEP] operator[SEP] identifier[lambda] operator[SEP] identifier[put] operator[SEP] identifier[p] , identifier[dist] operator[SEP] operator[SEP] } Keyword[else] { Keyword[assert] operator[SEP] identifier[c] operator[!=] Other[0] operator[SEP] operator[:] literal[String] operator[SEP] identifier[pi] operator[SEP] identifier[put] operator[SEP] identifier[q] , identifier[p] operator[SEP] operator[SEP] identifier[lambda] operator[SEP] identifier[put] operator[SEP] identifier[q] , identifier[dist] operator[SEP] operator[SEP] } identifier[heap] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] identifier[LOG] operator[SEP] identifier[incrementProcessed] operator[SEP] identifier[pprog] operator[SEP] operator[SEP] } identifier[LOG] operator[SEP] identifier[ensureCompleted] operator[SEP] identifier[pprog] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DBIDArrayIter] identifier[iter] operator[=] identifier[ids] operator[SEP] identifier[iter] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[valid] operator[SEP] operator[SEP] operator[SEP] identifier[iter] operator[SEP] identifier[advance] operator[SEP] operator[SEP] operator[SEP] { Keyword[double] identifier[d] operator[=] identifier[lambda] operator[SEP] identifier[doubleValue] operator[SEP] identifier[iter] operator[SEP] operator[SEP] identifier[pi] operator[SEP] identifier[assignVar] operator[SEP] identifier[iter] , identifier[p] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[set] operator[SEP] identifier[p] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[d] operator[>=] identifier[lambda] operator[SEP] identifier[doubleValue] operator[SEP] identifier[q] operator[SEP] operator[&&] operator[!] identifier[DBIDUtil] operator[SEP] identifier[equal] operator[SEP] identifier[q] , identifier[pi] operator[SEP] identifier[assignVar] operator[SEP] identifier[q] , identifier[n] operator[SEP] operator[SEP] operator[SEP] { identifier[q] operator[SEP] identifier[set] operator[SEP] identifier[n] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[DBIDUtil] operator[SEP] identifier[equal] operator[SEP] identifier[p] , identifier[q] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebuggingFinest] operator[SEP] operator[SEP] operator[SEP] { identifier[LOG] operator[SEP] identifier[finest] operator[SEP] literal[String] operator[+] identifier[p] operator[+] literal[String] operator[+] identifier[q] operator[SEP] operator[SEP] } identifier[pi] operator[SEP] identifier[put] operator[SEP] identifier[iter] , identifier[q] operator[SEP] operator[SEP] } } }
private Method getMethod(Object controller, String methodName) throws RoutesException { try { // try to retrieve the method and check if an exception is thrown return controller.getClass().getMethod(methodName, Request.class, Response.class); } catch (Exception e) { throw new RoutesException(e); } }
class class_name[name] begin[{] method[getMethod, return_type[type[Method]], modifier[private], parameter[controller, methodName]] begin[{] TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=controller, selectors=[MethodInvocation(arguments=[MemberReference(member=methodName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Request, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Response, sub_type=None))], member=getMethod, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=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=RoutesException, 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[private] identifier[Method] identifier[getMethod] operator[SEP] identifier[Object] identifier[controller] , identifier[String] identifier[methodName] operator[SEP] Keyword[throws] identifier[RoutesException] { Keyword[try] { Keyword[return] identifier[controller] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getMethod] operator[SEP] identifier[methodName] , identifier[Request] operator[SEP] Keyword[class] , identifier[Response] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RoutesException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public static byte[] toHexByteArray(final byte[] buffer, final int offset, final int length) { final byte[] outputBuffer = new byte[length << 1]; for (int i = 0; i < (length << 1); i += 2) { final byte b = buffer[offset + (i >> 1)]; outputBuffer[i] = HEX_DIGIT_TABLE[(b >> 4) & 0x0F]; outputBuffer[i + 1] = HEX_DIGIT_TABLE[b & 0x0F]; } return outputBuffer; }
class class_name[name] begin[{] method[toHexByteArray, return_type[type[byte]], modifier[public static], parameter[buffer, offset, length]] begin[{] local_variable[type[byte], outputBuffer] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>>), operator=+))]), name=b)], modifiers={'final'}, type=BasicType(dimensions=[], name=byte)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=HEX_DIGIT_TABLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x0F), operator=&))])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=outputBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), type==, value=MemberReference(member=HEX_DIGIT_TABLE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x0F), operator=&))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=<<), operator=<), 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=[Assignment(expressionl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), label=None) return[member[.outputBuffer]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[byte] operator[SEP] operator[SEP] identifier[toHexByteArray] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] , Keyword[final] Keyword[int] identifier[offset] , Keyword[final] Keyword[int] identifier[length] operator[SEP] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[outputBuffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[length] operator[<<] Other[1] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] operator[SEP] identifier[length] operator[<<] Other[1] operator[SEP] operator[SEP] identifier[i] operator[+=] Other[2] operator[SEP] { Keyword[final] Keyword[byte] identifier[b] operator[=] identifier[buffer] operator[SEP] identifier[offset] operator[+] operator[SEP] identifier[i] operator[>] operator[>] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[outputBuffer] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[HEX_DIGIT_TABLE] operator[SEP] operator[SEP] identifier[b] operator[>] operator[>] Other[4] operator[SEP] operator[&] literal[Integer] operator[SEP] operator[SEP] identifier[outputBuffer] operator[SEP] identifier[i] operator[+] Other[1] operator[SEP] operator[=] identifier[HEX_DIGIT_TABLE] operator[SEP] identifier[b] operator[&] literal[Integer] operator[SEP] operator[SEP] } Keyword[return] identifier[outputBuffer] operator[SEP] }
private Object prepareValue(Class expectedClass, Object pValue) { if (pValue == null) { return null; } if (Enum.class.isAssignableFrom(expectedClass)) { return Enum.valueOf(expectedClass,pValue.toString()); } else { return prepareForDirectUsage(expectedClass, pValue); } }
class class_name[name] begin[{] method[prepareValue, return_type[type[Object]], modifier[private], parameter[expectedClass, pValue]] begin[{] if[binary_operation[member[.pValue], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=expectedClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Enum, sub_type=None))] begin[{] return[call[Enum.valueOf, parameter[member[.expectedClass], call[pValue.toString, parameter[]]]]] else begin[{] return[call[.prepareForDirectUsage, parameter[member[.expectedClass], member[.pValue]]]] end[}] end[}] END[}]
Keyword[private] identifier[Object] identifier[prepareValue] operator[SEP] identifier[Class] identifier[expectedClass] , identifier[Object] identifier[pValue] operator[SEP] { Keyword[if] operator[SEP] identifier[pValue] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[Enum] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[expectedClass] operator[SEP] operator[SEP] { Keyword[return] identifier[Enum] operator[SEP] identifier[valueOf] operator[SEP] identifier[expectedClass] , identifier[pValue] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[prepareForDirectUsage] operator[SEP] identifier[expectedClass] , identifier[pValue] operator[SEP] operator[SEP] } }
public void marshall(LambdaDataSourceConfig lambdaDataSourceConfig, ProtocolMarshaller protocolMarshaller) { if (lambdaDataSourceConfig == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(lambdaDataSourceConfig.getLambdaFunctionArn(), LAMBDAFUNCTIONARN_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[lambdaDataSourceConfig, protocolMarshaller]] begin[{] if[binary_operation[member[.lambdaDataSourceConfig], ==, 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=getLambdaFunctionArn, postfix_operators=[], prefix_operators=[], qualifier=lambdaDataSourceConfig, selectors=[], type_arguments=None), MemberReference(member=LAMBDAFUNCTIONARN_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[LambdaDataSourceConfig] identifier[lambdaDataSourceConfig] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[lambdaDataSourceConfig] 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[lambdaDataSourceConfig] operator[SEP] identifier[getLambdaFunctionArn] operator[SEP] operator[SEP] , identifier[LAMBDAFUNCTIONARN_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] } }
@Pure public static String[] split(URL filename) { if (filename == null) { return new String[0]; } if (isJarURL(filename)) { return split(getJarFile(filename)); } final String path = filename.getPath(); String[] tab = path.split(Pattern.quote(URL_PATH_SEPARATOR)); if (tab.length >= 2 && "".equals(tab[0]) && Pattern.matches("^[a-zA-Z][:|]$", tab[1])) { //$NON-NLS-1$ //$NON-NLS-2$ tab = Arrays.copyOfRange(tab, 1, tab.length); for (int i = 1; i < tab.length; ++i) { tab[i] = decodeHTMLEntities(tab[i]); } } else { for (int i = 0; i < tab.length; ++i) { tab[i] = decodeHTMLEntities(tab[i]); } } return tab; }
class class_name[name] begin[{] method[split, return_type[type[String]], modifier[public static], parameter[filename]] begin[{] if[binary_operation[member[.filename], ==, literal[null]]] begin[{] return[ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] else begin[{] None end[}] if[call[.isJarURL, parameter[member[.filename]]]] begin[{] return[call[.split, parameter[call[.getJarFile, parameter[member[.filename]]]]]] else begin[{] None end[}] local_variable[type[String], path] local_variable[type[String], tab] if[binary_operation[binary_operation[binary_operation[member[tab.length], >=, literal[2]], &&, literal[""]], &&, call[Pattern.matches, parameter[literal["^[a-zA-Z][:|]$"], member[.tab]]]]] begin[{] assign[member[.tab], call[Arrays.copyOfRange, parameter[member[.tab], literal[1], member[tab.length]]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=tab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=decodeHTMLEntities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tab, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) else begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=tab, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=decodeHTMLEntities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=tab, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) end[}] return[member[.tab]] end[}] END[}]
annotation[@] identifier[Pure] Keyword[public] Keyword[static] identifier[String] operator[SEP] operator[SEP] identifier[split] operator[SEP] identifier[URL] identifier[filename] operator[SEP] { Keyword[if] operator[SEP] identifier[filename] operator[==] Other[null] operator[SEP] { Keyword[return] Keyword[new] identifier[String] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[isJarURL] operator[SEP] identifier[filename] operator[SEP] operator[SEP] { Keyword[return] identifier[split] operator[SEP] identifier[getJarFile] operator[SEP] identifier[filename] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] identifier[String] identifier[path] operator[=] identifier[filename] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[tab] operator[=] identifier[path] operator[SEP] identifier[split] operator[SEP] identifier[Pattern] operator[SEP] identifier[quote] operator[SEP] identifier[URL_PATH_SEPARATOR] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tab] operator[SEP] identifier[length] operator[>=] Other[2] operator[&&] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[tab] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[&&] identifier[Pattern] operator[SEP] identifier[matches] operator[SEP] literal[String] , identifier[tab] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] { identifier[tab] operator[=] identifier[Arrays] operator[SEP] identifier[copyOfRange] operator[SEP] identifier[tab] , Other[1] , identifier[tab] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[tab] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[tab] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[decodeHTMLEntities] operator[SEP] identifier[tab] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[tab] operator[SEP] identifier[length] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[tab] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[decodeHTMLEntities] operator[SEP] identifier[tab] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] identifier[tab] operator[SEP] }
public void setRegularization(double regularization) { if (Double.isInfinite(regularization) || Double.isNaN(regularization) || regularization <= 0) throw new IllegalArgumentException("Regularization must be a positive value"); this.reg = regularization; }
class class_name[name] begin[{] method[setRegularization, return_type[void], modifier[public], parameter[regularization]] begin[{] if[binary_operation[binary_operation[call[Double.isInfinite, parameter[member[.regularization]]], ||, call[Double.isNaN, parameter[member[.regularization]]]], ||, binary_operation[member[.regularization], <=, literal[0]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Regularization must be a positive value")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] assign[THIS[member[None.reg]], member[.regularization]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setRegularization] operator[SEP] Keyword[double] identifier[regularization] operator[SEP] { Keyword[if] operator[SEP] identifier[Double] operator[SEP] identifier[isInfinite] operator[SEP] identifier[regularization] operator[SEP] operator[||] identifier[Double] operator[SEP] identifier[isNaN] operator[SEP] identifier[regularization] operator[SEP] operator[||] identifier[regularization] operator[<=] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[reg] operator[=] identifier[regularization] operator[SEP] }
public static void multiplyMM(float[] result, int resultOffset, float[] lhs, int lhsOffset, float[] rhs, int rhsOffset) { result[resultOffset + 0] = rhs[0] * lhs[0] + rhs[1] * lhs[4] + rhs[2] * lhs[8] + rhs[3] * lhs[12]; result[resultOffset + 1] = rhs[0] * lhs[1] + rhs[1] * lhs[5] + rhs[2] * lhs[9] + rhs[3] * lhs[13]; result[resultOffset + 2] = rhs[0] * lhs[2] + rhs[1] * lhs[6] + rhs[2] * lhs[10] + rhs[3] * lhs[14]; result[resultOffset + 3] = rhs[0] * lhs[3] + rhs[1] * lhs[7] + rhs[2] * lhs[11] + rhs[3] * lhs[15]; result[resultOffset + 4] = rhs[4] * lhs[0] + rhs[5] * lhs[4] + rhs[6] * lhs[8] + rhs[7] * lhs[12]; result[resultOffset + 5] = rhs[4] * lhs[1] + rhs[5] * lhs[5] + rhs[6] * lhs[9] + rhs[7] * lhs[13]; result[resultOffset + 6] = rhs[4] * lhs[2] + rhs[5] * lhs[6] + rhs[6] * lhs[10] + rhs[7] * lhs[14]; result[resultOffset + 7] = rhs[4] * lhs[3] + rhs[5] * lhs[7] + rhs[6] * lhs[11] + rhs[7] * lhs[15]; result[resultOffset + 8] = rhs[8] * lhs[0] + rhs[9] * lhs[4] + rhs[10] * lhs[8] + rhs[11] * lhs[12]; result[resultOffset + 9] = rhs[8] * lhs[1] + rhs[9] * lhs[5] + rhs[10] * lhs[9] + rhs[11] * lhs[13]; result[resultOffset + 10] = rhs[8] * lhs[2] + rhs[9] * lhs[6] + rhs[10] * lhs[10] + rhs[11] * lhs[14]; result[resultOffset + 11] = rhs[8] * lhs[3] + rhs[9] * lhs[7] + rhs[10] * lhs[11] + rhs[11] * lhs[15]; result[resultOffset + 12] = rhs[12] * lhs[0] + rhs[13] * lhs[4] + rhs[14] * lhs[8] + rhs[15] * lhs[12]; result[resultOffset + 13] = rhs[12] * lhs[1] + rhs[13] * lhs[5] + rhs[14] * lhs[9] + rhs[15] * lhs[13]; result[resultOffset + 14] = rhs[12] * lhs[2] + rhs[13] * lhs[6] + rhs[14] * lhs[10] + rhs[15] * lhs[14]; result[resultOffset + 15] = rhs[12] * lhs[3] + rhs[13] * lhs[7] + rhs[14] * lhs[11] + rhs[15] * lhs[15]; }
class class_name[name] begin[{] method[multiplyMM, return_type[void], modifier[public static], parameter[result, resultOffset, lhs, lhsOffset, rhs, rhsOffset]] begin[{] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] assign[member[.result], binary_operation[binary_operation[binary_operation[binary_operation[member[.rhs], *, member[.lhs]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]], +, binary_operation[member[.rhs], *, member[.lhs]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[multiplyMM] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[result] , Keyword[int] identifier[resultOffset] , Keyword[float] operator[SEP] operator[SEP] identifier[lhs] , Keyword[int] identifier[lhsOffset] , Keyword[float] operator[SEP] operator[SEP] identifier[rhs] , Keyword[int] identifier[rhsOffset] operator[SEP] { identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[0] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[0] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[0] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[1] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[4] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[2] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[8] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[3] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[12] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[1] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[0] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[1] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[1] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[5] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[2] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[9] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[3] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[13] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[2] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[0] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[2] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[1] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[6] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[2] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[10] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[3] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[14] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[3] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[0] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[3] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[1] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[7] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[2] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[11] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[3] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[15] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[4] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[4] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[0] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[5] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[4] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[6] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[8] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[7] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[12] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[5] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[4] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[1] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[5] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[5] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[6] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[9] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[7] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[13] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[6] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[4] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[2] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[5] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[6] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[6] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[10] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[7] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[14] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[7] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[4] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[3] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[5] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[7] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[6] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[11] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[7] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[15] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[8] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[8] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[0] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[9] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[4] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[10] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[8] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[11] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[12] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[9] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[8] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[1] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[9] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[5] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[10] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[9] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[11] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[13] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[10] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[8] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[2] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[9] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[6] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[10] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[10] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[11] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[14] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[11] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[8] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[3] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[9] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[7] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[10] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[11] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[11] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[15] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[12] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[12] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[0] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[13] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[4] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[14] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[8] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[15] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[12] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[13] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[12] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[1] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[13] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[5] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[14] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[9] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[15] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[13] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[14] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[12] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[2] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[13] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[6] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[14] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[10] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[15] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[14] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[resultOffset] operator[+] Other[15] operator[SEP] operator[=] identifier[rhs] operator[SEP] Other[12] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[3] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[13] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[7] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[14] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[11] operator[SEP] operator[+] identifier[rhs] operator[SEP] Other[15] operator[SEP] operator[*] identifier[lhs] operator[SEP] Other[15] operator[SEP] operator[SEP] }