code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public static boolean openNotification() throws Exception { boolean success = false; // get API level int apiLevel = Client.getInstance().mapField("android.os.Build$VERSION", "SDK_INT").getInt(0); if (apiLevel >= 18) { success = Client.getInstance().map(Constants.UIAUTOMATOR_UIDEVICE, "openNotification").getBoolean(0); } else { // try a brute force method int displayHeight = getDisplayHeight(); // Calculated a Y position to pull down to that is the display height minus 10% int pullTo = displayHeight - (int)((double)displayHeight * .1); Client.getInstance().map(Constants.UIAUTOMATOR_UIDEVICE, "swipe", 10, 0, 10, pullTo, 100); success = true; } return success; }
class class_name[name] begin[{] method[openNotification, return_type[type[boolean]], modifier[public static], parameter[]] begin[{] local_variable[type[boolean], success] local_variable[type[int], apiLevel] if[binary_operation[member[.apiLevel], >=, literal[18]]] begin[{] assign[member[.success], call[Client.getInstance, parameter[]]] else begin[{] local_variable[type[int], displayHeight] local_variable[type[int], pullTo] call[Client.getInstance, parameter[]] assign[member[.success], literal[true]] end[}] return[member[.success]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[openNotification] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { Keyword[boolean] identifier[success] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[apiLevel] operator[=] identifier[Client] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[mapField] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[getInt] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[apiLevel] operator[>=] Other[18] operator[SEP] { identifier[success] operator[=] identifier[Client] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Constants] operator[SEP] identifier[UIAUTOMATOR_UIDEVICE] , literal[String] operator[SEP] operator[SEP] identifier[getBoolean] operator[SEP] Other[0] operator[SEP] operator[SEP] } Keyword[else] { Keyword[int] identifier[displayHeight] operator[=] identifier[getDisplayHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[pullTo] operator[=] identifier[displayHeight] operator[-] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] Keyword[double] operator[SEP] identifier[displayHeight] operator[*] literal[Float] operator[SEP] operator[SEP] identifier[Client] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[Constants] operator[SEP] identifier[UIAUTOMATOR_UIDEVICE] , literal[String] , Other[10] , Other[0] , Other[10] , identifier[pullTo] , Other[100] operator[SEP] operator[SEP] identifier[success] operator[=] literal[boolean] operator[SEP] } Keyword[return] identifier[success] operator[SEP] }
private void generateClass() throws FileNotFoundException, JasperException, Exception { long t1 = 0; if (log.isLoggable(Level.FINE)) { t1 = System.currentTimeMillis(); } String javaFileName = ctxt.getServletJavaFileName(); setJavaCompilerOptions(); // Start java compilation JavacErrorDetail[] javacErrors = javaCompiler.compile(ctxt.getFullClassName(), pageNodes); if (javacErrors != null) { // If there are errors, always generate java files to disk. javaCompiler.doJavaFile(true); log.severe("Error compiling file: " + javaFileName); errDispatcher.javacError(javacErrors); } if (log.isLoggable(Level.FINE)) { long t2 = System.currentTimeMillis(); log.fine("Compiled " + javaFileName + " " + (t2-t1) + "ms"); } // Save or delete the generated Java files, depending on the // value of "keepgenerated" attribute javaCompiler.doJavaFile(ctxt.keepGenerated()); // JSR45 Support if (!ctxt.isPrototypeMode() && !options.isSmapSuppressed()) { smapUtil.installSmap(); } // START CR 6373479 if (jsw != null && jsw.getServletClassLastModifiedTime() <= 0) { jsw.setServletClassLastModifiedTime( javaCompiler.getClassLastModified()); } // END CR 6373479 if (options.getSaveBytecode()) { javaCompiler.saveClassFile(ctxt.getFullClassName(), ctxt.getClassFileName()); } // On some systems, due to file caching, the time stamp for the updated // JSP file may actually be greater than that of the newly created byte // codes in the cache. In such cases, adjust the cache time stamp to // JSP page time, to avoid unnecessary recompilations. ctxt.getRuntimeContext().adjustBytecodeTime(ctxt.getFullClassName(), jspModTime); }
class class_name[name] begin[{] method[generateClass, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[long], t1] if[call[log.isLoggable, parameter[member[Level.FINE]]]] begin[{] assign[member[.t1], call[System.currentTimeMillis, parameter[]]] else begin[{] None end[}] local_variable[type[String], javaFileName] call[.setJavaCompilerOptions, parameter[]] local_variable[type[JavacErrorDetail], javacErrors] if[binary_operation[member[.javacErrors], !=, literal[null]]] begin[{] call[javaCompiler.doJavaFile, parameter[literal[true]]] call[log.severe, parameter[binary_operation[literal["Error compiling file: "], +, member[.javaFileName]]]] call[errDispatcher.javacError, parameter[member[.javacErrors]]] else begin[{] None end[}] if[call[log.isLoggable, parameter[member[Level.FINE]]]] begin[{] local_variable[type[long], t2] call[log.fine, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Compiled "], +, member[.javaFileName]], +, literal[" "]], +, binary_operation[member[.t2], -, member[.t1]]], +, literal["ms"]]]] else begin[{] None end[}] call[javaCompiler.doJavaFile, parameter[call[ctxt.keepGenerated, parameter[]]]] if[binary_operation[call[ctxt.isPrototypeMode, parameter[]], &&, call[options.isSmapSuppressed, parameter[]]]] begin[{] call[smapUtil.installSmap, parameter[]] else begin[{] None end[}] if[binary_operation[binary_operation[member[.jsw], !=, literal[null]], &&, binary_operation[call[jsw.getServletClassLastModifiedTime, parameter[]], <=, literal[0]]]] begin[{] call[jsw.setServletClassLastModifiedTime, parameter[call[javaCompiler.getClassLastModified, parameter[]]]] else begin[{] None end[}] if[call[options.getSaveBytecode, parameter[]]] begin[{] call[javaCompiler.saveClassFile, parameter[call[ctxt.getFullClassName, parameter[]], call[ctxt.getClassFileName, parameter[]]]] else begin[{] None end[}] call[ctxt.getRuntimeContext, parameter[]] end[}] END[}]
Keyword[private] Keyword[void] identifier[generateClass] operator[SEP] operator[SEP] Keyword[throws] identifier[FileNotFoundException] , identifier[JasperException] , identifier[Exception] { Keyword[long] identifier[t1] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[t1] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[javaFileName] operator[=] identifier[ctxt] operator[SEP] identifier[getServletJavaFileName] operator[SEP] operator[SEP] operator[SEP] identifier[setJavaCompilerOptions] operator[SEP] operator[SEP] operator[SEP] identifier[JavacErrorDetail] operator[SEP] operator[SEP] identifier[javacErrors] operator[=] identifier[javaCompiler] operator[SEP] identifier[compile] operator[SEP] identifier[ctxt] operator[SEP] identifier[getFullClassName] operator[SEP] operator[SEP] , identifier[pageNodes] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[javacErrors] operator[!=] Other[null] operator[SEP] { identifier[javaCompiler] operator[SEP] identifier[doJavaFile] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[severe] operator[SEP] literal[String] operator[+] identifier[javaFileName] operator[SEP] operator[SEP] identifier[errDispatcher] operator[SEP] identifier[javacError] operator[SEP] identifier[javacErrors] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { Keyword[long] identifier[t2] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[fine] operator[SEP] literal[String] operator[+] identifier[javaFileName] operator[+] literal[String] operator[+] operator[SEP] identifier[t2] operator[-] identifier[t1] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[javaCompiler] operator[SEP] identifier[doJavaFile] operator[SEP] identifier[ctxt] operator[SEP] identifier[keepGenerated] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[ctxt] operator[SEP] identifier[isPrototypeMode] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[options] operator[SEP] identifier[isSmapSuppressed] operator[SEP] operator[SEP] operator[SEP] { identifier[smapUtil] operator[SEP] identifier[installSmap] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[jsw] operator[!=] Other[null] operator[&&] identifier[jsw] operator[SEP] identifier[getServletClassLastModifiedTime] operator[SEP] operator[SEP] operator[<=] Other[0] operator[SEP] { identifier[jsw] operator[SEP] identifier[setServletClassLastModifiedTime] operator[SEP] identifier[javaCompiler] operator[SEP] identifier[getClassLastModified] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[options] operator[SEP] identifier[getSaveBytecode] operator[SEP] operator[SEP] operator[SEP] { identifier[javaCompiler] operator[SEP] identifier[saveClassFile] operator[SEP] identifier[ctxt] operator[SEP] identifier[getFullClassName] operator[SEP] operator[SEP] , identifier[ctxt] operator[SEP] identifier[getClassFileName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ctxt] operator[SEP] identifier[getRuntimeContext] operator[SEP] operator[SEP] operator[SEP] identifier[adjustBytecodeTime] operator[SEP] identifier[ctxt] operator[SEP] identifier[getFullClassName] operator[SEP] operator[SEP] , identifier[jspModTime] operator[SEP] operator[SEP] }
private static void deleteCacheInfoUpdate(CacheStatus cacheStatus) { if (!cacheStatus.isInited()) { // if it is not created yet, do nothing. return; } synchronized (baseDirSize) { Long dirSize = baseDirSize.get(cacheStatus.getBaseDir()); if ( dirSize != null ) { dirSize -= cacheStatus.size; baseDirSize.put(cacheStatus.getBaseDir(), dirSize); } } synchronized (baseDirNumberSubDir) { Integer dirSubDir = baseDirNumberSubDir.get(cacheStatus.getBaseDir()); if ( dirSubDir != null ) { dirSubDir--; baseDirNumberSubDir.put(cacheStatus.getBaseDir(), dirSubDir); } } }
class class_name[name] begin[{] method[deleteCacheInfoUpdate, return_type[void], modifier[private static], parameter[cacheStatus]] begin[{] if[call[cacheStatus.isInited, parameter[]]] begin[{] return[None] else begin[{] None end[}] SYNCHRONIZED[member[.baseDirSize]] BEGIN[{] local_variable[type[Long], dirSize] if[binary_operation[member[.dirSize], !=, literal[null]]] begin[{] assign[member[.dirSize], member[cacheStatus.size]] call[baseDirSize.put, parameter[call[cacheStatus.getBaseDir, parameter[]], member[.dirSize]]] else begin[{] None end[}] END[}] SYNCHRONIZED[member[.baseDirNumberSubDir]] BEGIN[{] local_variable[type[Integer], dirSubDir] if[binary_operation[member[.dirSubDir], !=, literal[null]]] begin[{] member[.dirSubDir] call[baseDirNumberSubDir.put, parameter[call[cacheStatus.getBaseDir, parameter[]], member[.dirSubDir]]] else begin[{] None end[}] END[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[deleteCacheInfoUpdate] operator[SEP] identifier[CacheStatus] identifier[cacheStatus] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[cacheStatus] operator[SEP] identifier[isInited] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[synchronized] operator[SEP] identifier[baseDirSize] operator[SEP] { identifier[Long] identifier[dirSize] operator[=] identifier[baseDirSize] operator[SEP] identifier[get] operator[SEP] identifier[cacheStatus] operator[SEP] identifier[getBaseDir] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dirSize] operator[!=] Other[null] operator[SEP] { identifier[dirSize] operator[-=] identifier[cacheStatus] operator[SEP] identifier[size] operator[SEP] identifier[baseDirSize] operator[SEP] identifier[put] operator[SEP] identifier[cacheStatus] operator[SEP] identifier[getBaseDir] operator[SEP] operator[SEP] , identifier[dirSize] operator[SEP] operator[SEP] } } Keyword[synchronized] operator[SEP] identifier[baseDirNumberSubDir] operator[SEP] { identifier[Integer] identifier[dirSubDir] operator[=] identifier[baseDirNumberSubDir] operator[SEP] identifier[get] operator[SEP] identifier[cacheStatus] operator[SEP] identifier[getBaseDir] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dirSubDir] operator[!=] Other[null] operator[SEP] { identifier[dirSubDir] operator[--] operator[SEP] identifier[baseDirNumberSubDir] operator[SEP] identifier[put] operator[SEP] identifier[cacheStatus] operator[SEP] identifier[getBaseDir] operator[SEP] operator[SEP] , identifier[dirSubDir] operator[SEP] operator[SEP] } } }
public static boolean isDirectoryPath(URI path) { return (path != null) && path.toString().endsWith(GoogleCloudStorage.PATH_DELIMITER); }
class class_name[name] begin[{] method[isDirectoryPath, return_type[type[boolean]], modifier[public static], parameter[path]] begin[{] return[binary_operation[binary_operation[member[.path], !=, literal[null]], &&, call[path.toString, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isDirectoryPath] operator[SEP] identifier[URI] identifier[path] operator[SEP] { Keyword[return] operator[SEP] identifier[path] operator[!=] Other[null] operator[SEP] operator[&&] identifier[path] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[endsWith] operator[SEP] identifier[GoogleCloudStorage] operator[SEP] identifier[PATH_DELIMITER] operator[SEP] operator[SEP] }
@Override public int smallByteSize() { int bound = byteSize(); ByteBuffer buf = ByteBuffer.allocate(bound); asSmallBytes(buf); return buf.position(); }
class class_name[name] begin[{] method[smallByteSize, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[int], bound] local_variable[type[ByteBuffer], buf] call[.asSmallBytes, parameter[member[.buf]]] return[call[buf.position, parameter[]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[smallByteSize] operator[SEP] operator[SEP] { Keyword[int] identifier[bound] operator[=] identifier[byteSize] operator[SEP] operator[SEP] operator[SEP] identifier[ByteBuffer] identifier[buf] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocate] operator[SEP] identifier[bound] operator[SEP] operator[SEP] identifier[asSmallBytes] operator[SEP] identifier[buf] operator[SEP] operator[SEP] Keyword[return] identifier[buf] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[SEP] }
public Surface rotate (float angle) { float sr = (float) Math.sin(angle); float cr = (float) Math.cos(angle); transform(cr, sr, -sr, cr, 0, 0); return this; }
class class_name[name] begin[{] method[rotate, return_type[type[Surface]], modifier[public], parameter[angle]] begin[{] local_variable[type[float], sr] local_variable[type[float], cr] call[.transform, parameter[member[.cr], member[.sr], member[.sr], member[.cr], literal[0], literal[0]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[Surface] identifier[rotate] operator[SEP] Keyword[float] identifier[angle] operator[SEP] { Keyword[float] identifier[sr] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[Math] operator[SEP] identifier[sin] operator[SEP] identifier[angle] operator[SEP] operator[SEP] Keyword[float] identifier[cr] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[Math] operator[SEP] identifier[cos] operator[SEP] identifier[angle] operator[SEP] operator[SEP] identifier[transform] operator[SEP] identifier[cr] , identifier[sr] , operator[-] identifier[sr] , identifier[cr] , Other[0] , Other[0] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public void delete(String resourceGroupName, String serviceEndpointPolicyName, String serviceEndpointPolicyDefinitionName) { deleteWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName).toBlocking().last().body(); }
class class_name[name] begin[{] method[delete, return_type[void], modifier[public], parameter[resourceGroupName, serviceEndpointPolicyName, serviceEndpointPolicyDefinitionName]] begin[{] call[.deleteWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.serviceEndpointPolicyName], member[.serviceEndpointPolicyDefinitionName]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[delete] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[serviceEndpointPolicyName] , identifier[String] identifier[serviceEndpointPolicyDefinitionName] operator[SEP] { identifier[deleteWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[serviceEndpointPolicyName] , identifier[serviceEndpointPolicyDefinitionName] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[last] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] }
private float[] getData40(RandomAccessFile raf, Grib2Drs.Type40 gdrs) throws IOException { // 6-xx jpeg2000 data block to decode // dataPoints are number of points encoded, it could be less than the // totalNPoints in the grid record if bitMap is used, otherwise equal //int dataPoints = drs.getDataPoints(); int nb = gdrs.numberOfBits; int D = gdrs.decimalScaleFactor; float DD = (float) java.lang.Math.pow((double) 10, (double) D); float R = gdrs.referenceValue; int E = gdrs.binaryScaleFactor; float EE = (float) java.lang.Math.pow(2.0, (double) E); float ref_val = R / DD; Grib2JpegDecoder g2j = null; // try { if (nb != 0) { // there's data to decode g2j = new Grib2JpegDecoder(nb, false); byte[] buf = new byte[dataLength - 5]; raf.readFully(buf); g2j.decode(buf); gdrs.hasSignedProblem = g2j.hasSignedProblem(); } float[] result = new float[totalNPoints]; // no data to decode, set to reference value if (nb == 0) { for (int i = 0; i < dataNPoints; i++) { result[i] = ref_val; } return result; } int[] idata = g2j.getGdata(); if (bitmap == null) { // must be one decoded value in idata for every expected data point if (idata.length != dataNPoints) { logger.debug("Number of points in the data record {} != {} expected from GDS", idata.length, dataNPoints); throw new IllegalStateException( "Number of points in the data record {} != expected from GDS"); } for (int i = 0; i < dataNPoints; i++) { // Y * 10^D = R + (X1 + X2) * 2^E ; // regulation 92.9.4 // Y = (R + ( 0 + X2) * EE)/DD ; result[i] = (R + idata[i] * EE) / DD; } return result; } else { // use bitmap to skip missing values for (int i = 0, j = 0; i < totalNPoints; i++) { if (GribNumbers.testBitIsSet(bitmap[i / 8], i % 8)) { if (j >= idata.length) { logger.warn("HEY jj2000 data count %d < bitmask count %d, i=%d, totalNPoints=%d%n", idata.length, j, i, totalNPoints); break; } int indata = idata[j]; result[i] = (R + indata * EE) / DD; j++; } else { result[i] = staticMissingValue; } } } return result; /* } catch (NullPointerException npe) { logger.error("Grib2DataReader2.jpeg2000Unpacking: bit rate too small nb =" + nb + " for file" + raf.getLocation()); float[] data = new float[dataNPoints]; for (int i = 0; i < dataNPoints; i++) { data[i] = staticMissingValue; // LOOK ?? } return data; } */ }
class class_name[name] begin[{] method[getData40, return_type[type[float]], modifier[private], parameter[raf, gdrs]] begin[{] local_variable[type[int], nb] local_variable[type[int], D] local_variable[type[float], DD] local_variable[type[float], R] local_variable[type[int], E] local_variable[type[float], EE] local_variable[type[float], ref_val] local_variable[type[Grib2JpegDecoder], g2j] if[binary_operation[member[.nb], !=, literal[0]]] begin[{] assign[member[.g2j], ClassCreator(arguments=[MemberReference(member=nb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Grib2JpegDecoder, sub_type=None))] local_variable[type[byte], buf] call[raf.readFully, parameter[member[.buf]]] call[g2j.decode, parameter[member[.buf]]] assign[member[gdrs.hasSignedProblem], call[g2j.hasSignedProblem, parameter[]]] else begin[{] None end[}] local_variable[type[float], result] if[binary_operation[member[.nb], ==, literal[0]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=ref_val, 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=dataNPoints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.result]] else begin[{] None end[}] local_variable[type[int], idata] if[binary_operation[member[.bitmap], ==, literal[null]]] begin[{] if[binary_operation[member[idata.length], !=, member[.dataNPoints]]] begin[{] call[logger.debug, parameter[literal["Number of points in the data record {} != {} expected from GDS"], member[idata.length], member[.dataNPoints]]] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Number of points in the data record {} != expected from GDS")], 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[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=R, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=idata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=EE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), operandr=MemberReference(member=DD, 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=dataNPoints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.result]] else begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=bitmap, 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=8), operator=/))]), BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=%)], member=testBitIsSet, postfix_operators=[], prefix_operators=[], qualifier=GribNumbers, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=staticMissingValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=idata, 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="HEY jj2000 data count %d < bitmask count %d, i=%d, totalNPoints=%d%n"), MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=idata, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=totalNPoints, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=idata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=indata)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=R, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=indata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=EE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operator=+), operandr=MemberReference(member=DD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/)), label=None), StatementExpression(expression=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=totalNPoints, 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), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) end[}] return[member[.result]] end[}] END[}]
Keyword[private] Keyword[float] operator[SEP] operator[SEP] identifier[getData40] operator[SEP] identifier[RandomAccessFile] identifier[raf] , identifier[Grib2Drs] operator[SEP] identifier[Type40] identifier[gdrs] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[int] identifier[nb] operator[=] identifier[gdrs] operator[SEP] identifier[numberOfBits] operator[SEP] Keyword[int] identifier[D] operator[=] identifier[gdrs] operator[SEP] identifier[decimalScaleFactor] operator[SEP] Keyword[float] identifier[DD] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] operator[SEP] Keyword[double] operator[SEP] Other[10] , operator[SEP] Keyword[double] operator[SEP] identifier[D] operator[SEP] operator[SEP] Keyword[float] identifier[R] operator[=] identifier[gdrs] operator[SEP] identifier[referenceValue] operator[SEP] Keyword[int] identifier[E] operator[=] identifier[gdrs] operator[SEP] identifier[binaryScaleFactor] operator[SEP] Keyword[float] identifier[EE] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Math] operator[SEP] identifier[pow] operator[SEP] literal[Float] , operator[SEP] Keyword[double] operator[SEP] identifier[E] operator[SEP] operator[SEP] Keyword[float] identifier[ref_val] operator[=] identifier[R] operator[/] identifier[DD] operator[SEP] identifier[Grib2JpegDecoder] identifier[g2j] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[nb] operator[!=] Other[0] operator[SEP] { identifier[g2j] operator[=] Keyword[new] identifier[Grib2JpegDecoder] operator[SEP] identifier[nb] , literal[boolean] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[dataLength] operator[-] Other[5] operator[SEP] operator[SEP] identifier[raf] operator[SEP] identifier[readFully] operator[SEP] identifier[buf] operator[SEP] operator[SEP] identifier[g2j] operator[SEP] identifier[decode] operator[SEP] identifier[buf] operator[SEP] operator[SEP] identifier[gdrs] operator[SEP] identifier[hasSignedProblem] operator[=] identifier[g2j] operator[SEP] identifier[hasSignedProblem] operator[SEP] operator[SEP] operator[SEP] } Keyword[float] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] Keyword[float] operator[SEP] identifier[totalNPoints] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nb] operator[==] Other[0] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dataNPoints] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[ref_val] operator[SEP] } Keyword[return] identifier[result] operator[SEP] } Keyword[int] operator[SEP] operator[SEP] identifier[idata] operator[=] identifier[g2j] operator[SEP] identifier[getGdata] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bitmap] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[idata] operator[SEP] identifier[length] operator[!=] identifier[dataNPoints] operator[SEP] { identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[idata] operator[SEP] identifier[length] , identifier[dataNPoints] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[dataNPoints] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[R] operator[+] identifier[idata] operator[SEP] identifier[i] operator[SEP] operator[*] identifier[EE] operator[SEP] operator[/] identifier[DD] operator[SEP] } Keyword[return] identifier[result] operator[SEP] } Keyword[else] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[j] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[totalNPoints] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[GribNumbers] operator[SEP] identifier[testBitIsSet] operator[SEP] identifier[bitmap] operator[SEP] identifier[i] operator[/] Other[8] operator[SEP] , identifier[i] operator[%] Other[8] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[j] operator[>=] identifier[idata] operator[SEP] identifier[length] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] , identifier[idata] operator[SEP] identifier[length] , identifier[j] , identifier[i] , identifier[totalNPoints] operator[SEP] operator[SEP] Keyword[break] operator[SEP] } Keyword[int] identifier[indata] operator[=] identifier[idata] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[R] operator[+] identifier[indata] operator[*] identifier[EE] operator[SEP] operator[/] identifier[DD] operator[SEP] identifier[j] operator[++] operator[SEP] } Keyword[else] { identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[staticMissingValue] operator[SEP] } } } Keyword[return] identifier[result] operator[SEP] }
public boolean hasMoreMessages() { if (!rqueue.isEmpty()) { return true; } else { synchronized (omap) { Iterator<TapStream> itr = omap.keySet().iterator(); while (itr.hasNext()) { TapStream ts = itr.next(); if (ts.isCompleted() || ts.isCancelled() || ts.hasErrored()) { omap.get(ts).shutdown(); omap.remove(ts); } } if (omap.size() > 0) { return true; } } } return false; }
class class_name[name] begin[{] method[hasMoreMessages, return_type[type[boolean]], modifier[public], parameter[]] begin[{] if[call[rqueue.isEmpty, parameter[]]] begin[{] return[literal[true]] else begin[{] SYNCHRONIZED[member[.omap]] BEGIN[{] local_variable[type[Iterator], itr] while[call[itr.hasNext, parameter[]]] begin[{] local_variable[type[TapStream], ts] if[binary_operation[binary_operation[call[ts.isCompleted, parameter[]], ||, call[ts.isCancelled, parameter[]]], ||, call[ts.hasErrored, parameter[]]]] begin[{] call[omap.get, parameter[member[.ts]]] call[omap.remove, parameter[member[.ts]]] else begin[{] None end[}] end[}] if[binary_operation[call[omap.size, parameter[]], >, literal[0]]] begin[{] return[literal[true]] else begin[{] None end[}] END[}] end[}] return[literal[false]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[hasMoreMessages] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[rqueue] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { Keyword[synchronized] operator[SEP] identifier[omap] operator[SEP] { identifier[Iterator] operator[<] identifier[TapStream] operator[>] identifier[itr] operator[=] identifier[omap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[itr] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[TapStream] identifier[ts] operator[=] identifier[itr] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ts] operator[SEP] identifier[isCompleted] operator[SEP] operator[SEP] operator[||] identifier[ts] operator[SEP] identifier[isCancelled] operator[SEP] operator[SEP] operator[||] identifier[ts] operator[SEP] identifier[hasErrored] operator[SEP] operator[SEP] operator[SEP] { identifier[omap] operator[SEP] identifier[get] operator[SEP] identifier[ts] operator[SEP] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] identifier[omap] operator[SEP] identifier[remove] operator[SEP] identifier[ts] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[omap] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } } Keyword[return] literal[boolean] operator[SEP] }
private static ClusterConfig config(String[] resources, ClassLoader classLoader) { return new ConfigMapper(classLoader).loadResources(ClusterConfig.class, resources); }
class class_name[name] begin[{] method[config, return_type[type[ClusterConfig]], modifier[private static], parameter[resources, classLoader]] begin[{] return[ClassCreator(arguments=[MemberReference(member=classLoader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClusterConfig, sub_type=None)), MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadResources, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ConfigMapper, sub_type=None))] end[}] END[}]
Keyword[private] Keyword[static] identifier[ClusterConfig] identifier[config] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[resources] , identifier[ClassLoader] identifier[classLoader] operator[SEP] { Keyword[return] Keyword[new] identifier[ConfigMapper] operator[SEP] identifier[classLoader] operator[SEP] operator[SEP] identifier[loadResources] operator[SEP] identifier[ClusterConfig] operator[SEP] Keyword[class] , identifier[resources] operator[SEP] operator[SEP] }
public static void setDnsCache(String host, String... ips) { try { InetAddressCacheUtil.setInetAddressCache(host, ips, NEVER_EXPIRATION); } catch (Exception e) { final String message = String.format("Fail to setDnsCache for host %s ip %s, cause: %s", host, Arrays.toString(ips), e.toString()); throw new DnsCacheManipulatorException(message, e); } }
class class_name[name] begin[{] method[setDnsCache, return_type[void], modifier[public static], parameter[host, ips]] begin[{] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ips, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=NEVER_EXPIRATION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setInetAddressCache, postfix_operators=[], prefix_operators=[], qualifier=InetAddressCacheUtil, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Fail to setDnsCache for host %s ip %s, cause: %s"), MemberReference(member=host, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=ips, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Arrays, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), name=message)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=message, 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=DnsCacheManipulatorException, 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[static] Keyword[void] identifier[setDnsCache] operator[SEP] identifier[String] identifier[host] , identifier[String] operator[...] identifier[ips] operator[SEP] { Keyword[try] { identifier[InetAddressCacheUtil] operator[SEP] identifier[setInetAddressCache] operator[SEP] identifier[host] , identifier[ips] , identifier[NEVER_EXPIRATION] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[final] identifier[String] identifier[message] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[host] , identifier[Arrays] operator[SEP] identifier[toString] operator[SEP] identifier[ips] operator[SEP] , identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[DnsCacheManipulatorException] operator[SEP] identifier[message] , identifier[e] operator[SEP] operator[SEP] } }
@Override public void error(final MessageItem messageItem, final Throwable t) { getLogger().error(messageItem.getMarker(), messageItem.getText(), t); throwError(messageItem, t); }
class class_name[name] begin[{] method[error, return_type[void], modifier[public], parameter[messageItem, t]] begin[{] call[.getLogger, parameter[]] call[.throwError, parameter[member[.messageItem], member[.t]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[error] operator[SEP] Keyword[final] identifier[MessageItem] identifier[messageItem] , Keyword[final] identifier[Throwable] identifier[t] operator[SEP] { identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] identifier[messageItem] operator[SEP] identifier[getMarker] operator[SEP] operator[SEP] , identifier[messageItem] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , identifier[t] operator[SEP] operator[SEP] identifier[throwError] operator[SEP] identifier[messageItem] , identifier[t] operator[SEP] operator[SEP] }
public void setIntProperty( String key , int value ) { settings.setProperty(key, String.valueOf(value)); }
class class_name[name] begin[{] method[setIntProperty, return_type[void], modifier[public], parameter[key, value]] begin[{] call[settings.setProperty, parameter[member[.key], call[String.valueOf, parameter[member[.value]]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setIntProperty] operator[SEP] identifier[String] identifier[key] , Keyword[int] identifier[value] operator[SEP] { identifier[settings] operator[SEP] identifier[setProperty] operator[SEP] identifier[key] , identifier[String] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] }
public TwoPhaseMove prepareMove(Path src, Path dst) throws FileAlreadyExistsException { return new TwoPhaseMove(src, dst); }
class class_name[name] begin[{] method[prepareMove, return_type[type[TwoPhaseMove]], modifier[public], parameter[src, dst]] begin[{] return[ClassCreator(arguments=[MemberReference(member=src, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dst, 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=TwoPhaseMove, sub_type=None))] end[}] END[}]
Keyword[public] identifier[TwoPhaseMove] identifier[prepareMove] operator[SEP] identifier[Path] identifier[src] , identifier[Path] identifier[dst] operator[SEP] Keyword[throws] identifier[FileAlreadyExistsException] { Keyword[return] Keyword[new] identifier[TwoPhaseMove] operator[SEP] identifier[src] , identifier[dst] operator[SEP] operator[SEP] }
@Override public boolean isSameFile(FileObject a, FileObject b) { return stdFileManager.isSameFile(b, b); }
class class_name[name] begin[{] method[isSameFile, return_type[type[boolean]], modifier[public], parameter[a, b]] begin[{] return[call[stdFileManager.isSameFile, parameter[member[.b], member[.b]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[isSameFile] operator[SEP] identifier[FileObject] identifier[a] , identifier[FileObject] identifier[b] operator[SEP] { Keyword[return] identifier[stdFileManager] operator[SEP] identifier[isSameFile] operator[SEP] identifier[b] , identifier[b] operator[SEP] operator[SEP] }
public CmsUploadProgessInfo getInfo() { if (m_finished) { return new CmsUploadProgessInfo( getItem(), (int)getPercent(), UPLOAD_STATE.finished, getContentLength(), getBytesRead()); } return new CmsUploadProgessInfo( getItem(), (int)getPercent(), UPLOAD_STATE.running, getContentLength(), getBytesRead()); }
class class_name[name] begin[{] method[getInfo, return_type[type[CmsUploadProgessInfo]], modifier[public], parameter[]] begin[{] if[member[.m_finished]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MethodInvocation(arguments=[], member=getPercent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), MemberReference(member=finished, postfix_operators=[], prefix_operators=[], qualifier=UPLOAD_STATE, selectors=[]), MethodInvocation(arguments=[], member=getContentLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getBytesRead, 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=CmsUploadProgessInfo, sub_type=None))] else begin[{] None end[}] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getItem, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), Cast(expression=MethodInvocation(arguments=[], member=getPercent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), MemberReference(member=running, postfix_operators=[], prefix_operators=[], qualifier=UPLOAD_STATE, selectors=[]), MethodInvocation(arguments=[], member=getContentLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getBytesRead, 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=CmsUploadProgessInfo, sub_type=None))] end[}] END[}]
Keyword[public] identifier[CmsUploadProgessInfo] identifier[getInfo] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[m_finished] operator[SEP] { Keyword[return] Keyword[new] identifier[CmsUploadProgessInfo] operator[SEP] identifier[getItem] operator[SEP] operator[SEP] , operator[SEP] Keyword[int] operator[SEP] identifier[getPercent] operator[SEP] operator[SEP] , identifier[UPLOAD_STATE] operator[SEP] identifier[finished] , identifier[getContentLength] operator[SEP] operator[SEP] , identifier[getBytesRead] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[new] identifier[CmsUploadProgessInfo] operator[SEP] identifier[getItem] operator[SEP] operator[SEP] , operator[SEP] Keyword[int] operator[SEP] identifier[getPercent] operator[SEP] operator[SEP] , identifier[UPLOAD_STATE] operator[SEP] identifier[running] , identifier[getContentLength] operator[SEP] operator[SEP] , identifier[getBytesRead] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void setupSFields() { this.getRecord(MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE).getField(MessageLogScreenRecord.CONTACT_TYPE_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE).getField(MessageLogScreenRecord.CONTACT_ID).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE).getField(MessageLogScreenRecord.MESSAGE_INFO_TYPE_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE).getField(MessageLogScreenRecord.MESSAGE_TYPE_ID).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE).getField(MessageLogScreenRecord.MESSAGE_STATUS_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE).getField(MessageLogScreenRecord.MESSAGE_TRANSPORT_ID).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE).getField(MessageLogScreenRecord.USER_ID).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE).getField(MessageLogScreenRecord.START_DATE).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE).getField(MessageLogScreenRecord.END_DATE).setupDefaultView(this.getNextLocation(ScreenConstants.RIGHT_WITH_DESC, ScreenConstants.DONT_SET_ANCHOR), this, ScreenConstants.DEFAULT_DISPLAY); }
class class_name[name] begin[{] method[setupSFields, return_type[void], modifier[public], parameter[]] begin[{] THIS[call[None.getRecord, parameter[member[MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE]]]call[None.getField, parameter[member[MessageLogScreenRecord.CONTACT_TYPE_ID]]]call[None.setupDefaultView, parameter[THIS[call[None.getNextLocation, parameter[member[ScreenConstants.NEXT_LOGICAL], member[ScreenConstants.ANCHOR_DEFAULT]]]], THIS[], member[ScreenConstants.DEFAULT_DISPLAY]]]] THIS[call[None.getRecord, parameter[member[MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE]]]call[None.getField, parameter[member[MessageLogScreenRecord.CONTACT_ID]]]call[None.setupDefaultView, parameter[THIS[call[None.getNextLocation, parameter[member[ScreenConstants.RIGHT_WITH_DESC], member[ScreenConstants.DONT_SET_ANCHOR]]]], THIS[], member[ScreenConstants.DEFAULT_DISPLAY]]]] THIS[call[None.getRecord, parameter[member[MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE]]]call[None.getField, parameter[member[MessageLogScreenRecord.MESSAGE_INFO_TYPE_ID]]]call[None.setupDefaultView, parameter[THIS[call[None.getNextLocation, parameter[member[ScreenConstants.NEXT_LOGICAL], member[ScreenConstants.ANCHOR_DEFAULT]]]], THIS[], member[ScreenConstants.DEFAULT_DISPLAY]]]] THIS[call[None.getRecord, parameter[member[MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE]]]call[None.getField, parameter[member[MessageLogScreenRecord.MESSAGE_TYPE_ID]]]call[None.setupDefaultView, parameter[THIS[call[None.getNextLocation, parameter[member[ScreenConstants.RIGHT_WITH_DESC], member[ScreenConstants.DONT_SET_ANCHOR]]]], THIS[], member[ScreenConstants.DEFAULT_DISPLAY]]]] THIS[call[None.getRecord, parameter[member[MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE]]]call[None.getField, parameter[member[MessageLogScreenRecord.MESSAGE_STATUS_ID]]]call[None.setupDefaultView, parameter[THIS[call[None.getNextLocation, parameter[member[ScreenConstants.NEXT_LOGICAL], member[ScreenConstants.ANCHOR_DEFAULT]]]], THIS[], member[ScreenConstants.DEFAULT_DISPLAY]]]] THIS[call[None.getRecord, parameter[member[MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE]]]call[None.getField, parameter[member[MessageLogScreenRecord.MESSAGE_TRANSPORT_ID]]]call[None.setupDefaultView, parameter[THIS[call[None.getNextLocation, parameter[member[ScreenConstants.RIGHT_WITH_DESC], member[ScreenConstants.DONT_SET_ANCHOR]]]], THIS[], member[ScreenConstants.DEFAULT_DISPLAY]]]] THIS[call[None.getRecord, parameter[member[MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE]]]call[None.getField, parameter[member[MessageLogScreenRecord.USER_ID]]]call[None.setupDefaultView, parameter[THIS[call[None.getNextLocation, parameter[member[ScreenConstants.NEXT_LOGICAL], member[ScreenConstants.ANCHOR_DEFAULT]]]], THIS[], member[ScreenConstants.DEFAULT_DISPLAY]]]] THIS[call[None.getRecord, parameter[member[MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE]]]call[None.getField, parameter[member[MessageLogScreenRecord.START_DATE]]]call[None.setupDefaultView, parameter[THIS[call[None.getNextLocation, parameter[member[ScreenConstants.NEXT_LOGICAL], member[ScreenConstants.ANCHOR_DEFAULT]]]], THIS[], member[ScreenConstants.DEFAULT_DISPLAY]]]] THIS[call[None.getRecord, parameter[member[MessageLogScreenRecord.MESSAGE_LOG_SCREEN_RECORD_FILE]]]call[None.getField, parameter[member[MessageLogScreenRecord.END_DATE]]]call[None.setupDefaultView, parameter[THIS[call[None.getNextLocation, parameter[member[ScreenConstants.RIGHT_WITH_DESC], member[ScreenConstants.DONT_SET_ANCHOR]]]], THIS[], member[ScreenConstants.DEFAULT_DISPLAY]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setupSFields] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_LOG_SCREEN_RECORD_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[CONTACT_TYPE_ID] operator[SEP] operator[SEP] identifier[setupDefaultView] operator[SEP] Keyword[this] operator[SEP] identifier[getNextLocation] operator[SEP] identifier[ScreenConstants] operator[SEP] identifier[NEXT_LOGICAL] , identifier[ScreenConstants] operator[SEP] identifier[ANCHOR_DEFAULT] operator[SEP] , Keyword[this] , identifier[ScreenConstants] operator[SEP] identifier[DEFAULT_DISPLAY] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_LOG_SCREEN_RECORD_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[CONTACT_ID] operator[SEP] operator[SEP] identifier[setupDefaultView] operator[SEP] Keyword[this] operator[SEP] identifier[getNextLocation] operator[SEP] identifier[ScreenConstants] operator[SEP] identifier[RIGHT_WITH_DESC] , identifier[ScreenConstants] operator[SEP] identifier[DONT_SET_ANCHOR] operator[SEP] , Keyword[this] , identifier[ScreenConstants] operator[SEP] identifier[DEFAULT_DISPLAY] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_LOG_SCREEN_RECORD_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_INFO_TYPE_ID] operator[SEP] operator[SEP] identifier[setupDefaultView] operator[SEP] Keyword[this] operator[SEP] identifier[getNextLocation] operator[SEP] identifier[ScreenConstants] operator[SEP] identifier[NEXT_LOGICAL] , identifier[ScreenConstants] operator[SEP] identifier[ANCHOR_DEFAULT] operator[SEP] , Keyword[this] , identifier[ScreenConstants] operator[SEP] identifier[DEFAULT_DISPLAY] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_LOG_SCREEN_RECORD_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_TYPE_ID] operator[SEP] operator[SEP] identifier[setupDefaultView] operator[SEP] Keyword[this] operator[SEP] identifier[getNextLocation] operator[SEP] identifier[ScreenConstants] operator[SEP] identifier[RIGHT_WITH_DESC] , identifier[ScreenConstants] operator[SEP] identifier[DONT_SET_ANCHOR] operator[SEP] , Keyword[this] , identifier[ScreenConstants] operator[SEP] identifier[DEFAULT_DISPLAY] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_LOG_SCREEN_RECORD_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_STATUS_ID] operator[SEP] operator[SEP] identifier[setupDefaultView] operator[SEP] Keyword[this] operator[SEP] identifier[getNextLocation] operator[SEP] identifier[ScreenConstants] operator[SEP] identifier[NEXT_LOGICAL] , identifier[ScreenConstants] operator[SEP] identifier[ANCHOR_DEFAULT] operator[SEP] , Keyword[this] , identifier[ScreenConstants] operator[SEP] identifier[DEFAULT_DISPLAY] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_LOG_SCREEN_RECORD_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_TRANSPORT_ID] operator[SEP] operator[SEP] identifier[setupDefaultView] operator[SEP] Keyword[this] operator[SEP] identifier[getNextLocation] operator[SEP] identifier[ScreenConstants] operator[SEP] identifier[RIGHT_WITH_DESC] , identifier[ScreenConstants] operator[SEP] identifier[DONT_SET_ANCHOR] operator[SEP] , Keyword[this] , identifier[ScreenConstants] operator[SEP] identifier[DEFAULT_DISPLAY] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_LOG_SCREEN_RECORD_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[USER_ID] operator[SEP] operator[SEP] identifier[setupDefaultView] operator[SEP] Keyword[this] operator[SEP] identifier[getNextLocation] operator[SEP] identifier[ScreenConstants] operator[SEP] identifier[NEXT_LOGICAL] , identifier[ScreenConstants] operator[SEP] identifier[ANCHOR_DEFAULT] operator[SEP] , Keyword[this] , identifier[ScreenConstants] operator[SEP] identifier[DEFAULT_DISPLAY] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_LOG_SCREEN_RECORD_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[START_DATE] operator[SEP] operator[SEP] identifier[setupDefaultView] operator[SEP] Keyword[this] operator[SEP] identifier[getNextLocation] operator[SEP] identifier[ScreenConstants] operator[SEP] identifier[NEXT_LOGICAL] , identifier[ScreenConstants] operator[SEP] identifier[ANCHOR_DEFAULT] operator[SEP] , Keyword[this] , identifier[ScreenConstants] operator[SEP] identifier[DEFAULT_DISPLAY] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[MESSAGE_LOG_SCREEN_RECORD_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[MessageLogScreenRecord] operator[SEP] identifier[END_DATE] operator[SEP] operator[SEP] identifier[setupDefaultView] operator[SEP] Keyword[this] operator[SEP] identifier[getNextLocation] operator[SEP] identifier[ScreenConstants] operator[SEP] identifier[RIGHT_WITH_DESC] , identifier[ScreenConstants] operator[SEP] identifier[DONT_SET_ANCHOR] operator[SEP] , Keyword[this] , identifier[ScreenConstants] operator[SEP] identifier[DEFAULT_DISPLAY] operator[SEP] operator[SEP] }
public static String getTrustManagerFactoryAlgorithm() { if (trustManagerFactoryAlgorithm == null) { trustManagerFactoryAlgorithm = AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return Security.getProperty("ssl.TrustManagerFactory.algorithm"); } }); } return trustManagerFactoryAlgorithm; }
class class_name[name] begin[{] method[getTrustManagerFactoryAlgorithm, return_type[type[String]], modifier[public static], parameter[]] begin[{] if[binary_operation[member[.trustManagerFactoryAlgorithm], ==, literal[null]]] begin[{] assign[member[.trustManagerFactoryAlgorithm], call[AccessController.doPrivileged, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ssl.TrustManagerFactory.algorithm")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=Security, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=PrivilegedAction, sub_type=None))]]] else begin[{] None end[}] return[member[.trustManagerFactoryAlgorithm]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getTrustManagerFactoryAlgorithm] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[trustManagerFactoryAlgorithm] operator[==] Other[null] operator[SEP] { identifier[trustManagerFactoryAlgorithm] operator[=] identifier[AccessController] operator[SEP] identifier[doPrivileged] operator[SEP] Keyword[new] identifier[PrivilegedAction] operator[<] identifier[String] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[run] operator[SEP] operator[SEP] { Keyword[return] identifier[Security] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] } Keyword[return] identifier[trustManagerFactoryAlgorithm] operator[SEP] }
private Operation createOperation(List<Data> keyValueSequence) { NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); MapOperationProvider operationProvider = mapServiceContext.getMapOperationProvider(name); MapOperation operation = operationProvider.createPutFromLoadAllOperation(name, keyValueSequence); operation.setNodeEngine(nodeEngine); operation.setPartitionId(partitionId); OperationAccessor.setCallerAddress(operation, nodeEngine.getThisAddress()); operation.setCallerUuid(nodeEngine.getLocalMember().getUuid()); operation.setServiceName(MapService.SERVICE_NAME); return operation; }
class class_name[name] begin[{] method[createOperation, return_type[type[Operation]], modifier[private], parameter[keyValueSequence]] begin[{] local_variable[type[NodeEngine], nodeEngine] local_variable[type[MapOperationProvider], operationProvider] local_variable[type[MapOperation], operation] call[operation.setNodeEngine, parameter[member[.nodeEngine]]] call[operation.setPartitionId, parameter[member[.partitionId]]] call[OperationAccessor.setCallerAddress, parameter[member[.operation], call[nodeEngine.getThisAddress, parameter[]]]] call[operation.setCallerUuid, parameter[call[nodeEngine.getLocalMember, parameter[]]]] call[operation.setServiceName, parameter[member[MapService.SERVICE_NAME]]] return[member[.operation]] end[}] END[}]
Keyword[private] identifier[Operation] identifier[createOperation] operator[SEP] identifier[List] operator[<] identifier[Data] operator[>] identifier[keyValueSequence] operator[SEP] { identifier[NodeEngine] identifier[nodeEngine] operator[=] identifier[mapServiceContext] operator[SEP] identifier[getNodeEngine] operator[SEP] operator[SEP] operator[SEP] identifier[MapOperationProvider] identifier[operationProvider] operator[=] identifier[mapServiceContext] operator[SEP] identifier[getMapOperationProvider] operator[SEP] identifier[name] operator[SEP] operator[SEP] identifier[MapOperation] identifier[operation] operator[=] identifier[operationProvider] operator[SEP] identifier[createPutFromLoadAllOperation] operator[SEP] identifier[name] , identifier[keyValueSequence] operator[SEP] operator[SEP] identifier[operation] operator[SEP] identifier[setNodeEngine] operator[SEP] identifier[nodeEngine] operator[SEP] operator[SEP] identifier[operation] operator[SEP] identifier[setPartitionId] operator[SEP] identifier[partitionId] operator[SEP] operator[SEP] identifier[OperationAccessor] operator[SEP] identifier[setCallerAddress] operator[SEP] identifier[operation] , identifier[nodeEngine] operator[SEP] identifier[getThisAddress] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[operation] operator[SEP] identifier[setCallerUuid] operator[SEP] identifier[nodeEngine] operator[SEP] identifier[getLocalMember] operator[SEP] operator[SEP] operator[SEP] identifier[getUuid] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[operation] operator[SEP] identifier[setServiceName] operator[SEP] identifier[MapService] operator[SEP] identifier[SERVICE_NAME] operator[SEP] operator[SEP] Keyword[return] identifier[operation] operator[SEP] }
public ResultSet getSchemas(final String catalog, final String schemaPattern) throws SQLException { return RowLists.rowList2(String.class, String.class). withLabel(1, "TABLE_SCHEM"). withLabel(2, "TABLE_CATALOG"). resultSet(); }
class class_name[name] begin[{] method[getSchemas, return_type[type[ResultSet]], modifier[public], parameter[catalog, schemaPattern]] begin[{] return[call[RowLists.rowList2, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[ResultSet] identifier[getSchemas] operator[SEP] Keyword[final] identifier[String] identifier[catalog] , Keyword[final] identifier[String] identifier[schemaPattern] operator[SEP] Keyword[throws] identifier[SQLException] { Keyword[return] identifier[RowLists] operator[SEP] identifier[rowList2] operator[SEP] identifier[String] operator[SEP] Keyword[class] , identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[withLabel] operator[SEP] Other[1] , literal[String] operator[SEP] operator[SEP] identifier[withLabel] operator[SEP] Other[2] , literal[String] operator[SEP] operator[SEP] identifier[resultSet] operator[SEP] operator[SEP] operator[SEP] }
public static void main(String[] args) { if (args.length != 0) { LOG.info("java -cp {} {}", RuntimeConstants.ALLUXIO_JAR, AlluxioWorker.class.getCanonicalName()); System.exit(-1); } if (!ConfigurationUtils.masterHostConfigured(ServerConfiguration.global())) { ProcessUtils.fatalError(LOG, ConfigurationUtils.getMasterHostNotConfiguredMessage("Alluxio worker")); } CommonUtils.PROCESS_TYPE.set(CommonUtils.ProcessType.WORKER); MasterInquireClient masterInquireClient = MasterInquireClient.Factory.create(ServerConfiguration.global()); try { RetryUtils.retry("load cluster default configuration with master", () -> { InetSocketAddress masterAddress = masterInquireClient.getPrimaryRpcAddress(); ServerConfiguration.loadClusterDefaults(masterAddress); }, RetryUtils.defaultWorkerMasterClientRetry( ServerConfiguration.getDuration(PropertyKey.WORKER_MASTER_CONNECT_RETRY_TIMEOUT))); } catch (IOException e) { ProcessUtils.fatalError(LOG, "Failed to load cluster default configuration for worker: %s", e.getMessage()); } WorkerProcess process = WorkerProcess.Factory.create(); ProcessUtils.run(process); }
class class_name[name] begin[{] method[main, return_type[void], modifier[public static], parameter[args]] begin[{] if[binary_operation[member[args.length], !=, literal[0]]] begin[{] call[LOG.info, parameter[literal["java -cp {} {}"], member[RuntimeConstants.ALLUXIO_JAR], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getCanonicalName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=AlluxioWorker, sub_type=None))]] call[System.exit, parameter[literal[1]]] else begin[{] None end[}] if[call[ConfigurationUtils.masterHostConfigured, parameter[call[ServerConfiguration.global, parameter[]]]]] begin[{] call[ProcessUtils.fatalError, parameter[member[.LOG], call[ConfigurationUtils.getMasterHostNotConfiguredMessage, parameter[literal["Alluxio worker"]]]]] else begin[{] None end[}] call[CommonUtils.PROCESS_TYPE.set, parameter[member[CommonUtils.ProcessType.WORKER]]] local_variable[type[MasterInquireClient], masterInquireClient] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="load cluster default configuration with master"), LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPrimaryRpcAddress, postfix_operators=[], prefix_operators=[], qualifier=masterInquireClient, selectors=[], type_arguments=None), name=masterAddress)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InetSocketAddress, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=masterAddress, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClusterDefaults, postfix_operators=[], prefix_operators=[], qualifier=ServerConfiguration, selectors=[], type_arguments=None), label=None)], parameters=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=WORKER_MASTER_CONNECT_RETRY_TIMEOUT, postfix_operators=[], prefix_operators=[], qualifier=PropertyKey, selectors=[])], member=getDuration, postfix_operators=[], prefix_operators=[], qualifier=ServerConfiguration, selectors=[], type_arguments=None)], member=defaultWorkerMasterClientRetry, postfix_operators=[], prefix_operators=[], qualifier=RetryUtils, selectors=[], type_arguments=None)], member=retry, postfix_operators=[], prefix_operators=[], qualifier=RetryUtils, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=LOG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to load cluster default configuration for worker: %s"), MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=fatalError, postfix_operators=[], prefix_operators=[], qualifier=ProcessUtils, 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) local_variable[type[WorkerProcess], process] call[ProcessUtils.run, parameter[member[.process]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[!=] Other[0] operator[SEP] { identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[RuntimeConstants] operator[SEP] identifier[ALLUXIO_JAR] , identifier[AlluxioWorker] operator[SEP] Keyword[class] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[exit] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[ConfigurationUtils] operator[SEP] identifier[masterHostConfigured] operator[SEP] identifier[ServerConfiguration] operator[SEP] identifier[global] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[ProcessUtils] operator[SEP] identifier[fatalError] operator[SEP] identifier[LOG] , identifier[ConfigurationUtils] operator[SEP] identifier[getMasterHostNotConfiguredMessage] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } identifier[CommonUtils] operator[SEP] identifier[PROCESS_TYPE] operator[SEP] identifier[set] operator[SEP] identifier[CommonUtils] operator[SEP] identifier[ProcessType] operator[SEP] identifier[WORKER] operator[SEP] operator[SEP] identifier[MasterInquireClient] identifier[masterInquireClient] operator[=] identifier[MasterInquireClient] operator[SEP] identifier[Factory] operator[SEP] identifier[create] operator[SEP] identifier[ServerConfiguration] operator[SEP] identifier[global] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[RetryUtils] operator[SEP] identifier[retry] operator[SEP] literal[String] , operator[SEP] operator[SEP] operator[->] { identifier[InetSocketAddress] identifier[masterAddress] operator[=] identifier[masterInquireClient] operator[SEP] identifier[getPrimaryRpcAddress] operator[SEP] operator[SEP] operator[SEP] identifier[ServerConfiguration] operator[SEP] identifier[loadClusterDefaults] operator[SEP] identifier[masterAddress] operator[SEP] operator[SEP] } , identifier[RetryUtils] operator[SEP] identifier[defaultWorkerMasterClientRetry] operator[SEP] identifier[ServerConfiguration] operator[SEP] identifier[getDuration] operator[SEP] identifier[PropertyKey] operator[SEP] identifier[WORKER_MASTER_CONNECT_RETRY_TIMEOUT] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[ProcessUtils] operator[SEP] identifier[fatalError] operator[SEP] identifier[LOG] , literal[String] , identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[WorkerProcess] identifier[process] operator[=] identifier[WorkerProcess] operator[SEP] identifier[Factory] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[ProcessUtils] operator[SEP] identifier[run] operator[SEP] identifier[process] operator[SEP] operator[SEP] }
public static Calendar parseDateFormat(String s, DateFormat dateFormat, TimeZone tz) { ParsePosition pp = new ParsePosition(0); Calendar ret = parseDateFormat(s, dateFormat, tz, pp); if (pp.getIndex() != s.length()) { // Didn't consume entire string - not good return null; } return ret; }
class class_name[name] begin[{] method[parseDateFormat, return_type[type[Calendar]], modifier[public static], parameter[s, dateFormat, tz]] begin[{] local_variable[type[ParsePosition], pp] local_variable[type[Calendar], ret] if[binary_operation[call[pp.getIndex, parameter[]], !=, call[s.length, parameter[]]]] begin[{] return[literal[null]] else begin[{] None end[}] return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Calendar] identifier[parseDateFormat] operator[SEP] identifier[String] identifier[s] , identifier[DateFormat] identifier[dateFormat] , identifier[TimeZone] identifier[tz] operator[SEP] { identifier[ParsePosition] identifier[pp] operator[=] Keyword[new] identifier[ParsePosition] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[Calendar] identifier[ret] operator[=] identifier[parseDateFormat] operator[SEP] identifier[s] , identifier[dateFormat] , identifier[tz] , identifier[pp] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pp] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[!=] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
private boolean impliesPath0(final String yourName) { // segment-by-segment comparison final String myName = getName(); final Iterator<String> myIter = JndiPermissionNameParser.nameIterator(myName); final Iterator<String> yourIter = JndiPermissionNameParser.nameIterator(yourName); // even if it's just "", there is always a first element assert myIter.hasNext() && yourIter.hasNext(); String myNext; String yourNext; for (;;) { myNext = myIter.next(); yourNext = yourIter.next(); if (myNext.equals("-")) { // "-" implies everything including "" return true; } if (! myNext.equals("*") && ! myNext.equals(yourNext)) { // "foo/bar" does not imply "foo/baz" return false; } if (myIter.hasNext()) { if (! yourIter.hasNext()) { // "foo/bar" does not imply "foo" return false; } } else { // if neither has next, "foo/bar" implies "foo/bar", else "foo" does not imply "foo/bar" return ! yourIter.hasNext(); } } }
class class_name[name] begin[{] method[impliesPath0, return_type[type[boolean]], modifier[private], parameter[yourName]] begin[{] local_variable[type[String], myName] local_variable[type[Iterator], myIter] local_variable[type[Iterator], yourIter] AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=myIter, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=yourIter, selectors=[], type_arguments=None), operator=&&), label=None, value=None) local_variable[type[String], myNext] local_variable[type[String], yourNext] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=myNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=myIter, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=yourNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=yourIter, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="-")], member=equals, postfix_operators=[], prefix_operators=[], qualifier=myNext, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="*")], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=myNext, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=yourNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=['!'], qualifier=myNext, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=myIter, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=['!'], qualifier=yourIter, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=['!'], qualifier=yourIter, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]))]))]), control=ForControl(condition=None, init=None, update=None), label=None) end[}] END[}]
Keyword[private] Keyword[boolean] identifier[impliesPath0] operator[SEP] Keyword[final] identifier[String] identifier[yourName] operator[SEP] { Keyword[final] identifier[String] identifier[myName] operator[=] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[myIter] operator[=] identifier[JndiPermissionNameParser] operator[SEP] identifier[nameIterator] operator[SEP] identifier[myName] operator[SEP] operator[SEP] Keyword[final] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[yourIter] operator[=] identifier[JndiPermissionNameParser] operator[SEP] identifier[nameIterator] operator[SEP] identifier[yourName] operator[SEP] operator[SEP] Keyword[assert] identifier[myIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] identifier[yourIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[myNext] operator[SEP] identifier[String] identifier[yourNext] operator[SEP] Keyword[for] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[myNext] operator[=] identifier[myIter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[yourNext] operator[=] identifier[yourIter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[myNext] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[myNext] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[&&] operator[!] identifier[myNext] operator[SEP] identifier[equals] operator[SEP] identifier[yourNext] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[myIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[yourIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[else] { Keyword[return] operator[!] identifier[yourIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] } } }
public Set<AbstractHtml> getChildren(final Object accessObject) { if (accessObject == null || !(SecurityClassConstants.BROWSER_PAGE .equals(accessObject.getClass().getName()))) { throw new WffSecurityException( "Not allowed to consume this method. This method is for internal use."); } return children; }
class class_name[name] begin[{] method[getChildren, return_type[type[Set]], modifier[public], parameter[accessObject]] begin[{] if[binary_operation[binary_operation[member[.accessObject], ==, literal[null]], ||, call[SecurityClassConstants.BROWSER_PAGE.equals, parameter[call[accessObject.getClass, parameter[]]]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Not allowed to consume this method. This method is for internal use.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WffSecurityException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.children]] end[}] END[}]
Keyword[public] identifier[Set] operator[<] identifier[AbstractHtml] operator[>] identifier[getChildren] operator[SEP] Keyword[final] identifier[Object] identifier[accessObject] operator[SEP] { Keyword[if] operator[SEP] identifier[accessObject] operator[==] Other[null] operator[||] operator[!] operator[SEP] identifier[SecurityClassConstants] operator[SEP] identifier[BROWSER_PAGE] operator[SEP] identifier[equals] operator[SEP] identifier[accessObject] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[WffSecurityException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[children] operator[SEP] }
public void shutdown() { if (executor != null) { executor.shutdown(); executor = null; } if (timer != null) { timer.cancel(); timer = null; } instance = null; }
class class_name[name] begin[{] method[shutdown, return_type[void], modifier[public], parameter[]] begin[{] if[binary_operation[member[.executor], !=, literal[null]]] begin[{] call[executor.shutdown, parameter[]] assign[member[.executor], literal[null]] else begin[{] None end[}] if[binary_operation[member[.timer], !=, literal[null]]] begin[{] call[timer.cancel, parameter[]] assign[member[.timer], literal[null]] else begin[{] None end[}] assign[member[.instance], literal[null]] end[}] END[}]
Keyword[public] Keyword[void] identifier[shutdown] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[executor] operator[!=] Other[null] operator[SEP] { identifier[executor] operator[SEP] identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] identifier[executor] operator[=] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[timer] operator[!=] Other[null] operator[SEP] { identifier[timer] operator[SEP] identifier[cancel] operator[SEP] operator[SEP] operator[SEP] identifier[timer] operator[=] Other[null] operator[SEP] } identifier[instance] operator[=] Other[null] operator[SEP] }
public synchronized Object firstKey(Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "firstKey", new Object[] { transaction }); Entry entry = firstEntry(transaction); Object returnKey = entry.getKey(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "firstKey", new Object[] { returnKey }); return returnKey; }
class class_name[name] begin[{] method[firstKey, return_type[type[Object]], modifier[synchronized public], parameter[transaction]] begin[{] if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{] call[trace.entry, parameter[THIS[], member[.cclass], literal["firstKey"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=transaction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] local_variable[type[Entry], entry] local_variable[type[Object], returnKey] if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{] call[trace.exit, parameter[THIS[], member[.cclass], literal["firstKey"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=returnKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] return[member[.returnKey]] end[}] END[}]
Keyword[public] Keyword[synchronized] identifier[Object] identifier[firstKey] operator[SEP] identifier[Transaction] identifier[transaction] operator[SEP] Keyword[throws] identifier[ObjectManagerException] { Keyword[if] operator[SEP] identifier[Tracing] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[transaction] } operator[SEP] operator[SEP] identifier[Entry] identifier[entry] operator[=] identifier[firstEntry] operator[SEP] identifier[transaction] operator[SEP] operator[SEP] identifier[Object] identifier[returnKey] operator[=] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Tracing] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { identifier[returnKey] } operator[SEP] operator[SEP] Keyword[return] identifier[returnKey] operator[SEP] }
public static String getOutputPart(ProcessOutput processOutput,String prefix) { //get output String output=processOutput.getOutputText(); if(output!=null) { //set flag boolean validOutput=false; int index=output.indexOf(prefix); if(index!=-1) { //get index index=index+prefix.length(); if(output.length()>index) { //get output output=output.substring(index); output=output.trim(); index=output.indexOf("\n"); if(index!=-1) { output=output.substring(0,index); output=output.trim(); } if(output.length()>0) { //set flag validOutput=true; } } } if(!validOutput) { output=null; } } return output; }
class class_name[name] begin[{] method[getOutputPart, return_type[type[String]], modifier[public static], parameter[processOutput, prefix]] begin[{] local_variable[type[String], output] if[binary_operation[member[.output], !=, literal[null]]] begin[{] local_variable[type[boolean], validOutput] local_variable[type[int], index] if[binary_operation[member[.index], !=, literal[1]]] begin[{] assign[member[.index], binary_operation[member[.index], +, call[prefix.length, parameter[]]]] if[binary_operation[call[output.length, parameter[]], >, member[.index]]] begin[{] assign[member[.output], call[output.substring, parameter[member[.index]]]] assign[member[.output], call[output.trim, parameter[]]] assign[member[.index], call[output.indexOf, parameter[literal["\n"]]]] if[binary_operation[member[.index], !=, literal[1]]] begin[{] assign[member[.output], call[output.substring, parameter[literal[0], member[.index]]]] assign[member[.output], call[output.trim, parameter[]]] else begin[{] None end[}] if[binary_operation[call[output.length, parameter[]], >, literal[0]]] begin[{] assign[member[.validOutput], literal[true]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] None end[}] if[member[.validOutput]] begin[{] assign[member[.output], literal[null]] else begin[{] None end[}] else begin[{] None end[}] return[member[.output]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getOutputPart] operator[SEP] identifier[ProcessOutput] identifier[processOutput] , identifier[String] identifier[prefix] operator[SEP] { identifier[String] identifier[output] operator[=] identifier[processOutput] operator[SEP] identifier[getOutputText] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[output] operator[!=] Other[null] operator[SEP] { Keyword[boolean] identifier[validOutput] operator[=] literal[boolean] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[output] operator[SEP] identifier[indexOf] operator[SEP] identifier[prefix] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[!=] operator[-] Other[1] operator[SEP] { identifier[index] operator[=] identifier[index] operator[+] identifier[prefix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[output] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[index] operator[SEP] { identifier[output] operator[=] identifier[output] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[output] operator[=] identifier[output] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[index] operator[=] identifier[output] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[!=] operator[-] Other[1] operator[SEP] { identifier[output] operator[=] identifier[output] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[SEP] operator[SEP] identifier[output] operator[=] identifier[output] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[output] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { identifier[validOutput] operator[=] literal[boolean] operator[SEP] } } } Keyword[if] operator[SEP] operator[!] identifier[validOutput] operator[SEP] { identifier[output] operator[=] Other[null] operator[SEP] } } Keyword[return] identifier[output] operator[SEP] }
private void parseValue() { // 当值无时,视为空判定 if (null == this.value) { this.operator = OPERATOR_IS; this.value = VALUE_NULL; return; } // 对数组和集合值按照 IN 处理 if (this.value instanceof Collection || ArrayUtil.isArray(this.value)) { this.operator = OPERATOR_IN; return; } // 其他类型值,跳过 if (false == (this.value instanceof String)) { return; } String valueStr = ((String) value); if (StrUtil.isBlank(valueStr)) { // 空字段不做处理 return; } valueStr = valueStr.trim(); // 处理null if (StrUtil.endWithIgnoreCase(valueStr, "null")) { if (StrUtil.equalsIgnoreCase("= null", valueStr) || StrUtil.equalsIgnoreCase("is null", valueStr)) { // 处理"= null"和"is null"转换为"IS NULL" this.operator = OPERATOR_IS; this.value = VALUE_NULL; this.isPlaceHolder = false; return; } else if (StrUtil.equalsIgnoreCase("!= null", valueStr) || StrUtil.equalsIgnoreCase("is not null", valueStr)) { // 处理"!= null"和"is not null"转换为"IS NOT NULL" this.operator = OPERATOR_IS_NOT; this.value = VALUE_NULL; this.isPlaceHolder = false; return; } } List<String> strs = StrUtil.split(valueStr, StrUtil.C_SPACE, 2); if (strs.size() < 2) { return; } // 处理常用符号和IN final String firstPart = strs.get(0).trim().toUpperCase(); if (OPERATORS.contains(firstPart)) { this.operator = firstPart; this.value = strs.get(1).trim(); return; } // 处理LIKE if (OPERATOR_LIKE.equals(firstPart)) { this.operator = OPERATOR_LIKE; this.value = unwrapQuote(strs.get(1)); return; } // 处理BETWEEN x AND y if (OPERATOR_BETWEEN.equals(firstPart)) { final List<String> betweenValueStrs = StrSpliter.splitTrimIgnoreCase(strs.get(1), LogicalOperator.AND.toString(), 2, true); if (betweenValueStrs.size() < 2) { // 必须满足a AND b格式,不满足被当作普通值 return; } this.operator = OPERATOR_BETWEEN; this.value = unwrapQuote(betweenValueStrs.get(0)); this.secondValue = unwrapQuote(betweenValueStrs.get(1)); return; } }
class class_name[name] begin[{] method[parseValue, return_type[void], modifier[private], parameter[]] begin[{] if[binary_operation[literal[null], ==, THIS[member[None.value]]]] begin[{] assign[THIS[member[None.operator]], member[.OPERATOR_IS]] assign[THIS[member[None.value]], member[.VALUE_NULL]] return[None] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[member[None.value]], instanceof, type[Collection]], ||, call[ArrayUtil.isArray, parameter[THIS[member[None.value]]]]]] begin[{] assign[THIS[member[None.operator]], member[.OPERATOR_IN]] return[None] else begin[{] None end[}] if[binary_operation[literal[false], ==, binary_operation[THIS[member[None.value]], instanceof, type[String]]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[String], valueStr] if[call[StrUtil.isBlank, parameter[member[.valueStr]]]] begin[{] return[None] else begin[{] None end[}] assign[member[.valueStr], call[valueStr.trim, parameter[]]] if[call[StrUtil.endWithIgnoreCase, parameter[member[.valueStr], literal["null"]]]] begin[{] if[binary_operation[call[StrUtil.equalsIgnoreCase, parameter[literal["= null"], member[.valueStr]]], ||, call[StrUtil.equalsIgnoreCase, parameter[literal["is null"], member[.valueStr]]]]] begin[{] assign[THIS[member[None.operator]], member[.OPERATOR_IS]] assign[THIS[member[None.value]], member[.VALUE_NULL]] assign[THIS[member[None.isPlaceHolder]], literal[false]] return[None] else begin[{] if[binary_operation[call[StrUtil.equalsIgnoreCase, parameter[literal["!= null"], member[.valueStr]]], ||, call[StrUtil.equalsIgnoreCase, parameter[literal["is not null"], member[.valueStr]]]]] begin[{] assign[THIS[member[None.operator]], member[.OPERATOR_IS_NOT]] assign[THIS[member[None.value]], member[.VALUE_NULL]] assign[THIS[member[None.isPlaceHolder]], literal[false]] return[None] else begin[{] None end[}] end[}] else begin[{] None end[}] local_variable[type[List], strs] if[binary_operation[call[strs.size, parameter[]], <, literal[2]]] begin[{] return[None] else begin[{] None end[}] local_variable[type[String], firstPart] if[call[OPERATORS.contains, parameter[member[.firstPart]]]] begin[{] assign[THIS[member[None.operator]], member[.firstPart]] assign[THIS[member[None.value]], call[strs.get, parameter[literal[1]]]] return[None] else begin[{] None end[}] if[call[OPERATOR_LIKE.equals, parameter[member[.firstPart]]]] begin[{] assign[THIS[member[None.operator]], member[.OPERATOR_LIKE]] assign[THIS[member[None.value]], call[.unwrapQuote, parameter[call[strs.get, parameter[literal[1]]]]]] return[None] else begin[{] None end[}] if[call[OPERATOR_BETWEEN.equals, parameter[member[.firstPart]]]] begin[{] local_variable[type[List], betweenValueStrs] if[binary_operation[call[betweenValueStrs.size, parameter[]], <, literal[2]]] begin[{] return[None] else begin[{] None end[}] assign[THIS[member[None.operator]], member[.OPERATOR_BETWEEN]] assign[THIS[member[None.value]], call[.unwrapQuote, parameter[call[betweenValueStrs.get, parameter[literal[0]]]]]] assign[THIS[member[None.secondValue]], call[.unwrapQuote, parameter[call[betweenValueStrs.get, parameter[literal[1]]]]]] return[None] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[parseValue] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] Keyword[this] operator[SEP] identifier[value] operator[SEP] { Keyword[this] operator[SEP] identifier[operator] operator[=] identifier[OPERATOR_IS] operator[SEP] Keyword[this] operator[SEP] identifier[value] operator[=] identifier[VALUE_NULL] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[value] Keyword[instanceof] identifier[Collection] operator[||] identifier[ArrayUtil] operator[SEP] identifier[isArray] operator[SEP] Keyword[this] operator[SEP] identifier[value] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[operator] operator[=] identifier[OPERATOR_IN] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] literal[boolean] operator[==] operator[SEP] Keyword[this] operator[SEP] identifier[value] Keyword[instanceof] identifier[String] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[String] identifier[valueStr] operator[=] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StrUtil] operator[SEP] identifier[isBlank] operator[SEP] identifier[valueStr] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } identifier[valueStr] operator[=] identifier[valueStr] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[StrUtil] operator[SEP] identifier[endWithIgnoreCase] operator[SEP] identifier[valueStr] , literal[String] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[StrUtil] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] , identifier[valueStr] operator[SEP] operator[||] identifier[StrUtil] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] , identifier[valueStr] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[operator] operator[=] identifier[OPERATOR_IS] operator[SEP] Keyword[this] operator[SEP] identifier[value] operator[=] identifier[VALUE_NULL] operator[SEP] Keyword[this] operator[SEP] identifier[isPlaceHolder] operator[=] literal[boolean] operator[SEP] Keyword[return] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[StrUtil] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] , identifier[valueStr] operator[SEP] operator[||] identifier[StrUtil] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] , identifier[valueStr] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[operator] operator[=] identifier[OPERATOR_IS_NOT] operator[SEP] Keyword[this] operator[SEP] identifier[value] operator[=] identifier[VALUE_NULL] operator[SEP] Keyword[this] operator[SEP] identifier[isPlaceHolder] operator[=] literal[boolean] operator[SEP] Keyword[return] operator[SEP] } } identifier[List] operator[<] identifier[String] operator[>] identifier[strs] operator[=] identifier[StrUtil] operator[SEP] identifier[split] operator[SEP] identifier[valueStr] , identifier[StrUtil] operator[SEP] identifier[C_SPACE] , Other[2] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[strs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[2] operator[SEP] { Keyword[return] operator[SEP] } Keyword[final] identifier[String] identifier[firstPart] operator[=] identifier[strs] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[toUpperCase] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[OPERATORS] operator[SEP] identifier[contains] operator[SEP] identifier[firstPart] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[operator] operator[=] identifier[firstPart] operator[SEP] Keyword[this] operator[SEP] identifier[value] operator[=] identifier[strs] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[OPERATOR_LIKE] operator[SEP] identifier[equals] operator[SEP] identifier[firstPart] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[operator] operator[=] identifier[OPERATOR_LIKE] operator[SEP] Keyword[this] operator[SEP] identifier[value] operator[=] identifier[unwrapQuote] operator[SEP] identifier[strs] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[if] operator[SEP] identifier[OPERATOR_BETWEEN] operator[SEP] identifier[equals] operator[SEP] identifier[firstPart] operator[SEP] operator[SEP] { Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[betweenValueStrs] operator[=] identifier[StrSpliter] operator[SEP] identifier[splitTrimIgnoreCase] operator[SEP] identifier[strs] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] , identifier[LogicalOperator] operator[SEP] identifier[AND] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[2] , literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[betweenValueStrs] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[2] operator[SEP] { Keyword[return] operator[SEP] } Keyword[this] operator[SEP] identifier[operator] operator[=] identifier[OPERATOR_BETWEEN] operator[SEP] Keyword[this] operator[SEP] identifier[value] operator[=] identifier[unwrapQuote] operator[SEP] identifier[betweenValueStrs] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[secondValue] operator[=] identifier[unwrapQuote] operator[SEP] identifier[betweenValueStrs] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } }
private void checkAtLeast(int i) throws ContradictionException { ISet pot = target.getPotSet(g, i); ISet ker = target.getMandSet(g, i); int potSize = pot.size(); if (potSize < degrees[i]) { g.removeNode(i, this); } else if (potSize == degrees[i] && g.getMandatoryNodes().contains(i) && ker.size() < potSize) { for (int s : pot) { target.enforce(g, i, s, this); } } }
class class_name[name] begin[{] method[checkAtLeast, return_type[void], modifier[private], parameter[i]] begin[{] local_variable[type[ISet], pot] local_variable[type[ISet], ker] local_variable[type[int], potSize] if[binary_operation[member[.potSize], <, member[.degrees]]] begin[{] call[g.removeNode, parameter[member[.i], THIS[]]] else begin[{] if[binary_operation[binary_operation[binary_operation[member[.potSize], ==, member[.degrees]], &&, call[g.getMandatoryNodes, parameter[]]], &&, binary_operation[call[ker.size, parameter[]], <, member[.potSize]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=g, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=enforce, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=s)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None) else begin[{] None end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkAtLeast] operator[SEP] Keyword[int] identifier[i] operator[SEP] Keyword[throws] identifier[ContradictionException] { identifier[ISet] identifier[pot] operator[=] identifier[target] operator[SEP] identifier[getPotSet] operator[SEP] identifier[g] , identifier[i] operator[SEP] operator[SEP] identifier[ISet] identifier[ker] operator[=] identifier[target] operator[SEP] identifier[getMandSet] operator[SEP] identifier[g] , identifier[i] operator[SEP] operator[SEP] Keyword[int] identifier[potSize] operator[=] identifier[pot] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[potSize] operator[<] identifier[degrees] operator[SEP] identifier[i] operator[SEP] operator[SEP] { identifier[g] operator[SEP] identifier[removeNode] operator[SEP] identifier[i] , Keyword[this] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[potSize] operator[==] identifier[degrees] operator[SEP] identifier[i] operator[SEP] operator[&&] identifier[g] operator[SEP] identifier[getMandatoryNodes] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[i] operator[SEP] operator[&&] identifier[ker] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[potSize] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[s] operator[:] identifier[pot] operator[SEP] { identifier[target] operator[SEP] identifier[enforce] operator[SEP] identifier[g] , identifier[i] , identifier[s] , Keyword[this] operator[SEP] operator[SEP] } } }
public DeleteFacesRequest withFaceIds(String... faceIds) { if (this.faceIds == null) { setFaceIds(new java.util.ArrayList<String>(faceIds.length)); } for (String ele : faceIds) { this.faceIds.add(ele); } return this; }
class class_name[name] begin[{] method[withFaceIds, return_type[type[DeleteFacesRequest]], modifier[public], parameter[faceIds]] begin[{] if[binary_operation[THIS[member[None.faceIds]], ==, literal[null]]] begin[{] call[.setFaceIds, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=faceIds, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=faceIds, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=faceIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DeleteFacesRequest] identifier[withFaceIds] operator[SEP] identifier[String] operator[...] identifier[faceIds] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[faceIds] operator[==] Other[null] operator[SEP] { identifier[setFaceIds] operator[SEP] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[String] operator[>] operator[SEP] identifier[faceIds] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[ele] operator[:] identifier[faceIds] operator[SEP] { Keyword[this] operator[SEP] identifier[faceIds] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
private static void recurseBeanCreationParams(List<UberField> uberFields, Class<?> beanType, ActionDescriptor annotatedParameters, ActionInputParameter annotatedParameter, Object currentCallValue, String parentParamName, Set<String> knownFields) { // TODO collection, map and object node creation are only describable by an annotation, not via type reflection if (ObjectNode.class.isAssignableFrom(beanType) || Map.class.isAssignableFrom(beanType) || Collection.class.isAssignableFrom(beanType) || beanType.isArray()) { return; // use @Input(include) to list parameter names, at least? Or mix with hdiv's form builder? } try { Constructor[] constructors = beanType.getConstructors(); // find default ctor Constructor constructor = PropertyUtils.findDefaultCtor(constructors); // find ctor with JsonCreator ann if (constructor == null) { constructor = PropertyUtils.findJsonCreator(constructors, JsonCreator.class); } Assert.notNull(constructor, "no default constructor or JsonCreator found for type " + beanType .getName()); int parameterCount = constructor.getParameterTypes().length; if (parameterCount > 0) { Annotation[][] annotationsOnParameters = constructor.getParameterAnnotations(); Class[] parameters = constructor.getParameterTypes(); int paramIndex = 0; for (Annotation[] annotationsOnParameter : annotationsOnParameters) { for (Annotation annotation : annotationsOnParameter) { if (JsonProperty.class == annotation.annotationType()) { JsonProperty jsonProperty = (JsonProperty) annotation; // TODO use required attribute of JsonProperty for required fields String paramName = jsonProperty.value(); Class parameterType = parameters[paramIndex]; Object propertyValue = PropertyUtils.getPropertyOrFieldValue(currentCallValue, paramName); MethodParameter methodParameter = new MethodParameter(constructor, paramIndex); addUberFieldsForMethodParameter(uberFields, methodParameter, annotatedParameter, annotatedParameters, parentParamName, paramName, parameterType, propertyValue, knownFields); paramIndex++; // increase for each @JsonProperty } } } Assert.isTrue(parameters.length == paramIndex, "not all constructor arguments of @JsonCreator " + constructor.getName() + " are annotated with @JsonProperty"); } Set<String> knownConstructorFields = new HashSet<String>(uberFields.size()); for (UberField sirenField : uberFields) { knownConstructorFields.add(sirenField.getName()); } // TODO support Option provider by other method args? Map<String, PropertyDescriptor> propertyDescriptors = PropertyUtils.getPropertyDescriptors(beanType); // add input field for every setter for (PropertyDescriptor propertyDescriptor : propertyDescriptors.values()) { final Method writeMethod = propertyDescriptor.getWriteMethod(); String propertyName = propertyDescriptor.getName(); if (writeMethod == null || knownFields.contains(parentParamName + propertyName)) { continue; } final Class<?> propertyType = propertyDescriptor.getPropertyType(); Object propertyValue = PropertyUtils.getPropertyOrFieldValue(currentCallValue, propertyName); MethodParameter methodParameter = new MethodParameter(propertyDescriptor.getWriteMethod(), 0); addUberFieldsForMethodParameter(uberFields, methodParameter, annotatedParameter, annotatedParameters, parentParamName, propertyName, propertyType, propertyValue, knownConstructorFields); } } catch (Exception e) { throw new RuntimeException("Failed to write input fields for constructor", e); } }
class class_name[name] begin[{] method[recurseBeanCreationParams, return_type[void], modifier[private static], parameter[uberFields, beanType, annotatedParameters, annotatedParameter, currentCallValue, parentParamName, knownFields]] begin[{] if[binary_operation[binary_operation[binary_operation[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=beanType, 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=ObjectNode, sub_type=None)), ||, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=beanType, 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=Map, sub_type=None))], ||, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=beanType, 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=Collection, sub_type=None))], ||, call[beanType.isArray, parameter[]]]] begin[{] return[None] else begin[{] None end[}] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getConstructors, postfix_operators=[], prefix_operators=[], qualifier=beanType, selectors=[], type_arguments=None), name=constructors)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Constructor, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=constructors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findDefaultCtor, postfix_operators=[], prefix_operators=[], qualifier=PropertyUtils, selectors=[], type_arguments=None), name=constructor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Constructor, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=constructor, 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=constructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=constructors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonCreator, sub_type=None))], member=findJsonCreator, postfix_operators=[], prefix_operators=[], qualifier=PropertyUtils, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=constructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="no default constructor or JsonCreator found for type "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=beanType, selectors=[], type_arguments=None), operator=+)], member=notNull, postfix_operators=[], prefix_operators=[], qualifier=Assert, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=constructor, selectors=[MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), name=parameterCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=parameterCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParameterAnnotations, postfix_operators=[], prefix_operators=[], qualifier=constructor, selectors=[], type_arguments=None), name=annotationsOnParameters)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None, None], name=Annotation, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParameterTypes, postfix_operators=[], prefix_operators=[], qualifier=constructor, selectors=[], type_arguments=None), name=parameters)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=paramIndex)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JsonProperty, sub_type=None)), operandr=MethodInvocation(arguments=[], member=annotationType, postfix_operators=[], prefix_operators=[], qualifier=annotation, selectors=[], type_arguments=None), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=annotation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=JsonProperty, sub_type=None)), name=jsonProperty)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=JsonProperty, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=value, postfix_operators=[], prefix_operators=[], qualifier=jsonProperty, selectors=[], type_arguments=None), name=paramName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=parameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=paramIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=parameterType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentCallValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paramName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPropertyOrFieldValue, postfix_operators=[], prefix_operators=[], qualifier=PropertyUtils, selectors=[], type_arguments=None), name=propertyValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=constructor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paramIndex, 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=MethodParameter, sub_type=None)), name=methodParameter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodParameter, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=uberFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annotatedParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annotatedParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentParamName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paramName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameterType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=knownFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addUberFieldsForMethodParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=paramIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=annotationsOnParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotation)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Annotation, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=annotationsOnParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=annotationsOnParameter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Annotation, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=parameters, selectors=[]), operandr=MemberReference(member=paramIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="not all constructor arguments of @JsonCreator "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=constructor, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" are annotated with @JsonProperty"), operator=+)], member=isTrue, postfix_operators=[], prefix_operators=[], qualifier=Assert, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=uberFields, selectors=[], type_arguments=None)], 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)), name=knownConstructorFields)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=sirenField, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=knownConstructorFields, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=uberFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sirenField)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UberField, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=beanType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPropertyDescriptors, postfix_operators=[], prefix_operators=[], qualifier=PropertyUtils, selectors=[], type_arguments=None), name=propertyDescriptors)], 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=PropertyDescriptor, sub_type=None))], dimensions=[], name=Map, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getWriteMethod, postfix_operators=[], prefix_operators=[], qualifier=propertyDescriptor, selectors=[], type_arguments=None), name=writeMethod)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=propertyDescriptor, selectors=[], type_arguments=None), name=propertyName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=writeMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=parentParamName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=contains, postfix_operators=[], prefix_operators=[], qualifier=knownFields, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=[], qualifier=propertyDescriptor, selectors=[], type_arguments=None), name=propertyType)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=currentCallValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPropertyOrFieldValue, postfix_operators=[], prefix_operators=[], qualifier=PropertyUtils, selectors=[], type_arguments=None), name=propertyValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getWriteMethod, postfix_operators=[], prefix_operators=[], qualifier=propertyDescriptor, selectors=[], type_arguments=None), 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=MethodParameter, sub_type=None)), name=methodParameter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MethodParameter, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=uberFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=methodParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annotatedParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=annotatedParameters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parentParamName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=propertyValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=knownConstructorFields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addUberFieldsForMethodParameter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=propertyDescriptors, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=propertyDescriptor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PropertyDescriptor, sub_type=None))), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to write input fields for constructor"), 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[private] Keyword[static] Keyword[void] identifier[recurseBeanCreationParams] operator[SEP] identifier[List] operator[<] identifier[UberField] operator[>] identifier[uberFields] , identifier[Class] operator[<] operator[?] operator[>] identifier[beanType] , identifier[ActionDescriptor] identifier[annotatedParameters] , identifier[ActionInputParameter] identifier[annotatedParameter] , identifier[Object] identifier[currentCallValue] , identifier[String] identifier[parentParamName] , identifier[Set] operator[<] identifier[String] operator[>] identifier[knownFields] operator[SEP] { Keyword[if] operator[SEP] identifier[ObjectNode] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[beanType] operator[SEP] operator[||] identifier[Map] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[beanType] operator[SEP] operator[||] identifier[Collection] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[beanType] operator[SEP] operator[||] identifier[beanType] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] operator[SEP] } Keyword[try] { identifier[Constructor] operator[SEP] operator[SEP] identifier[constructors] operator[=] identifier[beanType] operator[SEP] identifier[getConstructors] operator[SEP] operator[SEP] operator[SEP] identifier[Constructor] identifier[constructor] operator[=] identifier[PropertyUtils] operator[SEP] identifier[findDefaultCtor] operator[SEP] identifier[constructors] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[constructor] operator[==] Other[null] operator[SEP] { identifier[constructor] operator[=] identifier[PropertyUtils] operator[SEP] identifier[findJsonCreator] operator[SEP] identifier[constructors] , identifier[JsonCreator] operator[SEP] Keyword[class] operator[SEP] operator[SEP] } identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[constructor] , literal[String] operator[+] identifier[beanType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[parameterCount] operator[=] identifier[constructor] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] identifier[length] operator[SEP] Keyword[if] operator[SEP] identifier[parameterCount] operator[>] Other[0] operator[SEP] { identifier[Annotation] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[annotationsOnParameters] operator[=] identifier[constructor] operator[SEP] identifier[getParameterAnnotations] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[SEP] operator[SEP] identifier[parameters] operator[=] identifier[constructor] operator[SEP] identifier[getParameterTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[paramIndex] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Annotation] operator[SEP] operator[SEP] identifier[annotationsOnParameter] operator[:] identifier[annotationsOnParameters] operator[SEP] { Keyword[for] operator[SEP] identifier[Annotation] identifier[annotation] operator[:] identifier[annotationsOnParameter] operator[SEP] { Keyword[if] operator[SEP] identifier[JsonProperty] operator[SEP] Keyword[class] operator[==] identifier[annotation] operator[SEP] identifier[annotationType] operator[SEP] operator[SEP] operator[SEP] { identifier[JsonProperty] identifier[jsonProperty] operator[=] operator[SEP] identifier[JsonProperty] operator[SEP] identifier[annotation] operator[SEP] identifier[String] identifier[paramName] operator[=] identifier[jsonProperty] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] identifier[Class] identifier[parameterType] operator[=] identifier[parameters] operator[SEP] identifier[paramIndex] operator[SEP] operator[SEP] identifier[Object] identifier[propertyValue] operator[=] identifier[PropertyUtils] operator[SEP] identifier[getPropertyOrFieldValue] operator[SEP] identifier[currentCallValue] , identifier[paramName] operator[SEP] operator[SEP] identifier[MethodParameter] identifier[methodParameter] operator[=] Keyword[new] identifier[MethodParameter] operator[SEP] identifier[constructor] , identifier[paramIndex] operator[SEP] operator[SEP] identifier[addUberFieldsForMethodParameter] operator[SEP] identifier[uberFields] , identifier[methodParameter] , identifier[annotatedParameter] , identifier[annotatedParameters] , identifier[parentParamName] , identifier[paramName] , identifier[parameterType] , identifier[propertyValue] , identifier[knownFields] operator[SEP] operator[SEP] identifier[paramIndex] operator[++] operator[SEP] } } } identifier[Assert] operator[SEP] identifier[isTrue] operator[SEP] identifier[parameters] operator[SEP] identifier[length] operator[==] identifier[paramIndex] , literal[String] operator[+] identifier[constructor] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[Set] operator[<] identifier[String] operator[>] identifier[knownConstructorFields] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[String] operator[>] operator[SEP] identifier[uberFields] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[UberField] identifier[sirenField] operator[:] identifier[uberFields] operator[SEP] { identifier[knownConstructorFields] operator[SEP] identifier[add] operator[SEP] identifier[sirenField] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[Map] operator[<] identifier[String] , identifier[PropertyDescriptor] operator[>] identifier[propertyDescriptors] operator[=] identifier[PropertyUtils] operator[SEP] identifier[getPropertyDescriptors] operator[SEP] identifier[beanType] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[PropertyDescriptor] identifier[propertyDescriptor] operator[:] identifier[propertyDescriptors] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[final] identifier[Method] identifier[writeMethod] operator[=] identifier[propertyDescriptor] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[propertyName] operator[=] identifier[propertyDescriptor] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[writeMethod] operator[==] Other[null] operator[||] identifier[knownFields] operator[SEP] identifier[contains] operator[SEP] identifier[parentParamName] operator[+] identifier[propertyName] operator[SEP] operator[SEP] { Keyword[continue] operator[SEP] } Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[propertyType] operator[=] identifier[propertyDescriptor] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[propertyValue] operator[=] identifier[PropertyUtils] operator[SEP] identifier[getPropertyOrFieldValue] operator[SEP] identifier[currentCallValue] , identifier[propertyName] operator[SEP] operator[SEP] identifier[MethodParameter] identifier[methodParameter] operator[=] Keyword[new] identifier[MethodParameter] operator[SEP] identifier[propertyDescriptor] operator[SEP] identifier[getWriteMethod] operator[SEP] operator[SEP] , Other[0] operator[SEP] operator[SEP] identifier[addUberFieldsForMethodParameter] operator[SEP] identifier[uberFields] , identifier[methodParameter] , identifier[annotatedParameter] , identifier[annotatedParameters] , identifier[parentParamName] , identifier[propertyName] , identifier[propertyType] , identifier[propertyValue] , identifier[knownConstructorFields] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
public final NotificationChannel updateNotificationChannel( FieldMask updateMask, NotificationChannel notificationChannel) { UpdateNotificationChannelRequest request = UpdateNotificationChannelRequest.newBuilder() .setUpdateMask(updateMask) .setNotificationChannel(notificationChannel) .build(); return updateNotificationChannel(request); }
class class_name[name] begin[{] method[updateNotificationChannel, return_type[type[NotificationChannel]], modifier[final public], parameter[updateMask, notificationChannel]] begin[{] local_variable[type[UpdateNotificationChannelRequest], request] return[call[.updateNotificationChannel, parameter[member[.request]]]] end[}] END[}]
Keyword[public] Keyword[final] identifier[NotificationChannel] identifier[updateNotificationChannel] operator[SEP] identifier[FieldMask] identifier[updateMask] , identifier[NotificationChannel] identifier[notificationChannel] operator[SEP] { identifier[UpdateNotificationChannelRequest] identifier[request] operator[=] identifier[UpdateNotificationChannelRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setUpdateMask] operator[SEP] identifier[updateMask] operator[SEP] operator[SEP] identifier[setNotificationChannel] operator[SEP] identifier[notificationChannel] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[updateNotificationChannel] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public int increment (int key, int amount) { Record rec = locateRecord(key); if (rec == null) { put(key, amount); return amount; } else { return (rec.value += amount); } }
class class_name[name] begin[{] method[increment, return_type[type[int]], modifier[public], parameter[key, amount]] begin[{] local_variable[type[Record], rec] if[binary_operation[member[.rec], ==, literal[null]]] begin[{] call[.put, parameter[member[.key], member[.amount]]] return[member[.amount]] else begin[{] return[assign[member[rec.value], member[.amount]]] end[}] end[}] END[}]
Keyword[public] Keyword[int] identifier[increment] operator[SEP] Keyword[int] identifier[key] , Keyword[int] identifier[amount] operator[SEP] { identifier[Record] identifier[rec] operator[=] identifier[locateRecord] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rec] operator[==] Other[null] operator[SEP] { identifier[put] operator[SEP] identifier[key] , identifier[amount] operator[SEP] operator[SEP] Keyword[return] identifier[amount] operator[SEP] } Keyword[else] { Keyword[return] operator[SEP] identifier[rec] operator[SEP] identifier[value] operator[+=] identifier[amount] operator[SEP] operator[SEP] } }
@Override public CallbackHandler getCallbackHandler(byte[] credToken, HttpServletRequest req, HttpServletResponse resp, List tokenHolderList, Map appContext, String authMechOid) { // TODO Auto-generated method stub return null; }
class class_name[name] begin[{] method[getCallbackHandler, return_type[type[CallbackHandler]], modifier[public], parameter[credToken, req, resp, tokenHolderList, appContext, authMechOid]] begin[{] return[literal[null]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[CallbackHandler] identifier[getCallbackHandler] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[credToken] , identifier[HttpServletRequest] identifier[req] , identifier[HttpServletResponse] identifier[resp] , identifier[List] identifier[tokenHolderList] , identifier[Map] identifier[appContext] , identifier[String] identifier[authMechOid] operator[SEP] { Keyword[return] Other[null] operator[SEP] }
@Override public boolean eIsSet(int featureID) { switch (featureID) { case AfplibPackage.MCF__RG: return rg != null && !rg.isEmpty(); } return super.eIsSet(featureID); }
class class_name[name] begin[{] method[eIsSet, return_type[type[boolean]], modifier[public], parameter[featureID]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=MCF__RG, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=rg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=rg, selectors=[], type_arguments=None), operator=&&), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eIsSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[eIsSet] operator[SEP] Keyword[int] identifier[featureID] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[MCF__RG] operator[:] Keyword[return] identifier[rg] operator[!=] Other[null] operator[&&] operator[!] identifier[rg] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] Keyword[super] operator[SEP] identifier[eIsSet] operator[SEP] identifier[featureID] operator[SEP] operator[SEP] }
public static List<TagAndLength> parseTagAndLength(final byte[] data) { List<TagAndLength> tagAndLengthList = new ArrayList<TagAndLength>(); if (data != null) { TLVInputStream stream = new TLVInputStream(new ByteArrayInputStream(data)); try { while (stream.available() > 0) { if (stream.available() < 2) { throw new TlvException("Data length < 2 : " + stream.available()); } ITag tag = searchTagById(stream.readTag()); int tagValueLength = stream.readLength(); tagAndLengthList.add(new TagAndLength(tag, tagValueLength)); } } catch (IOException e) { LOGGER.error(e.getMessage(), e); } finally { IOUtils.closeQuietly(stream); } } return tagAndLengthList; }
class class_name[name] begin[{] method[parseTagAndLength, return_type[type[List]], modifier[public static], parameter[data]] begin[{] local_variable[type[List], tagAndLengthList] if[binary_operation[member[.data], !=, literal[null]]] begin[{] local_variable[type[TLVInputStream], stream] TryStatement(block=[WhileStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=available, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Data length < 2 : "), operandr=MethodInvocation(arguments=[], member=available, postfix_operators=[], prefix_operators=[], qualifier=stream, 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=TlvException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=readTag, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None)], member=searchTagById, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=tag)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ITag, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLength, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), name=tagValueLength)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tagValueLength, 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=TagAndLength, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=tagAndLengthList, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=available, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOGGER, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeQuietly, postfix_operators=[], prefix_operators=[], qualifier=IOUtils, selectors=[], type_arguments=None), label=None)], label=None, resources=None) else begin[{] None end[}] return[member[.tagAndLengthList]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[TagAndLength] operator[>] identifier[parseTagAndLength] operator[SEP] Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[SEP] { identifier[List] operator[<] identifier[TagAndLength] operator[>] identifier[tagAndLengthList] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[TagAndLength] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[!=] Other[null] operator[SEP] { identifier[TLVInputStream] identifier[stream] operator[=] Keyword[new] identifier[TLVInputStream] operator[SEP] Keyword[new] identifier[ByteArrayInputStream] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[while] operator[SEP] identifier[stream] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[if] operator[SEP] identifier[stream] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[<] Other[2] operator[SEP] { Keyword[throw] Keyword[new] identifier[TlvException] operator[SEP] literal[String] operator[+] identifier[stream] operator[SEP] identifier[available] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[ITag] identifier[tag] operator[=] identifier[searchTagById] operator[SEP] identifier[stream] operator[SEP] identifier[readTag] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[tagValueLength] operator[=] identifier[stream] operator[SEP] identifier[readLength] operator[SEP] operator[SEP] operator[SEP] identifier[tagAndLengthList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[TagAndLength] operator[SEP] identifier[tag] , identifier[tagValueLength] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[LOGGER] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { identifier[IOUtils] operator[SEP] identifier[closeQuietly] operator[SEP] identifier[stream] operator[SEP] operator[SEP] } } Keyword[return] identifier[tagAndLengthList] operator[SEP] }
public static <E> List<E> toList(Iterable<E> iter) { return toList(iter.iterator()); }
class class_name[name] begin[{] method[toList, return_type[type[List]], modifier[public static], parameter[iter]] begin[{] return[call[.toList, parameter[call[iter.iterator, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[List] operator[<] identifier[E] operator[>] identifier[toList] operator[SEP] identifier[Iterable] operator[<] identifier[E] operator[>] identifier[iter] operator[SEP] { Keyword[return] identifier[toList] operator[SEP] identifier[iter] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void evictFromCache(Serializable pk) { Assert.notNull(pk, "Primary key (identifier) required"); MutableAcl acl = getFromCache(pk); if (acl != null) { cache.remove(acl.getId()); cache.remove(acl.getObjectIdentity()); } }
class class_name[name] begin[{] method[evictFromCache, return_type[void], modifier[public], parameter[pk]] begin[{] call[Assert.notNull, parameter[member[.pk], literal["Primary key (identifier) required"]]] local_variable[type[MutableAcl], acl] if[binary_operation[member[.acl], !=, literal[null]]] begin[{] call[cache.remove, parameter[call[acl.getId, parameter[]]]] call[cache.remove, parameter[call[acl.getObjectIdentity, parameter[]]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[evictFromCache] operator[SEP] identifier[Serializable] identifier[pk] operator[SEP] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[pk] , literal[String] operator[SEP] operator[SEP] identifier[MutableAcl] identifier[acl] operator[=] identifier[getFromCache] operator[SEP] identifier[pk] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[acl] operator[!=] Other[null] operator[SEP] { identifier[cache] operator[SEP] identifier[remove] operator[SEP] identifier[acl] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[cache] operator[SEP] identifier[remove] operator[SEP] identifier[acl] operator[SEP] identifier[getObjectIdentity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public static <E> double skewDivergence(Counter<E> c1, Counter<E> c2, double skew) { Counter<E> average = linearCombination(c2, skew, c1, (1.0 - skew)); return klDivergence(c1, average); }
class class_name[name] begin[{] method[skewDivergence, return_type[type[double]], modifier[public static], parameter[c1, c2, skew]] begin[{] local_variable[type[Counter], average] return[call[.klDivergence, parameter[member[.c1], member[.average]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] Keyword[double] identifier[skewDivergence] operator[SEP] identifier[Counter] operator[<] identifier[E] operator[>] identifier[c1] , identifier[Counter] operator[<] identifier[E] operator[>] identifier[c2] , Keyword[double] identifier[skew] operator[SEP] { identifier[Counter] operator[<] identifier[E] operator[>] identifier[average] operator[=] identifier[linearCombination] operator[SEP] identifier[c2] , identifier[skew] , identifier[c1] , operator[SEP] literal[Float] operator[-] identifier[skew] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[klDivergence] operator[SEP] identifier[c1] , identifier[average] operator[SEP] operator[SEP] }
protected T deserializeNullValue( JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params ) { reader.skipValue(); return null; }
class class_name[name] begin[{] method[deserializeNullValue, return_type[type[T]], modifier[protected], parameter[reader, ctx, params]] begin[{] call[reader.skipValue, parameter[]] return[literal[null]] end[}] END[}]
Keyword[protected] identifier[T] identifier[deserializeNullValue] operator[SEP] identifier[JsonReader] identifier[reader] , identifier[JsonDeserializationContext] identifier[ctx] , identifier[JsonDeserializerParameters] identifier[params] operator[SEP] { identifier[reader] operator[SEP] identifier[skipValue] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] }
public boolean hasUnnamedParameters(String originalSql) { boolean hasUnnamedParameters = false; char[] statement = originalSql.toCharArray(); int i = 0; while (i < statement.length) { int skipToPosition = i; while (i < statement.length) { skipToPosition = skipCommentsAndQuotes(statement, i); if (i == skipToPosition) { break; } else { i = skipToPosition; } } if (i >= statement.length) { break; } char c = statement[i]; if (c == '?') { hasUnnamedParameters = true; break; } i++; } return hasUnnamedParameters; }
class class_name[name] begin[{] method[hasUnnamedParameters, return_type[type[boolean]], modifier[public], parameter[originalSql]] begin[{] local_variable[type[boolean], hasUnnamedParameters] local_variable[type[char], statement] local_variable[type[int], i] while[binary_operation[member[.i], <, member[statement.length]]] begin[{] local_variable[type[int], skipToPosition] while[binary_operation[member[.i], <, member[statement.length]]] begin[{] assign[member[.skipToPosition], call[.skipCommentsAndQuotes, parameter[member[.statement], member[.i]]]] if[binary_operation[member[.i], ==, member[.skipToPosition]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] assign[member[.i], member[.skipToPosition]] end[}] end[}] if[binary_operation[member[.i], >=, member[statement.length]]] begin[{] BreakStatement(goto=None, label=None) else begin[{] None end[}] local_variable[type[char], c] if[binary_operation[member[.c], ==, literal['?']]] begin[{] assign[member[.hasUnnamedParameters], literal[true]] BreakStatement(goto=None, label=None) else begin[{] None end[}] member[.i] end[}] return[member[.hasUnnamedParameters]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[hasUnnamedParameters] operator[SEP] identifier[String] identifier[originalSql] operator[SEP] { Keyword[boolean] identifier[hasUnnamedParameters] operator[=] literal[boolean] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[statement] operator[=] identifier[originalSql] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[<] identifier[statement] operator[SEP] identifier[length] operator[SEP] { Keyword[int] identifier[skipToPosition] operator[=] identifier[i] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[<] identifier[statement] operator[SEP] identifier[length] operator[SEP] { identifier[skipToPosition] operator[=] identifier[skipCommentsAndQuotes] operator[SEP] identifier[statement] , identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[i] operator[==] identifier[skipToPosition] operator[SEP] { Keyword[break] operator[SEP] } Keyword[else] { identifier[i] operator[=] identifier[skipToPosition] operator[SEP] } } Keyword[if] operator[SEP] identifier[i] operator[>=] identifier[statement] operator[SEP] identifier[length] operator[SEP] { Keyword[break] operator[SEP] } Keyword[char] identifier[c] operator[=] identifier[statement] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { identifier[hasUnnamedParameters] operator[=] literal[boolean] operator[SEP] Keyword[break] operator[SEP] } identifier[i] operator[++] operator[SEP] } Keyword[return] identifier[hasUnnamedParameters] operator[SEP] }
private synchronized void ungetLogService() { doWarnIfClosed = doDebug(); if (log != null) { bc.ungetService(logSR); logSR = null; log = null; } }
class class_name[name] begin[{] method[ungetLogService, return_type[void], modifier[synchronized private], parameter[]] begin[{] assign[member[.doWarnIfClosed], call[.doDebug, parameter[]]] if[binary_operation[member[.log], !=, literal[null]]] begin[{] call[bc.ungetService, parameter[member[.logSR]]] assign[member[.logSR], literal[null]] assign[member[.log], literal[null]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[synchronized] Keyword[void] identifier[ungetLogService] operator[SEP] operator[SEP] { identifier[doWarnIfClosed] operator[=] identifier[doDebug] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[!=] Other[null] operator[SEP] { identifier[bc] operator[SEP] identifier[ungetService] operator[SEP] identifier[logSR] operator[SEP] operator[SEP] identifier[logSR] operator[=] Other[null] operator[SEP] identifier[log] operator[=] Other[null] operator[SEP] } }
public LinkedList<Diff> diff_main(String text1, String text2, boolean checklines) { // Set a deadline by which time the diff must be complete. long deadline; if (Diff_Timeout <= 0) { deadline = Long.MAX_VALUE; } else { deadline = System.currentTimeMillis() + (long) (Diff_Timeout * 1000); } return diff_main(text1, text2, checklines, deadline); }
class class_name[name] begin[{] method[diff_main, return_type[type[LinkedList]], modifier[public], parameter[text1, text2, checklines]] begin[{] local_variable[type[long], deadline] if[binary_operation[member[.Diff_Timeout], <=, literal[0]]] begin[{] assign[member[.deadline], member[Long.MAX_VALUE]] else begin[{] assign[member[.deadline], binary_operation[call[System.currentTimeMillis, parameter[]], +, Cast(expression=BinaryOperation(operandl=MemberReference(member=Diff_Timeout, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=*), type=BasicType(dimensions=[], name=long))]] end[}] return[call[.diff_main, parameter[member[.text1], member[.text2], member[.checklines], member[.deadline]]]] end[}] END[}]
Keyword[public] identifier[LinkedList] operator[<] identifier[Diff] operator[>] identifier[diff_main] operator[SEP] identifier[String] identifier[text1] , identifier[String] identifier[text2] , Keyword[boolean] identifier[checklines] operator[SEP] { Keyword[long] identifier[deadline] operator[SEP] Keyword[if] operator[SEP] identifier[Diff_Timeout] operator[<=] Other[0] operator[SEP] { identifier[deadline] operator[=] identifier[Long] operator[SEP] identifier[MAX_VALUE] operator[SEP] } Keyword[else] { identifier[deadline] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[+] operator[SEP] Keyword[long] operator[SEP] operator[SEP] identifier[Diff_Timeout] operator[*] Other[1000] operator[SEP] operator[SEP] } Keyword[return] identifier[diff_main] operator[SEP] identifier[text1] , identifier[text2] , identifier[checklines] , identifier[deadline] operator[SEP] operator[SEP] }
public static Response put(URI uri, String body, ContentType contentType, String username, String password) throws URISyntaxException, HttpException { return putBody(new HttpPut(uri), body, contentType, new UsernamePasswordCredentials(username, password), null); }
class class_name[name] begin[{] method[put, return_type[type[Response]], modifier[public static], parameter[uri, body, contentType, username, password]] begin[{] return[call[.putBody, parameter[ClassCreator(arguments=[MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=HttpPut, sub_type=None)), member[.body], member[.contentType], ClassCreator(arguments=[MemberReference(member=username, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=password, 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=UsernamePasswordCredentials, sub_type=None)), literal[null]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Response] identifier[put] operator[SEP] identifier[URI] identifier[uri] , identifier[String] identifier[body] , identifier[ContentType] identifier[contentType] , identifier[String] identifier[username] , identifier[String] identifier[password] operator[SEP] Keyword[throws] identifier[URISyntaxException] , identifier[HttpException] { Keyword[return] identifier[putBody] operator[SEP] Keyword[new] identifier[HttpPut] operator[SEP] identifier[uri] operator[SEP] , identifier[body] , identifier[contentType] , Keyword[new] identifier[UsernamePasswordCredentials] operator[SEP] identifier[username] , identifier[password] operator[SEP] , Other[null] operator[SEP] operator[SEP] }
public IGosuParser createParser( ISymbolTable symTable, IScriptabilityModifier scriptabilityConstraint ) { IGosuParser parser = new GosuParser( symTable, scriptabilityConstraint ); return parser; }
class class_name[name] begin[{] method[createParser, return_type[type[IGosuParser]], modifier[public], parameter[symTable, scriptabilityConstraint]] begin[{] local_variable[type[IGosuParser], parser] return[member[.parser]] end[}] END[}]
Keyword[public] identifier[IGosuParser] identifier[createParser] operator[SEP] identifier[ISymbolTable] identifier[symTable] , identifier[IScriptabilityModifier] identifier[scriptabilityConstraint] operator[SEP] { identifier[IGosuParser] identifier[parser] operator[=] Keyword[new] identifier[GosuParser] operator[SEP] identifier[symTable] , identifier[scriptabilityConstraint] operator[SEP] operator[SEP] Keyword[return] identifier[parser] operator[SEP] }
public synchronized String getCatalog() throws SQLException { checkClosed(); try { return (String) sessionProxy.getAttribute( SessionInterface.INFO_CATALOG); } catch (HsqlException e) { throw Util.sqlException(e); } }
class class_name[name] begin[{] method[getCatalog, return_type[type[String]], modifier[synchronized public], parameter[]] begin[{] call[.checkClosed, parameter[]] TryStatement(block=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[MemberReference(member=INFO_CATALOG, postfix_operators=[], prefix_operators=[], qualifier=SessionInterface, selectors=[])], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=sessionProxy, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sqlException, postfix_operators=[], prefix_operators=[], qualifier=Util, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['HsqlException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[synchronized] identifier[String] identifier[getCatalog] operator[SEP] operator[SEP] Keyword[throws] identifier[SQLException] { identifier[checkClosed] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { Keyword[return] operator[SEP] identifier[String] operator[SEP] identifier[sessionProxy] operator[SEP] identifier[getAttribute] operator[SEP] identifier[SessionInterface] operator[SEP] identifier[INFO_CATALOG] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[HsqlException] identifier[e] operator[SEP] { Keyword[throw] identifier[Util] operator[SEP] identifier[sqlException] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
private void validateEntry(String key, Object value) { if (isBlank(key)) { throw new IllegalArgumentException("key cannot be null/blank"); } if (ModifiedUTF8Charset.calculateByteLength(key) > 255) { throw new IllegalArgumentException("key length > 255 bytes"); } else if (value == null) { throw new IllegalArgumentException("value cannot be null"); } else if (value instanceof String) { if (ModifiedUTF8Charset.calculateByteLength((String) value) > 32767) { throw new IllegalArgumentException("string value length > 34767 bytes"); } } else if (value instanceof Integer || value instanceof Long || value instanceof Double) { // valid } else { throw new IllegalArgumentException("Illegal value type: "+value.getClass().toString()); } }
class class_name[name] begin[{] method[validateEntry, return_type[void], modifier[private], parameter[key, value]] begin[{] if[call[.isBlank, parameter[member[.key]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="key cannot be null/blank")], 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[call[ModifiedUTF8Charset.calculateByteLength, parameter[member[.key]]], >, literal[255]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="key length > 255 bytes")], 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[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value cannot be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] if[binary_operation[member[.value], instanceof, type[String]]] begin[{] if[binary_operation[call[ModifiedUTF8Charset.calculateByteLength, parameter[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]], >, literal[32767]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="string value length > 34767 bytes")], 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[}] else begin[{] if[binary_operation[binary_operation[binary_operation[member[.value], instanceof, type[Integer]], ||, binary_operation[member[.value], instanceof, type[Long]]], ||, binary_operation[member[.value], instanceof, type[Double]]]] begin[{] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Illegal value type: "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], 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) end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[validateEntry] operator[SEP] identifier[String] identifier[key] , identifier[Object] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[isBlank] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ModifiedUTF8Charset] operator[SEP] identifier[calculateByteLength] operator[SEP] identifier[key] operator[SEP] operator[>] Other[255] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[String] operator[SEP] { Keyword[if] operator[SEP] identifier[ModifiedUTF8Charset] operator[SEP] identifier[calculateByteLength] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[value] operator[SEP] operator[>] Other[32767] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Integer] operator[||] identifier[value] Keyword[instanceof] identifier[Long] operator[||] identifier[value] Keyword[instanceof] identifier[Double] operator[SEP] { } Keyword[else] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
@SuppressWarnings("static-method") protected boolean generateOptions(IStyleAppendable it) { it.appendNl("\\newif\\ifusesarlcolors\\usesarlcolorstrue"); //$NON-NLS-1$ it.appendNl("\\DeclareOption{sarlcolors}{\\global\\usesarlcolorstrue}"); //$NON-NLS-1$ it.appendNl("\\DeclareOption{nosarlcolors}{\\global\\usesarlcolorsfalse}"); //$NON-NLS-1$ return true; }
class class_name[name] begin[{] method[generateOptions, return_type[type[boolean]], modifier[protected], parameter[it]] begin[{] call[it.appendNl, parameter[literal["\\newif\\ifusesarlcolors\\usesarlcolorstrue"]]] call[it.appendNl, parameter[literal["\\DeclareOption{sarlcolors}{\\global\\usesarlcolorstrue}"]]] call[it.appendNl, parameter[literal["\\DeclareOption{nosarlcolors}{\\global\\usesarlcolorsfalse}"]]] return[literal[true]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[protected] Keyword[boolean] identifier[generateOptions] operator[SEP] identifier[IStyleAppendable] identifier[it] operator[SEP] { identifier[it] operator[SEP] identifier[appendNl] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[appendNl] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[it] operator[SEP] identifier[appendNl] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
private int adaptToStepSize(final int number) { if (getStepSize() > 0) { int offset = number - getMinNumber(); int mod = offset % getStepSize(); float halfStepSize = (float) getStepSize() / 2.0f; int result = ((mod > halfStepSize) ? offset + getStepSize() - mod : offset - mod) + getMinNumber(); return Math.min(result, getMaxNumber()); } return number; }
class class_name[name] begin[{] method[adaptToStepSize, return_type[type[int]], modifier[private], parameter[number]] begin[{] if[binary_operation[call[.getStepSize, parameter[]], >, literal[0]]] begin[{] local_variable[type[int], offset] local_variable[type[int], mod] local_variable[type[float], halfStepSize] local_variable[type[int], result] return[call[Math.min, parameter[member[.result], call[.getMaxNumber, parameter[]]]]] else begin[{] None end[}] return[member[.number]] end[}] END[}]
Keyword[private] Keyword[int] identifier[adaptToStepSize] operator[SEP] Keyword[final] Keyword[int] identifier[number] operator[SEP] { Keyword[if] operator[SEP] identifier[getStepSize] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[int] identifier[offset] operator[=] identifier[number] operator[-] identifier[getMinNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[mod] operator[=] identifier[offset] operator[%] identifier[getStepSize] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[halfStepSize] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[getStepSize] operator[SEP] operator[SEP] operator[/] literal[Float] operator[SEP] Keyword[int] identifier[result] operator[=] operator[SEP] operator[SEP] identifier[mod] operator[>] identifier[halfStepSize] operator[SEP] operator[?] identifier[offset] operator[+] identifier[getStepSize] operator[SEP] operator[SEP] operator[-] identifier[mod] operator[:] identifier[offset] operator[-] identifier[mod] operator[SEP] operator[+] identifier[getMinNumber] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[result] , identifier[getMaxNumber] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[number] operator[SEP] }
private Set<Dataset> getDatasetsWithThrowables() { Set<Dataset> datasetsWithThrowables = Sets.newHashSet(); for (Dataset dataset : this.datasets) { if (!dataset.throwables().isEmpty()) { datasetsWithThrowables.add(dataset); } } return datasetsWithThrowables; }
class class_name[name] begin[{] method[getDatasetsWithThrowables, return_type[type[Set]], modifier[private], parameter[]] begin[{] local_variable[type[Set], datasetsWithThrowables] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=throwables, postfix_operators=[], prefix_operators=['!'], qualifier=dataset, selectors=[MethodInvocation(arguments=[], member=isEmpty, 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=MethodInvocation(arguments=[MemberReference(member=dataset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=datasetsWithThrowables, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=datasets, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dataset)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Dataset, sub_type=None))), label=None) return[member[.datasetsWithThrowables]] end[}] END[}]
Keyword[private] identifier[Set] operator[<] identifier[Dataset] operator[>] identifier[getDatasetsWithThrowables] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[Dataset] operator[>] identifier[datasetsWithThrowables] operator[=] identifier[Sets] operator[SEP] identifier[newHashSet] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Dataset] identifier[dataset] operator[:] Keyword[this] operator[SEP] identifier[datasets] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[dataset] operator[SEP] identifier[throwables] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[datasetsWithThrowables] operator[SEP] identifier[add] operator[SEP] identifier[dataset] operator[SEP] operator[SEP] } } Keyword[return] identifier[datasetsWithThrowables] operator[SEP] }
public DescribeInstanceHealthResult withInstanceStates(InstanceState... instanceStates) { if (this.instanceStates == null) { setInstanceStates(new com.amazonaws.internal.SdkInternalList<InstanceState>(instanceStates.length)); } for (InstanceState ele : instanceStates) { this.instanceStates.add(ele); } return this; }
class class_name[name] begin[{] method[withInstanceStates, return_type[type[DescribeInstanceHealthResult]], modifier[public], parameter[instanceStates]] begin[{] if[binary_operation[THIS[member[None.instanceStates]], ==, literal[null]]] begin[{] call[.setInstanceStates, parameter[ClassCreator(arguments=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=instanceStates, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=InstanceState, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=instanceStates, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=ele, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=instanceStates, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=ele)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InstanceState, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[DescribeInstanceHealthResult] identifier[withInstanceStates] operator[SEP] identifier[InstanceState] operator[...] identifier[instanceStates] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[instanceStates] operator[==] Other[null] operator[SEP] { identifier[setInstanceStates] operator[SEP] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[InstanceState] operator[>] operator[SEP] identifier[instanceStates] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[InstanceState] identifier[ele] operator[:] identifier[instanceStates] operator[SEP] { Keyword[this] operator[SEP] identifier[instanceStates] operator[SEP] identifier[add] operator[SEP] identifier[ele] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
@Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.IPD__IOC_ADAT: setIOCAdat((byte[])newValue); return; case AfplibPackage.IPD__IMAGE_DATA: setImageData((byte[])newValue); return; } super.eSet(featureID, newValue); }
class class_name[name] begin[{] method[eSet, return_type[void], modifier[public], parameter[featureID, newValue]] begin[{] SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=IPD__IOC_ADAT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=byte))], member=setIOCAdat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=IPD__IMAGE_DATA, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[None], name=byte))], member=setImageData, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None) SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eSet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[eSet] operator[SEP] Keyword[int] identifier[featureID] , identifier[Object] identifier[newValue] operator[SEP] { Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] { Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[IPD__IOC_ADAT] operator[:] identifier[setIOCAdat] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[IPD__IMAGE_DATA] operator[:] identifier[setImageData] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] identifier[newValue] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[super] operator[SEP] identifier[eSet] operator[SEP] identifier[featureID] , identifier[newValue] operator[SEP] operator[SEP] }
public FessMessages addConstraintsNotBlankMessage(String property) { assertPropertyNotNull(property); add(property, new UserMessage(CONSTRAINTS_NotBlank_MESSAGE)); return this; }
class class_name[name] begin[{] method[addConstraintsNotBlankMessage, return_type[type[FessMessages]], modifier[public], parameter[property]] begin[{] call[.assertPropertyNotNull, parameter[member[.property]]] call[.add, parameter[member[.property], ClassCreator(arguments=[MemberReference(member=CONSTRAINTS_NotBlank_MESSAGE, 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=UserMessage, sub_type=None))]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[FessMessages] identifier[addConstraintsNotBlankMessage] operator[SEP] identifier[String] identifier[property] operator[SEP] { identifier[assertPropertyNotNull] operator[SEP] identifier[property] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[property] , Keyword[new] identifier[UserMessage] operator[SEP] identifier[CONSTRAINTS_NotBlank_MESSAGE] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public JsonObject put(final String key, final String value) { Objects.requireNonNull(key); map.put(key, value); return this; }
class class_name[name] begin[{] method[put, return_type[type[JsonObject]], modifier[public], parameter[key, value]] begin[{] call[Objects.requireNonNull, parameter[member[.key]]] call[map.put, parameter[member[.key], member[.value]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[JsonObject] identifier[put] operator[SEP] Keyword[final] identifier[String] identifier[key] , Keyword[final] identifier[String] identifier[value] operator[SEP] { identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public EClass getIfcArbitraryOpenProfileDef() { if (ifcArbitraryOpenProfileDefEClass == null) { ifcArbitraryOpenProfileDefEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(29); } return ifcArbitraryOpenProfileDefEClass; }
class class_name[name] begin[{] method[getIfcArbitraryOpenProfileDef, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcArbitraryOpenProfileDefEClass], ==, literal[null]]] begin[{] assign[member[.ifcArbitraryOpenProfileDefEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=29)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcArbitraryOpenProfileDefEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcArbitraryOpenProfileDef] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcArbitraryOpenProfileDefEClass] operator[==] Other[null] operator[SEP] { identifier[ifcArbitraryOpenProfileDefEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[29] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcArbitraryOpenProfileDefEClass] operator[SEP] }
public String getLocalHost() { InetAddress localAddress = addressLocal(); if (localAddress != null) return localAddress.getHostAddress(); else return null; }
class class_name[name] begin[{] method[getLocalHost, return_type[type[String]], modifier[public], parameter[]] begin[{] local_variable[type[InetAddress], localAddress] if[binary_operation[member[.localAddress], !=, literal[null]]] begin[{] return[call[localAddress.getHostAddress, parameter[]]] else begin[{] return[literal[null]] end[}] end[}] END[}]
Keyword[public] identifier[String] identifier[getLocalHost] operator[SEP] operator[SEP] { identifier[InetAddress] identifier[localAddress] operator[=] identifier[addressLocal] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[localAddress] operator[!=] Other[null] operator[SEP] Keyword[return] identifier[localAddress] operator[SEP] identifier[getHostAddress] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[return] Other[null] operator[SEP] }
public static String SITInfo( EnumMap<SIT, EnumMap<CIT, Boolean>> shp ){ StringBuilder result = new StringBuilder(); for( SIT key: shp.keySet() ){ result.append("\t"+key.toString()+":"+CITInfo( shp.get(key))+"\n"); } return result.toString(); }
class class_name[name] begin[{] method[SITInfo, return_type[type[String]], modifier[public static], parameter[shp]] begin[{] local_variable[type[StringBuilder], result] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\t"), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=key, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operator=+), operandr=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=shp, selectors=[], type_arguments=None)], member=CITInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), operator=+)], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=shp, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SIT, sub_type=None))), label=None) return[call[result.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[SITInfo] operator[SEP] identifier[EnumMap] operator[<] identifier[SIT] , identifier[EnumMap] operator[<] identifier[CIT] , identifier[Boolean] operator[>] operator[>] identifier[shp] operator[SEP] { identifier[StringBuilder] identifier[result] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SIT] identifier[key] operator[:] identifier[shp] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[+] identifier[key] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[CITInfo] operator[SEP] identifier[shp] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public static void checkArgument( boolean expression, String messageFormat, Object... messageArgs) { if (!expression) { throw new IllegalArgumentException(format(messageFormat, messageArgs)); } }
class class_name[name] begin[{] method[checkArgument, return_type[void], modifier[public static], parameter[expression, messageFormat, messageArgs]] begin[{] if[member[.expression]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=messageFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=messageArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[checkArgument] operator[SEP] Keyword[boolean] identifier[expression] , identifier[String] identifier[messageFormat] , identifier[Object] operator[...] identifier[messageArgs] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[expression] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] identifier[format] operator[SEP] identifier[messageFormat] , identifier[messageArgs] operator[SEP] operator[SEP] operator[SEP] } }
@Nonnull public CompletableFuture<Optional<Object>> send(final Object data, final MediaType type) { return event(data).type(type).send(); }
class class_name[name] begin[{] method[send, return_type[type[CompletableFuture]], modifier[public], parameter[data, type]] begin[{] return[call[.event, parameter[member[.data]]]] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] identifier[CompletableFuture] operator[<] identifier[Optional] operator[<] identifier[Object] operator[>] operator[>] identifier[send] operator[SEP] Keyword[final] identifier[Object] identifier[data] , Keyword[final] identifier[MediaType] identifier[type] operator[SEP] { Keyword[return] identifier[event] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[type] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[send] operator[SEP] operator[SEP] operator[SEP] }
@Implementation protected void prepare() { checkStateException("prepare()", preparableStates); MediaInfo info = getMediaInfo(); if (info.preparationDelay > 0) { SystemClock.sleep(info.preparationDelay); } invokePreparedListener(); }
class class_name[name] begin[{] method[prepare, return_type[void], modifier[protected], parameter[]] begin[{] call[.checkStateException, parameter[literal["prepare()"], member[.preparableStates]]] local_variable[type[MediaInfo], info] if[binary_operation[member[info.preparationDelay], >, literal[0]]] begin[{] call[SystemClock.sleep, parameter[member[info.preparationDelay]]] else begin[{] None end[}] call[.invokePreparedListener, parameter[]] end[}] END[}]
annotation[@] identifier[Implementation] Keyword[protected] Keyword[void] identifier[prepare] operator[SEP] operator[SEP] { identifier[checkStateException] operator[SEP] literal[String] , identifier[preparableStates] operator[SEP] operator[SEP] identifier[MediaInfo] identifier[info] operator[=] identifier[getMediaInfo] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[info] operator[SEP] identifier[preparationDelay] operator[>] Other[0] operator[SEP] { identifier[SystemClock] operator[SEP] identifier[sleep] operator[SEP] identifier[info] operator[SEP] identifier[preparationDelay] operator[SEP] operator[SEP] } identifier[invokePreparedListener] operator[SEP] operator[SEP] operator[SEP] }
public List<ModelServiceInstance> getUPModelInstances(String serviceName){ List<ModelServiceInstance> list = new ArrayList<ModelServiceInstance>(); for(ModelServiceInstance instance : getModelInstances(serviceName)){ if(instance.getStatus().equals(OperationalStatus.UP)) { list.add(instance); } } return list; }
class class_name[name] begin[{] method[getUPModelInstances, return_type[type[List]], modifier[public], parameter[serviceName]] begin[{] local_variable[type[List], list] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getStatus, postfix_operators=[], prefix_operators=[], qualifier=instance, selectors=[MethodInvocation(arguments=[MemberReference(member=UP, postfix_operators=[], prefix_operators=[], qualifier=OperationalStatus, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=instance, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=serviceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getModelInstances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=instance)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ModelServiceInstance, sub_type=None))), label=None) return[member[.list]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[ModelServiceInstance] operator[>] identifier[getUPModelInstances] operator[SEP] identifier[String] identifier[serviceName] operator[SEP] { identifier[List] operator[<] identifier[ModelServiceInstance] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ModelServiceInstance] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ModelServiceInstance] identifier[instance] operator[:] identifier[getModelInstances] operator[SEP] identifier[serviceName] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[instance] operator[SEP] identifier[getStatus] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[OperationalStatus] operator[SEP] identifier[UP] operator[SEP] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[instance] operator[SEP] operator[SEP] } } Keyword[return] identifier[list] operator[SEP] }
private static boolean overlaps_(String scl, int dim_a, int dim_b) { if (dim_a == dim_b) { if (dim_a != 1) { // Valid for area-area, Point-Point if (scl.charAt(0) == 'T' && scl.charAt(1) == '*' && scl.charAt(2) == 'T' && scl.charAt(3) == '*' && scl.charAt(4) == '*' && scl.charAt(5) == '*' && scl.charAt(6) == 'T' && scl.charAt(7) == '*' && scl.charAt(8) == '*') return true; return false; } // Valid for Line-Line if (scl.charAt(0) == '1' && scl.charAt(1) == '*' && scl.charAt(2) == 'T' && scl.charAt(3) == '*' && scl.charAt(4) == '*' && scl.charAt(5) == '*' && scl.charAt(6) == 'T' && scl.charAt(7) == '*' && scl.charAt(8) == '*') return true; } return false; }
class class_name[name] begin[{] method[overlaps_, return_type[type[boolean]], modifier[private static], parameter[scl, dim_a, dim_b]] begin[{] if[binary_operation[member[.dim_a], ==, member[.dim_b]]] begin[{] if[binary_operation[member[.dim_a], !=, literal[1]]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[scl.charAt, parameter[literal[0]]], ==, literal['T']], &&, binary_operation[call[scl.charAt, parameter[literal[1]]], ==, literal['*']]], &&, binary_operation[call[scl.charAt, parameter[literal[2]]], ==, literal['T']]], &&, binary_operation[call[scl.charAt, parameter[literal[3]]], ==, literal['*']]], &&, binary_operation[call[scl.charAt, parameter[literal[4]]], ==, literal['*']]], &&, binary_operation[call[scl.charAt, parameter[literal[5]]], ==, literal['*']]], &&, binary_operation[call[scl.charAt, parameter[literal[6]]], ==, literal['T']]], &&, binary_operation[call[scl.charAt, parameter[literal[7]]], ==, literal['*']]], &&, binary_operation[call[scl.charAt, parameter[literal[8]]], ==, literal['*']]]] begin[{] return[literal[true]] else begin[{] None end[}] return[literal[false]] else begin[{] None end[}] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[scl.charAt, parameter[literal[0]]], ==, literal['1']], &&, binary_operation[call[scl.charAt, parameter[literal[1]]], ==, literal['*']]], &&, binary_operation[call[scl.charAt, parameter[literal[2]]], ==, literal['T']]], &&, binary_operation[call[scl.charAt, parameter[literal[3]]], ==, literal['*']]], &&, binary_operation[call[scl.charAt, parameter[literal[4]]], ==, literal['*']]], &&, binary_operation[call[scl.charAt, parameter[literal[5]]], ==, literal['*']]], &&, binary_operation[call[scl.charAt, parameter[literal[6]]], ==, literal['T']]], &&, binary_operation[call[scl.charAt, parameter[literal[7]]], ==, literal['*']]], &&, binary_operation[call[scl.charAt, parameter[literal[8]]], ==, literal['*']]]] begin[{] return[literal[true]] else begin[{] None end[}] else begin[{] None end[}] return[literal[false]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[overlaps_] operator[SEP] identifier[String] identifier[scl] , Keyword[int] identifier[dim_a] , Keyword[int] identifier[dim_b] operator[SEP] { Keyword[if] operator[SEP] identifier[dim_a] operator[==] identifier[dim_b] operator[SEP] { Keyword[if] operator[SEP] identifier[dim_a] operator[!=] Other[1] operator[SEP] { Keyword[if] operator[SEP] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[2] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[3] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[4] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[5] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[6] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[7] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[8] operator[SEP] operator[==] literal[String] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[2] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[3] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[4] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[5] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[6] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[7] operator[SEP] operator[==] literal[String] operator[&&] identifier[scl] operator[SEP] identifier[charAt] operator[SEP] Other[8] operator[SEP] operator[==] literal[String] operator[SEP] Keyword[return] literal[boolean] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public @NotNull ShortAssert isGreaterThan(short other) { if (actual > other) { return this; } failIfCustomMessageIsSet(); throw failure(unexpectedLessThanOrEqualTo(actual, other)); }
class class_name[name] begin[{] method[isGreaterThan, return_type[type[ShortAssert]], modifier[public], parameter[other]] begin[{] if[binary_operation[member[.actual], >, member[.other]]] begin[{] return[THIS[]] else begin[{] None end[}] call[.failIfCustomMessageIsSet, parameter[]] ThrowStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=actual, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unexpectedLessThanOrEqualTo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=failure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None) end[}] END[}]
Keyword[public] annotation[@] identifier[NotNull] identifier[ShortAssert] identifier[isGreaterThan] operator[SEP] Keyword[short] identifier[other] operator[SEP] { Keyword[if] operator[SEP] identifier[actual] operator[>] identifier[other] operator[SEP] { Keyword[return] Keyword[this] operator[SEP] } identifier[failIfCustomMessageIsSet] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] identifier[failure] operator[SEP] identifier[unexpectedLessThanOrEqualTo] operator[SEP] identifier[actual] , identifier[other] operator[SEP] operator[SEP] operator[SEP] }
protected void extendArray(int k) { // size + 1 could overflow if (this.size + k > this.keys.length) { int newCapacity; if (this.keys.length < 1024) { newCapacity = 2 * (this.size + k); } else { newCapacity = 5 * (this.size + k) / 4; } this.keys = Arrays.copyOf(this.keys, newCapacity); this.values = Arrays.copyOf(this.values, newCapacity); } }
class class_name[name] begin[{] method[extendArray, return_type[void], modifier[protected], parameter[k]] begin[{] if[binary_operation[binary_operation[THIS[member[None.size]], +, member[.k]], >, THIS[member[None.keys]member[None.length]]]] begin[{] local_variable[type[int], newCapacity] if[binary_operation[THIS[member[None.keys]member[None.length]], <, literal[1024]]] begin[{] assign[member[.newCapacity], binary_operation[literal[2], *, binary_operation[THIS[member[None.size]], +, member[.k]]]] else begin[{] assign[member[.newCapacity], binary_operation[binary_operation[literal[5], *, binary_operation[THIS[member[None.size]], +, member[.k]]], /, literal[4]]] end[}] assign[THIS[member[None.keys]], call[Arrays.copyOf, parameter[THIS[member[None.keys]], member[.newCapacity]]]] assign[THIS[member[None.values]], call[Arrays.copyOf, parameter[THIS[member[None.values]], member[.newCapacity]]]] else begin[{] None end[}] end[}] END[}]
Keyword[protected] Keyword[void] identifier[extendArray] operator[SEP] Keyword[int] identifier[k] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[size] operator[+] identifier[k] operator[>] Keyword[this] operator[SEP] identifier[keys] operator[SEP] identifier[length] operator[SEP] { Keyword[int] identifier[newCapacity] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[keys] operator[SEP] identifier[length] operator[<] Other[1024] operator[SEP] { identifier[newCapacity] operator[=] Other[2] operator[*] operator[SEP] Keyword[this] operator[SEP] identifier[size] operator[+] identifier[k] operator[SEP] operator[SEP] } Keyword[else] { identifier[newCapacity] operator[=] Other[5] operator[*] operator[SEP] Keyword[this] operator[SEP] identifier[size] operator[+] identifier[k] operator[SEP] operator[/] Other[4] operator[SEP] } Keyword[this] operator[SEP] identifier[keys] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] Keyword[this] operator[SEP] identifier[keys] , identifier[newCapacity] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[values] operator[=] identifier[Arrays] operator[SEP] identifier[copyOf] operator[SEP] Keyword[this] operator[SEP] identifier[values] , identifier[newCapacity] operator[SEP] operator[SEP] } }
public BsonDateTime getDateTime(final Object key, final BsonDateTime defaultValue) { if (!containsKey(key)) { return defaultValue; } return get(key).asDateTime(); }
class class_name[name] begin[{] method[getDateTime, return_type[type[BsonDateTime]], modifier[public], parameter[key, defaultValue]] begin[{] if[call[.containsKey, parameter[member[.key]]]] begin[{] return[member[.defaultValue]] else begin[{] None end[}] return[call[.get, parameter[member[.key]]]] end[}] END[}]
Keyword[public] identifier[BsonDateTime] identifier[getDateTime] operator[SEP] Keyword[final] identifier[Object] identifier[key] , Keyword[final] identifier[BsonDateTime] identifier[defaultValue] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] { Keyword[return] identifier[defaultValue] operator[SEP] } Keyword[return] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[asDateTime] operator[SEP] operator[SEP] operator[SEP] }
public void setValue(Integer newValue) { Integer oldValue = value; value = newValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.MMCRG__VALUE, oldValue, value)); }
class class_name[name] begin[{] method[setValue, return_type[void], modifier[public], parameter[newValue]] begin[{] local_variable[type[Integer], oldValue] assign[member[.value], member[.newValue]] if[call[.eNotificationRequired, parameter[]]] begin[{] call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=MMCRG__VALUE, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ENotificationImpl, sub_type=None))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[setValue] operator[SEP] identifier[Integer] identifier[newValue] operator[SEP] { identifier[Integer] identifier[oldValue] operator[=] identifier[value] operator[SEP] identifier[value] operator[=] identifier[newValue] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[MMCRG__VALUE] , identifier[oldValue] , identifier[value] operator[SEP] operator[SEP] operator[SEP] }
public static String dumpCursorToString(Cursor cursor) { StringBuilder sb = new StringBuilder(); dumpCursor(cursor, sb); return sb.toString(); }
class class_name[name] begin[{] method[dumpCursorToString, return_type[type[String]], modifier[public static], parameter[cursor]] begin[{] local_variable[type[StringBuilder], sb] call[.dumpCursor, parameter[member[.cursor], member[.sb]]] return[call[sb.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[dumpCursorToString] operator[SEP] identifier[Cursor] identifier[cursor] operator[SEP] { identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[dumpCursor] operator[SEP] identifier[cursor] , identifier[sb] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public void setTunnelConnections( Iterable<String> pathAndSpecList ) throws JSchException { Map<String, Set<Tunnel>> tunnelMap = new HashMap<String, Set<Tunnel>>(); for ( String pathAndSpecString : pathAndSpecList ) { String[] pathAndSpec = pathAndSpecString.trim().split( "\\|" ); Set<Tunnel> tunnelList = tunnelMap.get( pathAndSpec[0] ); if ( tunnelList == null ) { tunnelList = new HashSet<Tunnel>(); tunnelMap.put( pathAndSpec[0], tunnelList ); } tunnelList.add( new Tunnel( pathAndSpec[1] ) ); } tunnelConnections = new ArrayList<TunnelConnection>(); SessionFactoryCache sessionFactoryCache = new SessionFactoryCache( baseSessionFactory ); for ( String path : tunnelMap.keySet() ) { tunnelConnections.add( new TunnelConnection( sessionFactoryCache.getSessionFactory( path ), new ArrayList<Tunnel>( tunnelMap.get( path ) ) ) ); } }
class class_name[name] begin[{] method[setTunnelConnections, return_type[void], modifier[public], parameter[pathAndSpecList]] begin[{] local_variable[type[Map], tunnelMap] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=pathAndSpecString, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\\|")], member=split, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=pathAndSpec)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=pathAndSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tunnelMap, selectors=[], type_arguments=None), name=tunnelList)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Tunnel, sub_type=None))], dimensions=[], name=Set, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tunnelList, 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=tunnelList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Tunnel, sub_type=None))], dimensions=None, name=HashSet, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pathAndSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), MemberReference(member=tunnelList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=tunnelMap, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=pathAndSpec, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Tunnel, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=tunnelList, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pathAndSpecList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pathAndSpecString)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) assign[member[.tunnelConnections], 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=TunnelConnection, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] local_variable[type[SessionFactoryCache], sessionFactoryCache] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSessionFactory, postfix_operators=[], prefix_operators=[], qualifier=sessionFactoryCache, selectors=[], type_arguments=None), ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=tunnelMap, selectors=[], type_arguments=None)], 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=Tunnel, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TunnelConnection, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=tunnelConnections, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=tunnelMap, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=path)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[setTunnelConnections] operator[SEP] identifier[Iterable] operator[<] identifier[String] operator[>] identifier[pathAndSpecList] operator[SEP] Keyword[throws] identifier[JSchException] { identifier[Map] operator[<] identifier[String] , identifier[Set] operator[<] identifier[Tunnel] operator[>] operator[>] identifier[tunnelMap] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Set] operator[<] identifier[Tunnel] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[pathAndSpecString] operator[:] identifier[pathAndSpecList] operator[SEP] { identifier[String] operator[SEP] operator[SEP] identifier[pathAndSpec] operator[=] identifier[pathAndSpecString] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[Tunnel] operator[>] identifier[tunnelList] operator[=] identifier[tunnelMap] operator[SEP] identifier[get] operator[SEP] identifier[pathAndSpec] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tunnelList] operator[==] Other[null] operator[SEP] { identifier[tunnelList] operator[=] Keyword[new] identifier[HashSet] operator[<] identifier[Tunnel] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[tunnelMap] operator[SEP] identifier[put] operator[SEP] identifier[pathAndSpec] operator[SEP] Other[0] operator[SEP] , identifier[tunnelList] operator[SEP] operator[SEP] } identifier[tunnelList] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[Tunnel] operator[SEP] identifier[pathAndSpec] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[tunnelConnections] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[TunnelConnection] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[SessionFactoryCache] identifier[sessionFactoryCache] operator[=] Keyword[new] identifier[SessionFactoryCache] operator[SEP] identifier[baseSessionFactory] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[path] operator[:] identifier[tunnelMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] { identifier[tunnelConnections] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[TunnelConnection] operator[SEP] identifier[sessionFactoryCache] operator[SEP] identifier[getSessionFactory] operator[SEP] identifier[path] operator[SEP] , Keyword[new] identifier[ArrayList] operator[<] identifier[Tunnel] operator[>] operator[SEP] identifier[tunnelMap] operator[SEP] identifier[get] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public <H,R> Map<String,AttributeValue> convertKey(final H hashKey, final R rangeKey) { final Map<String,AttributeValue> key = new LinkedHashMap<String,AttributeValue>(4); final DynamoDBMapperFieldModel<T,H> hk = this.<H>hashKey(); final AttributeValue hkValue = hashKey == null ? null : hk.convert(hashKey); if (hkValue != null) { key.put(hk.name(), hkValue); } else { throw new DynamoDBMappingException( targetType.getSimpleName() + "[" + hk.name() + "]; no HASH key value present" ); } final DynamoDBMapperFieldModel<T,R> rk = this.<R>rangeKeyIfExists(); final AttributeValue rkValue = rangeKey == null ? null : rk.convert(rangeKey); if (rkValue != null) { key.put(rk.name(), rkValue); } else if (rk != null) { throw new DynamoDBMappingException( targetType.getSimpleName() + "[" + rk.name() + "]; no RANGE key value present" ); } return key; }
class class_name[name] begin[{] method[convertKey, return_type[type[Map]], modifier[public], parameter[hashKey, rangeKey]] begin[{] local_variable[type[Map], key] local_variable[type[DynamoDBMapperFieldModel], hk] local_variable[type[AttributeValue], hkValue] if[binary_operation[member[.hkValue], !=, literal[null]]] begin[{] call[key.put, parameter[call[hk.name, parameter[]], member[.hkValue]]] else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=targetType, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="["), operator=+), operandr=MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=hk, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]; no HASH key value present"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DynamoDBMappingException, sub_type=None)), label=None) end[}] local_variable[type[DynamoDBMapperFieldModel], rk] local_variable[type[AttributeValue], rkValue] if[binary_operation[member[.rkValue], !=, literal[null]]] begin[{] call[key.put, parameter[call[rk.name, parameter[]], member[.rkValue]]] else begin[{] if[binary_operation[member[.rk], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=[], prefix_operators=[], qualifier=targetType, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="["), operator=+), operandr=MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=rk, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="]; no RANGE key value present"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DynamoDBMappingException, sub_type=None)), label=None) else begin[{] None end[}] end[}] return[member[.key]] end[}] END[}]
Keyword[public] operator[<] identifier[H] , identifier[R] operator[>] identifier[Map] operator[<] identifier[String] , identifier[AttributeValue] operator[>] identifier[convertKey] operator[SEP] Keyword[final] identifier[H] identifier[hashKey] , Keyword[final] identifier[R] identifier[rangeKey] operator[SEP] { Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[AttributeValue] operator[>] identifier[key] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[AttributeValue] operator[>] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[final] identifier[DynamoDBMapperFieldModel] operator[<] identifier[T] , identifier[H] operator[>] identifier[hk] operator[=] Keyword[this] operator[SEP] operator[<] identifier[H] operator[>] identifier[hashKey] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[AttributeValue] identifier[hkValue] operator[=] identifier[hashKey] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[hk] operator[SEP] identifier[convert] operator[SEP] identifier[hashKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hkValue] operator[!=] Other[null] operator[SEP] { identifier[key] operator[SEP] identifier[put] operator[SEP] identifier[hk] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[hkValue] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[DynamoDBMappingException] operator[SEP] identifier[targetType] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[hk] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[final] identifier[DynamoDBMapperFieldModel] operator[<] identifier[T] , identifier[R] operator[>] identifier[rk] operator[=] Keyword[this] operator[SEP] operator[<] identifier[R] operator[>] identifier[rangeKeyIfExists] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[AttributeValue] identifier[rkValue] operator[=] identifier[rangeKey] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[rk] operator[SEP] identifier[convert] operator[SEP] identifier[rangeKey] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rkValue] operator[!=] Other[null] operator[SEP] { identifier[key] operator[SEP] identifier[put] operator[SEP] identifier[rk] operator[SEP] identifier[name] operator[SEP] operator[SEP] , identifier[rkValue] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[rk] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[DynamoDBMappingException] operator[SEP] identifier[targetType] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[rk] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[key] operator[SEP] }
public static ZooClassDef bootstrapZooClassDef() { ZooClassDef meta = new ZooClassDef(ZooClassDef.class.getName(), 51, 50, 51, 0); ArrayList<ZooFieldDef> fields = new ArrayList<ZooFieldDef>(); fields.add(new ZooFieldDef(meta, "className", String.class.getName(), 0, JdoType.STRING, 70)); fields.add(new ZooFieldDef(meta, "oidSuper", long.class.getName(), 0, JdoType.PRIMITIVE, 71)); fields.add(new ZooFieldDef(meta, "schemaId", long.class.getName(), 0, JdoType.PRIMITIVE, 72)); fields.add(new ZooFieldDef(meta, "versionId", short.class.getName(), 0, JdoType.PRIMITIVE, 73)); fields.add(new ZooFieldDef(meta, "localFields", ArrayList.class.getName(), 0, JdoType.SCO, 74)); fields.add(new ZooFieldDef(meta, "prevVersionOid", long.class.getName(), 0, JdoType.PRIMITIVE, 75)); fields.add(new ZooFieldDef(meta, "evolutionOperations", ArrayList.class.getName(), 0, JdoType.SCO, 76)); //new ZooFieldDef(this, allFields, ZooFieldDef[].class.getName(), typeOid, JdoType.ARRAY); meta.registerFields(fields); meta.cls = ZooClassDef.class; meta.className = ZooClassDef.class.getName(); meta.associateFields(); meta.associateJavaTypes(); return meta; }
class class_name[name] begin[{] method[bootstrapZooClassDef, return_type[type[ZooClassDef]], modifier[public static], parameter[]] begin[{] local_variable[type[ZooClassDef], meta] local_variable[type[ArrayList], fields] call[fields.add, parameter[ClassCreator(arguments=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="className"), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=STRING, postfix_operators=[], prefix_operators=[], qualifier=JdoType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=70)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZooFieldDef, sub_type=None))]] call[fields.add, parameter[ClassCreator(arguments=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="oidSuper"), ClassReference(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=BasicType(dimensions=[], name=long)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=PRIMITIVE, postfix_operators=[], prefix_operators=[], qualifier=JdoType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=71)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZooFieldDef, sub_type=None))]] call[fields.add, parameter[ClassCreator(arguments=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="schemaId"), ClassReference(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=BasicType(dimensions=[], name=long)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=PRIMITIVE, postfix_operators=[], prefix_operators=[], qualifier=JdoType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=72)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZooFieldDef, sub_type=None))]] call[fields.add, parameter[ClassCreator(arguments=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="versionId"), ClassReference(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=BasicType(dimensions=[], name=short)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=PRIMITIVE, postfix_operators=[], prefix_operators=[], qualifier=JdoType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=73)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZooFieldDef, sub_type=None))]] call[fields.add, parameter[ClassCreator(arguments=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="localFields"), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=SCO, postfix_operators=[], prefix_operators=[], qualifier=JdoType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=74)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZooFieldDef, sub_type=None))]] call[fields.add, parameter[ClassCreator(arguments=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="prevVersionOid"), ClassReference(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=BasicType(dimensions=[], name=long)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=PRIMITIVE, postfix_operators=[], prefix_operators=[], qualifier=JdoType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=75)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZooFieldDef, sub_type=None))]] call[fields.add, parameter[ClassCreator(arguments=[MemberReference(member=meta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="evolutionOperations"), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=SCO, postfix_operators=[], prefix_operators=[], qualifier=JdoType, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=76)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZooFieldDef, sub_type=None))]] call[meta.registerFields, parameter[member[.fields]]] assign[member[meta.cls], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ZooClassDef, sub_type=None))] assign[member[meta.className], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ZooClassDef, sub_type=None))] call[meta.associateFields, parameter[]] call[meta.associateJavaTypes, parameter[]] return[member[.meta]] end[}] END[}]
Keyword[public] Keyword[static] identifier[ZooClassDef] identifier[bootstrapZooClassDef] operator[SEP] operator[SEP] { identifier[ZooClassDef] identifier[meta] operator[=] Keyword[new] identifier[ZooClassDef] operator[SEP] identifier[ZooClassDef] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Other[51] , Other[50] , Other[51] , Other[0] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[ZooFieldDef] operator[>] identifier[fields] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[ZooFieldDef] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ZooFieldDef] operator[SEP] identifier[meta] , literal[String] , identifier[String] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Other[0] , identifier[JdoType] operator[SEP] identifier[STRING] , Other[70] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ZooFieldDef] operator[SEP] identifier[meta] , literal[String] , Keyword[long] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Other[0] , identifier[JdoType] operator[SEP] identifier[PRIMITIVE] , Other[71] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ZooFieldDef] operator[SEP] identifier[meta] , literal[String] , Keyword[long] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Other[0] , identifier[JdoType] operator[SEP] identifier[PRIMITIVE] , Other[72] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ZooFieldDef] operator[SEP] identifier[meta] , literal[String] , Keyword[short] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Other[0] , identifier[JdoType] operator[SEP] identifier[PRIMITIVE] , Other[73] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ZooFieldDef] operator[SEP] identifier[meta] , literal[String] , identifier[ArrayList] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Other[0] , identifier[JdoType] operator[SEP] identifier[SCO] , Other[74] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ZooFieldDef] operator[SEP] identifier[meta] , literal[String] , Keyword[long] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Other[0] , identifier[JdoType] operator[SEP] identifier[PRIMITIVE] , Other[75] operator[SEP] operator[SEP] operator[SEP] identifier[fields] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ZooFieldDef] operator[SEP] identifier[meta] , literal[String] , identifier[ArrayList] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Other[0] , identifier[JdoType] operator[SEP] identifier[SCO] , Other[76] operator[SEP] operator[SEP] operator[SEP] identifier[meta] operator[SEP] identifier[registerFields] operator[SEP] identifier[fields] operator[SEP] operator[SEP] identifier[meta] operator[SEP] identifier[cls] operator[=] identifier[ZooClassDef] operator[SEP] Keyword[class] operator[SEP] identifier[meta] operator[SEP] identifier[className] operator[=] identifier[ZooClassDef] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[meta] operator[SEP] identifier[associateFields] operator[SEP] operator[SEP] operator[SEP] identifier[meta] operator[SEP] identifier[associateJavaTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[meta] operator[SEP] }
public static AssociativeArray2D survivalFunction(FlatDataCollection flatDataCollection) { AssociativeArray2D survivalFunction = new AssociativeArray2D(); //AssociativeArray2D is important to maintain the order of the first keys Queue<Double> censoredData = new PriorityQueue<>(); Queue<Double> uncensoredData = new PriorityQueue<>(); int n = flatDataCollection.size(); if(n==0) { throw new IllegalArgumentException("The provided collection can't be empty."); } for(Object value : flatDataCollection) { String str = value.toString(); if(str.endsWith(CENSORED_NUMBER_POSTFIX)) { //censored internalData encoded as 4.3+ or -4.3+ censoredData.add(Double.valueOf(str.substring(0,str.length()-CENSORED_NUMBER_POSTFIX.length()))); //remove the trailing char and convert it to double } else { //uncensored internalData uncensoredData.add(TypeInference.toDouble(value)); //convert it to double } } Double currentCensored = null; Double currentUncensored = null; int i = 1; double previousUncensoredValue = 1.0; double varianceDenominator = 0.0; do { if(currentCensored==null) { currentCensored=censoredData.poll(); } if(currentUncensored==null) { currentUncensored=uncensoredData.poll(); } boolean isCensored = false; String key; if(currentUncensored == null) { key=currentCensored.toString().concat(CENSORED_NUMBER_POSTFIX); currentCensored = null; isCensored = true; } else if(currentCensored == null) { key=currentUncensored.toString(); currentUncensored = null; } else if(currentCensored<currentUncensored) { //NOT EQUAL! Uncensored internalData of the same value are always larger key=currentCensored.toString().concat(CENSORED_NUMBER_POSTFIX); currentCensored = null; isCensored = true; } else { key=currentUncensored.toString(); currentUncensored = null; } Integer previousMi = (Integer)survivalFunction.get2d(key, "mi"); if(previousMi==null) { previousMi=0; } //in case of ties the last value will overwrite the previous. Thus we make automatically the tie correction survivalFunction.put2d(key, "i", i); survivalFunction.put2d(key, "mi", previousMi+1); if(isCensored==false) { survivalFunction.put2d(key, "r", i); double Sti=(n-i)/(n-i+1.0)*previousUncensoredValue; if(n-i>0) { varianceDenominator+=1.0/((n-i)*(n-i+1.0)); } survivalFunction.put2d(key, "Sti", Sti); survivalFunction.put2d(key, "varianceSti", Sti*Sti*varianceDenominator); previousUncensoredValue=Sti; } ++i; } while(currentCensored!=null || currentUncensored!=null || !censoredData.isEmpty() || !uncensoredData.isEmpty()); //censoredData=null; //uncensoredData=null; return survivalFunction; }
class class_name[name] begin[{] method[survivalFunction, return_type[type[AssociativeArray2D]], modifier[public static], parameter[flatDataCollection]] begin[{] local_variable[type[AssociativeArray2D], survivalFunction] local_variable[type[Queue], censoredData] local_variable[type[Queue], uncensoredData] local_variable[type[int], n] if[binary_operation[member[.n], ==, literal[0]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The provided collection can't be empty.")], 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=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None), name=str)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=CENSORED_NUMBER_POSTFIX, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=endsWith, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toDouble, postfix_operators=[], prefix_operators=[], qualifier=TypeInference, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=uncensoredData, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=CENSORED_NUMBER_POSTFIX, selectors=[], type_arguments=None), operator=-)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=censoredData, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=flatDataCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) local_variable[type[Double], currentCensored] local_variable[type[Double], currentUncensored] local_variable[type[int], i] local_variable[type[double], previousUncensoredValue] local_variable[type[double], varianceDenominator] do[binary_operation[binary_operation[binary_operation[binary_operation[member[.currentCensored], !=, literal[null]], ||, binary_operation[member[.currentUncensored], !=, literal[null]]], ||, call[censoredData.isEmpty, parameter[]]], ||, call[uncensoredData.isEmpty, parameter[]]]] begin[{] if[binary_operation[member[.currentCensored], ==, literal[null]]] begin[{] assign[member[.currentCensored], call[censoredData.poll, parameter[]]] else begin[{] None end[}] if[binary_operation[member[.currentUncensored], ==, literal[null]]] begin[{] assign[member[.currentUncensored], call[uncensoredData.poll, parameter[]]] else begin[{] None end[}] local_variable[type[boolean], isCensored] local_variable[type[String], key] if[binary_operation[member[.currentUncensored], ==, literal[null]]] begin[{] assign[member[.key], call[currentCensored.toString, parameter[]]] assign[member[.currentCensored], literal[null]] assign[member[.isCensored], literal[true]] else begin[{] if[binary_operation[member[.currentCensored], ==, literal[null]]] begin[{] assign[member[.key], call[currentUncensored.toString, parameter[]]] assign[member[.currentUncensored], literal[null]] else begin[{] if[binary_operation[member[.currentCensored], <, member[.currentUncensored]]] begin[{] assign[member[.key], call[currentCensored.toString, parameter[]]] assign[member[.currentCensored], literal[null]] assign[member[.isCensored], literal[true]] else begin[{] assign[member[.key], call[currentUncensored.toString, parameter[]]] assign[member[.currentUncensored], literal[null]] end[}] end[}] end[}] local_variable[type[Integer], previousMi] if[binary_operation[member[.previousMi], ==, literal[null]]] begin[{] assign[member[.previousMi], literal[0]] else begin[{] None end[}] call[survivalFunction.put2d, parameter[member[.key], literal["i"], member[.i]]] call[survivalFunction.put2d, parameter[member[.key], literal["mi"], binary_operation[member[.previousMi], +, literal[1]]]] if[binary_operation[member[.isCensored], ==, literal[false]]] begin[{] call[survivalFunction.put2d, parameter[member[.key], literal["r"], member[.i]]] local_variable[type[double], Sti] if[binary_operation[binary_operation[member[.n], -, member[.i]], >, literal[0]]] begin[{] assign[member[.varianceDenominator], binary_operation[literal[1.0], /, binary_operation[binary_operation[member[.n], -, member[.i]], *, binary_operation[binary_operation[member[.n], -, member[.i]], +, literal[1.0]]]]] else begin[{] None end[}] call[survivalFunction.put2d, parameter[member[.key], literal["Sti"], member[.Sti]]] call[survivalFunction.put2d, parameter[member[.key], literal["varianceSti"], binary_operation[binary_operation[member[.Sti], *, member[.Sti]], *, member[.varianceDenominator]]]] assign[member[.previousUncensoredValue], member[.Sti]] else begin[{] None end[}] member[.i] end[}] return[member[.survivalFunction]] end[}] END[}]
Keyword[public] Keyword[static] identifier[AssociativeArray2D] identifier[survivalFunction] operator[SEP] identifier[FlatDataCollection] identifier[flatDataCollection] operator[SEP] { identifier[AssociativeArray2D] identifier[survivalFunction] operator[=] Keyword[new] identifier[AssociativeArray2D] operator[SEP] operator[SEP] operator[SEP] identifier[Queue] operator[<] identifier[Double] operator[>] identifier[censoredData] operator[=] Keyword[new] identifier[PriorityQueue] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Queue] operator[<] identifier[Double] operator[>] identifier[uncensoredData] operator[=] Keyword[new] identifier[PriorityQueue] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[n] operator[=] identifier[flatDataCollection] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[==] Other[0] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] identifier[Object] identifier[value] operator[:] identifier[flatDataCollection] operator[SEP] { identifier[String] identifier[str] operator[=] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[str] operator[SEP] identifier[endsWith] operator[SEP] identifier[CENSORED_NUMBER_POSTFIX] operator[SEP] operator[SEP] { identifier[censoredData] operator[SEP] identifier[add] operator[SEP] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[str] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[CENSORED_NUMBER_POSTFIX] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[uncensoredData] operator[SEP] identifier[add] operator[SEP] identifier[TypeInference] operator[SEP] identifier[toDouble] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] } } identifier[Double] identifier[currentCensored] operator[=] Other[null] operator[SEP] identifier[Double] identifier[currentUncensored] operator[=] Other[null] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] Keyword[double] identifier[previousUncensoredValue] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[varianceDenominator] operator[=] literal[Float] operator[SEP] Keyword[do] { Keyword[if] operator[SEP] identifier[currentCensored] operator[==] Other[null] operator[SEP] { identifier[currentCensored] operator[=] identifier[censoredData] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[currentUncensored] operator[==] Other[null] operator[SEP] { identifier[currentUncensored] operator[=] identifier[uncensoredData] operator[SEP] identifier[poll] operator[SEP] operator[SEP] operator[SEP] } Keyword[boolean] identifier[isCensored] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[key] operator[SEP] Keyword[if] operator[SEP] identifier[currentUncensored] operator[==] Other[null] operator[SEP] { identifier[key] operator[=] identifier[currentCensored] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[concat] operator[SEP] identifier[CENSORED_NUMBER_POSTFIX] operator[SEP] operator[SEP] identifier[currentCensored] operator[=] Other[null] operator[SEP] identifier[isCensored] operator[=] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[currentCensored] operator[==] Other[null] operator[SEP] { identifier[key] operator[=] identifier[currentUncensored] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[currentUncensored] operator[=] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[currentCensored] operator[<] identifier[currentUncensored] operator[SEP] { identifier[key] operator[=] identifier[currentCensored] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[concat] operator[SEP] identifier[CENSORED_NUMBER_POSTFIX] operator[SEP] operator[SEP] identifier[currentCensored] operator[=] Other[null] operator[SEP] identifier[isCensored] operator[=] literal[boolean] operator[SEP] } Keyword[else] { identifier[key] operator[=] identifier[currentUncensored] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[currentUncensored] operator[=] Other[null] operator[SEP] } identifier[Integer] identifier[previousMi] operator[=] operator[SEP] identifier[Integer] operator[SEP] identifier[survivalFunction] operator[SEP] identifier[get2d] operator[SEP] identifier[key] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[previousMi] operator[==] Other[null] operator[SEP] { identifier[previousMi] operator[=] Other[0] operator[SEP] } identifier[survivalFunction] operator[SEP] identifier[put2d] operator[SEP] identifier[key] , literal[String] , identifier[i] operator[SEP] operator[SEP] identifier[survivalFunction] operator[SEP] identifier[put2d] operator[SEP] identifier[key] , literal[String] , identifier[previousMi] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[isCensored] operator[==] literal[boolean] operator[SEP] { identifier[survivalFunction] operator[SEP] identifier[put2d] operator[SEP] identifier[key] , literal[String] , identifier[i] operator[SEP] operator[SEP] Keyword[double] identifier[Sti] operator[=] operator[SEP] identifier[n] operator[-] identifier[i] operator[SEP] operator[/] operator[SEP] identifier[n] operator[-] identifier[i] operator[+] literal[Float] operator[SEP] operator[*] identifier[previousUncensoredValue] operator[SEP] Keyword[if] operator[SEP] identifier[n] operator[-] identifier[i] operator[>] Other[0] operator[SEP] { identifier[varianceDenominator] operator[+=] literal[Float] operator[/] operator[SEP] operator[SEP] identifier[n] operator[-] identifier[i] operator[SEP] operator[*] operator[SEP] identifier[n] operator[-] identifier[i] operator[+] literal[Float] operator[SEP] operator[SEP] operator[SEP] } identifier[survivalFunction] operator[SEP] identifier[put2d] operator[SEP] identifier[key] , literal[String] , identifier[Sti] operator[SEP] operator[SEP] identifier[survivalFunction] operator[SEP] identifier[put2d] operator[SEP] identifier[key] , literal[String] , identifier[Sti] operator[*] identifier[Sti] operator[*] identifier[varianceDenominator] operator[SEP] operator[SEP] identifier[previousUncensoredValue] operator[=] identifier[Sti] operator[SEP] } operator[++] identifier[i] operator[SEP] } Keyword[while] operator[SEP] identifier[currentCensored] operator[!=] Other[null] operator[||] identifier[currentUncensored] operator[!=] Other[null] operator[||] operator[!] identifier[censoredData] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] operator[!] identifier[uncensoredData] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[survivalFunction] operator[SEP] }
public static int argmax(double[] v) { assert (v.length > 0); int maxIndex = 0; double currentMax = v[0]; for(int i = 1; i < v.length; i++) { final double x = v[i]; if(x > currentMax) { maxIndex = i; currentMax = x; } } return maxIndex; }
class class_name[name] begin[{] method[argmax, return_type[type[int]], modifier[public static], parameter[v]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=v, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None, value=None) local_variable[type[int], maxIndex] local_variable[type[double], currentMax] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=v, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=x)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=currentMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentMax, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=v, 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) return[member[.maxIndex]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[argmax] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[v] operator[SEP] { Keyword[assert] operator[SEP] identifier[v] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] operator[SEP] Keyword[int] identifier[maxIndex] operator[=] Other[0] operator[SEP] Keyword[double] identifier[currentMax] operator[=] identifier[v] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] identifier[v] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[final] Keyword[double] identifier[x] operator[=] identifier[v] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[x] operator[>] identifier[currentMax] operator[SEP] { identifier[maxIndex] operator[=] identifier[i] operator[SEP] identifier[currentMax] operator[=] identifier[x] operator[SEP] } } Keyword[return] identifier[maxIndex] operator[SEP] }
protected void destroyConnection(ConnectionHandle conn) { postDestroyConnection(conn); conn.setInReplayMode(true); // we're dead, stop attempting to replay anything try { conn.internalClose(); } catch (SQLException e) { logger.error("Error in attempting to close connection", e); } }
class class_name[name] begin[{] method[destroyConnection, return_type[void], modifier[protected], parameter[conn]] begin[{] call[.postDestroyConnection, parameter[member[.conn]]] call[conn.setInReplayMode, parameter[literal[true]]] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=internalClose, postfix_operators=[], prefix_operators=[], qualifier=conn, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error in attempting to close connection"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] Keyword[void] identifier[destroyConnection] operator[SEP] identifier[ConnectionHandle] identifier[conn] operator[SEP] { identifier[postDestroyConnection] operator[SEP] identifier[conn] operator[SEP] operator[SEP] identifier[conn] operator[SEP] identifier[setInReplayMode] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[try] { identifier[conn] operator[SEP] identifier[internalClose] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }
@Override public LiveLocalStoreDataflow analyze(IAnalysisCache analysisCache, MethodDescriptor descriptor) throws CheckedAnalysisException { MethodGen methodGen = getMethodGen(analysisCache, descriptor); if (methodGen == null) { return null; } CFG cfg = getCFG(analysisCache, descriptor); ReverseDepthFirstSearch rdfs = getReverseDepthFirstSearch(analysisCache, descriptor); LiveLocalStoreAnalysis analysis = new LiveLocalStoreAnalysis(methodGen, rdfs, getDepthFirstSearch(analysisCache, descriptor)); LiveLocalStoreDataflow dataflow = new LiveLocalStoreDataflow(cfg, analysis); dataflow.execute(); if (ClassContext.DUMP_DATAFLOW_ANALYSIS) { ClassContext.dumpLiveLocalStoreDataflow(descriptor, cfg, dataflow); } return dataflow; }
class class_name[name] begin[{] method[analyze, return_type[type[LiveLocalStoreDataflow]], modifier[public], parameter[analysisCache, descriptor]] begin[{] local_variable[type[MethodGen], methodGen] if[binary_operation[member[.methodGen], ==, literal[null]]] begin[{] return[literal[null]] else begin[{] None end[}] local_variable[type[CFG], cfg] local_variable[type[ReverseDepthFirstSearch], rdfs] local_variable[type[LiveLocalStoreAnalysis], analysis] local_variable[type[LiveLocalStoreDataflow], dataflow] call[dataflow.execute, parameter[]] if[member[ClassContext.DUMP_DATAFLOW_ANALYSIS]] begin[{] call[ClassContext.dumpLiveLocalStoreDataflow, parameter[member[.descriptor], member[.cfg], member[.dataflow]]] else begin[{] None end[}] return[member[.dataflow]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[LiveLocalStoreDataflow] identifier[analyze] operator[SEP] identifier[IAnalysisCache] identifier[analysisCache] , identifier[MethodDescriptor] identifier[descriptor] operator[SEP] Keyword[throws] identifier[CheckedAnalysisException] { identifier[MethodGen] identifier[methodGen] operator[=] identifier[getMethodGen] operator[SEP] identifier[analysisCache] , identifier[descriptor] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[methodGen] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } identifier[CFG] identifier[cfg] operator[=] identifier[getCFG] operator[SEP] identifier[analysisCache] , identifier[descriptor] operator[SEP] operator[SEP] identifier[ReverseDepthFirstSearch] identifier[rdfs] operator[=] identifier[getReverseDepthFirstSearch] operator[SEP] identifier[analysisCache] , identifier[descriptor] operator[SEP] operator[SEP] identifier[LiveLocalStoreAnalysis] identifier[analysis] operator[=] Keyword[new] identifier[LiveLocalStoreAnalysis] operator[SEP] identifier[methodGen] , identifier[rdfs] , identifier[getDepthFirstSearch] operator[SEP] identifier[analysisCache] , identifier[descriptor] operator[SEP] operator[SEP] operator[SEP] identifier[LiveLocalStoreDataflow] identifier[dataflow] operator[=] Keyword[new] identifier[LiveLocalStoreDataflow] operator[SEP] identifier[cfg] , identifier[analysis] operator[SEP] operator[SEP] identifier[dataflow] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ClassContext] operator[SEP] identifier[DUMP_DATAFLOW_ANALYSIS] operator[SEP] { identifier[ClassContext] operator[SEP] identifier[dumpLiveLocalStoreDataflow] operator[SEP] identifier[descriptor] , identifier[cfg] , identifier[dataflow] operator[SEP] operator[SEP] } Keyword[return] identifier[dataflow] operator[SEP] }
@Override public List<MemorySegment> dispose() { this.freeMemory.addAll(this.sortBuffer); this.sortBuffer.clear(); return this.freeMemory; }
class class_name[name] begin[{] method[dispose, return_type[type[List]], modifier[public], parameter[]] begin[{] THIS[member[None.freeMemory]call[None.addAll, parameter[THIS[member[None.sortBuffer]]]]] THIS[member[None.sortBuffer]call[None.clear, parameter[]]] return[THIS[member[None.freeMemory]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[MemorySegment] operator[>] identifier[dispose] operator[SEP] operator[SEP] { Keyword[this] operator[SEP] identifier[freeMemory] operator[SEP] identifier[addAll] operator[SEP] Keyword[this] operator[SEP] identifier[sortBuffer] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[sortBuffer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[freeMemory] operator[SEP] }
public static String getElementValue(Element parent, String tagName) { Element element = getChildElement(parent, tagName); if (element != null) { NodeList nodes = element.getChildNodes(); if (nodes != null && nodes.getLength() > 0) { for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); if (node instanceof Text) { return ((Text) node).getData(); } } } } return null; }
class class_name[name] begin[{] method[getElementValue, return_type[type[String]], modifier[public static], parameter[parent, tagName]] begin[{] local_variable[type[Element], element] if[binary_operation[member[.element], !=, literal[null]]] begin[{] local_variable[type[NodeList], nodes] if[binary_operation[binary_operation[member[.nodes], !=, literal[null]], &&, binary_operation[call[nodes.getLength, parameter[]], >, literal[0]]]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=nodes, selectors=[], type_arguments=None), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=Text, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=node, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Text, sub_type=None)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=nodes, 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) else begin[{] None end[}] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getElementValue] operator[SEP] identifier[Element] identifier[parent] , identifier[String] identifier[tagName] operator[SEP] { identifier[Element] identifier[element] operator[=] identifier[getChildElement] operator[SEP] identifier[parent] , identifier[tagName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[element] operator[!=] Other[null] operator[SEP] { identifier[NodeList] identifier[nodes] operator[=] identifier[element] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nodes] operator[!=] Other[null] operator[&&] identifier[nodes] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[nodes] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Node] identifier[node] operator[=] identifier[nodes] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[node] Keyword[instanceof] identifier[Text] operator[SEP] { Keyword[return] operator[SEP] operator[SEP] identifier[Text] operator[SEP] identifier[node] operator[SEP] operator[SEP] identifier[getData] operator[SEP] operator[SEP] operator[SEP] } } } } Keyword[return] Other[null] operator[SEP] }
public BigDecimal optBigDecimal(String key, BigDecimal defaultValue) { try { return this.getBigDecimal(key); } catch (Exception e) { return defaultValue; } }
class class_name[name] begin[{] method[optBigDecimal, return_type[type[BigDecimal]], modifier[public], parameter[key, defaultValue]] begin[{] TryStatement(block=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBigDecimal, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), 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] identifier[BigDecimal] identifier[optBigDecimal] operator[SEP] identifier[String] identifier[key] , identifier[BigDecimal] identifier[defaultValue] operator[SEP] { Keyword[try] { Keyword[return] Keyword[this] operator[SEP] identifier[getBigDecimal] operator[SEP] identifier[key] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[return] identifier[defaultValue] operator[SEP] } }
protected void writeOut(byte[] buf, int offset, int len) throws IOException { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME,"writeOut", "writeOut len --> "+len); } out.write(buf, offset, len); }
class class_name[name] begin[{] method[writeOut, return_type[void], modifier[protected], parameter[buf, offset, len]] begin[{] if[binary_operation[call[com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[logger.isLoggable, parameter[member[Level.FINE]]]]] begin[{] call[logger.logp, parameter[member[Level.FINE], member[.CLASS_NAME], literal["writeOut"], binary_operation[literal["writeOut len --> "], +, member[.len]]]] else begin[{] None end[}] call[out.write, parameter[member[.buf], member[.offset], member[.len]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[writeOut] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[buf] , Keyword[int] identifier[offset] , Keyword[int] identifier[len] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[if] operator[SEP] identifier[com] operator[SEP] identifier[ibm] operator[SEP] identifier[ejs] operator[SEP] identifier[ras] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] { identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[+] identifier[len] operator[SEP] operator[SEP] } identifier[out] operator[SEP] identifier[write] operator[SEP] identifier[buf] , identifier[offset] , identifier[len] operator[SEP] operator[SEP] }
public boolean invokeProxyScript(ScriptWrapper script, HttpMessage msg, boolean request) { validateScriptType(script, TYPE_PROXY); Writer writer = getWriters(script); try { // Dont need to check if enabled as it can only be invoked manually ProxyScript s = this.getInterface(script, ProxyScript.class); if (s != null) { if (request) { return s.proxyRequest(msg); } else { return s.proxyResponse(msg); } } else { handleUnspecifiedScriptError(script, writer, Constant.messages.getString("script.interface.proxy.error")); } } catch (Exception e) { handleScriptException(script, writer, e); } // Return true so that the request is submitted - if we returned false all proxying would fail on script errors return true; }
class class_name[name] begin[{] method[invokeProxyScript, return_type[type[boolean]], modifier[public], parameter[script, msg, request]] begin[{] call[.validateScriptType, parameter[member[.script], member[.TYPE_PROXY]]] local_variable[type[Writer], writer] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=script, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProxyScript, sub_type=None))], member=getInterface, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=s)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ProxyScript, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=script, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="script.interface.proxy.error")], member=getString, postfix_operators=[], prefix_operators=[], qualifier=Constant.messages, selectors=[], type_arguments=None)], member=handleUnspecifiedScriptError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=proxyResponse, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=proxyRequest, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None), label=None)]))]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=script, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleScriptException, postfix_operators=[], prefix_operators=[], qualifier=, 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[true]] end[}] END[}]
Keyword[public] Keyword[boolean] identifier[invokeProxyScript] operator[SEP] identifier[ScriptWrapper] identifier[script] , identifier[HttpMessage] identifier[msg] , Keyword[boolean] identifier[request] operator[SEP] { identifier[validateScriptType] operator[SEP] identifier[script] , identifier[TYPE_PROXY] operator[SEP] operator[SEP] identifier[Writer] identifier[writer] operator[=] identifier[getWriters] operator[SEP] identifier[script] operator[SEP] operator[SEP] Keyword[try] { identifier[ProxyScript] identifier[s] operator[=] Keyword[this] operator[SEP] identifier[getInterface] operator[SEP] identifier[script] , identifier[ProxyScript] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[request] operator[SEP] { Keyword[return] identifier[s] operator[SEP] identifier[proxyRequest] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[s] operator[SEP] identifier[proxyResponse] operator[SEP] identifier[msg] operator[SEP] operator[SEP] } } Keyword[else] { identifier[handleUnspecifiedScriptError] operator[SEP] identifier[script] , identifier[writer] , identifier[Constant] operator[SEP] identifier[messages] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[handleScriptException] operator[SEP] identifier[script] , identifier[writer] , identifier[e] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public Step createRootStep() { return new Step() .withName("Root step") .withTitle("Allure step processing error: if you see this step something went wrong.") .withStart(System.currentTimeMillis()) .withStatus(Status.BROKEN); }
class class_name[name] begin[{] method[createRootStep, return_type[type[Step]], modifier[public], parameter[]] begin[{] return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Root step")], member=withName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Allure step processing error: if you see this step something went wrong.")], member=withTitle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)], member=withStart, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=BROKEN, postfix_operators=[], prefix_operators=[], qualifier=Status, selectors=[])], member=withStatus, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Step, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Step] identifier[createRootStep] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[Step] operator[SEP] operator[SEP] operator[SEP] identifier[withName] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[withTitle] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[withStart] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[withStatus] operator[SEP] identifier[Status] operator[SEP] identifier[BROKEN] operator[SEP] operator[SEP] }
@Override public LongWatermark getPreviousHighWatermark(Partition partition) { if (this.previousWatermarks.hasPartitionWatermarks(tableKey(partition.getTable()))) { // If partition has a watermark return. if (this.previousWatermarks.get(tableKey(partition.getTable())).containsKey(partitionKey(partition))) { return new LongWatermark(this.previousWatermarks.getPartitionWatermark(tableKey(partition.getTable()), partitionKey(partition))); } } return new LongWatermark(0); }
class class_name[name] begin[{] method[getPreviousHighWatermark, return_type[type[LongWatermark]], modifier[public], parameter[partition]] begin[{] if[THIS[member[None.previousWatermarks]call[None.hasPartitionWatermarks, parameter[call[.tableKey, parameter[call[partition.getTable, parameter[]]]]]]]] begin[{] if[THIS[member[None.previousWatermarks]call[None.get, parameter[call[.tableKey, parameter[call[partition.getTable, parameter[]]]]]]call[None.containsKey, parameter[call[.partitionKey, parameter[member[.partition]]]]]]] begin[{] return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=previousWatermarks, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTable, postfix_operators=[], prefix_operators=[], qualifier=partition, selectors=[], type_arguments=None)], member=tableKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=partition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=partitionKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getPartitionWatermark, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=LongWatermark, sub_type=None))] else begin[{] None end[}] else begin[{] None end[}] return[ClassCreator(arguments=[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=LongWatermark, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[LongWatermark] identifier[getPreviousHighWatermark] operator[SEP] identifier[Partition] identifier[partition] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[previousWatermarks] operator[SEP] identifier[hasPartitionWatermarks] operator[SEP] identifier[tableKey] operator[SEP] identifier[partition] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[previousWatermarks] operator[SEP] identifier[get] operator[SEP] identifier[tableKey] operator[SEP] identifier[partition] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[partitionKey] operator[SEP] identifier[partition] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Keyword[new] identifier[LongWatermark] operator[SEP] Keyword[this] operator[SEP] identifier[previousWatermarks] operator[SEP] identifier[getPartitionWatermark] operator[SEP] identifier[tableKey] operator[SEP] identifier[partition] operator[SEP] identifier[getTable] operator[SEP] operator[SEP] operator[SEP] , identifier[partitionKey] operator[SEP] identifier[partition] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Keyword[new] identifier[LongWatermark] operator[SEP] Other[0] operator[SEP] operator[SEP] }
@Override public DeregisterEventTopicResult deregisterEventTopic(DeregisterEventTopicRequest request) { request = beforeClientExecution(request); return executeDeregisterEventTopic(request); }
class class_name[name] begin[{] method[deregisterEventTopic, return_type[type[DeregisterEventTopicResult]], modifier[public], parameter[request]] begin[{] assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]] return[call[.executeDeregisterEventTopic, parameter[member[.request]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[DeregisterEventTopicResult] identifier[deregisterEventTopic] operator[SEP] identifier[DeregisterEventTopicRequest] identifier[request] operator[SEP] { identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDeregisterEventTopic] operator[SEP] identifier[request] operator[SEP] operator[SEP] }
public void startServices(boolean startTLD) { synchronized (this.serviceMonitor) { //multiple threads can call this concurrently if (this.batchUpdateDaemon == null) { //---------------------------------------------- // Initialize BatchUpdateDaemon object //---------------------------------------------- batchUpdateDaemon = new BatchUpdateDaemon(cacheConfig.batchUpdateInterval); //---------------------------------------------- // Initialize InvalidationAuditDaemon object //---------------------------------------------- invalidationAuditDaemon = new InvalidationAuditDaemon(cacheConfig.timeHoldingInvalidations); //---------------------------------------------- // link invalidationAuditDaemon to BatchUpdateDaemon //---------------------------------------------- batchUpdateDaemon.setInvalidationAuditDaemon(invalidationAuditDaemon); if (tc.isDebugEnabled()) { Tr.debug(tc, "startServices() - starting BatchUpdateDaemon/invalidationAuditDaemon services. " + "These services should only start once for all cache instances. Settings are: " + " batchUpdateInterval=" + cacheConfig.batchUpdateInterval + " timeHoldingInvalidations=" + cacheConfig.timeHoldingInvalidations); } //---------------------------------------------- // start services //---------------------------------------------- batchUpdateDaemon.start(); invalidationAuditDaemon.start(); } if (startTLD && this.timeLimitDaemon == null) { //---------------------------------------------- // Initialize TimeLimitDaemon object //---------------------------------------------- // lruToDiskTriggerTime is set to the default (5 sec) under the following conditions // (1) less than 1 msec // (2) larger than timeGranularityInSeconds int lruToDiskTriggerTime = CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME; if (cacheConfig.lruToDiskTriggerTime > cacheConfig.timeGranularityInSeconds * 1000 || cacheConfig.lruToDiskTriggerTime < CacheConfig.MIN_LRU_TO_DISK_TRIGGER_TIME) { Tr.warning(tc, "DYNA0069W", new Object[] { new Integer(cacheConfig.lruToDiskTriggerTime), "lruToDiskTriggerTime", cacheConfig.cacheName, new Integer(CacheConfig.MIN_LRU_TO_DISK_TRIGGER_TIME), new Integer(cacheConfig.timeGranularityInSeconds * 1000), new Integer(CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME)}); cacheConfig.lruToDiskTriggerTime = lruToDiskTriggerTime; } else { lruToDiskTriggerTime = cacheConfig.lruToDiskTriggerTime; } if (lruToDiskTriggerTime == CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME && (cacheConfig.lruToDiskTriggerPercent > CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_PERCENT || cacheConfig.memoryCacheSizeInMB != CacheConfig.DEFAULT_DISABLE_CACHE_SIZE_MB)) { lruToDiskTriggerTime = CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME_FOR_TRIMCACHE; cacheConfig.lruToDiskTriggerTime = lruToDiskTriggerTime; Tr.audit(tc, "DYNA1069I", new Object[] { new Integer(cacheConfig.lruToDiskTriggerTime)}); } //---------------------------------------------- // Initialize TimeLimitDaemon object //---------------------------------------------- timeLimitDaemon = new TimeLimitDaemon(cacheConfig.timeGranularityInSeconds, lruToDiskTriggerTime); if (tc.isDebugEnabled()) { Tr.debug(tc, "startServices() - starting TimeLimitDaemon service. " + "This service should only start once for all cache instances. Settings are: " + " timeGranularityInSeconds=" + cacheConfig.timeGranularityInSeconds + " lruToDiskTriggerTime=" + cacheConfig.lruToDiskTriggerTime); } //---------------------------------------------- // start service //---------------------------------------------- timeLimitDaemon.start(); } } }
class class_name[name] begin[{] method[startServices, return_type[void], modifier[public], parameter[startTLD]] begin[{] SYNCHRONIZED[THIS[member[None.serviceMonitor]]] BEGIN[{] if[binary_operation[THIS[member[None.batchUpdateDaemon]], ==, literal[null]]] begin[{] assign[member[.batchUpdateDaemon], ClassCreator(arguments=[MemberReference(member=batchUpdateInterval, postfix_operators=[], prefix_operators=[], qualifier=cacheConfig, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BatchUpdateDaemon, sub_type=None))] assign[member[.invalidationAuditDaemon], ClassCreator(arguments=[MemberReference(member=timeHoldingInvalidations, postfix_operators=[], prefix_operators=[], qualifier=cacheConfig, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvalidationAuditDaemon, sub_type=None))] call[batchUpdateDaemon.setInvalidationAuditDaemon, parameter[member[.invalidationAuditDaemon]]] if[call[tc.isDebugEnabled, parameter[]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["startServices() - starting BatchUpdateDaemon/invalidationAuditDaemon services. "], +, literal["These services should only start once for all cache instances. Settings are: "]], +, literal[" batchUpdateInterval="]], +, member[cacheConfig.batchUpdateInterval]], +, literal[" timeHoldingInvalidations="]], +, member[cacheConfig.timeHoldingInvalidations]]]] else begin[{] None end[}] call[batchUpdateDaemon.start, parameter[]] call[invalidationAuditDaemon.start, parameter[]] else begin[{] None end[}] if[binary_operation[member[.startTLD], &&, binary_operation[THIS[member[None.timeLimitDaemon]], ==, literal[null]]]] begin[{] local_variable[type[int], lruToDiskTriggerTime] if[binary_operation[binary_operation[member[cacheConfig.lruToDiskTriggerTime], >, binary_operation[member[cacheConfig.timeGranularityInSeconds], *, literal[1000]]], ||, binary_operation[member[cacheConfig.lruToDiskTriggerTime], <, member[CacheConfig.MIN_LRU_TO_DISK_TRIGGER_TIME]]]] begin[{] call[Tr.warning, parameter[member[.tc], literal["DYNA0069W"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassCreator(arguments=[MemberReference(member=lruToDiskTriggerTime, postfix_operators=[], prefix_operators=[], qualifier=cacheConfig, 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)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="lruToDiskTriggerTime"), MemberReference(member=cacheName, postfix_operators=[], prefix_operators=[], qualifier=cacheConfig, selectors=[]), ClassCreator(arguments=[MemberReference(member=MIN_LRU_TO_DISK_TRIGGER_TIME, postfix_operators=[], prefix_operators=[], qualifier=CacheConfig, 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)), ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=timeGranularityInSeconds, postfix_operators=[], prefix_operators=[], qualifier=cacheConfig, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1000), operator=*)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), ClassCreator(arguments=[MemberReference(member=DEFAULT_LRU_TO_DISK_TRIGGER_TIME, postfix_operators=[], prefix_operators=[], qualifier=CacheConfig, 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))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] assign[member[cacheConfig.lruToDiskTriggerTime], member[.lruToDiskTriggerTime]] else begin[{] assign[member[.lruToDiskTriggerTime], member[cacheConfig.lruToDiskTriggerTime]] end[}] if[binary_operation[binary_operation[member[.lruToDiskTriggerTime], ==, member[CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME]], &&, binary_operation[binary_operation[member[cacheConfig.lruToDiskTriggerPercent], >, member[CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_PERCENT]], ||, binary_operation[member[cacheConfig.memoryCacheSizeInMB], !=, member[CacheConfig.DEFAULT_DISABLE_CACHE_SIZE_MB]]]]] begin[{] assign[member[.lruToDiskTriggerTime], member[CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME_FOR_TRIMCACHE]] assign[member[cacheConfig.lruToDiskTriggerTime], member[.lruToDiskTriggerTime]] call[Tr.audit, parameter[member[.tc], literal["DYNA1069I"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassCreator(arguments=[MemberReference(member=lruToDiskTriggerTime, postfix_operators=[], prefix_operators=[], qualifier=cacheConfig, 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))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]] else begin[{] None end[}] assign[member[.timeLimitDaemon], ClassCreator(arguments=[MemberReference(member=timeGranularityInSeconds, postfix_operators=[], prefix_operators=[], qualifier=cacheConfig, selectors=[]), MemberReference(member=lruToDiskTriggerTime, 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=TimeLimitDaemon, sub_type=None))] if[call[tc.isDebugEnabled, parameter[]]] begin[{] call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["startServices() - starting TimeLimitDaemon service. "], +, literal["This service should only start once for all cache instances. Settings are: "]], +, literal[" timeGranularityInSeconds="]], +, member[cacheConfig.timeGranularityInSeconds]], +, literal[" lruToDiskTriggerTime="]], +, member[cacheConfig.lruToDiskTriggerTime]]]] else begin[{] None end[}] call[timeLimitDaemon.start, parameter[]] else begin[{] None end[}] END[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[startServices] operator[SEP] Keyword[boolean] identifier[startTLD] operator[SEP] { Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[serviceMonitor] operator[SEP] { Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[batchUpdateDaemon] operator[==] Other[null] operator[SEP] { identifier[batchUpdateDaemon] operator[=] Keyword[new] identifier[BatchUpdateDaemon] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[batchUpdateInterval] operator[SEP] operator[SEP] identifier[invalidationAuditDaemon] operator[=] Keyword[new] identifier[InvalidationAuditDaemon] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[timeHoldingInvalidations] operator[SEP] operator[SEP] identifier[batchUpdateDaemon] operator[SEP] identifier[setInvalidationAuditDaemon] operator[SEP] identifier[invalidationAuditDaemon] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[cacheConfig] operator[SEP] identifier[batchUpdateInterval] operator[+] literal[String] operator[+] identifier[cacheConfig] operator[SEP] identifier[timeHoldingInvalidations] operator[SEP] operator[SEP] } identifier[batchUpdateDaemon] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] identifier[invalidationAuditDaemon] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[startTLD] operator[&&] Keyword[this] operator[SEP] identifier[timeLimitDaemon] operator[==] Other[null] operator[SEP] { Keyword[int] identifier[lruToDiskTriggerTime] operator[=] identifier[CacheConfig] operator[SEP] identifier[DEFAULT_LRU_TO_DISK_TRIGGER_TIME] operator[SEP] Keyword[if] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[lruToDiskTriggerTime] operator[>] identifier[cacheConfig] operator[SEP] identifier[timeGranularityInSeconds] operator[*] Other[1000] operator[||] identifier[cacheConfig] operator[SEP] identifier[lruToDiskTriggerTime] operator[<] identifier[CacheConfig] operator[SEP] identifier[MIN_LRU_TO_DISK_TRIGGER_TIME] operator[SEP] { identifier[Tr] operator[SEP] identifier[warning] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { Keyword[new] identifier[Integer] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[lruToDiskTriggerTime] operator[SEP] , literal[String] , identifier[cacheConfig] operator[SEP] identifier[cacheName] , Keyword[new] identifier[Integer] operator[SEP] identifier[CacheConfig] operator[SEP] identifier[MIN_LRU_TO_DISK_TRIGGER_TIME] operator[SEP] , Keyword[new] identifier[Integer] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[timeGranularityInSeconds] operator[*] Other[1000] operator[SEP] , Keyword[new] identifier[Integer] operator[SEP] identifier[CacheConfig] operator[SEP] identifier[DEFAULT_LRU_TO_DISK_TRIGGER_TIME] operator[SEP] } operator[SEP] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[lruToDiskTriggerTime] operator[=] identifier[lruToDiskTriggerTime] operator[SEP] } Keyword[else] { identifier[lruToDiskTriggerTime] operator[=] identifier[cacheConfig] operator[SEP] identifier[lruToDiskTriggerTime] operator[SEP] } Keyword[if] operator[SEP] identifier[lruToDiskTriggerTime] operator[==] identifier[CacheConfig] operator[SEP] identifier[DEFAULT_LRU_TO_DISK_TRIGGER_TIME] operator[&&] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[lruToDiskTriggerPercent] operator[>] identifier[CacheConfig] operator[SEP] identifier[DEFAULT_LRU_TO_DISK_TRIGGER_PERCENT] operator[||] identifier[cacheConfig] operator[SEP] identifier[memoryCacheSizeInMB] operator[!=] identifier[CacheConfig] operator[SEP] identifier[DEFAULT_DISABLE_CACHE_SIZE_MB] operator[SEP] operator[SEP] { identifier[lruToDiskTriggerTime] operator[=] identifier[CacheConfig] operator[SEP] identifier[DEFAULT_LRU_TO_DISK_TRIGGER_TIME_FOR_TRIMCACHE] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[lruToDiskTriggerTime] operator[=] identifier[lruToDiskTriggerTime] operator[SEP] identifier[Tr] operator[SEP] identifier[audit] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] { Keyword[new] identifier[Integer] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[lruToDiskTriggerTime] operator[SEP] } operator[SEP] operator[SEP] } identifier[timeLimitDaemon] operator[=] Keyword[new] identifier[TimeLimitDaemon] operator[SEP] identifier[cacheConfig] operator[SEP] identifier[timeGranularityInSeconds] , identifier[lruToDiskTriggerTime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[cacheConfig] operator[SEP] identifier[timeGranularityInSeconds] operator[+] literal[String] operator[+] identifier[cacheConfig] operator[SEP] identifier[lruToDiskTriggerTime] operator[SEP] operator[SEP] } identifier[timeLimitDaemon] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] } } }
public static EventStream<Long> animationFrames() { return animationTicks() .accumulate(t(0L, -1L), (state, now) -> state.map((d, last) -> { return t(last == -1L ? 0L : now - last, now); })) .map(t -> t._1); }
class class_name[name] begin[{] method[animationFrames, return_type[type[EventStream]], modifier[public static], parameter[]] begin[{] return[call[.animationTicks, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[EventStream] operator[<] identifier[Long] operator[>] identifier[animationFrames] operator[SEP] operator[SEP] { Keyword[return] identifier[animationTicks] operator[SEP] operator[SEP] operator[SEP] identifier[accumulate] operator[SEP] identifier[t] operator[SEP] Other[0L] , operator[-] Other[1L] operator[SEP] , operator[SEP] identifier[state] , identifier[now] operator[SEP] operator[->] identifier[state] operator[SEP] identifier[map] operator[SEP] operator[SEP] identifier[d] , identifier[last] operator[SEP] operator[->] { Keyword[return] identifier[t] operator[SEP] identifier[last] operator[==] operator[-] Other[1L] operator[?] Other[0L] operator[:] identifier[now] operator[-] identifier[last] , identifier[now] operator[SEP] operator[SEP] } operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[t] operator[->] identifier[t] operator[SEP] identifier[_1] operator[SEP] operator[SEP] }
private Collection<AnnotationData> getAnnotationSet(final Collection<TagAndLength> pTags) { Collection<AnnotationData> ret = null; if (pTags != null) { Map<ITag, AnnotationData> data = AnnotationUtils.getInstance().getMap().get(getClass().getName()); ret = new ArrayList<AnnotationData>(data.size()); for (TagAndLength tal : pTags) { AnnotationData ann = data.get(tal.getTag()); if (ann != null) { ann.setSize(tal.getLength() * BitUtils.BYTE_SIZE); } else { ann = new AnnotationData(); ann.setSkip(true); ann.setSize(tal.getLength() * BitUtils.BYTE_SIZE); } ret.add(ann); } } else { ret = AnnotationUtils.getInstance().getMapSet().get(getClass().getName()); } return ret; }
class class_name[name] begin[{] method[getAnnotationSet, return_type[type[Collection]], modifier[private], parameter[pTags]] begin[{] local_variable[type[Collection], ret] if[binary_operation[member[.pTags], !=, literal[null]]] begin[{] local_variable[type[Map], data] assign[member[.ret], ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AnnotationData, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTag, postfix_operators=[], prefix_operators=[], qualifier=tal, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), name=ann)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AnnotationData, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ann, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ann, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnnotationData, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setSkip, postfix_operators=[], prefix_operators=[], qualifier=ann, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=tal, selectors=[], type_arguments=None), operandr=MemberReference(member=BYTE_SIZE, postfix_operators=[], prefix_operators=[], qualifier=BitUtils, selectors=[]), operator=*)], member=setSize, postfix_operators=[], prefix_operators=[], qualifier=ann, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=tal, selectors=[], type_arguments=None), operandr=MemberReference(member=BYTE_SIZE, postfix_operators=[], prefix_operators=[], qualifier=BitUtils, selectors=[]), operator=*)], member=setSize, postfix_operators=[], prefix_operators=[], qualifier=ann, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ann, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=ret, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=pTags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tal)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TagAndLength, sub_type=None))), label=None) else begin[{] assign[member[.ret], call[AnnotationUtils.getInstance, parameter[]]] end[}] return[member[.ret]] end[}] END[}]
Keyword[private] identifier[Collection] operator[<] identifier[AnnotationData] operator[>] identifier[getAnnotationSet] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[TagAndLength] operator[>] identifier[pTags] operator[SEP] { identifier[Collection] operator[<] identifier[AnnotationData] operator[>] identifier[ret] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[pTags] operator[!=] Other[null] operator[SEP] { identifier[Map] operator[<] identifier[ITag] , identifier[AnnotationData] operator[>] identifier[data] operator[=] identifier[AnnotationUtils] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getMap] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ret] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[AnnotationData] operator[>] operator[SEP] identifier[data] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TagAndLength] identifier[tal] operator[:] identifier[pTags] operator[SEP] { identifier[AnnotationData] identifier[ann] operator[=] identifier[data] operator[SEP] identifier[get] operator[SEP] identifier[tal] operator[SEP] identifier[getTag] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ann] operator[!=] Other[null] operator[SEP] { identifier[ann] operator[SEP] identifier[setSize] operator[SEP] identifier[tal] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[*] identifier[BitUtils] operator[SEP] identifier[BYTE_SIZE] operator[SEP] operator[SEP] } Keyword[else] { identifier[ann] operator[=] Keyword[new] identifier[AnnotationData] operator[SEP] operator[SEP] operator[SEP] identifier[ann] operator[SEP] identifier[setSkip] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[ann] operator[SEP] identifier[setSize] operator[SEP] identifier[tal] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[*] identifier[BitUtils] operator[SEP] identifier[BYTE_SIZE] operator[SEP] operator[SEP] } identifier[ret] operator[SEP] identifier[add] operator[SEP] identifier[ann] operator[SEP] operator[SEP] } } Keyword[else] { identifier[ret] operator[=] identifier[AnnotationUtils] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getMapSet] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
protected boolean evaluate(NumericType firstNumber, NumericType secondNumber) { // If either of the arguments is a real number, then use real number arithmetic, otherwise use integer arithmetic. if (firstNumber.isInteger() && secondNumber.isInteger()) { return firstNumber.intValue() < secondNumber.intValue(); } else { return firstNumber.doubleValue() < secondNumber.doubleValue(); } }
class class_name[name] begin[{] method[evaluate, return_type[type[boolean]], modifier[protected], parameter[firstNumber, secondNumber]] begin[{] if[binary_operation[call[firstNumber.isInteger, parameter[]], &&, call[secondNumber.isInteger, parameter[]]]] begin[{] return[binary_operation[call[firstNumber.intValue, parameter[]], <, call[secondNumber.intValue, parameter[]]]] else begin[{] return[binary_operation[call[firstNumber.doubleValue, parameter[]], <, call[secondNumber.doubleValue, parameter[]]]] end[}] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[evaluate] operator[SEP] identifier[NumericType] identifier[firstNumber] , identifier[NumericType] identifier[secondNumber] operator[SEP] { Keyword[if] operator[SEP] identifier[firstNumber] operator[SEP] identifier[isInteger] operator[SEP] operator[SEP] operator[&&] identifier[secondNumber] operator[SEP] identifier[isInteger] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[firstNumber] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[<] identifier[secondNumber] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[return] identifier[firstNumber] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[<] identifier[secondNumber] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] } }
public static <PS, SEG, S> UndoManager<List<PlainTextChange>> plainTextUndoManager( GenericStyledArea<PS, SEG, S> area) { return plainTextUndoManager(area, DEFAULT_PREVENT_MERGE_DELAY); }
class class_name[name] begin[{] method[plainTextUndoManager, return_type[type[UndoManager]], modifier[public static], parameter[area]] begin[{] return[call[.plainTextUndoManager, parameter[member[.area], member[.DEFAULT_PREVENT_MERGE_DELAY]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[PS] , identifier[SEG] , identifier[S] operator[>] identifier[UndoManager] operator[<] identifier[List] operator[<] identifier[PlainTextChange] operator[>] operator[>] identifier[plainTextUndoManager] operator[SEP] identifier[GenericStyledArea] operator[<] identifier[PS] , identifier[SEG] , identifier[S] operator[>] identifier[area] operator[SEP] { Keyword[return] identifier[plainTextUndoManager] operator[SEP] identifier[area] , identifier[DEFAULT_PREVENT_MERGE_DELAY] operator[SEP] operator[SEP] }
@Override protected synchronized void onDraw(@NonNull Canvas canvas) { super.onDraw(canvas); paint.setTextSize(textSize); paint.setStyle(Style.FILL); paint.setColor(defaultColor); paint.setAntiAlias(true); float minMaxLabelSize = 0; if (showLabels) { // draw min and max labels String minLabel = getContext().getString(R.string.demo_min_label); String maxLabel = getContext().getString(R.string.demo_max_label); minMaxLabelSize = Math.max(paint.measureText(minLabel), paint.measureText(maxLabel)); float minMaxHeight = textOffset + thumbHalfHeight + textSize / 3; canvas.drawText(minLabel, 0, minMaxHeight, paint); canvas.drawText(maxLabel, getWidth() - minMaxLabelSize, minMaxHeight, paint); } padding = internalPad + minMaxLabelSize + thumbHalfWidth; // draw seek bar background line rect.left = padding; rect.right = getWidth() - padding; canvas.drawRect(rect, paint); boolean selectedValuesAreDefault = (normalizedMinValue <= minDeltaForDefault && normalizedMaxValue >= 1 - minDeltaForDefault); int colorToUseForButtonsAndHighlightedLine = !alwaysActive && !activateOnDefaultValues && selectedValuesAreDefault ? defaultColor : // default values activeColor; // non default, filter is active // draw seek bar active range line rect.left = normalizedToScreen(normalizedMinValue); rect.right = normalizedToScreen(normalizedMaxValue); paint.setColor(colorToUseForButtonsAndHighlightedLine); canvas.drawRect(rect, paint); // draw minimum thumb (& shadow if requested) if not a single thumb control if (!singleThumb) { if (thumbShadow) { drawThumbShadow(normalizedToScreen(normalizedMinValue), canvas); } drawThumb(normalizedToScreen(normalizedMinValue), Thumb.MIN.equals(pressedThumb), canvas, selectedValuesAreDefault); } // draw maximum thumb & shadow (if necessary) if (thumbShadow) { drawThumbShadow(normalizedToScreen(normalizedMaxValue), canvas); } drawThumb(normalizedToScreen(normalizedMaxValue), Thumb.MAX.equals(pressedThumb), canvas, selectedValuesAreDefault); // draw the text if sliders have moved from default edges if (showTextAboveThumbs && (activateOnDefaultValues || !selectedValuesAreDefault)) { paint.setTextSize(textSize); paint.setColor(textAboveThumbsColor); String minText = valueToString(getSelectedMinValue()); String maxText = valueToString(getSelectedMaxValue()); float minTextWidth = paint.measureText(minText); float maxTextWidth = paint.measureText(maxText); // keep the position so that the labels don't get cut off float minPosition = Math.max(0f, normalizedToScreen(normalizedMinValue) - minTextWidth * 0.5f); float maxPosition = Math.min(getWidth() - maxTextWidth, normalizedToScreen(normalizedMaxValue) - maxTextWidth * 0.5f); if (!singleThumb) { // check if the labels overlap, or are too close to each other int spacing = PixelUtil.dpToPx(getContext(), TEXT_LATERAL_PADDING_IN_DP); float overlap = minPosition + minTextWidth - maxPosition + spacing; if (overlap > 0f) { // we could move them the same ("overlap * 0.5f") // but we rather move more the one which is farther from the ends, as it has more space minPosition -= overlap * normalizedMinValue / (normalizedMinValue + 1-normalizedMaxValue); maxPosition += overlap * (1-normalizedMaxValue) / (normalizedMinValue + 1-normalizedMaxValue); } canvas.drawText(minText, minPosition, distanceToTop + textSize, paint); } canvas.drawText(maxText, maxPosition, distanceToTop + textSize, paint); } }
class class_name[name] begin[{] method[onDraw, return_type[void], modifier[synchronized protected], parameter[canvas]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=canvas, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onDraw, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) call[paint.setTextSize, parameter[member[.textSize]]] call[paint.setStyle, parameter[member[Style.FILL]]] call[paint.setColor, parameter[member[.defaultColor]]] call[paint.setAntiAlias, parameter[literal[true]]] local_variable[type[float], minMaxLabelSize] if[member[.showLabels]] begin[{] local_variable[type[String], minLabel] local_variable[type[String], maxLabel] assign[member[.minMaxLabelSize], call[Math.max, parameter[call[paint.measureText, parameter[member[.minLabel]]], call[paint.measureText, parameter[member[.maxLabel]]]]]] local_variable[type[float], minMaxHeight] call[canvas.drawText, parameter[member[.minLabel], literal[0], member[.minMaxHeight], member[.paint]]] call[canvas.drawText, parameter[member[.maxLabel], binary_operation[call[.getWidth, parameter[]], -, member[.minMaxLabelSize]], member[.minMaxHeight], member[.paint]]] else begin[{] None end[}] assign[member[.padding], binary_operation[binary_operation[member[.internalPad], +, member[.minMaxLabelSize]], +, member[.thumbHalfWidth]]] assign[member[rect.left], member[.padding]] assign[member[rect.right], binary_operation[call[.getWidth, parameter[]], -, member[.padding]]] call[canvas.drawRect, parameter[member[.rect], member[.paint]]] local_variable[type[boolean], selectedValuesAreDefault] local_variable[type[int], colorToUseForButtonsAndHighlightedLine] assign[member[rect.left], call[.normalizedToScreen, parameter[member[.normalizedMinValue]]]] assign[member[rect.right], call[.normalizedToScreen, parameter[member[.normalizedMaxValue]]]] call[paint.setColor, parameter[member[.colorToUseForButtonsAndHighlightedLine]]] call[canvas.drawRect, parameter[member[.rect], member[.paint]]] if[member[.singleThumb]] begin[{] if[member[.thumbShadow]] begin[{] call[.drawThumbShadow, parameter[call[.normalizedToScreen, parameter[member[.normalizedMinValue]]], member[.canvas]]] else begin[{] None end[}] call[.drawThumb, parameter[call[.normalizedToScreen, parameter[member[.normalizedMinValue]]], call[Thumb.MIN.equals, parameter[member[.pressedThumb]]], member[.canvas], member[.selectedValuesAreDefault]]] else begin[{] None end[}] if[member[.thumbShadow]] begin[{] call[.drawThumbShadow, parameter[call[.normalizedToScreen, parameter[member[.normalizedMaxValue]]], member[.canvas]]] else begin[{] None end[}] call[.drawThumb, parameter[call[.normalizedToScreen, parameter[member[.normalizedMaxValue]]], call[Thumb.MAX.equals, parameter[member[.pressedThumb]]], member[.canvas], member[.selectedValuesAreDefault]]] if[binary_operation[member[.showTextAboveThumbs], &&, binary_operation[member[.activateOnDefaultValues], ||, member[.selectedValuesAreDefault]]]] begin[{] call[paint.setTextSize, parameter[member[.textSize]]] call[paint.setColor, parameter[member[.textAboveThumbsColor]]] local_variable[type[String], minText] local_variable[type[String], maxText] local_variable[type[float], minTextWidth] local_variable[type[float], maxTextWidth] local_variable[type[float], minPosition] local_variable[type[float], maxPosition] if[member[.singleThumb]] begin[{] local_variable[type[int], spacing] local_variable[type[float], overlap] if[binary_operation[member[.overlap], >, literal[0f]]] begin[{] assign[member[.minPosition], binary_operation[binary_operation[member[.overlap], *, member[.normalizedMinValue]], /, binary_operation[binary_operation[member[.normalizedMinValue], +, literal[1]], -, member[.normalizedMaxValue]]]] assign[member[.maxPosition], binary_operation[binary_operation[member[.overlap], *, binary_operation[literal[1], -, member[.normalizedMaxValue]]], /, binary_operation[binary_operation[member[.normalizedMinValue], +, literal[1]], -, member[.normalizedMaxValue]]]] else begin[{] None end[}] call[canvas.drawText, parameter[member[.minText], member[.minPosition], binary_operation[member[.distanceToTop], +, member[.textSize]], member[.paint]]] else begin[{] None end[}] call[canvas.drawText, parameter[member[.maxText], member[.maxPosition], binary_operation[member[.distanceToTop], +, member[.textSize]], member[.paint]]] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[protected] Keyword[synchronized] Keyword[void] identifier[onDraw] operator[SEP] annotation[@] identifier[NonNull] identifier[Canvas] identifier[canvas] operator[SEP] { Keyword[super] operator[SEP] identifier[onDraw] operator[SEP] identifier[canvas] operator[SEP] operator[SEP] identifier[paint] operator[SEP] identifier[setTextSize] operator[SEP] identifier[textSize] operator[SEP] operator[SEP] identifier[paint] operator[SEP] identifier[setStyle] operator[SEP] identifier[Style] operator[SEP] identifier[FILL] operator[SEP] operator[SEP] identifier[paint] operator[SEP] identifier[setColor] operator[SEP] identifier[defaultColor] operator[SEP] operator[SEP] identifier[paint] operator[SEP] identifier[setAntiAlias] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[float] identifier[minMaxLabelSize] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[showLabels] operator[SEP] { identifier[String] identifier[minLabel] operator[=] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[demo_min_label] operator[SEP] operator[SEP] identifier[String] identifier[maxLabel] operator[=] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] identifier[R] operator[SEP] identifier[string] operator[SEP] identifier[demo_max_label] operator[SEP] operator[SEP] identifier[minMaxLabelSize] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[paint] operator[SEP] identifier[measureText] operator[SEP] identifier[minLabel] operator[SEP] , identifier[paint] operator[SEP] identifier[measureText] operator[SEP] identifier[maxLabel] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[minMaxHeight] operator[=] identifier[textOffset] operator[+] identifier[thumbHalfHeight] operator[+] identifier[textSize] operator[/] Other[3] operator[SEP] identifier[canvas] operator[SEP] identifier[drawText] operator[SEP] identifier[minLabel] , Other[0] , identifier[minMaxHeight] , identifier[paint] operator[SEP] operator[SEP] identifier[canvas] operator[SEP] identifier[drawText] operator[SEP] identifier[maxLabel] , identifier[getWidth] operator[SEP] operator[SEP] operator[-] identifier[minMaxLabelSize] , identifier[minMaxHeight] , identifier[paint] operator[SEP] operator[SEP] } identifier[padding] operator[=] identifier[internalPad] operator[+] identifier[minMaxLabelSize] operator[+] identifier[thumbHalfWidth] operator[SEP] identifier[rect] operator[SEP] identifier[left] operator[=] identifier[padding] operator[SEP] identifier[rect] operator[SEP] identifier[right] operator[=] identifier[getWidth] operator[SEP] operator[SEP] operator[-] identifier[padding] operator[SEP] identifier[canvas] operator[SEP] identifier[drawRect] operator[SEP] identifier[rect] , identifier[paint] operator[SEP] operator[SEP] Keyword[boolean] identifier[selectedValuesAreDefault] operator[=] operator[SEP] identifier[normalizedMinValue] operator[<=] identifier[minDeltaForDefault] operator[&&] identifier[normalizedMaxValue] operator[>=] Other[1] operator[-] identifier[minDeltaForDefault] operator[SEP] operator[SEP] Keyword[int] identifier[colorToUseForButtonsAndHighlightedLine] operator[=] operator[!] identifier[alwaysActive] operator[&&] operator[!] identifier[activateOnDefaultValues] operator[&&] identifier[selectedValuesAreDefault] operator[?] identifier[defaultColor] operator[:] identifier[activeColor] operator[SEP] identifier[rect] operator[SEP] identifier[left] operator[=] identifier[normalizedToScreen] operator[SEP] identifier[normalizedMinValue] operator[SEP] operator[SEP] identifier[rect] operator[SEP] identifier[right] operator[=] identifier[normalizedToScreen] operator[SEP] identifier[normalizedMaxValue] operator[SEP] operator[SEP] identifier[paint] operator[SEP] identifier[setColor] operator[SEP] identifier[colorToUseForButtonsAndHighlightedLine] operator[SEP] operator[SEP] identifier[canvas] operator[SEP] identifier[drawRect] operator[SEP] identifier[rect] , identifier[paint] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[singleThumb] operator[SEP] { Keyword[if] operator[SEP] identifier[thumbShadow] operator[SEP] { identifier[drawThumbShadow] operator[SEP] identifier[normalizedToScreen] operator[SEP] identifier[normalizedMinValue] operator[SEP] , identifier[canvas] operator[SEP] operator[SEP] } identifier[drawThumb] operator[SEP] identifier[normalizedToScreen] operator[SEP] identifier[normalizedMinValue] operator[SEP] , identifier[Thumb] operator[SEP] identifier[MIN] operator[SEP] identifier[equals] operator[SEP] identifier[pressedThumb] operator[SEP] , identifier[canvas] , identifier[selectedValuesAreDefault] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[thumbShadow] operator[SEP] { identifier[drawThumbShadow] operator[SEP] identifier[normalizedToScreen] operator[SEP] identifier[normalizedMaxValue] operator[SEP] , identifier[canvas] operator[SEP] operator[SEP] } identifier[drawThumb] operator[SEP] identifier[normalizedToScreen] operator[SEP] identifier[normalizedMaxValue] operator[SEP] , identifier[Thumb] operator[SEP] identifier[MAX] operator[SEP] identifier[equals] operator[SEP] identifier[pressedThumb] operator[SEP] , identifier[canvas] , identifier[selectedValuesAreDefault] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[showTextAboveThumbs] operator[&&] operator[SEP] identifier[activateOnDefaultValues] operator[||] operator[!] identifier[selectedValuesAreDefault] operator[SEP] operator[SEP] { identifier[paint] operator[SEP] identifier[setTextSize] operator[SEP] identifier[textSize] operator[SEP] operator[SEP] identifier[paint] operator[SEP] identifier[setColor] operator[SEP] identifier[textAboveThumbsColor] operator[SEP] operator[SEP] identifier[String] identifier[minText] operator[=] identifier[valueToString] operator[SEP] identifier[getSelectedMinValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[maxText] operator[=] identifier[valueToString] operator[SEP] identifier[getSelectedMaxValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[float] identifier[minTextWidth] operator[=] identifier[paint] operator[SEP] identifier[measureText] operator[SEP] identifier[minText] operator[SEP] operator[SEP] Keyword[float] identifier[maxTextWidth] operator[=] identifier[paint] operator[SEP] identifier[measureText] operator[SEP] identifier[maxText] operator[SEP] operator[SEP] Keyword[float] identifier[minPosition] operator[=] identifier[Math] operator[SEP] identifier[max] operator[SEP] literal[Float] , identifier[normalizedToScreen] operator[SEP] identifier[normalizedMinValue] operator[SEP] operator[-] identifier[minTextWidth] operator[*] literal[Float] operator[SEP] operator[SEP] Keyword[float] identifier[maxPosition] operator[=] identifier[Math] operator[SEP] identifier[min] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[-] identifier[maxTextWidth] , identifier[normalizedToScreen] operator[SEP] identifier[normalizedMaxValue] operator[SEP] operator[-] identifier[maxTextWidth] operator[*] literal[Float] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[singleThumb] operator[SEP] { Keyword[int] identifier[spacing] operator[=] identifier[PixelUtil] operator[SEP] identifier[dpToPx] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] , identifier[TEXT_LATERAL_PADDING_IN_DP] operator[SEP] operator[SEP] Keyword[float] identifier[overlap] operator[=] identifier[minPosition] operator[+] identifier[minTextWidth] operator[-] identifier[maxPosition] operator[+] identifier[spacing] operator[SEP] Keyword[if] operator[SEP] identifier[overlap] operator[>] literal[Float] operator[SEP] { identifier[minPosition] operator[-=] identifier[overlap] operator[*] identifier[normalizedMinValue] operator[/] operator[SEP] identifier[normalizedMinValue] operator[+] Other[1] operator[-] identifier[normalizedMaxValue] operator[SEP] operator[SEP] identifier[maxPosition] operator[+=] identifier[overlap] operator[*] operator[SEP] Other[1] operator[-] identifier[normalizedMaxValue] operator[SEP] operator[/] operator[SEP] identifier[normalizedMinValue] operator[+] Other[1] operator[-] identifier[normalizedMaxValue] operator[SEP] operator[SEP] } identifier[canvas] operator[SEP] identifier[drawText] operator[SEP] identifier[minText] , identifier[minPosition] , identifier[distanceToTop] operator[+] identifier[textSize] , identifier[paint] operator[SEP] operator[SEP] } identifier[canvas] operator[SEP] identifier[drawText] operator[SEP] identifier[maxText] , identifier[maxPosition] , identifier[distanceToTop] operator[+] identifier[textSize] , identifier[paint] operator[SEP] operator[SEP] } }
private void checkSampledData(List<ValidationMessage> errors, String path, WrapperElement focus, SampledData fixed) { checkFixedValue(errors, path + ".origin", focus.getNamedChild("origin"), fixed.getOrigin(), "origin"); checkFixedValue(errors, path + ".period", focus.getNamedChild("period"), fixed.getPeriodElement(), "period"); checkFixedValue(errors, path + ".factor", focus.getNamedChild("factor"), fixed.getFactorElement(), "factor"); checkFixedValue(errors, path + ".lowerLimit", focus.getNamedChild("lowerLimit"), fixed.getLowerLimitElement(), "lowerLimit"); checkFixedValue(errors, path + ".upperLimit", focus.getNamedChild("upperLimit"), fixed.getUpperLimitElement(), "upperLimit"); checkFixedValue(errors, path + ".dimensions", focus.getNamedChild("dimensions"), fixed.getDimensionsElement(), "dimensions"); checkFixedValue(errors, path + ".data", focus.getNamedChild("data"), fixed.getDataElement(), "data"); }
class class_name[name] begin[{] method[checkSampledData, return_type[void], modifier[private], parameter[errors, path, focus, fixed]] begin[{] call[.checkFixedValue, parameter[member[.errors], binary_operation[member[.path], +, literal[".origin"]], call[focus.getNamedChild, parameter[literal["origin"]]], call[fixed.getOrigin, parameter[]], literal["origin"]]] call[.checkFixedValue, parameter[member[.errors], binary_operation[member[.path], +, literal[".period"]], call[focus.getNamedChild, parameter[literal["period"]]], call[fixed.getPeriodElement, parameter[]], literal["period"]]] call[.checkFixedValue, parameter[member[.errors], binary_operation[member[.path], +, literal[".factor"]], call[focus.getNamedChild, parameter[literal["factor"]]], call[fixed.getFactorElement, parameter[]], literal["factor"]]] call[.checkFixedValue, parameter[member[.errors], binary_operation[member[.path], +, literal[".lowerLimit"]], call[focus.getNamedChild, parameter[literal["lowerLimit"]]], call[fixed.getLowerLimitElement, parameter[]], literal["lowerLimit"]]] call[.checkFixedValue, parameter[member[.errors], binary_operation[member[.path], +, literal[".upperLimit"]], call[focus.getNamedChild, parameter[literal["upperLimit"]]], call[fixed.getUpperLimitElement, parameter[]], literal["upperLimit"]]] call[.checkFixedValue, parameter[member[.errors], binary_operation[member[.path], +, literal[".dimensions"]], call[focus.getNamedChild, parameter[literal["dimensions"]]], call[fixed.getDimensionsElement, parameter[]], literal["dimensions"]]] call[.checkFixedValue, parameter[member[.errors], binary_operation[member[.path], +, literal[".data"]], call[focus.getNamedChild, parameter[literal["data"]]], call[fixed.getDataElement, parameter[]], literal["data"]]] end[}] END[}]
Keyword[private] Keyword[void] identifier[checkSampledData] operator[SEP] identifier[List] operator[<] identifier[ValidationMessage] operator[>] identifier[errors] , identifier[String] identifier[path] , identifier[WrapperElement] identifier[focus] , identifier[SampledData] identifier[fixed] operator[SEP] { identifier[checkFixedValue] operator[SEP] identifier[errors] , identifier[path] operator[+] literal[String] , identifier[focus] operator[SEP] identifier[getNamedChild] operator[SEP] literal[String] operator[SEP] , identifier[fixed] operator[SEP] identifier[getOrigin] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[checkFixedValue] operator[SEP] identifier[errors] , identifier[path] operator[+] literal[String] , identifier[focus] operator[SEP] identifier[getNamedChild] operator[SEP] literal[String] operator[SEP] , identifier[fixed] operator[SEP] identifier[getPeriodElement] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[checkFixedValue] operator[SEP] identifier[errors] , identifier[path] operator[+] literal[String] , identifier[focus] operator[SEP] identifier[getNamedChild] operator[SEP] literal[String] operator[SEP] , identifier[fixed] operator[SEP] identifier[getFactorElement] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[checkFixedValue] operator[SEP] identifier[errors] , identifier[path] operator[+] literal[String] , identifier[focus] operator[SEP] identifier[getNamedChild] operator[SEP] literal[String] operator[SEP] , identifier[fixed] operator[SEP] identifier[getLowerLimitElement] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[checkFixedValue] operator[SEP] identifier[errors] , identifier[path] operator[+] literal[String] , identifier[focus] operator[SEP] identifier[getNamedChild] operator[SEP] literal[String] operator[SEP] , identifier[fixed] operator[SEP] identifier[getUpperLimitElement] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[checkFixedValue] operator[SEP] identifier[errors] , identifier[path] operator[+] literal[String] , identifier[focus] operator[SEP] identifier[getNamedChild] operator[SEP] literal[String] operator[SEP] , identifier[fixed] operator[SEP] identifier[getDimensionsElement] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[checkFixedValue] operator[SEP] identifier[errors] , identifier[path] operator[+] literal[String] , identifier[focus] operator[SEP] identifier[getNamedChild] operator[SEP] literal[String] operator[SEP] , identifier[fixed] operator[SEP] identifier[getDataElement] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] }
public static void setDynamicAttribute(StructImpl attributes, Collection.Key name, Object value, short caseType) { if (name.equalsIgnoreCase(KeyConstants._attributecollection)) { if (value instanceof lucee.runtime.type.Collection) { lucee.runtime.type.Collection coll = (lucee.runtime.type.Collection) value; Iterator<Entry<Key, Object>> it = coll.entryIterator(); Entry<Key, Object> e; while (it.hasNext()) { e = it.next(); if (attributes.get(e.getKey(), null) == null) attributes.setEL(e.getKey(), e.getValue()); } return; } else if (value instanceof Map) { Map map = (Map) value; Iterator it = map.entrySet().iterator(); Map.Entry entry; Key key; while (it.hasNext()) { entry = (Entry) it.next(); key = Caster.toKey(entry.getKey(), null); if (!attributes.containsKey(key)) { attributes.setEL(key, entry.getValue()); } } return; } } if (LOWER_CASE == caseType) name = KeyImpl.init(name.getLowerString()); else if (UPPER_CASE == caseType) name = KeyImpl.init(name.getUpperString()); attributes.setEL(name, value); }
class class_name[name] begin[{] method[setDynamicAttribute, return_type[void], modifier[public static], parameter[attributes, name, value, caseType]] begin[{] if[call[name.equalsIgnoreCase, parameter[member[KeyConstants._attributecollection]]]] begin[{] if[binary_operation[member[.value], instanceof, type[lucee]]] begin[{] local_variable[type[lucee], coll] local_variable[type[Iterator], it] local_variable[type[Entry], e] while[call[it.hasNext, parameter[]]] begin[{] assign[member[.e], call[it.next, parameter[]]] if[binary_operation[call[attributes.get, parameter[call[e.getKey, parameter[]], literal[null]]], ==, literal[null]]] begin[{] call[attributes.setEL, parameter[call[e.getKey, parameter[]], call[e.getValue, parameter[]]]] else begin[{] None end[}] end[}] return[None] else begin[{] if[binary_operation[member[.value], instanceof, type[Map]]] begin[{] local_variable[type[Map], map] local_variable[type[Iterator], it] local_variable[type[Map], entry] local_variable[type[Key], key] while[call[it.hasNext, parameter[]]] begin[{] assign[member[.entry], Cast(expression=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=it, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Entry, sub_type=None))] assign[member[.key], call[Caster.toKey, parameter[call[entry.getKey, parameter[]], literal[null]]]] if[call[attributes.containsKey, parameter[member[.key]]]] begin[{] call[attributes.setEL, parameter[member[.key], call[entry.getValue, parameter[]]]] else begin[{] None end[}] end[}] return[None] else begin[{] None end[}] end[}] else begin[{] None end[}] if[binary_operation[member[.LOWER_CASE], ==, member[.caseType]]] begin[{] assign[member[.name], call[KeyImpl.init, parameter[call[name.getLowerString, parameter[]]]]] else begin[{] if[binary_operation[member[.UPPER_CASE], ==, member[.caseType]]] begin[{] assign[member[.name], call[KeyImpl.init, parameter[call[name.getUpperString, parameter[]]]]] else begin[{] None end[}] end[}] call[attributes.setEL, parameter[member[.name], member[.value]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[setDynamicAttribute] operator[SEP] identifier[StructImpl] identifier[attributes] , identifier[Collection] operator[SEP] identifier[Key] identifier[name] , identifier[Object] identifier[value] , Keyword[short] identifier[caseType] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[KeyConstants] operator[SEP] identifier[_attributecollection] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[lucee] operator[SEP] identifier[runtime] operator[SEP] identifier[type] operator[SEP] identifier[Collection] operator[SEP] { identifier[lucee] operator[SEP] identifier[runtime] operator[SEP] identifier[type] operator[SEP] identifier[Collection] identifier[coll] operator[=] operator[SEP] identifier[lucee] operator[SEP] identifier[runtime] operator[SEP] identifier[type] operator[SEP] identifier[Collection] operator[SEP] identifier[value] operator[SEP] identifier[Iterator] operator[<] identifier[Entry] operator[<] identifier[Key] , identifier[Object] operator[>] operator[>] identifier[it] operator[=] identifier[coll] operator[SEP] identifier[entryIterator] operator[SEP] operator[SEP] operator[SEP] identifier[Entry] operator[<] identifier[Key] , identifier[Object] operator[>] identifier[e] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[e] operator[=] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[attributes] operator[SEP] identifier[get] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[==] Other[null] operator[SEP] identifier[attributes] operator[SEP] identifier[setEL] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Map] operator[SEP] { identifier[Map] identifier[map] operator[=] operator[SEP] identifier[Map] operator[SEP] identifier[value] operator[SEP] identifier[Iterator] identifier[it] operator[=] identifier[map] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] identifier[entry] operator[SEP] identifier[Key] identifier[key] operator[SEP] Keyword[while] operator[SEP] identifier[it] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] { identifier[entry] operator[=] operator[SEP] identifier[Entry] operator[SEP] identifier[it] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[=] identifier[Caster] operator[SEP] identifier[toKey] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[attributes] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] { identifier[attributes] operator[SEP] identifier[setEL] operator[SEP] identifier[key] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] operator[SEP] } } Keyword[if] operator[SEP] identifier[LOWER_CASE] operator[==] identifier[caseType] operator[SEP] identifier[name] operator[=] identifier[KeyImpl] operator[SEP] identifier[init] operator[SEP] identifier[name] operator[SEP] identifier[getLowerString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[UPPER_CASE] operator[==] identifier[caseType] operator[SEP] identifier[name] operator[=] identifier[KeyImpl] operator[SEP] identifier[init] operator[SEP] identifier[name] operator[SEP] identifier[getUpperString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[attributes] operator[SEP] identifier[setEL] operator[SEP] identifier[name] , identifier[value] operator[SEP] operator[SEP] }
public final void init(Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException { if (spi != null) { spi.engineInit(key, params, random); } else { chooseProvider(I_PARAMS, key, params, random); } /* Android-removed: this debugging mechanism is not used in Android. if (!skipDebug && pdebug != null) { pdebug.println("KeyAgreement." + algorithm + " algorithm from: " + this.provider.getName()); } */ }
class class_name[name] begin[{] method[init, return_type[void], modifier[final public], parameter[key, params, random]] begin[{] if[binary_operation[member[.spi], !=, literal[null]]] begin[{] call[spi.engineInit, parameter[member[.key], member[.params], member[.random]]] else begin[{] call[.chooseProvider, parameter[member[.I_PARAMS], member[.key], member[.params], member[.random]]] end[}] end[}] END[}]
Keyword[public] Keyword[final] Keyword[void] identifier[init] operator[SEP] identifier[Key] identifier[key] , identifier[AlgorithmParameterSpec] identifier[params] , identifier[SecureRandom] identifier[random] operator[SEP] Keyword[throws] identifier[InvalidKeyException] , identifier[InvalidAlgorithmParameterException] { Keyword[if] operator[SEP] identifier[spi] operator[!=] Other[null] operator[SEP] { identifier[spi] operator[SEP] identifier[engineInit] operator[SEP] identifier[key] , identifier[params] , identifier[random] operator[SEP] operator[SEP] } Keyword[else] { identifier[chooseProvider] operator[SEP] identifier[I_PARAMS] , identifier[key] , identifier[params] , identifier[random] operator[SEP] operator[SEP] } }
private void doFindGroup(final Message<JsonObject> message) { String group = message.body().getString("group"); if (group == null) { message.reply(new JsonObject().putString("status", "error").putString("message", "Invalid group name.")); return; } final String address = String.format("%s.%s", cluster, group); context.execute(new Action<Boolean>() { @Override public Boolean perform() { return groups.containsKey(address); } }, new Handler<AsyncResult<Boolean>>() { @Override public void handle(AsyncResult<Boolean> result) { if (result.failed()) { message.reply(new JsonObject().putString("status", "error").putString("message", result.cause().getMessage())); } else if (!result.result()) { message.reply(new JsonObject().putString("status", "error").putString("message", "Invalid group.")); } else { message.reply(new JsonObject().putString("status", "ok").putString("result", address)); } } }); }
class class_name[name] begin[{] method[doFindGroup, return_type[void], modifier[private], parameter[message]] begin[{] local_variable[type[String], group] if[binary_operation[member[.group], ==, literal[null]]] begin[{] call[message.reply, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="status"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="message"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid group name.")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None))]] return[None] else begin[{] None end[}] local_variable[type[String], address] call[context.execute, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=groups, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=perform, parameters=[], return_type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=None, name=Action, sub_type=None)), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=MethodInvocation(arguments=[], member=failed, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), else_statement=IfStatement(condition=MethodInvocation(arguments=[], member=result, postfix_operators=[], prefix_operators=['!'], qualifier=result, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="status"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ok")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="result"), MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None))], member=reply, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="status"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="message"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid group.")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None))], member=reply, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="status"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="error")], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="message"), MethodInvocation(arguments=[], member=cause, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[], member=getMessage, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=putString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=JsonObject, sub_type=None))], member=reply, postfix_operators=[], prefix_operators=[], qualifier=message, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=handle, parameters=[FormalParameter(annotations=[], modifiers=set(), name=result, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=[], name=AsyncResult, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], dimensions=[], name=AsyncResult, sub_type=None))], dimensions=None, name=Handler, sub_type=None))]] end[}] END[}]
Keyword[private] Keyword[void] identifier[doFindGroup] operator[SEP] Keyword[final] identifier[Message] operator[<] identifier[JsonObject] operator[>] identifier[message] operator[SEP] { identifier[String] identifier[group] operator[=] identifier[message] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[group] operator[==] Other[null] operator[SEP] { identifier[message] operator[SEP] identifier[reply] operator[SEP] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] } Keyword[final] identifier[String] identifier[address] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[cluster] , identifier[group] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[execute] operator[SEP] Keyword[new] identifier[Action] operator[<] identifier[Boolean] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Boolean] identifier[perform] operator[SEP] operator[SEP] { Keyword[return] identifier[groups] operator[SEP] identifier[containsKey] operator[SEP] identifier[address] operator[SEP] operator[SEP] } } , Keyword[new] identifier[Handler] operator[<] identifier[AsyncResult] operator[<] identifier[Boolean] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handle] operator[SEP] identifier[AsyncResult] operator[<] identifier[Boolean] operator[>] identifier[result] operator[SEP] { Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[failed] operator[SEP] operator[SEP] operator[SEP] { identifier[message] operator[SEP] identifier[reply] operator[SEP] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , identifier[result] operator[SEP] identifier[cause] operator[SEP] operator[SEP] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[result] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[SEP] { identifier[message] operator[SEP] identifier[reply] operator[SEP] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { identifier[message] operator[SEP] identifier[reply] operator[SEP] Keyword[new] identifier[JsonObject] operator[SEP] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[putString] operator[SEP] literal[String] , identifier[address] operator[SEP] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
public EClass getIfcTable() { if (ifcTableEClass == null) { ifcTableEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers() .get(593); } return ifcTableEClass; }
class class_name[name] begin[{] method[getIfcTable, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcTableEClass], ==, literal[null]]] begin[{] assign[member[.ifcTableEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=593)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))] else begin[{] None end[}] return[member[.ifcTableEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcTable] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcTableEClass] operator[==] Other[null] operator[SEP] { identifier[ifcTableEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[593] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcTableEClass] operator[SEP] }
private double calculateTempError(){ double error = 0; for(ExperimentalDataBinary data : experimental){ mixture.setZFraction(referenceComponent, data.getLiquidFraction()); mixture.setZFraction(nonReferenceComponent, 1-data.getLiquidFraction()); mixture.bubbleTemperature(); double tempCalc = mixture.getTemperature(); double tempExp = data.getTemperature(); error += Math.pow((tempCalc- tempExp)/tempExp,2); } return error; }
class class_name[name] begin[{] method[calculateTempError, return_type[type[double]], modifier[private], parameter[]] begin[{] local_variable[type[double], error] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=referenceComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getLiquidFraction, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None)], member=setZFraction, postfix_operators=[], prefix_operators=[], qualifier=mixture, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=nonReferenceComponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operandr=MethodInvocation(arguments=[], member=getLiquidFraction, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), operator=-)], member=setZFraction, postfix_operators=[], prefix_operators=[], qualifier=mixture, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=bubbleTemperature, postfix_operators=[], prefix_operators=[], qualifier=mixture, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTemperature, postfix_operators=[], prefix_operators=[], qualifier=mixture, selectors=[], type_arguments=None), name=tempCalc)], modifiers=set(), type=BasicType(dimensions=[], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTemperature, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), name=tempExp)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=tempCalc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=tempExp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), operandr=MemberReference(member=tempExp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=pow, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=experimental, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=data)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExperimentalDataBinary, sub_type=None))), label=None) return[member[.error]] end[}] END[}]
Keyword[private] Keyword[double] identifier[calculateTempError] operator[SEP] operator[SEP] { Keyword[double] identifier[error] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[ExperimentalDataBinary] identifier[data] operator[:] identifier[experimental] operator[SEP] { identifier[mixture] operator[SEP] identifier[setZFraction] operator[SEP] identifier[referenceComponent] , identifier[data] operator[SEP] identifier[getLiquidFraction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mixture] operator[SEP] identifier[setZFraction] operator[SEP] identifier[nonReferenceComponent] , Other[1] operator[-] identifier[data] operator[SEP] identifier[getLiquidFraction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mixture] operator[SEP] identifier[bubbleTemperature] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[tempCalc] operator[=] identifier[mixture] operator[SEP] identifier[getTemperature] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[tempExp] operator[=] identifier[data] operator[SEP] identifier[getTemperature] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[+=] identifier[Math] operator[SEP] identifier[pow] operator[SEP] operator[SEP] identifier[tempCalc] operator[-] identifier[tempExp] operator[SEP] operator[/] identifier[tempExp] , Other[2] operator[SEP] operator[SEP] } Keyword[return] identifier[error] operator[SEP] }
public void processSpace(Properties properties) { // Ensure that the bottom right corner of the matrix has a valid value // so that we always create a 2 * n set of dimensions in the default // case. if (cooccurrenceMatrix.get(termToIndex.numDimensions() - 1, termToIndex.numDimensions() - 1) == 0d) cooccurrenceMatrix.set(termToIndex.numDimensions() - 1, termToIndex.numDimensions() - 1, 0d); if (columnThreshold > -1d) thresholdColumns(columnThreshold); if (retainColumns > 0) retainOnly(retainColumns); }
class class_name[name] begin[{] method[processSpace, return_type[void], modifier[public], parameter[properties]] begin[{] if[binary_operation[call[cooccurrenceMatrix.get, parameter[binary_operation[call[termToIndex.numDimensions, parameter[]], -, literal[1]], binary_operation[call[termToIndex.numDimensions, parameter[]], -, literal[1]]]], ==, literal[0d]]] begin[{] call[cooccurrenceMatrix.set, parameter[binary_operation[call[termToIndex.numDimensions, parameter[]], -, literal[1]], binary_operation[call[termToIndex.numDimensions, parameter[]], -, literal[1]], literal[0d]]] else begin[{] None end[}] if[binary_operation[member[.columnThreshold], >, literal[1d]]] begin[{] call[.thresholdColumns, parameter[member[.columnThreshold]]] else begin[{] None end[}] if[binary_operation[member[.retainColumns], >, literal[0]]] begin[{] call[.retainOnly, parameter[member[.retainColumns]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[processSpace] operator[SEP] identifier[Properties] identifier[properties] operator[SEP] { Keyword[if] operator[SEP] identifier[cooccurrenceMatrix] operator[SEP] identifier[get] operator[SEP] identifier[termToIndex] operator[SEP] identifier[numDimensions] operator[SEP] operator[SEP] operator[-] Other[1] , identifier[termToIndex] operator[SEP] identifier[numDimensions] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[==] literal[Float] operator[SEP] identifier[cooccurrenceMatrix] operator[SEP] identifier[set] operator[SEP] identifier[termToIndex] operator[SEP] identifier[numDimensions] operator[SEP] operator[SEP] operator[-] Other[1] , identifier[termToIndex] operator[SEP] identifier[numDimensions] operator[SEP] operator[SEP] operator[-] Other[1] , literal[Float] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[columnThreshold] operator[>] operator[-] literal[Float] operator[SEP] identifier[thresholdColumns] operator[SEP] identifier[columnThreshold] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[retainColumns] operator[>] Other[0] operator[SEP] identifier[retainOnly] operator[SEP] identifier[retainColumns] operator[SEP] operator[SEP] }
public void registerServlet (@Nonnull final Class <? extends Servlet> aServletClass, @Nonnull @Nonempty final String sServletPath, @Nonnull @Nonempty final String sServletName, @Nullable final Map <String, String> aServletInitParams) { ValueEnforcer.notNull (aServletClass, "ServletClass"); ValueEnforcer.notEmpty (sServletPath, "ServletPath"); for (final ServletItem aItem : m_aServlets) { // Check path uniqueness if (aItem.getServletPath ().equals (sServletPath)) throw new IllegalArgumentException ("Another servlet with the path '" + sServletPath + "' is already registered: " + aItem); // Check name uniqueness if (aItem.getServletName ().equals (sServletName)) throw new IllegalArgumentException ("Another servlet with the name '" + sServletName + "' is already registered: " + aItem); } // Instantiate servlet final Servlet aServlet = GenericReflection.newInstance (aServletClass); if (aServlet == null) throw new IllegalArgumentException ("Failed to instantiate servlet class " + aServletClass); final ServletConfig aServletConfig = m_aSC.createServletConfig (sServletName, aServletInitParams); try { aServlet.init (aServletConfig); } catch (final ServletException ex) { throw new IllegalStateException ("Failed to init servlet " + aServlet + " with configuration " + aServletConfig + " for path '" + sServletPath + "'"); } m_aServlets.add (new ServletItem (aServlet, sServletPath)); }
class class_name[name] begin[{] method[registerServlet, return_type[void], modifier[public], parameter[aServletClass, sServletPath, sServletName, aServletInitParams]] begin[{] call[ValueEnforcer.notNull, parameter[member[.aServletClass], literal["ServletClass"]]] call[ValueEnforcer.notEmpty, parameter[member[.sServletPath], literal["ServletPath"]]] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getServletPath, postfix_operators=[], prefix_operators=[], qualifier=aItem, selectors=[MethodInvocation(arguments=[MemberReference(member=sServletPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Another servlet with the path '"), operandr=MemberReference(member=sServletPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is already registered: "), operator=+), operandr=MemberReference(member=aItem, 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)), IfStatement(condition=MethodInvocation(arguments=[], member=getServletName, postfix_operators=[], prefix_operators=[], qualifier=aItem, selectors=[MethodInvocation(arguments=[MemberReference(member=sServletName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Another servlet with the name '"), operandr=MemberReference(member=sServletName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' is already registered: "), operator=+), operandr=MemberReference(member=aItem, 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))]), control=EnhancedForControl(iterable=MemberReference(member=m_aServlets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=aItem)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=ServletItem, sub_type=None))), label=None) local_variable[type[Servlet], aServlet] if[binary_operation[member[.aServlet], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to instantiate servlet class "), operandr=MemberReference(member=aServletClass, 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[ServletConfig], aServletConfig] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=aServletConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=aServlet, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to init servlet "), operandr=MemberReference(member=aServlet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" with configuration "), operator=+), operandr=MemberReference(member=aServletConfig, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for path '"), operator=+), operandr=MemberReference(member=sServletPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['ServletException']))], finally_block=None, label=None, resources=None) call[m_aServlets.add, parameter[ClassCreator(arguments=[MemberReference(member=aServlet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sServletPath, 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=ServletItem, sub_type=None))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[registerServlet] operator[SEP] annotation[@] identifier[Nonnull] Keyword[final] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Servlet] operator[>] identifier[aServletClass] , annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] Keyword[final] identifier[String] identifier[sServletPath] , annotation[@] identifier[Nonnull] annotation[@] identifier[Nonempty] Keyword[final] identifier[String] identifier[sServletName] , annotation[@] identifier[Nullable] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[aServletInitParams] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[notNull] operator[SEP] identifier[aServletClass] , literal[String] operator[SEP] operator[SEP] identifier[ValueEnforcer] operator[SEP] identifier[notEmpty] operator[SEP] identifier[sServletPath] , literal[String] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[ServletItem] identifier[aItem] operator[:] identifier[m_aServlets] operator[SEP] { Keyword[if] operator[SEP] identifier[aItem] operator[SEP] identifier[getServletPath] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[sServletPath] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[sServletPath] operator[+] literal[String] operator[+] identifier[aItem] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aItem] operator[SEP] identifier[getServletName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[sServletName] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[sServletName] operator[+] literal[String] operator[+] identifier[aItem] operator[SEP] operator[SEP] } Keyword[final] identifier[Servlet] identifier[aServlet] operator[=] identifier[GenericReflection] operator[SEP] identifier[newInstance] operator[SEP] identifier[aServletClass] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[aServlet] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[aServletClass] operator[SEP] operator[SEP] Keyword[final] identifier[ServletConfig] identifier[aServletConfig] operator[=] identifier[m_aSC] operator[SEP] identifier[createServletConfig] operator[SEP] identifier[sServletName] , identifier[aServletInitParams] operator[SEP] operator[SEP] Keyword[try] { identifier[aServlet] operator[SEP] identifier[init] operator[SEP] identifier[aServletConfig] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] Keyword[final] identifier[ServletException] identifier[ex] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[aServlet] operator[+] literal[String] operator[+] identifier[aServletConfig] operator[+] literal[String] operator[+] identifier[sServletPath] operator[+] literal[String] operator[SEP] operator[SEP] } identifier[m_aServlets] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ServletItem] operator[SEP] identifier[aServlet] , identifier[sServletPath] operator[SEP] operator[SEP] operator[SEP] }
@Override public void renameTo(String newName) throws IOException { File oldBuildDir = getBuildDir(); super.renameTo(newName); File newBuildDir = getBuildDir(); if (oldBuildDir.isDirectory() && !newBuildDir.isDirectory()) { if (!newBuildDir.getParentFile().isDirectory()) { newBuildDir.getParentFile().mkdirs(); } if (!oldBuildDir.renameTo(newBuildDir)) { throw new IOException("failed to rename " + oldBuildDir + " to " + newBuildDir); } } }
class class_name[name] begin[{] method[renameTo, return_type[void], modifier[public], parameter[newName]] begin[{] local_variable[type[File], oldBuildDir] SuperMethodInvocation(arguments=[MemberReference(member=newName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=renameTo, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) local_variable[type[File], newBuildDir] if[binary_operation[call[oldBuildDir.isDirectory, parameter[]], &&, call[newBuildDir.isDirectory, parameter[]]]] begin[{] if[call[newBuildDir.getParentFile, parameter[]]] begin[{] call[newBuildDir.getParentFile, parameter[]] else begin[{] None end[}] if[call[oldBuildDir.renameTo, parameter[member[.newBuildDir]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="failed to rename "), operandr=MemberReference(member=oldBuildDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" to "), operator=+), operandr=MemberReference(member=newBuildDir, 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=IOException, sub_type=None)), label=None) else begin[{] None end[}] else begin[{] None end[}] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[renameTo] operator[SEP] identifier[String] identifier[newName] operator[SEP] Keyword[throws] identifier[IOException] { identifier[File] identifier[oldBuildDir] operator[=] identifier[getBuildDir] operator[SEP] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[renameTo] operator[SEP] identifier[newName] operator[SEP] operator[SEP] identifier[File] identifier[newBuildDir] operator[=] identifier[getBuildDir] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldBuildDir] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[newBuildDir] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[newBuildDir] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { identifier[newBuildDir] operator[SEP] identifier[getParentFile] operator[SEP] operator[SEP] operator[SEP] identifier[mkdirs] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[oldBuildDir] operator[SEP] identifier[renameTo] operator[SEP] identifier[newBuildDir] operator[SEP] operator[SEP] { Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] identifier[oldBuildDir] operator[+] literal[String] operator[+] identifier[newBuildDir] operator[SEP] operator[SEP] } } }
public static Boolean toBoolean(Object value){ if (value == null) { return false; } else if (value instanceof Boolean) { return (Boolean) value; } else if (value instanceof BigDecimal) { return value.equals(BigDecimal.ONE); } else if (value instanceof Long) { return value.equals(1L); } else if (value instanceof Integer) { return value.equals(1); } else if (value instanceof Character) { return value.equals('y') || value.equals('Y') || value.equals('t') || value.equals('T'); }else return value.toString().equalsIgnoreCase("yes") || value.toString().equalsIgnoreCase("true") || value.toString().equalsIgnoreCase("y") || value.toString().equalsIgnoreCase("t") || Boolean.parseBoolean(value.toString()); }
class class_name[name] begin[{] method[toBoolean, return_type[type[Boolean]], modifier[public static], parameter[value]] begin[{] if[binary_operation[member[.value], ==, literal[null]]] begin[{] return[literal[false]] else begin[{] if[binary_operation[member[.value], instanceof, type[Boolean]]] begin[{] return[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))] else begin[{] if[binary_operation[member[.value], instanceof, type[BigDecimal]]] begin[{] return[call[value.equals, parameter[member[BigDecimal.ONE]]]] else begin[{] if[binary_operation[member[.value], instanceof, type[Long]]] begin[{] return[call[value.equals, parameter[literal[1L]]]] else begin[{] if[binary_operation[member[.value], instanceof, type[Integer]]] begin[{] return[call[value.equals, parameter[literal[1]]]] else begin[{] if[binary_operation[member[.value], instanceof, type[Character]]] begin[{] return[binary_operation[binary_operation[binary_operation[call[value.equals, parameter[literal['y']]], ||, call[value.equals, parameter[literal['Y']]]], ||, call[value.equals, parameter[literal['t']]]], ||, call[value.equals, parameter[literal['T']]]]] else begin[{] return[binary_operation[binary_operation[binary_operation[binary_operation[call[value.toString, parameter[]], ||, call[value.toString, parameter[]]], ||, call[value.toString, parameter[]]], ||, call[value.toString, parameter[]]], ||, call[Boolean.parseBoolean, parameter[call[value.toString, parameter[]]]]]] end[}] end[}] end[}] end[}] end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[Boolean] identifier[toBoolean] operator[SEP] identifier[Object] identifier[value] operator[SEP] { Keyword[if] operator[SEP] identifier[value] operator[==] Other[null] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Boolean] operator[SEP] { Keyword[return] operator[SEP] identifier[Boolean] operator[SEP] identifier[value] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[BigDecimal] operator[SEP] { Keyword[return] identifier[value] operator[SEP] identifier[equals] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[ONE] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Long] operator[SEP] { Keyword[return] identifier[value] operator[SEP] identifier[equals] operator[SEP] Other[1L] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Integer] operator[SEP] { Keyword[return] identifier[value] operator[SEP] identifier[equals] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[value] Keyword[instanceof] identifier[Character] operator[SEP] { Keyword[return] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[else] Keyword[return] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[||] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[||] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[||] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[||] identifier[Boolean] operator[SEP] identifier[parseBoolean] operator[SEP] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public static List<String> extractParameterNames(Serializable lambda, int lambdaParametersCount) { SerializedLambda serializedLambda = serialized(lambda); Method lambdaMethod = lambdaMethod(serializedLambda); String[] paramNames = paramNameReader.getParamNames(lambdaMethod); return asList(Arrays.copyOfRange(paramNames, paramNames.length - lambdaParametersCount, paramNames.length)); }
class class_name[name] begin[{] method[extractParameterNames, return_type[type[List]], modifier[public static], parameter[lambda, lambdaParametersCount]] begin[{] local_variable[type[SerializedLambda], serializedLambda] local_variable[type[Method], lambdaMethod] local_variable[type[String], paramNames] return[call[.asList, parameter[call[Arrays.copyOfRange, parameter[member[.paramNames], binary_operation[member[paramNames.length], -, member[.lambdaParametersCount]], member[paramNames.length]]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[List] operator[<] identifier[String] operator[>] identifier[extractParameterNames] operator[SEP] identifier[Serializable] identifier[lambda] , Keyword[int] identifier[lambdaParametersCount] operator[SEP] { identifier[SerializedLambda] identifier[serializedLambda] operator[=] identifier[serialized] operator[SEP] identifier[lambda] operator[SEP] operator[SEP] identifier[Method] identifier[lambdaMethod] operator[=] identifier[lambdaMethod] operator[SEP] identifier[serializedLambda] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[paramNames] operator[=] identifier[paramNameReader] operator[SEP] identifier[getParamNames] operator[SEP] identifier[lambdaMethod] operator[SEP] operator[SEP] Keyword[return] identifier[asList] operator[SEP] identifier[Arrays] operator[SEP] identifier[copyOfRange] operator[SEP] identifier[paramNames] , identifier[paramNames] operator[SEP] identifier[length] operator[-] identifier[lambdaParametersCount] , identifier[paramNames] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] }
private boolean checkRestrictorService(RestrictorCheck pCheck, Object ... args) { try { ServiceReference[] serviceRefs = bundleContext.getServiceReferences(Restrictor.class.getName(),null); if (serviceRefs != null) { boolean ret = true; boolean found = false; for (ServiceReference serviceRef : serviceRefs) { Restrictor restrictor = (Restrictor) bundleContext.getService(serviceRef); if (restrictor != null) { ret = ret && pCheck.check(restrictor,args); found = true; } } return found && ret; } else { return false; } } catch (InvalidSyntaxException e) { // Will not happen, since we dont use a filter here throw new IllegalArgumentException("Impossible exception (we don't use a filter for fetching the services)",e); } }
class class_name[name] begin[{] method[checkRestrictorService, return_type[type[boolean]], modifier[private], parameter[pCheck, args]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Restrictor, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=getServiceReferences, postfix_operators=[], prefix_operators=[], qualifier=bundleContext, selectors=[], type_arguments=None), name=serviceRefs)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=ServiceReference, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=serviceRefs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), 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=true), name=ret)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), name=found)], modifiers=set(), type=BasicType(dimensions=[], name=boolean)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=serviceRef, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getService, postfix_operators=[], prefix_operators=[], qualifier=bundleContext, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Restrictor, sub_type=None)), name=restrictor)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Restrictor, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=restrictor, 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=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[MemberReference(member=restrictor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=args, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=check, postfix_operators=[], prefix_operators=[], qualifier=pCheck, selectors=[], type_arguments=None), operator=&&)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=serviceRefs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=serviceRef)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ServiceReference, sub_type=None))), label=None), ReturnStatement(expression=BinaryOperation(operandl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=&&), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Impossible exception (we don't use a filter for fetching the services)"), 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=IllegalArgumentException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InvalidSyntaxException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[private] Keyword[boolean] identifier[checkRestrictorService] operator[SEP] identifier[RestrictorCheck] identifier[pCheck] , identifier[Object] operator[...] identifier[args] operator[SEP] { Keyword[try] { identifier[ServiceReference] operator[SEP] operator[SEP] identifier[serviceRefs] operator[=] identifier[bundleContext] operator[SEP] identifier[getServiceReferences] operator[SEP] identifier[Restrictor] operator[SEP] Keyword[class] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[serviceRefs] operator[!=] Other[null] operator[SEP] { Keyword[boolean] identifier[ret] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[found] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[ServiceReference] identifier[serviceRef] operator[:] identifier[serviceRefs] operator[SEP] { identifier[Restrictor] identifier[restrictor] operator[=] operator[SEP] identifier[Restrictor] operator[SEP] identifier[bundleContext] operator[SEP] identifier[getService] operator[SEP] identifier[serviceRef] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[restrictor] operator[!=] Other[null] operator[SEP] { identifier[ret] operator[=] identifier[ret] operator[&&] identifier[pCheck] operator[SEP] identifier[check] operator[SEP] identifier[restrictor] , identifier[args] operator[SEP] operator[SEP] identifier[found] operator[=] literal[boolean] operator[SEP] } } Keyword[return] identifier[found] operator[&&] identifier[ret] operator[SEP] } Keyword[else] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InvalidSyntaxException] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } }