code
stringlengths
63
466k
code_sememe
stringlengths
141
3.79M
token_type
stringlengths
274
1.23M
public Class<?> getActualFieldType(final String field) { final Object fieldValue = getFieldValue(field); return fieldValue == null ? null : fieldValue.getClass(); }
class class_name[name] begin[{] method[getActualFieldType, return_type[type[Class]], modifier[public], parameter[field]] begin[{] local_variable[type[Object], fieldValue] return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=fieldValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=fieldValue, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))] end[}] END[}]
Keyword[public] identifier[Class] operator[<] operator[?] operator[>] identifier[getActualFieldType] operator[SEP] Keyword[final] identifier[String] identifier[field] operator[SEP] { Keyword[final] identifier[Object] identifier[fieldValue] operator[=] identifier[getFieldValue] operator[SEP] identifier[field] operator[SEP] operator[SEP] Keyword[return] identifier[fieldValue] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[fieldValue] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] }
private static void mergeBins( int mergedBinCount, float[] mergedPositions, long[] mergedBins, float[] deltas, int numMerge, int[] next, int[] prev ) { // repeatedly search for two closest bins, merge them and update the corresponding deltas // maintain index to the last valid bin int lastValidIndex = mergedBinCount - 1; // initialize prev / next lookup arrays for (int i = 0; i < mergedBinCount; ++i) { next[i] = i + 1; } for (int i = 0; i < mergedBinCount; ++i) { prev[i] = i - 1; } // initialize min-heap of deltas and the reverse index into the heap int heapSize = mergedBinCount - 1; int[] heap = new int[heapSize]; int[] reverseIndex = new int[heapSize]; for (int i = 0; i < heapSize; ++i) { heap[i] = i; } for (int i = 0; i < heapSize; ++i) { reverseIndex[i] = i; } heapify(heap, reverseIndex, heapSize, deltas); { int i = 0; while (i < numMerge) { // find the smallest delta within the range used for bins // pick minimum delta index using min-heap int currentIndex = heap[0]; final int nextIndex = next[currentIndex]; final int prevIndex = prev[currentIndex]; final long k0 = mergedBins[currentIndex] & COUNT_BITS; final long k1 = mergedBins[nextIndex] & COUNT_BITS; final float m0 = mergedPositions[currentIndex]; final float m1 = mergedPositions[nextIndex]; final float d1 = deltas[nextIndex]; final long sum = k0 + k1; final float w = (float) k0 / (float) sum; // merge bin at given position with the next bin final float mm0 = (m0 - m1) * w + m1; mergedPositions[currentIndex] = mm0; mergedBins[currentIndex] = sum | APPROX_FLAG_BIT; // update deltas and min-heap if (nextIndex == lastValidIndex) { // merged bin is the last => remove the current bin delta from the heap heapSize = heapDelete(heap, reverseIndex, heapSize, reverseIndex[currentIndex], deltas); } else { // merged bin is not the last => remove the merged bin delta from the heap heapSize = heapDelete(heap, reverseIndex, heapSize, reverseIndex[nextIndex], deltas); // updated current delta deltas[currentIndex] = m1 - mm0 + d1; // updated delta is necessarily larger than existing one, therefore we only need to push it down the heap siftDown(heap, reverseIndex, reverseIndex[currentIndex], heapSize - 1, deltas); } if (prevIndex >= 0) { // current bin is not the first, therefore update the previous bin delta deltas[prevIndex] = mm0 - mergedPositions[prevIndex]; // updated previous bin delta is necessarily larger than its existing value => push down the heap siftDown(heap, reverseIndex, reverseIndex[prevIndex], heapSize - 1, deltas); } // update last valid index if we merged the last bin if (nextIndex == lastValidIndex) { lastValidIndex = currentIndex; } next[currentIndex] = next[nextIndex]; if (nextIndex < lastValidIndex) { prev[next[nextIndex]] = currentIndex; } ++i; } } }
class class_name[name] begin[{] method[mergeBins, return_type[void], modifier[private static], parameter[mergedBinCount, mergedPositions, mergedBins, deltas, numMerge, next, prev]] begin[{] local_variable[type[int], lastValidIndex] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mergedBinCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=mergedBinCount, 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) local_variable[type[int], heapSize] local_variable[type[int], heap] local_variable[type[int], reverseIndex] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=heap, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=heapSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=reverseIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=heapSize, 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) call[.heapify, parameter[member[.heap], member[.reverseIndex], member[.heapSize], member[.deltas]]] local_variable[type[int], i] while[binary_operation[member[.i], <, member[.numMerge]]] begin[{] local_variable[type[int], currentIndex] local_variable[type[int], nextIndex] local_variable[type[int], prevIndex] local_variable[type[long], k0] local_variable[type[long], k1] local_variable[type[float], m0] local_variable[type[float], m1] local_variable[type[float], d1] local_variable[type[long], sum] local_variable[type[float], w] local_variable[type[float], mm0] assign[member[.mergedPositions], member[.mm0]] assign[member[.mergedBins], binary_operation[member[.sum], |, member[.APPROX_FLAG_BIT]]] if[binary_operation[member[.nextIndex], ==, member[.lastValidIndex]]] begin[{] assign[member[.heapSize], call[.heapDelete, parameter[member[.heap], member[.reverseIndex], member[.heapSize], member[.reverseIndex], member[.deltas]]]] else begin[{] assign[member[.heapSize], call[.heapDelete, parameter[member[.heap], member[.reverseIndex], member[.heapSize], member[.reverseIndex], member[.deltas]]]] assign[member[.deltas], binary_operation[binary_operation[member[.m1], -, member[.mm0]], +, member[.d1]]] call[.siftDown, parameter[member[.heap], member[.reverseIndex], member[.reverseIndex], binary_operation[member[.heapSize], -, literal[1]], member[.deltas]]] end[}] if[binary_operation[member[.prevIndex], >=, literal[0]]] begin[{] assign[member[.deltas], binary_operation[member[.mm0], -, member[.mergedPositions]]] call[.siftDown, parameter[member[.heap], member[.reverseIndex], member[.reverseIndex], binary_operation[member[.heapSize], -, literal[1]], member[.deltas]]] else begin[{] None end[}] if[binary_operation[member[.nextIndex], ==, member[.lastValidIndex]]] begin[{] assign[member[.lastValidIndex], member[.currentIndex]] else begin[{] None end[}] assign[member[.next], member[.next]] if[binary_operation[member[.nextIndex], <, member[.lastValidIndex]]] begin[{] assign[member[.prev], member[.currentIndex]] else begin[{] None end[}] member[.i] end[}] end[}] END[}]
Keyword[private] Keyword[static] Keyword[void] identifier[mergeBins] operator[SEP] Keyword[int] identifier[mergedBinCount] , Keyword[float] operator[SEP] operator[SEP] identifier[mergedPositions] , Keyword[long] operator[SEP] operator[SEP] identifier[mergedBins] , Keyword[float] operator[SEP] operator[SEP] identifier[deltas] , Keyword[int] identifier[numMerge] , Keyword[int] operator[SEP] operator[SEP] identifier[next] , Keyword[int] operator[SEP] operator[SEP] identifier[prev] operator[SEP] { Keyword[int] identifier[lastValidIndex] operator[=] identifier[mergedBinCount] operator[-] Other[1] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[mergedBinCount] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[next] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[i] operator[+] Other[1] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[mergedBinCount] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[prev] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[i] operator[-] Other[1] operator[SEP] } Keyword[int] identifier[heapSize] operator[=] identifier[mergedBinCount] operator[-] Other[1] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[heap] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[heapSize] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[reverseIndex] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[heapSize] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[heapSize] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[heap] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[i] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[heapSize] operator[SEP] operator[++] identifier[i] operator[SEP] { identifier[reverseIndex] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[i] operator[SEP] } identifier[heapify] operator[SEP] identifier[heap] , identifier[reverseIndex] , identifier[heapSize] , identifier[deltas] operator[SEP] operator[SEP] { Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[i] operator[<] identifier[numMerge] operator[SEP] { Keyword[int] identifier[currentIndex] operator[=] identifier[heap] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[nextIndex] operator[=] identifier[next] operator[SEP] identifier[currentIndex] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[prevIndex] operator[=] identifier[prev] operator[SEP] identifier[currentIndex] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[k0] operator[=] identifier[mergedBins] operator[SEP] identifier[currentIndex] operator[SEP] operator[&] identifier[COUNT_BITS] operator[SEP] Keyword[final] Keyword[long] identifier[k1] operator[=] identifier[mergedBins] operator[SEP] identifier[nextIndex] operator[SEP] operator[&] identifier[COUNT_BITS] operator[SEP] Keyword[final] Keyword[float] identifier[m0] operator[=] identifier[mergedPositions] operator[SEP] identifier[currentIndex] operator[SEP] operator[SEP] Keyword[final] Keyword[float] identifier[m1] operator[=] identifier[mergedPositions] operator[SEP] identifier[nextIndex] operator[SEP] operator[SEP] Keyword[final] Keyword[float] identifier[d1] operator[=] identifier[deltas] operator[SEP] identifier[nextIndex] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[sum] operator[=] identifier[k0] operator[+] identifier[k1] operator[SEP] Keyword[final] Keyword[float] identifier[w] operator[=] operator[SEP] Keyword[float] operator[SEP] identifier[k0] operator[/] operator[SEP] Keyword[float] operator[SEP] identifier[sum] operator[SEP] Keyword[final] Keyword[float] identifier[mm0] operator[=] operator[SEP] identifier[m0] operator[-] identifier[m1] operator[SEP] operator[*] identifier[w] operator[+] identifier[m1] operator[SEP] identifier[mergedPositions] operator[SEP] identifier[currentIndex] operator[SEP] operator[=] identifier[mm0] operator[SEP] identifier[mergedBins] operator[SEP] identifier[currentIndex] operator[SEP] operator[=] identifier[sum] operator[|] identifier[APPROX_FLAG_BIT] operator[SEP] Keyword[if] operator[SEP] identifier[nextIndex] operator[==] identifier[lastValidIndex] operator[SEP] { identifier[heapSize] operator[=] identifier[heapDelete] operator[SEP] identifier[heap] , identifier[reverseIndex] , identifier[heapSize] , identifier[reverseIndex] operator[SEP] identifier[currentIndex] operator[SEP] , identifier[deltas] operator[SEP] operator[SEP] } Keyword[else] { identifier[heapSize] operator[=] identifier[heapDelete] operator[SEP] identifier[heap] , identifier[reverseIndex] , identifier[heapSize] , identifier[reverseIndex] operator[SEP] identifier[nextIndex] operator[SEP] , identifier[deltas] operator[SEP] operator[SEP] identifier[deltas] operator[SEP] identifier[currentIndex] operator[SEP] operator[=] identifier[m1] operator[-] identifier[mm0] operator[+] identifier[d1] operator[SEP] identifier[siftDown] operator[SEP] identifier[heap] , identifier[reverseIndex] , identifier[reverseIndex] operator[SEP] identifier[currentIndex] operator[SEP] , identifier[heapSize] operator[-] Other[1] , identifier[deltas] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[prevIndex] operator[>=] Other[0] operator[SEP] { identifier[deltas] operator[SEP] identifier[prevIndex] operator[SEP] operator[=] identifier[mm0] operator[-] identifier[mergedPositions] operator[SEP] identifier[prevIndex] operator[SEP] operator[SEP] identifier[siftDown] operator[SEP] identifier[heap] , identifier[reverseIndex] , identifier[reverseIndex] operator[SEP] identifier[prevIndex] operator[SEP] , identifier[heapSize] operator[-] Other[1] , identifier[deltas] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[nextIndex] operator[==] identifier[lastValidIndex] operator[SEP] { identifier[lastValidIndex] operator[=] identifier[currentIndex] operator[SEP] } identifier[next] operator[SEP] identifier[currentIndex] operator[SEP] operator[=] identifier[next] operator[SEP] identifier[nextIndex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nextIndex] operator[<] identifier[lastValidIndex] operator[SEP] { identifier[prev] operator[SEP] identifier[next] operator[SEP] identifier[nextIndex] operator[SEP] operator[SEP] operator[=] identifier[currentIndex] operator[SEP] } operator[++] identifier[i] operator[SEP] } } }
public synchronized void reset() { ensureOpen(); encodedBuf.clear(); if (decodedBuf.capacity() > FilteredConstants.DEFAULT_DECODER_CAPACITY) { this.decodedBuf = CharBuffer.allocate(FilteredConstants.DEFAULT_DECODER_CAPACITY); } else { decodedBuf.clear(); } decoder.reset(); }
class class_name[name] begin[{] method[reset, return_type[void], modifier[synchronized public], parameter[]] begin[{] call[.ensureOpen, parameter[]] call[encodedBuf.clear, parameter[]] if[binary_operation[call[decodedBuf.capacity, parameter[]], >, member[FilteredConstants.DEFAULT_DECODER_CAPACITY]]] begin[{] assign[THIS[member[None.decodedBuf]], call[CharBuffer.allocate, parameter[member[FilteredConstants.DEFAULT_DECODER_CAPACITY]]]] else begin[{] call[decodedBuf.clear, parameter[]] end[}] call[decoder.reset, parameter[]] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[reset] operator[SEP] operator[SEP] { identifier[ensureOpen] operator[SEP] operator[SEP] operator[SEP] identifier[encodedBuf] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[decodedBuf] operator[SEP] identifier[capacity] operator[SEP] operator[SEP] operator[>] identifier[FilteredConstants] operator[SEP] identifier[DEFAULT_DECODER_CAPACITY] operator[SEP] { Keyword[this] operator[SEP] identifier[decodedBuf] operator[=] identifier[CharBuffer] operator[SEP] identifier[allocate] operator[SEP] identifier[FilteredConstants] operator[SEP] identifier[DEFAULT_DECODER_CAPACITY] operator[SEP] operator[SEP] } Keyword[else] { identifier[decodedBuf] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] } identifier[decoder] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] }
public static BCECPublicKey convertX509ToECPublicKey(byte[] x509Bytes) throws NoSuchProviderException, NoSuchAlgorithmException, InvalidKeySpecException { X509EncodedKeySpec eks = new X509EncodedKeySpec(x509Bytes); KeyFactory kf = KeyFactory.getInstance("EC", BouncyCastleProvider.PROVIDER_NAME); return (BCECPublicKey) kf.generatePublic(eks); }
class class_name[name] begin[{] method[convertX509ToECPublicKey, return_type[type[BCECPublicKey]], modifier[public static], parameter[x509Bytes]] begin[{] local_variable[type[X509EncodedKeySpec], eks] local_variable[type[KeyFactory], kf] return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=eks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=generatePublic, postfix_operators=[], prefix_operators=[], qualifier=kf, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=BCECPublicKey, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[BCECPublicKey] identifier[convertX509ToECPublicKey] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[x509Bytes] operator[SEP] Keyword[throws] identifier[NoSuchProviderException] , identifier[NoSuchAlgorithmException] , identifier[InvalidKeySpecException] { identifier[X509EncodedKeySpec] identifier[eks] operator[=] Keyword[new] identifier[X509EncodedKeySpec] operator[SEP] identifier[x509Bytes] operator[SEP] operator[SEP] identifier[KeyFactory] identifier[kf] operator[=] identifier[KeyFactory] operator[SEP] identifier[getInstance] operator[SEP] literal[String] , identifier[BouncyCastleProvider] operator[SEP] identifier[PROVIDER_NAME] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[BCECPublicKey] operator[SEP] identifier[kf] operator[SEP] identifier[generatePublic] operator[SEP] identifier[eks] operator[SEP] operator[SEP] }
public void unregisterEventID(String eventKey) { properties.remove(eventKey + "_DESCRIPTION"); properties.remove(eventKey); FileOutputStream out = null; BufferedReader reader = null; BufferedWriter writer = null; try { out = new FileOutputStream(eventPropertiesPath, true); final File tempFile = new File(eventPropertiesPath + "temp.properties"); final BufferedReader readerFinal = new BufferedReader(new FileReader(eventPropertiesPath)); final BufferedWriter writerFinal = new BufferedWriter(new FileWriter(tempFile)); doWithLock(out.getChannel(), lock -> { unlockedReloadFile(); if (getEventID(eventKey) != null) { return; } try { String currentLine = readerFinal.readLine(); while(currentLine != null) { String trimmedLine = currentLine.trim(); if(trimmedLine.equals(eventKey + "_DESCRIPTION") || trimmedLine.equals(eventKey)) continue; writerFinal.write(currentLine + System.getProperty("line.separator")); currentLine = readerFinal.readLine(); } } catch (IOException e) { e.printStackTrace(); } }); reader = readerFinal; writer = writerFinal; tempFile.renameTo(new File(eventPropertiesPath)); } catch (IOException e) { error("Unable find file", e); } finally { try { if (out != null) { out.close(); } if (writer != null) { writer.close(); } if (reader != null) { reader.close(); } } catch (IOException e) { error("Unable to close lock", e); } } }
class class_name[name] begin[{] method[unregisterEventID, return_type[void], modifier[public], parameter[eventKey]] begin[{] call[properties.remove, parameter[binary_operation[member[.eventKey], +, literal["_DESCRIPTION"]]]] call[properties.remove, parameter[member[.eventKey]]] local_variable[type[FileOutputStream], out] local_variable[type[BufferedReader], reader] local_variable[type[BufferedWriter], writer] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=eventPropertiesPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileOutputStream, sub_type=None))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=eventPropertiesPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="temp.properties"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None)), name=tempFile)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=eventPropertiesPath, 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=FileReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)), name=readerFinal)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=tempFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileWriter, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedWriter, sub_type=None)), name=writerFinal)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=BufferedWriter, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getChannel, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[], member=unlockedReloadFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=eventKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEventID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=None, label=None)])), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=readerFinal, selectors=[], type_arguments=None), name=currentLine)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=trim, postfix_operators=[], prefix_operators=[], qualifier=currentLine, selectors=[], type_arguments=None), name=trimmedLine)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=eventKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="_DESCRIPTION"), operator=+)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=trimmedLine, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=eventKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=trimmedLine, selectors=[], type_arguments=None), operator=||), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=currentLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="line.separator")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), operator=+)], member=write, postfix_operators=[], prefix_operators=[], qualifier=writerFinal, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=currentLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=readerFinal, selectors=[], type_arguments=None)), label=None)]), condition=BinaryOperation(operandl=MemberReference(member=currentLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)], parameters=[MemberReference(member=lock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])], member=doWithLock, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=readerFinal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=writerFinal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=eventPropertiesPath, 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=File, sub_type=None))], member=renameTo, postfix_operators=[], prefix_operators=[], qualifier=tempFile, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable find file"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=writer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=writer, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to close lock"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=, 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)], label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[unregisterEventID] operator[SEP] identifier[String] identifier[eventKey] operator[SEP] { identifier[properties] operator[SEP] identifier[remove] operator[SEP] identifier[eventKey] operator[+] literal[String] operator[SEP] operator[SEP] identifier[properties] operator[SEP] identifier[remove] operator[SEP] identifier[eventKey] operator[SEP] operator[SEP] identifier[FileOutputStream] identifier[out] operator[=] Other[null] operator[SEP] identifier[BufferedReader] identifier[reader] operator[=] Other[null] operator[SEP] identifier[BufferedWriter] identifier[writer] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[out] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[eventPropertiesPath] , literal[boolean] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[tempFile] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[eventPropertiesPath] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[BufferedReader] identifier[readerFinal] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[FileReader] operator[SEP] identifier[eventPropertiesPath] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[BufferedWriter] identifier[writerFinal] operator[=] Keyword[new] identifier[BufferedWriter] operator[SEP] Keyword[new] identifier[FileWriter] operator[SEP] identifier[tempFile] operator[SEP] operator[SEP] operator[SEP] identifier[doWithLock] operator[SEP] identifier[out] operator[SEP] identifier[getChannel] operator[SEP] operator[SEP] , identifier[lock] operator[->] { identifier[unlockedReloadFile] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[getEventID] operator[SEP] identifier[eventKey] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[return] operator[SEP] } Keyword[try] { identifier[String] identifier[currentLine] operator[=] identifier[readerFinal] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[currentLine] operator[!=] Other[null] operator[SEP] { identifier[String] identifier[trimmedLine] operator[=] identifier[currentLine] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[trimmedLine] operator[SEP] identifier[equals] operator[SEP] identifier[eventKey] operator[+] literal[String] operator[SEP] operator[||] identifier[trimmedLine] operator[SEP] identifier[equals] operator[SEP] identifier[eventKey] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[writerFinal] operator[SEP] identifier[write] operator[SEP] identifier[currentLine] operator[+] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[currentLine] operator[=] identifier[readerFinal] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] identifier[reader] operator[=] identifier[readerFinal] operator[SEP] identifier[writer] operator[=] identifier[writerFinal] operator[SEP] identifier[tempFile] operator[SEP] identifier[renameTo] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[eventPropertiesPath] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } Keyword[finally] { Keyword[try] { Keyword[if] operator[SEP] identifier[out] operator[!=] Other[null] operator[SEP] { identifier[out] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[writer] operator[!=] Other[null] operator[SEP] { identifier[writer] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[reader] operator[!=] Other[null] operator[SEP] { identifier[reader] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] { identifier[error] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] } } }
public void setProgressBackgroundColor(int colorRes) { mCircleView.setBackgroundColor(colorRes); mProgress.setBackgroundColor(getResources().getColor(colorRes)); }
class class_name[name] begin[{] method[setProgressBackgroundColor, return_type[void], modifier[public], parameter[colorRes]] begin[{] call[mCircleView.setBackgroundColor, parameter[member[.colorRes]]] call[mProgress.setBackgroundColor, parameter[call[.getResources, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setProgressBackgroundColor] operator[SEP] Keyword[int] identifier[colorRes] operator[SEP] { identifier[mCircleView] operator[SEP] identifier[setBackgroundColor] operator[SEP] identifier[colorRes] operator[SEP] operator[SEP] identifier[mProgress] operator[SEP] identifier[setBackgroundColor] operator[SEP] identifier[getResources] operator[SEP] operator[SEP] operator[SEP] identifier[getColor] operator[SEP] identifier[colorRes] operator[SEP] operator[SEP] operator[SEP] }
public Throwable setException(Throwable ex) { // Validate the state if (ivMethod == null) { throw new IllegalStateException("WSEJBEndpointManager.ejbPreInvoke must be called first."); } if (ivMethodContext == null) { if (ivMethodIndex != Integer.MIN_VALUE) { throw new IllegalStateException("WSEJBEndpointManager.ejbPostInvoke already called."); } // ejbPreInvoke called but failed; allow setException return ex; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "setException : " + ex.getClass().getName()); Throwable mappedException = null; ExceptionMappingStrategy exStrategy = ivMethodContext.getExceptionMappingStrategy(); // ----------------------------------------------------------------------- // First, determine if this is a 'checked' application exception. // // Where 'checked' means it is on the throws clause, and application // (per EJB spec) means it must be a subclass of Exception (including // RuntimeException), but not a subclass of RemoteException. // // Checked application exceptions are not mapped, so just set it on // the method context (EJSDeployedSupport) and return the same exception. // ----------------------------------------------------------------------- if (ex instanceof Exception && !(ex instanceof RemoteException)) { Class<?> exceptionClass = ex.getClass(); Class<?>[] checkedExceptions = ivMethod.getExceptionTypes(); // interate checked exception array and look for a match. for (Class<?> checkedClass : checkedExceptions) { if (checkedClass.isAssignableFrom(exceptionClass)) { // This is a checked exception, so call setCheckedException // to record this fact, and return the exception - no mapping. exStrategy.setCheckedException(ivMethodContext, (Exception) ex); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "setException : " + ex.getClass().getName()); return ex; } } } // ----------------------------------------------------------------------- // This is an 'unchecked' exception - perform mapping as necessary. // // Note that this may still be an application exception, as beginning // with EJB 3.0, RuntimeExceptions may also be application exceptions. // // Set the exception on the method context (EJSDeployedSupport), which // will determine if this is an application exception or not, perform // any necessary mapping, and allow postInvoke to properly decide // whether to rollback the transaction or not. // ----------------------------------------------------------------------- mappedException = exStrategy.setUncheckedException(ivMethodContext, ex); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "setException : " + mappedException.getClass().getName()); return mappedException; }
class class_name[name] begin[{] method[setException, return_type[type[Throwable]], modifier[public], parameter[ex]] begin[{] if[binary_operation[member[.ivMethod], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="WSEJBEndpointManager.ejbPreInvoke must be called first.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.ivMethodContext], ==, literal[null]]] begin[{] if[binary_operation[member[.ivMethodIndex], !=, member[Integer.MIN_VALUE]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="WSEJBEndpointManager.ejbPostInvoke already called.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None) else begin[{] None end[}] return[member[.ex]] else begin[{] None end[}] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.entry, parameter[member[.tc], binary_operation[literal["setException : "], +, call[ex.getClass, parameter[]]]]] else begin[{] None end[}] local_variable[type[Throwable], mappedException] local_variable[type[ExceptionMappingStrategy], exStrategy] if[binary_operation[binary_operation[member[.ex], instanceof, type[Exception]], &&, binary_operation[member[.ex], instanceof, type[RemoteException]]]] begin[{] local_variable[type[Class], exceptionClass] local_variable[type[Class], checkedExceptions] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=exceptionClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=checkedClass, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ivMethodContext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Exception, sub_type=None))], member=setCheckedException, postfix_operators=[], prefix_operators=[], qualifier=exStrategy, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="setException : "), operandr=MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+)], member=exit, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)), ReturnStatement(expression=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=checkedExceptions, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=checkedClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))), label=None) else begin[{] None end[}] assign[member[.mappedException], call[exStrategy.setUncheckedException, parameter[member[.ivMethodContext], member[.ex]]]] if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{] call[Tr.exit, parameter[member[.tc], binary_operation[literal["setException : "], +, call[mappedException.getClass, parameter[]]]]] else begin[{] None end[}] return[member[.mappedException]] end[}] END[}]
Keyword[public] identifier[Throwable] identifier[setException] operator[SEP] identifier[Throwable] identifier[ex] operator[SEP] { Keyword[if] operator[SEP] identifier[ivMethod] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ivMethodContext] operator[==] Other[null] operator[SEP] { Keyword[if] operator[SEP] identifier[ivMethodIndex] operator[!=] identifier[Integer] operator[SEP] identifier[MIN_VALUE] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[ex] operator[SEP] } Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[ex] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Throwable] identifier[mappedException] operator[=] Other[null] operator[SEP] identifier[ExceptionMappingStrategy] identifier[exStrategy] operator[=] identifier[ivMethodContext] operator[SEP] identifier[getExceptionMappingStrategy] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ex] Keyword[instanceof] identifier[Exception] operator[&&] operator[!] operator[SEP] identifier[ex] Keyword[instanceof] identifier[RemoteException] operator[SEP] operator[SEP] { identifier[Class] operator[<] operator[?] operator[>] identifier[exceptionClass] operator[=] identifier[ex] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[checkedExceptions] operator[=] identifier[ivMethod] operator[SEP] identifier[getExceptionTypes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[checkedClass] operator[:] identifier[checkedExceptions] operator[SEP] { Keyword[if] operator[SEP] identifier[checkedClass] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[exceptionClass] operator[SEP] operator[SEP] { identifier[exStrategy] operator[SEP] identifier[setCheckedException] operator[SEP] identifier[ivMethodContext] , operator[SEP] identifier[Exception] operator[SEP] identifier[ex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[ex] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[ex] operator[SEP] } } } identifier[mappedException] operator[=] identifier[exStrategy] operator[SEP] identifier[setUncheckedException] operator[SEP] identifier[ivMethodContext] , identifier[ex] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[mappedException] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[mappedException] operator[SEP] }
public static boolean isSpecialColorName(final String colorName) { for (final String name : SPECIAL_COLOR_NAMES) { if (name.equalsIgnoreCase(colorName)) { return true; } } return false; }
class class_name[name] begin[{] method[isSpecialColorName, return_type[type[boolean]], modifier[public static], parameter[colorName]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=colorName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=SPECIAL_COLOR_NAMES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[false]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[boolean] identifier[isSpecialColorName] operator[SEP] Keyword[final] identifier[String] identifier[colorName] operator[SEP] { Keyword[for] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[:] identifier[SPECIAL_COLOR_NAMES] operator[SEP] { Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[colorName] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } } Keyword[return] literal[boolean] operator[SEP] }
public static String findRootInstancePath( String scopedInstancePath ) { String result; if( Utils.isEmptyOrWhitespaces( scopedInstancePath )) { // Do not return null result = ""; } else if( scopedInstancePath.contains( "/" )) { // Be as flexible as possible with paths String s = scopedInstancePath.replaceFirst( "^/*", "" ); int index = s.indexOf( '/' ); result = index > 0 ? s.substring( 0, index ) : s; } else { // Assumed to be a root instance name result = scopedInstancePath; } return result; }
class class_name[name] begin[{] method[findRootInstancePath, return_type[type[String]], modifier[public static], parameter[scopedInstancePath]] begin[{] local_variable[type[String], result] if[call[Utils.isEmptyOrWhitespaces, parameter[member[.scopedInstancePath]]]] begin[{] assign[member[.result], literal[""]] else begin[{] if[call[scopedInstancePath.contains, parameter[literal["/"]]]] begin[{] local_variable[type[String], s] local_variable[type[int], index] assign[member[.result], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None))] else begin[{] assign[member[.result], member[.scopedInstancePath]] end[}] end[}] return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[findRootInstancePath] operator[SEP] identifier[String] identifier[scopedInstancePath] operator[SEP] { identifier[String] identifier[result] operator[SEP] Keyword[if] operator[SEP] identifier[Utils] operator[SEP] identifier[isEmptyOrWhitespaces] operator[SEP] identifier[scopedInstancePath] operator[SEP] operator[SEP] { identifier[result] operator[=] literal[String] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[scopedInstancePath] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[String] identifier[s] operator[=] identifier[scopedInstancePath] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[s] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[index] operator[>] Other[0] operator[?] identifier[s] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[index] operator[SEP] operator[:] identifier[s] operator[SEP] } Keyword[else] { identifier[result] operator[=] identifier[scopedInstancePath] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public Contacts getList(JinxConstants.ContactFilter filter, int page, int perPage, JinxConstants.ContactSort contactSort) throws JinxException { Map<String, String> params = new TreeMap<>(); params.put("method", "flickr.contacts.getList"); if (filter != null) { params.put("filter", filter.toString()); } if (page > 0) { params.put("page", Integer.toString(page)); } if (perPage > 0) { params.put("per_page", Integer.toString(perPage)); } if (contactSort != null) { params.put("sort", contactSort.toString()); } return jinx.flickrGet(params, Contacts.class); }
class class_name[name] begin[{] method[getList, return_type[type[Contacts]], modifier[public], parameter[filter, page, perPage, contactSort]] begin[{] local_variable[type[Map], params] call[params.put, parameter[literal["method"], literal["flickr.contacts.getList"]]] if[binary_operation[member[.filter], !=, literal[null]]] begin[{] call[params.put, parameter[literal["filter"], call[filter.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.page], >, literal[0]]] begin[{] call[params.put, parameter[literal["page"], call[Integer.toString, parameter[member[.page]]]]] else begin[{] None end[}] if[binary_operation[member[.perPage], >, literal[0]]] begin[{] call[params.put, parameter[literal["per_page"], call[Integer.toString, parameter[member[.perPage]]]]] else begin[{] None end[}] if[binary_operation[member[.contactSort], !=, literal[null]]] begin[{] call[params.put, parameter[literal["sort"], call[contactSort.toString, parameter[]]]] else begin[{] None end[}] return[call[jinx.flickrGet, parameter[member[.params], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Contacts, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[Contacts] identifier[getList] operator[SEP] identifier[JinxConstants] operator[SEP] identifier[ContactFilter] identifier[filter] , Keyword[int] identifier[page] , Keyword[int] identifier[perPage] , identifier[JinxConstants] operator[SEP] identifier[ContactSort] identifier[contactSort] operator[SEP] Keyword[throws] identifier[JinxException] { identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[params] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filter] operator[!=] Other[null] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[filter] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[page] operator[>] Other[0] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[page] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[perPage] operator[>] Other[0] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[perPage] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[contactSort] operator[!=] Other[null] operator[SEP] { identifier[params] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[contactSort] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[jinx] operator[SEP] identifier[flickrGet] operator[SEP] identifier[params] , identifier[Contacts] operator[SEP] Keyword[class] operator[SEP] operator[SEP] }
@Deprecated public static String reject(String string, CodePointPredicate predicate) { return StringIterate.rejectCodePoint(string, predicate); }
class class_name[name] begin[{] method[reject, return_type[type[String]], modifier[public static], parameter[string, predicate]] begin[{] return[call[StringIterate.rejectCodePoint, parameter[member[.string], member[.predicate]]]] end[}] END[}]
annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] identifier[String] identifier[reject] operator[SEP] identifier[String] identifier[string] , identifier[CodePointPredicate] identifier[predicate] operator[SEP] { Keyword[return] identifier[StringIterate] operator[SEP] identifier[rejectCodePoint] operator[SEP] identifier[string] , identifier[predicate] operator[SEP] operator[SEP] }
protected String getSecurityPassword() { String password = Config.getProperty(PASSWORD,Config.getProperty("SECURITY_PASSWORD","")); return password; }
class class_name[name] begin[{] method[getSecurityPassword, return_type[type[String]], modifier[protected], parameter[]] begin[{] local_variable[type[String], password] return[member[.password]] end[}] END[}]
Keyword[protected] identifier[String] identifier[getSecurityPassword] operator[SEP] operator[SEP] { identifier[String] identifier[password] operator[=] identifier[Config] operator[SEP] identifier[getProperty] operator[SEP] identifier[PASSWORD] , identifier[Config] operator[SEP] identifier[getProperty] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[password] operator[SEP] }
static ConfigurationStream resolveConfigFileAsStream(String configFilePath) throws ConfigurationException { InputStream fileStream; String fileExtention; if (configFilePath != null) { if (new File(configFilePath).isDirectory()) { String path = scanConfigFile(configFilePath); fileStream = getFileAsStream(new File(path)); fileExtention = FilenameUtils.getExtension(path); } else { fileStream = getFileAsStream(configFilePath); fileExtention = FilenameUtils.getExtension(configFilePath); } } else if (hasEnvironmentVariable(ENVIRONMENT_CONFIG_VARIABLE_NAME)) { fileStream = getFileAsStream(getEnvironemtVariableConfigFilePath()); fileExtention = FilenameUtils.getExtension(getEnvironemtVariableConfigFilePath().toFile().getName()); } else if (hasSystemPropertyVariable(SYSTEM_PROPERTY_CONFIG_VARIABLE_NAME)) { fileStream = getFileAsStream(getSystemPropertyConfigFilePath()); fileExtention = FilenameUtils.getExtension(getSystemPropertyConfigFilePath().toFile().getName()); } else if (getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + YML_EXTENTION) != null) { fileStream = getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + YML_EXTENTION); fileExtention = YML_EXTENTION; } else if (getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + YAML_EXTENTION) != null) { fileStream = getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + YAML_EXTENTION); fileExtention = YAML_EXTENTION; } else if (getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + XML_EXTENTION) != null) { fileStream = getClasspathResourceAsStream(CONFIG_FILE_NAME + "." + XML_EXTENTION); fileExtention = XML_EXTENTION; } else { String defaultConfigDir = System.getProperty("user.dir"); String defaultConfigPath = scanConfigFile(defaultConfigDir); fileExtention = FilenameUtils.getExtension(defaultConfigPath); fileStream = getFileAsStream(new File(defaultConfigPath)); } ConfigurationStream config = new ConfigurationStream(); config.setExtention(fileExtention); config.setInputStream(fileStream); return config; }
class class_name[name] begin[{] method[resolveConfigFileAsStream, return_type[type[ConfigurationStream]], modifier[static], parameter[configFilePath]] begin[{] local_variable[type[InputStream], fileStream] local_variable[type[String], fileExtention] if[binary_operation[member[.configFilePath], !=, literal[null]]] begin[{] if[ClassCreator(arguments=[MemberReference(member=configFilePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=isDirectory, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))] begin[{] local_variable[type[String], path] assign[member[.fileStream], call[.getFileAsStream, parameter[ClassCreator(arguments=[MemberReference(member=path, 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=File, sub_type=None))]]] assign[member[.fileExtention], call[FilenameUtils.getExtension, parameter[member[.path]]]] else begin[{] assign[member[.fileStream], call[.getFileAsStream, parameter[member[.configFilePath]]]] assign[member[.fileExtention], call[FilenameUtils.getExtension, parameter[member[.configFilePath]]]] end[}] else begin[{] if[call[.hasEnvironmentVariable, parameter[member[.ENVIRONMENT_CONFIG_VARIABLE_NAME]]]] begin[{] assign[member[.fileStream], call[.getFileAsStream, parameter[call[.getEnvironemtVariableConfigFilePath, parameter[]]]]] assign[member[.fileExtention], call[FilenameUtils.getExtension, parameter[call[.getEnvironemtVariableConfigFilePath, parameter[]]]]] else begin[{] if[call[.hasSystemPropertyVariable, parameter[member[.SYSTEM_PROPERTY_CONFIG_VARIABLE_NAME]]]] begin[{] assign[member[.fileStream], call[.getFileAsStream, parameter[call[.getSystemPropertyConfigFilePath, parameter[]]]]] assign[member[.fileExtention], call[FilenameUtils.getExtension, parameter[call[.getSystemPropertyConfigFilePath, parameter[]]]]] else begin[{] if[binary_operation[call[.getClasspathResourceAsStream, parameter[binary_operation[binary_operation[member[.CONFIG_FILE_NAME], +, literal["."]], +, member[.YML_EXTENTION]]]], !=, literal[null]]] begin[{] assign[member[.fileStream], call[.getClasspathResourceAsStream, parameter[binary_operation[binary_operation[member[.CONFIG_FILE_NAME], +, literal["."]], +, member[.YML_EXTENTION]]]]] assign[member[.fileExtention], member[.YML_EXTENTION]] else begin[{] if[binary_operation[call[.getClasspathResourceAsStream, parameter[binary_operation[binary_operation[member[.CONFIG_FILE_NAME], +, literal["."]], +, member[.YAML_EXTENTION]]]], !=, literal[null]]] begin[{] assign[member[.fileStream], call[.getClasspathResourceAsStream, parameter[binary_operation[binary_operation[member[.CONFIG_FILE_NAME], +, literal["."]], +, member[.YAML_EXTENTION]]]]] assign[member[.fileExtention], member[.YAML_EXTENTION]] else begin[{] if[binary_operation[call[.getClasspathResourceAsStream, parameter[binary_operation[binary_operation[member[.CONFIG_FILE_NAME], +, literal["."]], +, member[.XML_EXTENTION]]]], !=, literal[null]]] begin[{] assign[member[.fileStream], call[.getClasspathResourceAsStream, parameter[binary_operation[binary_operation[member[.CONFIG_FILE_NAME], +, literal["."]], +, member[.XML_EXTENTION]]]]] assign[member[.fileExtention], member[.XML_EXTENTION]] else begin[{] local_variable[type[String], defaultConfigDir] local_variable[type[String], defaultConfigPath] assign[member[.fileExtention], call[FilenameUtils.getExtension, parameter[member[.defaultConfigPath]]]] assign[member[.fileStream], call[.getFileAsStream, parameter[ClassCreator(arguments=[MemberReference(member=defaultConfigPath, 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=File, sub_type=None))]]] end[}] end[}] end[}] end[}] end[}] end[}] local_variable[type[ConfigurationStream], config] call[config.setExtention, parameter[member[.fileExtention]]] call[config.setInputStream, parameter[member[.fileStream]]] return[member[.config]] end[}] END[}]
Keyword[static] identifier[ConfigurationStream] identifier[resolveConfigFileAsStream] operator[SEP] identifier[String] identifier[configFilePath] operator[SEP] Keyword[throws] identifier[ConfigurationException] { identifier[InputStream] identifier[fileStream] operator[SEP] identifier[String] identifier[fileExtention] operator[SEP] Keyword[if] operator[SEP] identifier[configFilePath] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[configFilePath] operator[SEP] operator[SEP] identifier[isDirectory] operator[SEP] operator[SEP] operator[SEP] { identifier[String] identifier[path] operator[=] identifier[scanConfigFile] operator[SEP] identifier[configFilePath] operator[SEP] operator[SEP] identifier[fileStream] operator[=] identifier[getFileAsStream] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP] identifier[fileExtention] operator[=] identifier[FilenameUtils] operator[SEP] identifier[getExtension] operator[SEP] identifier[path] operator[SEP] operator[SEP] } Keyword[else] { identifier[fileStream] operator[=] identifier[getFileAsStream] operator[SEP] identifier[configFilePath] operator[SEP] operator[SEP] identifier[fileExtention] operator[=] identifier[FilenameUtils] operator[SEP] identifier[getExtension] operator[SEP] identifier[configFilePath] operator[SEP] operator[SEP] } } Keyword[else] Keyword[if] operator[SEP] identifier[hasEnvironmentVariable] operator[SEP] identifier[ENVIRONMENT_CONFIG_VARIABLE_NAME] operator[SEP] operator[SEP] { identifier[fileStream] operator[=] identifier[getFileAsStream] operator[SEP] identifier[getEnvironemtVariableConfigFilePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fileExtention] operator[=] identifier[FilenameUtils] operator[SEP] identifier[getExtension] operator[SEP] identifier[getEnvironemtVariableConfigFilePath] operator[SEP] operator[SEP] operator[SEP] identifier[toFile] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[hasSystemPropertyVariable] operator[SEP] identifier[SYSTEM_PROPERTY_CONFIG_VARIABLE_NAME] operator[SEP] operator[SEP] { identifier[fileStream] operator[=] identifier[getFileAsStream] operator[SEP] identifier[getSystemPropertyConfigFilePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[fileExtention] operator[=] identifier[FilenameUtils] operator[SEP] identifier[getExtension] operator[SEP] identifier[getSystemPropertyConfigFilePath] operator[SEP] operator[SEP] operator[SEP] identifier[toFile] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[getClasspathResourceAsStream] operator[SEP] identifier[CONFIG_FILE_NAME] operator[+] literal[String] operator[+] identifier[YML_EXTENTION] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[fileStream] operator[=] identifier[getClasspathResourceAsStream] operator[SEP] identifier[CONFIG_FILE_NAME] operator[+] literal[String] operator[+] identifier[YML_EXTENTION] operator[SEP] operator[SEP] identifier[fileExtention] operator[=] identifier[YML_EXTENTION] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[getClasspathResourceAsStream] operator[SEP] identifier[CONFIG_FILE_NAME] operator[+] literal[String] operator[+] identifier[YAML_EXTENTION] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[fileStream] operator[=] identifier[getClasspathResourceAsStream] operator[SEP] identifier[CONFIG_FILE_NAME] operator[+] literal[String] operator[+] identifier[YAML_EXTENTION] operator[SEP] operator[SEP] identifier[fileExtention] operator[=] identifier[YAML_EXTENTION] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[getClasspathResourceAsStream] operator[SEP] identifier[CONFIG_FILE_NAME] operator[+] literal[String] operator[+] identifier[XML_EXTENTION] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[fileStream] operator[=] identifier[getClasspathResourceAsStream] operator[SEP] identifier[CONFIG_FILE_NAME] operator[+] literal[String] operator[+] identifier[XML_EXTENTION] operator[SEP] operator[SEP] identifier[fileExtention] operator[=] identifier[XML_EXTENTION] operator[SEP] } Keyword[else] { identifier[String] identifier[defaultConfigDir] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[defaultConfigPath] operator[=] identifier[scanConfigFile] operator[SEP] identifier[defaultConfigDir] operator[SEP] operator[SEP] identifier[fileExtention] operator[=] identifier[FilenameUtils] operator[SEP] identifier[getExtension] operator[SEP] identifier[defaultConfigPath] operator[SEP] operator[SEP] identifier[fileStream] operator[=] identifier[getFileAsStream] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[defaultConfigPath] operator[SEP] operator[SEP] operator[SEP] } identifier[ConfigurationStream] identifier[config] operator[=] Keyword[new] identifier[ConfigurationStream] operator[SEP] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setExtention] operator[SEP] identifier[fileExtention] operator[SEP] operator[SEP] identifier[config] operator[SEP] identifier[setInputStream] operator[SEP] identifier[fileStream] operator[SEP] operator[SEP] Keyword[return] identifier[config] operator[SEP] }
public void configure(ConfigParams config) throws ConfigException { _timeout = config.getAsLongWithDefault("timeout", _timeout); _maxSize = config.getAsLongWithDefault("max_size", _maxSize); }
class class_name[name] begin[{] method[configure, return_type[void], modifier[public], parameter[config]] begin[{] assign[member[._timeout], call[config.getAsLongWithDefault, parameter[literal["timeout"], member[._timeout]]]] assign[member[._maxSize], call[config.getAsLongWithDefault, parameter[literal["max_size"], member[._maxSize]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[configure] operator[SEP] identifier[ConfigParams] identifier[config] operator[SEP] Keyword[throws] identifier[ConfigException] { identifier[_timeout] operator[=] identifier[config] operator[SEP] identifier[getAsLongWithDefault] operator[SEP] literal[String] , identifier[_timeout] operator[SEP] operator[SEP] identifier[_maxSize] operator[=] identifier[config] operator[SEP] identifier[getAsLongWithDefault] operator[SEP] literal[String] , identifier[_maxSize] operator[SEP] operator[SEP] }
public void disable(boolean value) throws IOException { AbstractCIBase jenkins = Jenkins.get(); Set<String> set = jenkins.getDisabledAdministrativeMonitors(); if(value) set.add(id); else set.remove(id); jenkins.save(); }
class class_name[name] begin[{] method[disable, return_type[void], modifier[public], parameter[value]] begin[{] local_variable[type[AbstractCIBase], jenkins] local_variable[type[Set], set] if[member[.value]] begin[{] call[set.add, parameter[member[.id]]] else begin[{] call[set.remove, parameter[member[.id]]] end[}] call[jenkins.save, parameter[]] end[}] END[}]
Keyword[public] Keyword[void] identifier[disable] operator[SEP] Keyword[boolean] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] { identifier[AbstractCIBase] identifier[jenkins] operator[=] identifier[Jenkins] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[set] operator[=] identifier[jenkins] operator[SEP] identifier[getDisabledAdministrativeMonitors] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[set] operator[SEP] identifier[add] operator[SEP] identifier[id] operator[SEP] operator[SEP] Keyword[else] identifier[set] operator[SEP] identifier[remove] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[jenkins] operator[SEP] identifier[save] operator[SEP] operator[SEP] operator[SEP] }
public String getStdFormatPattern(Locale locale) { return Timezone.NAME_PROVIDER.getStdFormatPattern((this.total == 0) && (this.fraction == 0), locale); }
class class_name[name] begin[{] method[getStdFormatPattern, return_type[type[String]], modifier[public], parameter[locale]] begin[{] return[call[Timezone.NAME_PROVIDER.getStdFormatPattern, parameter[binary_operation[binary_operation[THIS[member[None.total]], ==, literal[0]], &&, binary_operation[THIS[member[None.fraction]], ==, literal[0]]], member[.locale]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getStdFormatPattern] operator[SEP] identifier[Locale] identifier[locale] operator[SEP] { Keyword[return] identifier[Timezone] operator[SEP] identifier[NAME_PROVIDER] operator[SEP] identifier[getStdFormatPattern] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[total] operator[==] Other[0] operator[SEP] operator[&&] operator[SEP] Keyword[this] operator[SEP] identifier[fraction] operator[==] Other[0] operator[SEP] , identifier[locale] operator[SEP] operator[SEP] }
public List<RequestFuture<?>> broadcast(byte[] data, String fileName) { Checks.notNull(data, "Data"); Checks.check(data.length < Message.MAX_FILE_SIZE, "Provided data exceeds the maximum size of 8MB!"); return broadcast(new WebhookMessageBuilder().addFile(fileName, data).build()); }
class class_name[name] begin[{] method[broadcast, return_type[type[List]], modifier[public], parameter[data, fileName]] begin[{] call[Checks.notNull, parameter[member[.data], literal["Data"]]] call[Checks.check, parameter[binary_operation[member[data.length], <, member[Message.MAX_FILE_SIZE]], literal["Provided data exceeds the maximum size of 8MB!"]]] return[call[.broadcast, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=fileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addFile, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=build, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=WebhookMessageBuilder, sub_type=None))]]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[RequestFuture] operator[<] operator[?] operator[>] operator[>] identifier[broadcast] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] , identifier[String] identifier[fileName] operator[SEP] { identifier[Checks] operator[SEP] identifier[notNull] operator[SEP] identifier[data] , literal[String] operator[SEP] operator[SEP] identifier[Checks] operator[SEP] identifier[check] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[<] identifier[Message] operator[SEP] identifier[MAX_FILE_SIZE] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[broadcast] operator[SEP] Keyword[new] identifier[WebhookMessageBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[addFile] operator[SEP] identifier[fileName] , identifier[data] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
protected Resource[][] grabResources(FileSet[] filesets) { // // Get the list of resources being added/updated by calling Zip.grabResources // Resource [][] resources = super.grabResources(filesets); // // Iterate through the resources for each input FileSet, looking for an associated // manifest file. // for (int i = 0; i < filesets.length; i++) { if (resources[i].length == 0) continue; File base = filesets[i].getDir(getProject()); Resource [] setResources = resources[i]; for (int j = 0; j < setResources.length; j++) { File manifestFile = fileUtils.resolveFile(base, setResources[j].getName() + ".manifest"); if (manifestFile.exists()) manifestFiles.add(manifestFile); } } return resources; }
class class_name[name] begin[{] method[grabResources, return_type[type[Resource]], modifier[protected], parameter[filesets]] begin[{] local_variable[type[Resource], resources] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=filesets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=getDir, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=base)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=resources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=setResources)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=Resource, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=base, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=setResources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".manifest"), operator=+)], member=resolveFile, postfix_operators=[], prefix_operators=[], qualifier=fileUtils, selectors=[], type_arguments=None), name=manifestFile)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=exists, postfix_operators=[], prefix_operators=[], qualifier=manifestFile, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=manifestFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=manifestFiles, selectors=[], type_arguments=None), label=None))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=setResources, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=filesets, 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[.resources]] end[}] END[}]
Keyword[protected] identifier[Resource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[grabResources] operator[SEP] identifier[FileSet] operator[SEP] operator[SEP] identifier[filesets] operator[SEP] { identifier[Resource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[resources] operator[=] Keyword[super] operator[SEP] identifier[grabResources] operator[SEP] identifier[filesets] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[filesets] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { Keyword[if] operator[SEP] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[length] operator[==] Other[0] operator[SEP] Keyword[continue] operator[SEP] identifier[File] identifier[base] operator[=] identifier[filesets] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[getDir] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Resource] operator[SEP] operator[SEP] identifier[setResources] operator[=] identifier[resources] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[setResources] operator[SEP] identifier[length] operator[SEP] identifier[j] operator[++] operator[SEP] { identifier[File] identifier[manifestFile] operator[=] identifier[fileUtils] operator[SEP] identifier[resolveFile] operator[SEP] identifier[base] , identifier[setResources] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[manifestFile] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] identifier[manifestFiles] operator[SEP] identifier[add] operator[SEP] identifier[manifestFile] operator[SEP] operator[SEP] } } Keyword[return] identifier[resources] operator[SEP] }
private boolean isQueue(DestinationType type) { boolean isQueue = false; if (type == DestinationType.QUEUE || type == DestinationType.PORT) // type == DestinationType.SERVICE) isQueue = true; return isQueue; }
class class_name[name] begin[{] method[isQueue, return_type[type[boolean]], modifier[private], parameter[type]] begin[{] local_variable[type[boolean], isQueue] if[binary_operation[binary_operation[member[.type], ==, member[DestinationType.QUEUE]], ||, binary_operation[member[.type], ==, member[DestinationType.PORT]]]] begin[{] assign[member[.isQueue], literal[true]] else begin[{] None end[}] return[member[.isQueue]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isQueue] operator[SEP] identifier[DestinationType] identifier[type] operator[SEP] { Keyword[boolean] identifier[isQueue] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] identifier[DestinationType] operator[SEP] identifier[QUEUE] operator[||] identifier[type] operator[==] identifier[DestinationType] operator[SEP] identifier[PORT] operator[SEP] identifier[isQueue] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[isQueue] operator[SEP] }
public void createStream(String scope, String streamName, int minNumSegments, Duration latency) { DYNAMIC_LOGGER.incCounterValue(CREATE_STREAM, 1); DYNAMIC_LOGGER.reportGaugeValue(OPEN_TRANSACTIONS, 0, streamTags(scope, streamName)); DYNAMIC_LOGGER.reportGaugeValue(SEGMENTS_COUNT, minNumSegments, streamTags(scope, streamName)); DYNAMIC_LOGGER.incCounterValue(SEGMENTS_SPLITS, 0, streamTags(scope, streamName)); DYNAMIC_LOGGER.incCounterValue(SEGMENTS_MERGES, 0, streamTags(scope, streamName)); createStreamLatency.reportSuccessValue(latency.toMillis()); }
class class_name[name] begin[{] method[createStream, return_type[void], modifier[public], parameter[scope, streamName, minNumSegments, latency]] begin[{] call[DYNAMIC_LOGGER.incCounterValue, parameter[member[.CREATE_STREAM], literal[1]]] call[DYNAMIC_LOGGER.reportGaugeValue, parameter[member[.OPEN_TRANSACTIONS], literal[0], call[.streamTags, parameter[member[.scope], member[.streamName]]]]] call[DYNAMIC_LOGGER.reportGaugeValue, parameter[member[.SEGMENTS_COUNT], member[.minNumSegments], call[.streamTags, parameter[member[.scope], member[.streamName]]]]] call[DYNAMIC_LOGGER.incCounterValue, parameter[member[.SEGMENTS_SPLITS], literal[0], call[.streamTags, parameter[member[.scope], member[.streamName]]]]] call[DYNAMIC_LOGGER.incCounterValue, parameter[member[.SEGMENTS_MERGES], literal[0], call[.streamTags, parameter[member[.scope], member[.streamName]]]]] call[createStreamLatency.reportSuccessValue, parameter[call[latency.toMillis, parameter[]]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[createStream] operator[SEP] identifier[String] identifier[scope] , identifier[String] identifier[streamName] , Keyword[int] identifier[minNumSegments] , identifier[Duration] identifier[latency] operator[SEP] { identifier[DYNAMIC_LOGGER] operator[SEP] identifier[incCounterValue] operator[SEP] identifier[CREATE_STREAM] , Other[1] operator[SEP] operator[SEP] identifier[DYNAMIC_LOGGER] operator[SEP] identifier[reportGaugeValue] operator[SEP] identifier[OPEN_TRANSACTIONS] , Other[0] , identifier[streamTags] operator[SEP] identifier[scope] , identifier[streamName] operator[SEP] operator[SEP] operator[SEP] identifier[DYNAMIC_LOGGER] operator[SEP] identifier[reportGaugeValue] operator[SEP] identifier[SEGMENTS_COUNT] , identifier[minNumSegments] , identifier[streamTags] operator[SEP] identifier[scope] , identifier[streamName] operator[SEP] operator[SEP] operator[SEP] identifier[DYNAMIC_LOGGER] operator[SEP] identifier[incCounterValue] operator[SEP] identifier[SEGMENTS_SPLITS] , Other[0] , identifier[streamTags] operator[SEP] identifier[scope] , identifier[streamName] operator[SEP] operator[SEP] operator[SEP] identifier[DYNAMIC_LOGGER] operator[SEP] identifier[incCounterValue] operator[SEP] identifier[SEGMENTS_MERGES] , Other[0] , identifier[streamTags] operator[SEP] identifier[scope] , identifier[streamName] operator[SEP] operator[SEP] operator[SEP] identifier[createStreamLatency] operator[SEP] identifier[reportSuccessValue] operator[SEP] identifier[latency] operator[SEP] identifier[toMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public void applyTo(final PeekViewActivity activity, final View base) { final GestureDetectorCompat detector = new GestureDetectorCompat(activity, new GestureListener(activity, base, this)); base.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, final MotionEvent motionEvent) { // we use the detector for the long and short click motion events detector.onTouchEvent(motionEvent); if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) { forceRippleAnimation(base, motionEvent); } return true; } }); }
class class_name[name] begin[{] method[applyTo, return_type[void], modifier[public], parameter[activity, base]] begin[{] local_variable[type[GestureDetectorCompat], detector] call[base.setOnTouchListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=motionEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onTouchEvent, postfix_operators=[], prefix_operators=[], qualifier=detector, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getAction, postfix_operators=[], prefix_operators=[], qualifier=motionEvent, selectors=[], type_arguments=None), operandr=MemberReference(member=ACTION_DOWN, postfix_operators=[], prefix_operators=[], qualifier=MotionEvent, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=base, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=motionEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forceRippleAnimation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)], documentation=None, modifiers={'public'}, name=onTouch, parameters=[FormalParameter(annotations=[], modifiers=set(), name=view, type=ReferenceType(arguments=None, dimensions=[], name=View, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=motionEvent, type=ReferenceType(arguments=None, dimensions=[], name=MotionEvent, sub_type=None), varargs=False)], return_type=BasicType(dimensions=[], name=boolean), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=View, sub_type=ReferenceType(arguments=None, dimensions=None, name=OnTouchListener, sub_type=None)))]] end[}] END[}]
Keyword[public] Keyword[void] identifier[applyTo] operator[SEP] Keyword[final] identifier[PeekViewActivity] identifier[activity] , Keyword[final] identifier[View] identifier[base] operator[SEP] { Keyword[final] identifier[GestureDetectorCompat] identifier[detector] operator[=] Keyword[new] identifier[GestureDetectorCompat] operator[SEP] identifier[activity] , Keyword[new] identifier[GestureListener] operator[SEP] identifier[activity] , identifier[base] , Keyword[this] operator[SEP] operator[SEP] operator[SEP] identifier[base] operator[SEP] identifier[setOnTouchListener] operator[SEP] Keyword[new] identifier[View] operator[SEP] identifier[OnTouchListener] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[onTouch] operator[SEP] identifier[View] identifier[view] , Keyword[final] identifier[MotionEvent] identifier[motionEvent] operator[SEP] { identifier[detector] operator[SEP] identifier[onTouchEvent] operator[SEP] identifier[motionEvent] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[motionEvent] operator[SEP] identifier[getAction] operator[SEP] operator[SEP] operator[==] identifier[MotionEvent] operator[SEP] identifier[ACTION_DOWN] operator[SEP] { identifier[forceRippleAnimation] operator[SEP] identifier[base] , identifier[motionEvent] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] } } operator[SEP] operator[SEP] }
@Override public com.liferay.commerce.model.CommerceRegion addCommerceRegion( com.liferay.commerce.model.CommerceRegion commerceRegion) { return _commerceRegionLocalService.addCommerceRegion(commerceRegion); }
class class_name[name] begin[{] method[addCommerceRegion, return_type[type[com]], modifier[public], parameter[commerceRegion]] begin[{] return[call[_commerceRegionLocalService.addCommerceRegion, parameter[member[.commerceRegion]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[model] operator[SEP] identifier[CommerceRegion] identifier[addCommerceRegion] operator[SEP] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[model] operator[SEP] identifier[CommerceRegion] identifier[commerceRegion] operator[SEP] { Keyword[return] identifier[_commerceRegionLocalService] operator[SEP] identifier[addCommerceRegion] operator[SEP] identifier[commerceRegion] operator[SEP] operator[SEP] }
public RemoteTask getNewRemoteTask(Application app, Map<String,Object> properties) { try { // Map<String,Object> propApp = this.getApplicationProperties(properties); // Map<String,Object> propInitial = ProxyTask.getInitialProperties(this.getBasicServlet(), SERVLET_TYPE.PROXY); // if (propInitial != null) // propApp.putAll(propInitial); if (app == null) app = new MainApplication(((BaseApplication)m_application).getEnvironment(), properties, null); // propApp, null); RemoteTask remoteServer = new TaskSession(app); ((TaskSession)remoteServer).setProperties(properties); return remoteServer; } catch (Exception ex) { ex.printStackTrace(); return null; } }
class class_name[name] begin[{] method[getNewRemoteTask, return_type[type[RemoteTask]], modifier[public], parameter[app, properties]] begin[{] TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=app, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=app, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[Cast(expression=MemberReference(member=m_application, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BaseApplication, sub_type=None)), MemberReference(member=properties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MainApplication, sub_type=None))), label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=app, 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=TaskSession, sub_type=None)), name=remoteServer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RemoteTask, sub_type=None)), StatementExpression(expression=Cast(expression=MemberReference(member=remoteServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TaskSession, sub_type=None)), label=None), ReturnStatement(expression=MemberReference(member=remoteServer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=ex, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[RemoteTask] identifier[getNewRemoteTask] operator[SEP] identifier[Application] identifier[app] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[properties] operator[SEP] { Keyword[try] { Keyword[if] operator[SEP] identifier[app] operator[==] Other[null] operator[SEP] identifier[app] operator[=] Keyword[new] identifier[MainApplication] operator[SEP] operator[SEP] operator[SEP] identifier[BaseApplication] operator[SEP] identifier[m_application] operator[SEP] operator[SEP] identifier[getEnvironment] operator[SEP] operator[SEP] , identifier[properties] , Other[null] operator[SEP] operator[SEP] identifier[RemoteTask] identifier[remoteServer] operator[=] Keyword[new] identifier[TaskSession] operator[SEP] identifier[app] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[TaskSession] operator[SEP] identifier[remoteServer] operator[SEP] operator[SEP] identifier[setProperties] operator[SEP] identifier[properties] operator[SEP] operator[SEP] Keyword[return] identifier[remoteServer] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] { identifier[ex] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
public ByteBuffer preProcessOneWriteBuffer() { // We can process the single buffer case more efficiently than if we // include it as a part of the multi-buffer logic WsByteBufferImpl wsBuffImpl = null; try { wsBuffImpl = (WsByteBufferImpl) getBuffer(); } catch (ClassCastException cce) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Writing with a non-WsByteBufferImpl"); } return getBuffer().getWrappedByteBuffer(); } if (!wsBuffImpl.isDirect() && wsBuffImpl.hasArray()) { wsBuffImpl.copyToDirectBuffer(); return wsBuffImpl.oWsBBDirect; } return wsBuffImpl.getWrappedByteBufferNonSafe(); }
class class_name[name] begin[{] method[preProcessOneWriteBuffer, return_type[type[ByteBuffer]], modifier[public], parameter[]] begin[{] local_variable[type[WsByteBufferImpl], wsBuffImpl] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=wsBuffImpl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=getBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=WsByteBufferImpl, sub_type=None))), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Writing with a non-WsByteBufferImpl")], member=debug, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MethodInvocation(arguments=[], member=getBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getWrappedByteBuffer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cce, types=['ClassCastException']))], finally_block=None, label=None, resources=None) if[binary_operation[call[wsBuffImpl.isDirect, parameter[]], &&, call[wsBuffImpl.hasArray, parameter[]]]] begin[{] call[wsBuffImpl.copyToDirectBuffer, parameter[]] return[member[wsBuffImpl.oWsBBDirect]] else begin[{] None end[}] return[call[wsBuffImpl.getWrappedByteBufferNonSafe, parameter[]]] end[}] END[}]
Keyword[public] identifier[ByteBuffer] identifier[preProcessOneWriteBuffer] operator[SEP] operator[SEP] { identifier[WsByteBufferImpl] identifier[wsBuffImpl] operator[=] Other[null] operator[SEP] Keyword[try] { identifier[wsBuffImpl] operator[=] operator[SEP] identifier[WsByteBufferImpl] operator[SEP] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[cce] operator[SEP] { Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] { identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] } Keyword[return] identifier[getBuffer] operator[SEP] operator[SEP] operator[SEP] identifier[getWrappedByteBuffer] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[wsBuffImpl] operator[SEP] identifier[isDirect] operator[SEP] operator[SEP] operator[&&] identifier[wsBuffImpl] operator[SEP] identifier[hasArray] operator[SEP] operator[SEP] operator[SEP] { identifier[wsBuffImpl] operator[SEP] identifier[copyToDirectBuffer] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[wsBuffImpl] operator[SEP] identifier[oWsBBDirect] operator[SEP] } Keyword[return] identifier[wsBuffImpl] operator[SEP] identifier[getWrappedByteBufferNonSafe] operator[SEP] operator[SEP] operator[SEP] }
public static BytesEncryptor standard(CharSequence password, CharSequence salt) { return new AesBytesEncryptor(password.toString(), salt, KeyGenerators.secureRandom(16)); }
class class_name[name] begin[{] method[standard, return_type[type[BytesEncryptor]], modifier[public static], parameter[password, salt]] begin[{] return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=password, selectors=[], type_arguments=None), MemberReference(member=salt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16)], member=secureRandom, postfix_operators=[], prefix_operators=[], qualifier=KeyGenerators, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AesBytesEncryptor, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[BytesEncryptor] identifier[standard] operator[SEP] identifier[CharSequence] identifier[password] , identifier[CharSequence] identifier[salt] operator[SEP] { Keyword[return] Keyword[new] identifier[AesBytesEncryptor] operator[SEP] identifier[password] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , identifier[salt] , identifier[KeyGenerators] operator[SEP] identifier[secureRandom] operator[SEP] Other[16] operator[SEP] operator[SEP] operator[SEP] }
@Override public JSONObject toJsonObject() throws JSONException { JSONObject returnVal = new JSONObject(); //Template Name... if(this.getTemplateName() != null) { returnVal.put(JSONMapping.TEMPLATE_NAME, this.getTemplateName()); } //Template Description... if(this.getTemplateDescription() != null) { returnVal.put(JSONMapping.TEMPLATE_DESCRIPTION, this.getTemplateDescription()); } //Template Comment... if(this.getTemplateComment() != null) { returnVal.put(JSONMapping.TEMPLATE_COMMENT, this.getTemplateComment()); } //Forms and Fields... if(this.getFormsAndFields() != null && !this.getFormsAndFields().isEmpty()) { JSONArray jsonArray = new JSONArray(); for(Form form : this.getFormsAndFields()) { jsonArray.put(form.toJsonObject()); } returnVal.put(JSONMapping.FORMS_AND_FIELDS, jsonArray); } //User Queries... if(this.getUserQueries() != null && !this.getUserQueries().isEmpty()) { JSONArray jsonArray = new JSONArray(); for(UserQuery userQuery : this.getUserQueries()) { jsonArray.put(userQuery.toJsonObject()); } returnVal.put(JSONMapping.USER_QUERIES, jsonArray); } //Flows... if(this.getFlows() != null && !this.getFlows().isEmpty()) { JSONArray jsonArray = new JSONArray(); for(Flow flow : this.getFlows()) { jsonArray.put(flow.toJsonObject()); } returnVal.put(JSONMapping.FLOWS, jsonArray); } //Third Party Libraries... if(this.getThirdPartyLibraries() != null && !this.getThirdPartyLibraries().isEmpty()) { JSONArray jsonArray = new JSONArray(); for(ThirdPartyLibrary thirdPartyLibrary : this.getThirdPartyLibraries()) { jsonArray.put(thirdPartyLibrary.toJsonObject()); } returnVal.put(JSONMapping.THIRD_PARTY_LIBRARIES, jsonArray); } //User Fields... if(this.getUserFields() != null && !this.getUserFields().isEmpty()) { JSONArray jsonArray = new JSONArray(); for(Field field : this.getUserFields()) { jsonArray.put(field.toJsonObject()); } returnVal.put(JSONMapping.USER_FIELDS, jsonArray); } //Route Fields... if(this.getRouteFields() != null && !this.getRouteFields().isEmpty()) { JSONArray fieldsArr = new JSONArray(); for(Field toAdd :this.getRouteFields()) { fieldsArr.put(toAdd.toJsonObject()); } returnVal.put(JSONMapping.ROUTE_FIELDS, fieldsArr); } //Global Fields... if(this.getGlobalFields() != null && !this.getGlobalFields().isEmpty()) { JSONArray fieldsArr = new JSONArray(); for(Field toAdd :this.getGlobalFields()) { fieldsArr.put(toAdd.toJsonObject()); } returnVal.put(JSONMapping.GLOBAL_FIELDS, fieldsArr); } return returnVal; }
class class_name[name] begin[{] method[toJsonObject, return_type[type[JSONObject]], modifier[public], parameter[]] begin[{] local_variable[type[JSONObject], returnVal] if[binary_operation[THIS[call[None.getTemplateName, parameter[]]], !=, literal[null]]] begin[{] call[returnVal.put, parameter[member[JSONMapping.TEMPLATE_NAME], THIS[call[None.getTemplateName, parameter[]]]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getTemplateDescription, parameter[]]], !=, literal[null]]] begin[{] call[returnVal.put, parameter[member[JSONMapping.TEMPLATE_DESCRIPTION], THIS[call[None.getTemplateDescription, parameter[]]]]] else begin[{] None end[}] if[binary_operation[THIS[call[None.getTemplateComment, parameter[]]], !=, literal[null]]] begin[{] call[returnVal.put, parameter[member[JSONMapping.TEMPLATE_COMMENT], THIS[call[None.getTemplateComment, parameter[]]]]] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[call[None.getFormsAndFields, parameter[]]], !=, literal[null]], &&, THIS[call[None.getFormsAndFields, parameter[]]call[None.isEmpty, parameter[]]]]] begin[{] local_variable[type[JSONArray], jsonArray] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toJsonObject, postfix_operators=[], prefix_operators=[], qualifier=form, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=jsonArray, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getFormsAndFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=form)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Form, sub_type=None))), label=None) call[returnVal.put, parameter[member[JSONMapping.FORMS_AND_FIELDS], member[.jsonArray]]] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[call[None.getUserQueries, parameter[]]], !=, literal[null]], &&, THIS[call[None.getUserQueries, parameter[]]call[None.isEmpty, parameter[]]]]] begin[{] local_variable[type[JSONArray], jsonArray] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toJsonObject, postfix_operators=[], prefix_operators=[], qualifier=userQuery, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=jsonArray, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getUserQueries, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=userQuery)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=UserQuery, sub_type=None))), label=None) call[returnVal.put, parameter[member[JSONMapping.USER_QUERIES], member[.jsonArray]]] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[call[None.getFlows, parameter[]]], !=, literal[null]], &&, THIS[call[None.getFlows, parameter[]]call[None.isEmpty, parameter[]]]]] begin[{] local_variable[type[JSONArray], jsonArray] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toJsonObject, postfix_operators=[], prefix_operators=[], qualifier=flow, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=jsonArray, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getFlows, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=flow)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Flow, sub_type=None))), label=None) call[returnVal.put, parameter[member[JSONMapping.FLOWS], member[.jsonArray]]] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[call[None.getThirdPartyLibraries, parameter[]]], !=, literal[null]], &&, THIS[call[None.getThirdPartyLibraries, parameter[]]call[None.isEmpty, parameter[]]]]] begin[{] local_variable[type[JSONArray], jsonArray] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toJsonObject, postfix_operators=[], prefix_operators=[], qualifier=thirdPartyLibrary, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=jsonArray, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getThirdPartyLibraries, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=thirdPartyLibrary)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ThirdPartyLibrary, sub_type=None))), label=None) call[returnVal.put, parameter[member[JSONMapping.THIRD_PARTY_LIBRARIES], member[.jsonArray]]] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[call[None.getUserFields, parameter[]]], !=, literal[null]], &&, THIS[call[None.getUserFields, parameter[]]call[None.isEmpty, parameter[]]]]] begin[{] local_variable[type[JSONArray], jsonArray] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toJsonObject, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=jsonArray, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getUserFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None) call[returnVal.put, parameter[member[JSONMapping.USER_FIELDS], member[.jsonArray]]] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[call[None.getRouteFields, parameter[]]], !=, literal[null]], &&, THIS[call[None.getRouteFields, parameter[]]call[None.isEmpty, parameter[]]]]] begin[{] local_variable[type[JSONArray], fieldsArr] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toJsonObject, postfix_operators=[], prefix_operators=[], qualifier=toAdd, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=fieldsArr, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRouteFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=toAdd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None) call[returnVal.put, parameter[member[JSONMapping.ROUTE_FIELDS], member[.fieldsArr]]] else begin[{] None end[}] if[binary_operation[binary_operation[THIS[call[None.getGlobalFields, parameter[]]], !=, literal[null]], &&, THIS[call[None.getGlobalFields, parameter[]]call[None.isEmpty, parameter[]]]]] begin[{] local_variable[type[JSONArray], fieldsArr] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toJsonObject, postfix_operators=[], prefix_operators=[], qualifier=toAdd, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=fieldsArr, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getGlobalFields, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=toAdd)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None) call[returnVal.put, parameter[member[JSONMapping.GLOBAL_FIELDS], member[.fieldsArr]]] else begin[{] None end[}] return[member[.returnVal]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[JSONObject] identifier[toJsonObject] operator[SEP] operator[SEP] Keyword[throws] identifier[JSONException] { identifier[JSONObject] identifier[returnVal] operator[=] Keyword[new] identifier[JSONObject] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getTemplateName] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[returnVal] operator[SEP] identifier[put] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[TEMPLATE_NAME] , Keyword[this] operator[SEP] identifier[getTemplateName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getTemplateDescription] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[returnVal] operator[SEP] identifier[put] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[TEMPLATE_DESCRIPTION] , Keyword[this] operator[SEP] identifier[getTemplateDescription] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getTemplateComment] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[returnVal] operator[SEP] identifier[put] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[TEMPLATE_COMMENT] , Keyword[this] operator[SEP] identifier[getTemplateComment] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getFormsAndFields] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] Keyword[this] operator[SEP] identifier[getFormsAndFields] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[JSONArray] identifier[jsonArray] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Form] identifier[form] operator[:] Keyword[this] operator[SEP] identifier[getFormsAndFields] operator[SEP] operator[SEP] operator[SEP] { identifier[jsonArray] operator[SEP] identifier[put] operator[SEP] identifier[form] operator[SEP] identifier[toJsonObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[returnVal] operator[SEP] identifier[put] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[FORMS_AND_FIELDS] , identifier[jsonArray] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getUserQueries] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] Keyword[this] operator[SEP] identifier[getUserQueries] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[JSONArray] identifier[jsonArray] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[UserQuery] identifier[userQuery] operator[:] Keyword[this] operator[SEP] identifier[getUserQueries] operator[SEP] operator[SEP] operator[SEP] { identifier[jsonArray] operator[SEP] identifier[put] operator[SEP] identifier[userQuery] operator[SEP] identifier[toJsonObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[returnVal] operator[SEP] identifier[put] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[USER_QUERIES] , identifier[jsonArray] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getFlows] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] Keyword[this] operator[SEP] identifier[getFlows] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[JSONArray] identifier[jsonArray] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Flow] identifier[flow] operator[:] Keyword[this] operator[SEP] identifier[getFlows] operator[SEP] operator[SEP] operator[SEP] { identifier[jsonArray] operator[SEP] identifier[put] operator[SEP] identifier[flow] operator[SEP] identifier[toJsonObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[returnVal] operator[SEP] identifier[put] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[FLOWS] , identifier[jsonArray] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getThirdPartyLibraries] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] Keyword[this] operator[SEP] identifier[getThirdPartyLibraries] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[JSONArray] identifier[jsonArray] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ThirdPartyLibrary] identifier[thirdPartyLibrary] operator[:] Keyword[this] operator[SEP] identifier[getThirdPartyLibraries] operator[SEP] operator[SEP] operator[SEP] { identifier[jsonArray] operator[SEP] identifier[put] operator[SEP] identifier[thirdPartyLibrary] operator[SEP] identifier[toJsonObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[returnVal] operator[SEP] identifier[put] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[THIRD_PARTY_LIBRARIES] , identifier[jsonArray] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getUserFields] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] Keyword[this] operator[SEP] identifier[getUserFields] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[JSONArray] identifier[jsonArray] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[field] operator[:] Keyword[this] operator[SEP] identifier[getUserFields] operator[SEP] operator[SEP] operator[SEP] { identifier[jsonArray] operator[SEP] identifier[put] operator[SEP] identifier[field] operator[SEP] identifier[toJsonObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[returnVal] operator[SEP] identifier[put] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[USER_FIELDS] , identifier[jsonArray] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getRouteFields] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] Keyword[this] operator[SEP] identifier[getRouteFields] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[JSONArray] identifier[fieldsArr] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[toAdd] operator[:] Keyword[this] operator[SEP] identifier[getRouteFields] operator[SEP] operator[SEP] operator[SEP] { identifier[fieldsArr] operator[SEP] identifier[put] operator[SEP] identifier[toAdd] operator[SEP] identifier[toJsonObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[returnVal] operator[SEP] identifier[put] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[ROUTE_FIELDS] , identifier[fieldsArr] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getGlobalFields] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] operator[!] Keyword[this] operator[SEP] identifier[getGlobalFields] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[JSONArray] identifier[fieldsArr] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[toAdd] operator[:] Keyword[this] operator[SEP] identifier[getGlobalFields] operator[SEP] operator[SEP] operator[SEP] { identifier[fieldsArr] operator[SEP] identifier[put] operator[SEP] identifier[toAdd] operator[SEP] identifier[toJsonObject] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[returnVal] operator[SEP] identifier[put] operator[SEP] identifier[JSONMapping] operator[SEP] identifier[GLOBAL_FIELDS] , identifier[fieldsArr] operator[SEP] operator[SEP] } Keyword[return] identifier[returnVal] operator[SEP] }
private boolean noInput(Input input) { return input.words().isEmpty() || (input.words().size() == 1 && input.words().get(0).trim().isEmpty()) || (input.words().iterator().next().matches("\\s*//.*")); }
class class_name[name] begin[{] method[noInput, return_type[type[boolean]], modifier[private], parameter[input]] begin[{] return[binary_operation[binary_operation[call[input.words, parameter[]], ||, binary_operation[binary_operation[call[input.words, parameter[]], ==, literal[1]], &&, call[input.words, parameter[]]]], ||, call[input.words, parameter[]]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[noInput] operator[SEP] identifier[Input] identifier[input] operator[SEP] { Keyword[return] identifier[input] operator[SEP] identifier[words] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[input] operator[SEP] identifier[words] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[&&] identifier[input] operator[SEP] identifier[words] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] operator[||] operator[SEP] identifier[input] operator[SEP] identifier[words] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] }
private void buildImplementedMethodList() { Set<TypeMirror> intfacs = utils.getAllInterfaces(typeElement); for (TypeMirror interfaceType : intfacs) { ExecutableElement found = utils.findMethod(utils.asTypeElement(interfaceType), method); if (found != null) { removeOverriddenMethod(found); if (!overridingMethodFound(found)) { methlist.add(found); interfaces.put(found, interfaceType); } } } }
class class_name[name] begin[{] method[buildImplementedMethodList, return_type[void], modifier[private], parameter[]] begin[{] local_variable[type[Set], intfacs] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=interfaceType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=asTypeElement, postfix_operators=[], prefix_operators=[], qualifier=utils, selectors=[], type_arguments=None), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=findMethod, postfix_operators=[], prefix_operators=[], qualifier=utils, selectors=[], type_arguments=None), name=found)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ExecutableElement, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeOverriddenMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=overridingMethodFound, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=methlist, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=found, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=interfaceType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=interfaces, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=intfacs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=interfaceType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeMirror, sub_type=None))), label=None) end[}] END[}]
Keyword[private] Keyword[void] identifier[buildImplementedMethodList] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[TypeMirror] operator[>] identifier[intfacs] operator[=] identifier[utils] operator[SEP] identifier[getAllInterfaces] operator[SEP] identifier[typeElement] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TypeMirror] identifier[interfaceType] operator[:] identifier[intfacs] operator[SEP] { identifier[ExecutableElement] identifier[found] operator[=] identifier[utils] operator[SEP] identifier[findMethod] operator[SEP] identifier[utils] operator[SEP] identifier[asTypeElement] operator[SEP] identifier[interfaceType] operator[SEP] , identifier[method] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[found] operator[!=] Other[null] operator[SEP] { identifier[removeOverriddenMethod] operator[SEP] identifier[found] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[overridingMethodFound] operator[SEP] identifier[found] operator[SEP] operator[SEP] { identifier[methlist] operator[SEP] identifier[add] operator[SEP] identifier[found] operator[SEP] operator[SEP] identifier[interfaces] operator[SEP] identifier[put] operator[SEP] identifier[found] , identifier[interfaceType] operator[SEP] operator[SEP] } } } }
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { //Persistent is hidden from CLI users so let's set this to true here if it is not defined if (!operation.hasDefined(PERSISTENT.getName())) { operation.get(PERSISTENT.getName()).set(true); } boolean persistent = PERSISTENT.resolveModelAttribute(context, operation).asBoolean(); final Resource resource = Resource.Factory.create(!persistent); context.addResource(PathAddress.EMPTY_ADDRESS, resource); ModelNode newModel = resource.getModel(); // The 'persistent' and 'owner' parameters are hidden internal API, so handle them specifically PERSISTENT.validateAndSet(operation, newModel); OWNER.validateAndSet(operation, newModel); // Store the rest of the parameters that are documented parameters to this op. for (AttributeDefinition def : SERVER_ADD_ATTRIBUTES) { def.validateAndSet(operation, newModel); } // TODO: JBAS-9020: for the moment overlays are not supported, so there is a single content item ModelNode contentItemNode = newModel.require(CONTENT_RESOURCE_ALL.getName()).require(0); final ModelNode opAddr = operation.get(OP_ADDR); final PathAddress address = PathAddress.pathAddress(opAddr); final String name = address.getLastElement().getValue(); final String runtimeName = operation.hasDefined(RUNTIME_NAME.getName()) ? operation.get(RUNTIME_NAME.getName()).asString() : name; newModel.get(RUNTIME_NAME.getName()).set(runtimeName); final DeploymentHandlerUtil.ContentItem contentItem; if (contentItemNode.hasDefined(CONTENT_HASH.getName())) { contentItem = addFromHash(contentItemNode, name, address, context); } else if (contentItemNode.hasDefined(EMPTY.getName())) { contentItem = addEmptyContentDir(); contentItemNode = new ModelNode(); contentItemNode.get(CONTENT_HASH.getName()).set(contentItem.getHash()); contentItemNode.get(CONTENT_ARCHIVE.getName()).set(false); ModelNode content = new ModelNode(); content.add(contentItemNode); newModel.get(CONTENT_RESOURCE_ALL.getName()).set(content); } else if(hasValidContentAdditionParameterDefined(contentItemNode)) { contentItem = addFromContentAdditionParameter(context, contentItemNode); // Store a hash-based contentItemNode back to the model contentItemNode = new ModelNode(); contentItemNode.get(CONTENT_HASH.getName()).set(contentItem.getHash()); ModelNode content = new ModelNode(); content.add(contentItemNode); newModel.get(CONTENT_RESOURCE_ALL.getName()).set(content); } else { contentItem = addUnmanaged(contentItemNode); } if (context.getProcessType() == ProcessType.STANDALONE_SERVER) { // Add a step to validate uniqueness of runtime names context.addStep(new OperationStepHandler() { @Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { validateRuntimeNames(name, context); } }, OperationContext.Stage.MODEL); } if (ENABLED.resolveModelAttribute(context, newModel).asBoolean() && context.isNormalServer()) { DeploymentHandlerUtil.deploy(context, operation, runtimeName, name, vaultReader, contentItem); DeploymentUtils.enableAttribute(newModel); } if (contentItem.getHash() != null) { final byte[] contentHash = contentItem.getHash(); addFlushHandler(context, contentRepository,new OperationContext.ResultHandler() { @Override public void handleResult(ResultAction resultAction, OperationContext context, ModelNode operation) { if (resultAction == ResultAction.KEEP) { contentRepository.addContentReference(ModelContentReference.fromModelAddress(address, contentHash)); } } }); } }
class class_name[name] begin[{] method[execute, return_type[void], modifier[public], parameter[context, operation]] begin[{] if[call[operation.hasDefined, parameter[call[PERSISTENT.getName, parameter[]]]]] begin[{] call[operation.get, parameter[call[PERSISTENT.getName, parameter[]]]] else begin[{] None end[}] local_variable[type[boolean], persistent] local_variable[type[Resource], resource] call[context.addResource, parameter[member[PathAddress.EMPTY_ADDRESS], member[.resource]]] local_variable[type[ModelNode], newModel] call[PERSISTENT.validateAndSet, parameter[member[.operation], member[.newModel]]] call[OWNER.validateAndSet, parameter[member[.operation], member[.newModel]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=operation, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validateAndSet, postfix_operators=[], prefix_operators=[], qualifier=def, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=SERVER_ADD_ATTRIBUTES, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=def)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AttributeDefinition, sub_type=None))), label=None) local_variable[type[ModelNode], contentItemNode] local_variable[type[ModelNode], opAddr] local_variable[type[PathAddress], address] local_variable[type[String], name] local_variable[type[String], runtimeName] call[newModel.get, parameter[call[RUNTIME_NAME.getName, parameter[]]]] local_variable[type[DeploymentHandlerUtil], contentItem] if[call[contentItemNode.hasDefined, parameter[call[CONTENT_HASH.getName, parameter[]]]]] begin[{] assign[member[.contentItem], call[.addFromHash, parameter[member[.contentItemNode], member[.name], member[.address], member[.context]]]] else begin[{] if[call[contentItemNode.hasDefined, parameter[call[EMPTY.getName, parameter[]]]]] begin[{] assign[member[.contentItem], call[.addEmptyContentDir, parameter[]]] assign[member[.contentItemNode], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModelNode, sub_type=None))] call[contentItemNode.get, parameter[call[CONTENT_HASH.getName, parameter[]]]] call[contentItemNode.get, parameter[call[CONTENT_ARCHIVE.getName, parameter[]]]] local_variable[type[ModelNode], content] call[content.add, parameter[member[.contentItemNode]]] call[newModel.get, parameter[call[CONTENT_RESOURCE_ALL.getName, parameter[]]]] else begin[{] if[call[.hasValidContentAdditionParameterDefined, parameter[member[.contentItemNode]]]] begin[{] assign[member[.contentItem], call[.addFromContentAdditionParameter, parameter[member[.context], member[.contentItemNode]]]] assign[member[.contentItemNode], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ModelNode, sub_type=None))] call[contentItemNode.get, parameter[call[CONTENT_HASH.getName, parameter[]]]] local_variable[type[ModelNode], content] call[content.add, parameter[member[.contentItemNode]]] call[newModel.get, parameter[call[CONTENT_RESOURCE_ALL.getName, parameter[]]]] else begin[{] assign[member[.contentItem], call[.addUnmanaged, parameter[member[.contentItemNode]]]] end[}] end[}] end[}] if[binary_operation[call[context.getProcessType, parameter[]], ==, member[ProcessType.STANDALONE_SERVER]]] begin[{] call[context.addStep, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=validateRuntimeNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, parameters=[FormalParameter(annotations=[], modifiers=set(), name=context, type=ReferenceType(arguments=None, dimensions=[], name=OperationContext, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=operation, type=ReferenceType(arguments=None, dimensions=[], name=ModelNode, sub_type=None), varargs=False)], return_type=None, throws=['OperationFailedException'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OperationStepHandler, sub_type=None)), member[OperationContext.Stage.MODEL]]] else begin[{] None end[}] if[binary_operation[call[ENABLED.resolveModelAttribute, parameter[member[.context], member[.newModel]]], &&, call[context.isNormalServer, parameter[]]]] begin[{] call[DeploymentHandlerUtil.deploy, parameter[member[.context], member[.operation], member[.runtimeName], member[.name], member[.vaultReader], member[.contentItem]]] call[DeploymentUtils.enableAttribute, parameter[member[.newModel]]] else begin[{] None end[}] if[binary_operation[call[contentItem.getHash, parameter[]], !=, literal[null]]] begin[{] local_variable[type[byte], contentHash] call[.addFlushHandler, parameter[member[.context], member[.contentRepository], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=resultAction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=KEEP, postfix_operators=[], prefix_operators=[], qualifier=ResultAction, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=address, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contentHash, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromModelAddress, postfix_operators=[], prefix_operators=[], qualifier=ModelContentReference, selectors=[], type_arguments=None)], member=addContentReference, postfix_operators=[], prefix_operators=[], qualifier=contentRepository, selectors=[], type_arguments=None), label=None)]))], documentation=None, modifiers={'public'}, name=handleResult, parameters=[FormalParameter(annotations=[], modifiers=set(), name=resultAction, type=ReferenceType(arguments=None, dimensions=[], name=ResultAction, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=context, type=ReferenceType(arguments=None, dimensions=[], name=OperationContext, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=operation, type=ReferenceType(arguments=None, dimensions=[], name=ModelNode, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OperationContext, sub_type=ReferenceType(arguments=None, dimensions=None, name=ResultHandler, sub_type=None)))]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[OperationContext] identifier[context] , identifier[ModelNode] identifier[operation] operator[SEP] Keyword[throws] identifier[OperationFailedException] { Keyword[if] operator[SEP] operator[!] identifier[operation] operator[SEP] identifier[hasDefined] operator[SEP] identifier[PERSISTENT] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[operation] operator[SEP] identifier[get] operator[SEP] identifier[PERSISTENT] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP] } Keyword[boolean] identifier[persistent] operator[=] identifier[PERSISTENT] operator[SEP] identifier[resolveModelAttribute] operator[SEP] identifier[context] , identifier[operation] operator[SEP] operator[SEP] identifier[asBoolean] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Resource] identifier[resource] operator[=] identifier[Resource] operator[SEP] identifier[Factory] operator[SEP] identifier[create] operator[SEP] operator[!] identifier[persistent] operator[SEP] operator[SEP] identifier[context] operator[SEP] identifier[addResource] operator[SEP] identifier[PathAddress] operator[SEP] identifier[EMPTY_ADDRESS] , identifier[resource] operator[SEP] operator[SEP] identifier[ModelNode] identifier[newModel] operator[=] identifier[resource] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] operator[SEP] identifier[PERSISTENT] operator[SEP] identifier[validateAndSet] operator[SEP] identifier[operation] , identifier[newModel] operator[SEP] operator[SEP] identifier[OWNER] operator[SEP] identifier[validateAndSet] operator[SEP] identifier[operation] , identifier[newModel] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[AttributeDefinition] identifier[def] operator[:] identifier[SERVER_ADD_ATTRIBUTES] operator[SEP] { identifier[def] operator[SEP] identifier[validateAndSet] operator[SEP] identifier[operation] , identifier[newModel] operator[SEP] operator[SEP] } identifier[ModelNode] identifier[contentItemNode] operator[=] identifier[newModel] operator[SEP] identifier[require] operator[SEP] identifier[CONTENT_RESOURCE_ALL] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[require] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[final] identifier[ModelNode] identifier[opAddr] operator[=] identifier[operation] operator[SEP] identifier[get] operator[SEP] identifier[OP_ADDR] operator[SEP] operator[SEP] Keyword[final] identifier[PathAddress] identifier[address] operator[=] identifier[PathAddress] operator[SEP] identifier[pathAddress] operator[SEP] identifier[opAddr] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[=] identifier[address] operator[SEP] identifier[getLastElement] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[runtimeName] operator[=] identifier[operation] operator[SEP] identifier[hasDefined] operator[SEP] identifier[RUNTIME_NAME] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[?] identifier[operation] operator[SEP] identifier[get] operator[SEP] identifier[RUNTIME_NAME] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[asString] operator[SEP] operator[SEP] operator[:] identifier[name] operator[SEP] identifier[newModel] operator[SEP] identifier[get] operator[SEP] identifier[RUNTIME_NAME] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[runtimeName] operator[SEP] operator[SEP] Keyword[final] identifier[DeploymentHandlerUtil] operator[SEP] identifier[ContentItem] identifier[contentItem] operator[SEP] Keyword[if] operator[SEP] identifier[contentItemNode] operator[SEP] identifier[hasDefined] operator[SEP] identifier[CONTENT_HASH] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[contentItem] operator[=] identifier[addFromHash] operator[SEP] identifier[contentItemNode] , identifier[name] , identifier[address] , identifier[context] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[contentItemNode] operator[SEP] identifier[hasDefined] operator[SEP] identifier[EMPTY] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[contentItem] operator[=] identifier[addEmptyContentDir] operator[SEP] operator[SEP] operator[SEP] identifier[contentItemNode] operator[=] Keyword[new] identifier[ModelNode] operator[SEP] operator[SEP] operator[SEP] identifier[contentItemNode] operator[SEP] identifier[get] operator[SEP] identifier[CONTENT_HASH] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[contentItem] operator[SEP] identifier[getHash] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[contentItemNode] operator[SEP] identifier[get] operator[SEP] identifier[CONTENT_ARCHIVE] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[ModelNode] identifier[content] operator[=] Keyword[new] identifier[ModelNode] operator[SEP] operator[SEP] operator[SEP] identifier[content] operator[SEP] identifier[add] operator[SEP] identifier[contentItemNode] operator[SEP] operator[SEP] identifier[newModel] operator[SEP] identifier[get] operator[SEP] identifier[CONTENT_RESOURCE_ALL] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[content] operator[SEP] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[hasValidContentAdditionParameterDefined] operator[SEP] identifier[contentItemNode] operator[SEP] operator[SEP] { identifier[contentItem] operator[=] identifier[addFromContentAdditionParameter] operator[SEP] identifier[context] , identifier[contentItemNode] operator[SEP] operator[SEP] identifier[contentItemNode] operator[=] Keyword[new] identifier[ModelNode] operator[SEP] operator[SEP] operator[SEP] identifier[contentItemNode] operator[SEP] identifier[get] operator[SEP] identifier[CONTENT_HASH] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[contentItem] operator[SEP] identifier[getHash] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ModelNode] identifier[content] operator[=] Keyword[new] identifier[ModelNode] operator[SEP] operator[SEP] operator[SEP] identifier[content] operator[SEP] identifier[add] operator[SEP] identifier[contentItemNode] operator[SEP] operator[SEP] identifier[newModel] operator[SEP] identifier[get] operator[SEP] identifier[CONTENT_RESOURCE_ALL] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] identifier[content] operator[SEP] operator[SEP] } Keyword[else] { identifier[contentItem] operator[=] identifier[addUnmanaged] operator[SEP] identifier[contentItemNode] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[getProcessType] operator[SEP] operator[SEP] operator[==] identifier[ProcessType] operator[SEP] identifier[STANDALONE_SERVER] operator[SEP] { identifier[context] operator[SEP] identifier[addStep] operator[SEP] Keyword[new] identifier[OperationStepHandler] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[OperationContext] identifier[context] , identifier[ModelNode] identifier[operation] operator[SEP] Keyword[throws] identifier[OperationFailedException] { identifier[validateRuntimeNames] operator[SEP] identifier[name] , identifier[context] operator[SEP] operator[SEP] } } , identifier[OperationContext] operator[SEP] identifier[Stage] operator[SEP] identifier[MODEL] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[ENABLED] operator[SEP] identifier[resolveModelAttribute] operator[SEP] identifier[context] , identifier[newModel] operator[SEP] operator[SEP] identifier[asBoolean] operator[SEP] operator[SEP] operator[&&] identifier[context] operator[SEP] identifier[isNormalServer] operator[SEP] operator[SEP] operator[SEP] { identifier[DeploymentHandlerUtil] operator[SEP] identifier[deploy] operator[SEP] identifier[context] , identifier[operation] , identifier[runtimeName] , identifier[name] , identifier[vaultReader] , identifier[contentItem] operator[SEP] operator[SEP] identifier[DeploymentUtils] operator[SEP] identifier[enableAttribute] operator[SEP] identifier[newModel] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[contentItem] operator[SEP] identifier[getHash] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[final] Keyword[byte] operator[SEP] operator[SEP] identifier[contentHash] operator[=] identifier[contentItem] operator[SEP] identifier[getHash] operator[SEP] operator[SEP] operator[SEP] identifier[addFlushHandler] operator[SEP] identifier[context] , identifier[contentRepository] , Keyword[new] identifier[OperationContext] operator[SEP] identifier[ResultHandler] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[handleResult] operator[SEP] identifier[ResultAction] identifier[resultAction] , identifier[OperationContext] identifier[context] , identifier[ModelNode] identifier[operation] operator[SEP] { Keyword[if] operator[SEP] identifier[resultAction] operator[==] identifier[ResultAction] operator[SEP] identifier[KEEP] operator[SEP] { identifier[contentRepository] operator[SEP] identifier[addContentReference] operator[SEP] identifier[ModelContentReference] operator[SEP] identifier[fromModelAddress] operator[SEP] identifier[address] , identifier[contentHash] operator[SEP] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] } }
@Override public Reader bootstrapInput(ReaderConfig cfg, boolean mainDoc, int xmlVersion) throws IOException, XMLStreamException { /* First order of business: allocate input buffer. Not done during * construction for simplicity; that way config object need not be * passed before actual bootstrap method is called */ /* Let's make sure buffer is at least 6 chars (to know '<?xml ' * prefix), and preferably big enough to contain the whole declaration, * but not too long to waste space -- it won't be reused * by the real input reader. */ mCharBuffer = (cfg == null) ? new char[128] : cfg.allocSmallCBuffer(128); // 128 chars should be enough initialLoad(7); /* Only need 6 for signature ("<?xml\s"), but there may be a leading * BOM in there... and a valid xml declaration has to be longer * than 7 chars anyway (although, granted, shortest valid xml docl * is just 4 chars... "<a/>") */ if (mInputEnd >= 7) { char c = mCharBuffer[mInputPtr]; // BOM to skip? if (c == CHAR_BOM_MARKER) { c = mCharBuffer[++mInputPtr]; } if (c == '<') { if (mCharBuffer[mInputPtr+1] == '?' && mCharBuffer[mInputPtr+2] == 'x' && mCharBuffer[mInputPtr+3] == 'm' && mCharBuffer[mInputPtr+4] == 'l' && mCharBuffer[mInputPtr+5] <= CHAR_SPACE) { // Yup, got the declaration ok! mInputPtr += 6; // skip declaration readXmlDecl(mainDoc, xmlVersion); if (mFoundEncoding != null && mInputEncoding != null) { verifyXmlEncoding(cfg); } } } else { /* We may also get something that would be invalid xml * ("garbage" char; neither '<' nor space). If so, and * it's one of "well-known" cases, we can not only throw * an exception but also indicate a clue as to what is likely * to be wrong. */ /* Specifically, UTF-8 read via, say, ISO-8859-1 reader, can * "leak" marker (0xEF, 0xBB, 0xBF). While we could just eat * it, there's bound to be other problems cropping up, so let's * inform about the problem right away. */ if (c == 0xEF) { throw new WstxIOException("Unexpected first character (char code 0xEF), not valid in xml document: could be mangled UTF-8 BOM marker. Make sure that the Reader uses correct encoding or pass an InputStream instead"); } } } /* Ok, now; do we have unused chars we have read that need to * be merged in? */ if (mInputPtr < mInputEnd) { return new MergedReader(cfg, mIn, mCharBuffer, mInputPtr, mInputEnd); } return mIn; }
class class_name[name] begin[{] method[bootstrapInput, return_type[type[Reader]], modifier[public], parameter[cfg, mainDoc, xmlVersion]] begin[{] assign[member[.mCharBuffer], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=cfg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=128)], member=allocSmallCBuffer, postfix_operators=[], prefix_operators=[], qualifier=cfg, selectors=[], type_arguments=None), if_true=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=128)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=char)))] call[.initialLoad, parameter[literal[7]]] if[binary_operation[member[.mInputEnd], >=, literal[7]]] begin[{] local_variable[type[char], c] if[binary_operation[member[.c], ==, member[.CHAR_BOM_MARKER]]] begin[{] assign[member[.c], member[.mCharBuffer]] else begin[{] None end[}] if[binary_operation[member[.c], ==, literal['<']]] begin[{] if[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[member[.mCharBuffer], ==, literal['?']], &&, binary_operation[member[.mCharBuffer], ==, literal['x']]], &&, binary_operation[member[.mCharBuffer], ==, literal['m']]], &&, binary_operation[member[.mCharBuffer], ==, literal['l']]], &&, binary_operation[member[.mCharBuffer], <=, member[.CHAR_SPACE]]]] begin[{] assign[member[.mInputPtr], literal[6]] call[.readXmlDecl, parameter[member[.mainDoc], member[.xmlVersion]]] if[binary_operation[binary_operation[member[.mFoundEncoding], !=, literal[null]], &&, binary_operation[member[.mInputEncoding], !=, literal[null]]]] begin[{] call[.verifyXmlEncoding, parameter[member[.cfg]]] else begin[{] None end[}] else begin[{] None end[}] else begin[{] if[binary_operation[member[.c], ==, literal[0xEF]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected first character (char code 0xEF), not valid in xml document: could be mangled UTF-8 BOM marker. Make sure that the Reader uses correct encoding or pass an InputStream instead")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WstxIOException, sub_type=None)), label=None) else begin[{] None end[}] end[}] else begin[{] None end[}] if[binary_operation[member[.mInputPtr], <, member[.mInputEnd]]] begin[{] return[ClassCreator(arguments=[MemberReference(member=cfg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mIn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mCharBuffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mInputPtr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mInputEnd, 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=MergedReader, sub_type=None))] else begin[{] None end[}] return[member[.mIn]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[Reader] identifier[bootstrapInput] operator[SEP] identifier[ReaderConfig] identifier[cfg] , Keyword[boolean] identifier[mainDoc] , Keyword[int] identifier[xmlVersion] operator[SEP] Keyword[throws] identifier[IOException] , identifier[XMLStreamException] { identifier[mCharBuffer] operator[=] operator[SEP] identifier[cfg] operator[==] Other[null] operator[SEP] operator[?] Keyword[new] Keyword[char] operator[SEP] Other[128] operator[SEP] operator[:] identifier[cfg] operator[SEP] identifier[allocSmallCBuffer] operator[SEP] Other[128] operator[SEP] operator[SEP] identifier[initialLoad] operator[SEP] Other[7] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mInputEnd] operator[>=] Other[7] operator[SEP] { Keyword[char] identifier[c] operator[=] identifier[mCharBuffer] operator[SEP] identifier[mInputPtr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[CHAR_BOM_MARKER] operator[SEP] { identifier[c] operator[=] identifier[mCharBuffer] operator[SEP] operator[++] identifier[mInputPtr] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] { Keyword[if] operator[SEP] identifier[mCharBuffer] operator[SEP] identifier[mInputPtr] operator[+] Other[1] operator[SEP] operator[==] literal[String] operator[&&] identifier[mCharBuffer] operator[SEP] identifier[mInputPtr] operator[+] Other[2] operator[SEP] operator[==] literal[String] operator[&&] identifier[mCharBuffer] operator[SEP] identifier[mInputPtr] operator[+] Other[3] operator[SEP] operator[==] literal[String] operator[&&] identifier[mCharBuffer] operator[SEP] identifier[mInputPtr] operator[+] Other[4] operator[SEP] operator[==] literal[String] operator[&&] identifier[mCharBuffer] operator[SEP] identifier[mInputPtr] operator[+] Other[5] operator[SEP] operator[<=] identifier[CHAR_SPACE] operator[SEP] { identifier[mInputPtr] operator[+=] Other[6] operator[SEP] identifier[readXmlDecl] operator[SEP] identifier[mainDoc] , identifier[xmlVersion] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mFoundEncoding] operator[!=] Other[null] operator[&&] identifier[mInputEncoding] operator[!=] Other[null] operator[SEP] { identifier[verifyXmlEncoding] operator[SEP] identifier[cfg] operator[SEP] operator[SEP] } } } Keyword[else] { Keyword[if] operator[SEP] identifier[c] operator[==] literal[Integer] operator[SEP] { Keyword[throw] Keyword[new] identifier[WstxIOException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } } Keyword[if] operator[SEP] identifier[mInputPtr] operator[<] identifier[mInputEnd] operator[SEP] { Keyword[return] Keyword[new] identifier[MergedReader] operator[SEP] identifier[cfg] , identifier[mIn] , identifier[mCharBuffer] , identifier[mInputPtr] , identifier[mInputEnd] operator[SEP] operator[SEP] } Keyword[return] identifier[mIn] operator[SEP] }
public org.grails.datastore.mapping.query.api.Criteria sqlRestriction(String sqlRestriction) { if (!validateSimpleExpression()) { throwRuntimeException(new IllegalArgumentException("Call to [sqlRestriction] with value [" + sqlRestriction + "] not allowed here.")); } return sqlRestriction(sqlRestriction, Collections.EMPTY_LIST); }
class class_name[name] begin[{] method[sqlRestriction, return_type[type[org]], modifier[public], parameter[sqlRestriction]] begin[{] if[call[.validateSimpleExpression, parameter[]]] begin[{] call[.throwRuntimeException, parameter[ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Call to [sqlRestriction] with value ["), operandr=MemberReference(member=sqlRestriction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="] not allowed here."), 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))]] else begin[{] None end[}] return[call[.sqlRestriction, parameter[member[.sqlRestriction], member[Collections.EMPTY_LIST]]]] end[}] END[}]
Keyword[public] identifier[org] operator[SEP] identifier[grails] operator[SEP] identifier[datastore] operator[SEP] identifier[mapping] operator[SEP] identifier[query] operator[SEP] identifier[api] operator[SEP] identifier[Criteria] identifier[sqlRestriction] operator[SEP] identifier[String] identifier[sqlRestriction] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[validateSimpleExpression] operator[SEP] operator[SEP] operator[SEP] { identifier[throwRuntimeException] operator[SEP] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[sqlRestriction] operator[+] literal[String] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[sqlRestriction] operator[SEP] identifier[sqlRestriction] , identifier[Collections] operator[SEP] identifier[EMPTY_LIST] operator[SEP] operator[SEP] }
public static void error(final Logger logger, final String format, final Object... params) { error(logger, format, null, params); }
class class_name[name] begin[{] method[error, return_type[void], modifier[public static], parameter[logger, format, params]] begin[{] call[.error, parameter[member[.logger], member[.format], literal[null], member[.params]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[void] identifier[error] operator[SEP] Keyword[final] identifier[Logger] identifier[logger] , Keyword[final] identifier[String] identifier[format] , Keyword[final] identifier[Object] operator[...] identifier[params] operator[SEP] { identifier[error] operator[SEP] identifier[logger] , identifier[format] , Other[null] , identifier[params] operator[SEP] operator[SEP] }
@Override public <T extends ApiUser> List<T> getUserList() { return CommandUtil.getApiUserList(room.getUserList()); }
class class_name[name] begin[{] method[getUserList, return_type[type[List]], modifier[public], parameter[]] begin[{] return[call[CommandUtil.getApiUserList, parameter[call[room.getUserList, parameter[]]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[ApiUser] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[getUserList] operator[SEP] operator[SEP] { Keyword[return] identifier[CommandUtil] operator[SEP] identifier[getApiUserList] operator[SEP] identifier[room] operator[SEP] identifier[getUserList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
private void parseArgs(String[] args) { int index = 0; while (index < args.length) { String name = args[index]; if (name.equals("-?") || name.equalsIgnoreCase("-help")) { usage(); } if (name.charAt(0) != '-') { m_logger.error("Unrecognized parameter: {}", name); usage(); } if (++index >= args.length) { m_logger.error("Another parameter expected after '{}'", name); usage(); } String value = args[index]; try { m_config.set(name.substring(1), value); } catch (Exception e) { m_logger.error(e.toString()); usage(); } index++; } }
class class_name[name] begin[{] method[parseArgs, return_type[void], modifier[private], parameter[args]] begin[{] local_variable[type[int], index] while[binary_operation[member[.index], <, member[args.length]]] begin[{] local_variable[type[String], name] if[binary_operation[call[name.equals, parameter[literal["-?"]]], ||, call[name.equalsIgnoreCase, parameter[literal["-help"]]]]] begin[{] call[.usage, parameter[]] else begin[{] None end[}] if[binary_operation[call[name.charAt, parameter[literal[0]]], !=, literal['-']]] begin[{] call[m_logger.error, parameter[literal["Unrecognized parameter: {}"], member[.name]]] call[.usage, parameter[]] else begin[{] None end[}] if[binary_operation[member[.index], >=, member[args.length]]] begin[{] call[m_logger.error, parameter[literal["Another parameter expected after '{}'"], member[.name]]] call[.usage, parameter[]] else begin[{] None end[}] local_variable[type[String], value] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=name, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=set, postfix_operators=[], prefix_operators=[], qualifier=m_config, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=error, postfix_operators=[], prefix_operators=[], qualifier=m_logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=usage, 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) member[.index] end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[parseArgs] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[args] operator[SEP] { Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] Keyword[while] operator[SEP] identifier[index] operator[<] identifier[args] operator[SEP] identifier[length] operator[SEP] { identifier[String] identifier[name] operator[=] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[||] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] literal[String] operator[SEP] operator[SEP] { identifier[usage] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[!=] literal[String] operator[SEP] { identifier[m_logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[usage] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] operator[++] identifier[index] operator[>=] identifier[args] operator[SEP] identifier[length] operator[SEP] { identifier[m_logger] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[name] operator[SEP] operator[SEP] identifier[usage] operator[SEP] operator[SEP] operator[SEP] } identifier[String] identifier[value] operator[=] identifier[args] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[try] { identifier[m_config] operator[SEP] identifier[set] operator[SEP] identifier[name] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] , identifier[value] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { identifier[m_logger] operator[SEP] identifier[error] operator[SEP] identifier[e] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[usage] operator[SEP] operator[SEP] operator[SEP] } identifier[index] operator[++] operator[SEP] } }
public IComplexOption getComplexOption(String key) { Object object = this.options.get(key); if (object instanceof IComplexOption) return (IComplexOption) object; return null; }
class class_name[name] begin[{] method[getComplexOption, return_type[type[IComplexOption]], modifier[public], parameter[key]] begin[{] local_variable[type[Object], object] if[binary_operation[member[.object], instanceof, type[IComplexOption]]] begin[{] return[Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IComplexOption, sub_type=None))] else begin[{] None end[}] return[literal[null]] end[}] END[}]
Keyword[public] identifier[IComplexOption] identifier[getComplexOption] operator[SEP] identifier[String] identifier[key] operator[SEP] { identifier[Object] identifier[object] operator[=] Keyword[this] operator[SEP] identifier[options] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[IComplexOption] operator[SEP] Keyword[return] operator[SEP] identifier[IComplexOption] operator[SEP] identifier[object] operator[SEP] Keyword[return] Other[null] operator[SEP] }
public SftpFileAttributes get(String path, FileTransferProgress progress) throws FileNotFoundException, SftpStatusException, SshException, TransferCancelledException { return get(path, progress, false); }
class class_name[name] begin[{] method[get, return_type[type[SftpFileAttributes]], modifier[public], parameter[path, progress]] begin[{] return[call[.get, parameter[member[.path], member[.progress], literal[false]]]] end[}] END[}]
Keyword[public] identifier[SftpFileAttributes] identifier[get] operator[SEP] identifier[String] identifier[path] , identifier[FileTransferProgress] identifier[progress] operator[SEP] Keyword[throws] identifier[FileNotFoundException] , identifier[SftpStatusException] , identifier[SshException] , identifier[TransferCancelledException] { Keyword[return] identifier[get] operator[SEP] identifier[path] , identifier[progress] , literal[boolean] operator[SEP] operator[SEP] }
public void setupSFields() { this.getRecord(LogicFile.LOGIC_FILE_FILE).getField(LogicFile.SEQUENCE).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); this.getRecord(LogicFile.LOGIC_FILE_FILE).getField(LogicFile.METHOD_NAME).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); }
class class_name[name] begin[{] method[setupSFields, return_type[void], modifier[public], parameter[]] begin[{] THIS[call[None.getRecord, parameter[member[LogicFile.LOGIC_FILE_FILE]]]call[None.getField, parameter[member[LogicFile.SEQUENCE]]]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[LogicFile.LOGIC_FILE_FILE]]]call[None.getField, parameter[member[LogicFile.METHOD_NAME]]]call[None.setupDefaultView, parameter[THIS[call[None.getNextLocation, parameter[member[ScreenConstants.NEXT_LOGICAL], member[ScreenConstants.ANCHOR_DEFAULT]]]], 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[LogicFile] operator[SEP] identifier[LOGIC_FILE_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[LogicFile] operator[SEP] identifier[SEQUENCE] 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[LogicFile] operator[SEP] identifier[LOGIC_FILE_FILE] operator[SEP] operator[SEP] identifier[getField] operator[SEP] identifier[LogicFile] operator[SEP] identifier[METHOD_NAME] 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] }
public void setVideo(final Video[] video) { List<Video> list = video == null ? null : Arrays.asList(video); getOrCreateComponentModel().video = list; }
class class_name[name] begin[{] method[setVideo, return_type[void], modifier[public], parameter[video]] begin[{] local_variable[type[List], list] assign[call[.getOrCreateComponentModel, parameter[]], member[.list]] end[}] END[}]
Keyword[public] Keyword[void] identifier[setVideo] operator[SEP] Keyword[final] identifier[Video] operator[SEP] operator[SEP] identifier[video] operator[SEP] { identifier[List] operator[<] identifier[Video] operator[>] identifier[list] operator[=] identifier[video] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[video] operator[SEP] operator[SEP] identifier[getOrCreateComponentModel] operator[SEP] operator[SEP] operator[SEP] identifier[video] operator[=] identifier[list] operator[SEP] }
public static String getMavenPath(PluginCoordinates coordinates) { StringBuilder artifactSubPath = new StringBuilder(); artifactSubPath.append(coordinates.getGroupId().replace('.', '/')); artifactSubPath.append('/'); artifactSubPath.append(coordinates.getArtifactId()); artifactSubPath.append('/'); artifactSubPath.append(coordinates.getVersion()); artifactSubPath.append('/'); artifactSubPath.append(coordinates.getArtifactId()); artifactSubPath.append('-'); artifactSubPath.append(coordinates.getVersion()); if (coordinates.getClassifier() != null) { artifactSubPath.append('-'); artifactSubPath.append(coordinates.getClassifier()); } artifactSubPath.append('.'); artifactSubPath.append(coordinates.getType()); return artifactSubPath.toString(); }
class class_name[name] begin[{] method[getMavenPath, return_type[type[String]], modifier[public static], parameter[coordinates]] begin[{] local_variable[type[StringBuilder], artifactSubPath] call[artifactSubPath.append, parameter[call[coordinates.getGroupId, parameter[]]]] call[artifactSubPath.append, parameter[literal['/']]] call[artifactSubPath.append, parameter[call[coordinates.getArtifactId, parameter[]]]] call[artifactSubPath.append, parameter[literal['/']]] call[artifactSubPath.append, parameter[call[coordinates.getVersion, parameter[]]]] call[artifactSubPath.append, parameter[literal['/']]] call[artifactSubPath.append, parameter[call[coordinates.getArtifactId, parameter[]]]] call[artifactSubPath.append, parameter[literal['-']]] call[artifactSubPath.append, parameter[call[coordinates.getVersion, parameter[]]]] if[binary_operation[call[coordinates.getClassifier, parameter[]], !=, literal[null]]] begin[{] call[artifactSubPath.append, parameter[literal['-']]] call[artifactSubPath.append, parameter[call[coordinates.getClassifier, parameter[]]]] else begin[{] None end[}] call[artifactSubPath.append, parameter[literal['.']]] call[artifactSubPath.append, parameter[call[coordinates.getType, parameter[]]]] return[call[artifactSubPath.toString, parameter[]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[String] identifier[getMavenPath] operator[SEP] identifier[PluginCoordinates] identifier[coordinates] operator[SEP] { identifier[StringBuilder] identifier[artifactSubPath] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] identifier[coordinates] operator[SEP] identifier[getGroupId] operator[SEP] operator[SEP] operator[SEP] identifier[replace] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] identifier[coordinates] operator[SEP] identifier[getArtifactId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] identifier[coordinates] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] identifier[coordinates] operator[SEP] identifier[getArtifactId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] identifier[coordinates] operator[SEP] identifier[getVersion] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[coordinates] operator[SEP] identifier[getClassifier] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] identifier[coordinates] operator[SEP] identifier[getClassifier] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[artifactSubPath] operator[SEP] identifier[append] operator[SEP] identifier[coordinates] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[artifactSubPath] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] }
public String getCppName(Class<?> clazz) { ClassMapping mapping = mappingCache.get(clazz); Java4Cpp annotation = clazz.getAnnotation(Java4Cpp.class); if (mapping != null) { if (!Utils.isNullOrEmpty(mapping.getCppName())) { return mapping.getCppName(); } } if (annotation != null && !Utils.isNullOrEmpty(annotation.name())) { return annotation.name(); } return escapeName(clazz.getSimpleName()); }
class class_name[name] begin[{] method[getCppName, return_type[type[String]], modifier[public], parameter[clazz]] begin[{] local_variable[type[ClassMapping], mapping] local_variable[type[Java4Cpp], annotation] if[binary_operation[member[.mapping], !=, literal[null]]] begin[{] if[call[Utils.isNullOrEmpty, parameter[call[mapping.getCppName, parameter[]]]]] begin[{] return[call[mapping.getCppName, parameter[]]] else begin[{] None end[}] else begin[{] None end[}] if[binary_operation[binary_operation[member[.annotation], !=, literal[null]], &&, call[Utils.isNullOrEmpty, parameter[call[annotation.name, parameter[]]]]]] begin[{] return[call[annotation.name, parameter[]]] else begin[{] None end[}] return[call[.escapeName, parameter[call[clazz.getSimpleName, parameter[]]]]] end[}] END[}]
Keyword[public] identifier[String] identifier[getCppName] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] { identifier[ClassMapping] identifier[mapping] operator[=] identifier[mappingCache] operator[SEP] identifier[get] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] identifier[Java4Cpp] identifier[annotation] operator[=] identifier[clazz] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[Java4Cpp] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mapping] operator[!=] Other[null] operator[SEP] { Keyword[if] operator[SEP] operator[!] identifier[Utils] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[mapping] operator[SEP] identifier[getCppName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[mapping] operator[SEP] identifier[getCppName] operator[SEP] operator[SEP] operator[SEP] } } Keyword[if] operator[SEP] identifier[annotation] operator[!=] Other[null] operator[&&] operator[!] identifier[Utils] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[annotation] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[annotation] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[escapeName] operator[SEP] identifier[clazz] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
public Observable<ServiceResponse<VirtualMachineCaptureResultInner>> beginCaptureWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParameters parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (vmName == null) { throw new IllegalArgumentException("Parameter vmName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(parameters); return service.beginCapture(resourceGroupName, vmName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<VirtualMachineCaptureResultInner>>>() { @Override public Observable<ServiceResponse<VirtualMachineCaptureResultInner>> call(Response<ResponseBody> response) { try { ServiceResponse<VirtualMachineCaptureResultInner> clientResponse = beginCaptureDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); }
class class_name[name] begin[{] method[beginCaptureWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, vmName, parameters]] begin[{] if[binary_operation[member[.resourceGroupName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter resourceGroupName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.vmName], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter vmName is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.subscriptionId, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.subscriptionId() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.parameters], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter parameters is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[THIS[member[None.client]call[None.apiVersion, parameter[]]], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.apiVersion() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] call[Validator.validate, parameter[member[.parameters]]] return[call[service.beginCapture, parameter[member[.resourceGroupName], member[.vmName], THIS[member[None.client]call[None.subscriptionId, parameter[]]], member[.parameters], THIS[member[None.client]call[None.apiVersion, parameter[]]], THIS[member[None.client]call[None.acceptLanguage, parameter[]]], THIS[member[None.client]call[None.userAgent, parameter[]]]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[VirtualMachineCaptureResultInner] operator[>] operator[>] identifier[beginCaptureWithServiceResponseAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[vmName] , identifier[VirtualMachineCaptureParameters] identifier[parameters] operator[SEP] { Keyword[if] operator[SEP] identifier[resourceGroupName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[vmName] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[parameters] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[Validator] operator[SEP] identifier[validate] operator[SEP] identifier[parameters] operator[SEP] operator[SEP] Keyword[return] identifier[service] operator[SEP] identifier[beginCapture] operator[SEP] identifier[resourceGroupName] , identifier[vmName] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[subscriptionId] operator[SEP] operator[SEP] , identifier[parameters] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[apiVersion] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[acceptLanguage] operator[SEP] operator[SEP] , Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[userAgent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[flatMap] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[VirtualMachineCaptureResultInner] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[VirtualMachineCaptureResultInner] operator[>] operator[>] identifier[call] operator[SEP] identifier[Response] operator[<] identifier[ResponseBody] operator[>] identifier[response] operator[SEP] { Keyword[try] { identifier[ServiceResponse] operator[<] identifier[VirtualMachineCaptureResultInner] operator[>] identifier[clientResponse] operator[=] identifier[beginCaptureDelegate] operator[SEP] identifier[response] operator[SEP] operator[SEP] Keyword[return] identifier[Observable] operator[SEP] identifier[just] operator[SEP] identifier[clientResponse] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] { Keyword[return] identifier[Observable] operator[SEP] identifier[error] operator[SEP] identifier[t] operator[SEP] operator[SEP] } } } operator[SEP] operator[SEP] }
private void addPostParams(final Request request) { if (capacity != null) { request.addPostParam("Capacity", capacity.toString()); } if (available != null) { request.addPostParam("Available", available.toString()); } }
class class_name[name] begin[{] method[addPostParams, return_type[void], modifier[private], parameter[request]] begin[{] if[binary_operation[member[.capacity], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["Capacity"], call[capacity.toString, parameter[]]]] else begin[{] None end[}] if[binary_operation[member[.available], !=, literal[null]]] begin[{] call[request.addPostParam, parameter[literal["Available"], call[available.toString, parameter[]]]] else begin[{] None end[}] end[}] END[}]
Keyword[private] Keyword[void] identifier[addPostParams] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] { Keyword[if] operator[SEP] identifier[capacity] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[capacity] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[available] operator[!=] Other[null] operator[SEP] { identifier[request] operator[SEP] identifier[addPostParam] operator[SEP] literal[String] , identifier[available] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } }
public Transparency setTransparency(Boolean transparent) { Transparency prop = null; if (transparent != null) { prop = transparent ? Transparency.transparent() : Transparency.opaque(); } setTransparency(prop); return prop; }
class class_name[name] begin[{] method[setTransparency, return_type[type[Transparency]], modifier[public], parameter[transparent]] begin[{] local_variable[type[Transparency], prop] if[binary_operation[member[.transparent], !=, literal[null]]] begin[{] assign[member[.prop], TernaryExpression(condition=MemberReference(member=transparent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[], member=opaque, postfix_operators=[], prefix_operators=[], qualifier=Transparency, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[], member=transparent, postfix_operators=[], prefix_operators=[], qualifier=Transparency, selectors=[], type_arguments=None))] else begin[{] None end[}] call[.setTransparency, parameter[member[.prop]]] return[member[.prop]] end[}] END[}]
Keyword[public] identifier[Transparency] identifier[setTransparency] operator[SEP] identifier[Boolean] identifier[transparent] operator[SEP] { identifier[Transparency] identifier[prop] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[transparent] operator[!=] Other[null] operator[SEP] { identifier[prop] operator[=] identifier[transparent] operator[?] identifier[Transparency] operator[SEP] identifier[transparent] operator[SEP] operator[SEP] operator[:] identifier[Transparency] operator[SEP] identifier[opaque] operator[SEP] operator[SEP] operator[SEP] } identifier[setTransparency] operator[SEP] identifier[prop] operator[SEP] operator[SEP] Keyword[return] identifier[prop] operator[SEP] }
static Profile getProfileFromSystemProperties() { Profile result = null; // try to get system property String systemPropertyProfileName = System.getProperty(ProfilePropertyNames.PROFILE_SET_GLOBALLY_VIA_SYSTEM_PROPERTIES); if (systemPropertyProfileName != null) { // try to convert String to enum value try { result = Profile.valueOf(systemPropertyProfileName); } catch (IllegalArgumentException e) { logger.warn("Tracee ContextLoggerBuilder profile property ('" + ProfilePropertyNames.PROFILE_SET_GLOBALLY_VIA_SYSTEM_PROPERTIES + "') is set to the invalid value '" + systemPropertyProfileName + "' ==> Use default profile"); } } return result; }
class class_name[name] begin[{] method[getProfileFromSystemProperties, return_type[type[Profile]], modifier[static], parameter[]] begin[{] local_variable[type[Profile], result] local_variable[type[String], systemPropertyProfileName] if[binary_operation[member[.systemPropertyProfileName], !=, literal[null]]] begin[{] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=systemPropertyProfileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Profile, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Tracee ContextLoggerBuilder profile property ('"), operandr=MemberReference(member=PROFILE_SET_GLOBALLY_VIA_SYSTEM_PROPERTIES, postfix_operators=[], prefix_operators=[], qualifier=ProfilePropertyNames, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="') is set to the invalid value '"), operator=+), operandr=MemberReference(member=systemPropertyProfileName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' ==> Use default profile"), operator=+)], member=warn, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None) else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[static] identifier[Profile] identifier[getProfileFromSystemProperties] operator[SEP] operator[SEP] { identifier[Profile] identifier[result] operator[=] Other[null] operator[SEP] identifier[String] identifier[systemPropertyProfileName] operator[=] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] identifier[ProfilePropertyNames] operator[SEP] identifier[PROFILE_SET_GLOBALLY_VIA_SYSTEM_PROPERTIES] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[systemPropertyProfileName] operator[!=] Other[null] operator[SEP] { Keyword[try] { identifier[result] operator[=] identifier[Profile] operator[SEP] identifier[valueOf] operator[SEP] identifier[systemPropertyProfileName] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[e] operator[SEP] { identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[ProfilePropertyNames] operator[SEP] identifier[PROFILE_SET_GLOBALLY_VIA_SYSTEM_PROPERTIES] operator[+] literal[String] operator[+] identifier[systemPropertyProfileName] operator[+] literal[String] operator[SEP] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public static <T> String generateCommaSeparatedList(Collection<T> list) { if (list == null || list.size() == 0) { return ""; } StringBuilder result = new StringBuilder(); for (Object obj : list) { result.append(',').append(obj.toString()); } return result.length() == 0 ? "" : result.substring(1); }
class class_name[name] begin[{] method[generateCommaSeparatedList, return_type[type[String]], modifier[public static], parameter[list]] begin[{] if[binary_operation[binary_operation[member[.list], ==, literal[null]], ||, binary_operation[call[list.size, parameter[]], ==, literal[0]]]] begin[{] return[literal[""]] else begin[{] None end[}] local_variable[type[StringBuilder], result] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=',')], member=append, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=obj, selectors=[], type_arguments=None)], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=obj)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None) return[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""))] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[String] identifier[generateCommaSeparatedList] operator[SEP] identifier[Collection] operator[<] identifier[T] operator[>] identifier[list] operator[SEP] { Keyword[if] operator[SEP] identifier[list] operator[==] Other[null] operator[||] identifier[list] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[StringBuilder] identifier[result] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[obj] operator[:] identifier[list] operator[SEP] { identifier[result] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[obj] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[?] literal[String] operator[:] identifier[result] operator[SEP] identifier[substring] operator[SEP] Other[1] operator[SEP] operator[SEP] }
public static int parseNumericAddress(String ipaddr) { Matcher m = IP_ADDRESS_PATTERN.matcher(ipaddr); int ipInt = 0; if (m.find()) { for (int i = 1;i < 5;i++) try { int ipVal = Integer.valueOf(m.group(i)).intValue(); if ( ipVal < 0 || ipVal > 255) { return 0; } // Add to the integer address ipInt = (ipInt << 8) + ipVal; } catch (NumberFormatException ex) { return 0; } } // Return the integer address return ipInt; }
class class_name[name] begin[{] method[parseNumericAddress, return_type[type[int]], modifier[public static], parameter[ipaddr]] begin[{] local_variable[type[Matcher], m] local_variable[type[int], ipInt] if[call[m.find, parameter[]]] begin[{] ForStatement(body=TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=group, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[MethodInvocation(arguments=[], member=intValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=ipVal)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ipVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=<), operandr=BinaryOperation(operandl=MemberReference(member=ipVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=255), operator=>), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ipInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ipInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=<<), operandr=MemberReference(member=ipVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NumberFormatException']))], finally_block=None, label=None, resources=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) else begin[{] None end[}] return[member[.ipInt]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[int] identifier[parseNumericAddress] operator[SEP] identifier[String] identifier[ipaddr] operator[SEP] { identifier[Matcher] identifier[m] operator[=] identifier[IP_ADDRESS_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[ipaddr] operator[SEP] operator[SEP] Keyword[int] identifier[ipInt] operator[=] Other[0] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[SEP] identifier[find] operator[SEP] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[1] operator[SEP] identifier[i] operator[<] Other[5] operator[SEP] identifier[i] operator[++] operator[SEP] Keyword[try] { Keyword[int] identifier[ipVal] operator[=] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[m] operator[SEP] identifier[group] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ipVal] operator[<] Other[0] operator[||] identifier[ipVal] operator[>] Other[255] operator[SEP] { Keyword[return] Other[0] operator[SEP] } identifier[ipInt] operator[=] operator[SEP] identifier[ipInt] operator[<<] Other[8] operator[SEP] operator[+] identifier[ipVal] operator[SEP] } Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[ex] operator[SEP] { Keyword[return] Other[0] operator[SEP] } } Keyword[return] identifier[ipInt] operator[SEP] }
public java.util.List<ProcessorFeature> getProcessorFeatures() { if (processorFeatures == null) { processorFeatures = new com.amazonaws.internal.SdkInternalList<ProcessorFeature>(); } return processorFeatures; }
class class_name[name] begin[{] method[getProcessorFeatures, return_type[type[java]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.processorFeatures], ==, literal[null]]] begin[{] assign[member[.processorFeatures], ClassCreator(arguments=[], 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=ProcessorFeature, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))] else begin[{] None end[}] return[member[.processorFeatures]] end[}] END[}]
Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[ProcessorFeature] operator[>] identifier[getProcessorFeatures] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[processorFeatures] operator[==] Other[null] operator[SEP] { identifier[processorFeatures] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[ProcessorFeature] operator[>] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[processorFeatures] operator[SEP] }
public static Method[] findMethods(String[] namesAndDescriptors, Method[] methods) { Map map = new HashMap(); for (int i = 0; i < methods.length; i++) { Method method = methods[i]; map.put(method.getName() + Type.getMethodDescriptor(method), method); } Method[] result = new Method[namesAndDescriptors.length / 2]; for (int i = 0; i < result.length; i++) { result[i] = (Method)map.get(namesAndDescriptors[i * 2] + namesAndDescriptors[i * 2 + 1]); if (result[i] == null) { // TODO: error? } } return result; }
class class_name[name] begin[{] method[findMethods, return_type[type[Method]], modifier[public static], parameter[namesAndDescriptors, methods]] begin[{] local_variable[type[Map], map] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=methods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMethodDescriptor, postfix_operators=[], prefix_operators=[], qualifier=Type, selectors=[], type_arguments=None), operator=+), MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=methods, 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) local_variable[type[Method], result] 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=Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=namesAndDescriptors, 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=2), operator=*))]), operandr=MemberReference(member=namesAndDescriptors, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=*), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))]), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Method] operator[SEP] operator[SEP] identifier[findMethods] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[namesAndDescriptors] , identifier[Method] operator[SEP] operator[SEP] identifier[methods] operator[SEP] { identifier[Map] identifier[map] operator[=] Keyword[new] identifier[HashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[methods] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[Method] identifier[method] operator[=] identifier[methods] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[method] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] identifier[Type] operator[SEP] identifier[getMethodDescriptor] operator[SEP] identifier[method] operator[SEP] , identifier[method] operator[SEP] operator[SEP] } identifier[Method] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[Method] operator[SEP] identifier[namesAndDescriptors] operator[SEP] identifier[length] operator[/] Other[2] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[result] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] identifier[Method] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[namesAndDescriptors] operator[SEP] identifier[i] operator[*] Other[2] operator[SEP] operator[+] identifier[namesAndDescriptors] operator[SEP] identifier[i] operator[*] Other[2] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[SEP] { } } Keyword[return] identifier[result] operator[SEP] }
public List<File> processFiles() throws Exception { List<File> changed = new ArrayList<>(); for (File child : files) { File file = processFile(child); if (file != null) { changed.add(file); } } return changed; }
class class_name[name] begin[{] method[processFiles, return_type[type[List]], modifier[public], parameter[]] begin[{] local_variable[type[List], changed] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=child, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=file)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=changed, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=files, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=child)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=File, sub_type=None))), label=None) return[member[.changed]] end[}] END[}]
Keyword[public] identifier[List] operator[<] identifier[File] operator[>] identifier[processFiles] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] { identifier[List] operator[<] identifier[File] operator[>] identifier[changed] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[File] identifier[child] operator[:] identifier[files] operator[SEP] { identifier[File] identifier[file] operator[=] identifier[processFile] operator[SEP] identifier[child] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[file] operator[!=] Other[null] operator[SEP] { identifier[changed] operator[SEP] identifier[add] operator[SEP] identifier[file] operator[SEP] operator[SEP] } } Keyword[return] identifier[changed] operator[SEP] }
public static Map<CurrencyPair, Fee> adaptDynamicTradingFees( BitfinexTradingFeeResponse[] responses, List<CurrencyPair> currencyPairs) { Map<CurrencyPair, Fee> result = new HashMap<>(); for (BitfinexTradingFeeResponse response : responses) { BitfinexTradingFeeResponse.BitfinexTradingFeeResponseRow[] responseRows = response.getTradingFees(); for (BitfinexTradingFeeResponse.BitfinexTradingFeeResponseRow responseRow : responseRows) { Currency currency = Currency.getInstance(responseRow.getCurrency()); BigDecimal percentToFraction = BigDecimal.ONE.divide(BigDecimal.ONE.scaleByPowerOfTen(2)); Fee fee = new Fee( responseRow.getMakerFee().multiply(percentToFraction), responseRow.getTakerFee().multiply(percentToFraction)); for (CurrencyPair pair : currencyPairs) { // Fee to trade for a currency is the fee to trade currency pairs with this base. // Fee is typically assessed in units counter. if (pair.base.equals(currency)) { if (result.put(pair, fee) != null) { throw new IllegalStateException( "Fee for currency pair " + pair + " is overspecified"); } } } } } return result; }
class class_name[name] begin[{] method[adaptDynamicTradingFees, return_type[type[Map]], modifier[public static], parameter[responses, currencyPairs]] begin[{] local_variable[type[Map], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTradingFees, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None), name=responseRows)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=BitfinexTradingFeeResponse, sub_type=ReferenceType(arguments=None, dimensions=None, name=BitfinexTradingFeeResponseRow, sub_type=None))), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getCurrency, postfix_operators=[], prefix_operators=[], qualifier=responseRow, selectors=[], type_arguments=None)], member=getInstance, postfix_operators=[], prefix_operators=[], qualifier=Currency, selectors=[], type_arguments=None), name=currency)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Currency, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=scaleByPowerOfTen, postfix_operators=[], prefix_operators=[], qualifier=BigDecimal.ONE, selectors=[], type_arguments=None)], member=divide, postfix_operators=[], prefix_operators=[], qualifier=BigDecimal.ONE, selectors=[], type_arguments=None), name=percentToFraction)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getMakerFee, postfix_operators=[], prefix_operators=[], qualifier=responseRow, selectors=[MethodInvocation(arguments=[MemberReference(member=percentToFraction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=multiply, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getTakerFee, postfix_operators=[], prefix_operators=[], qualifier=responseRow, selectors=[MethodInvocation(arguments=[MemberReference(member=percentToFraction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=multiply, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Fee, sub_type=None)), name=fee)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Fee, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=currency, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=[], prefix_operators=[], qualifier=pair.base, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=pair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=fee, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Fee for currency pair "), operandr=MemberReference(member=pair, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" is overspecified"), 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)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=currencyPairs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pair)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CurrencyPair, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=responseRows, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=responseRow)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BitfinexTradingFeeResponse, sub_type=ReferenceType(arguments=None, dimensions=None, name=BitfinexTradingFeeResponseRow, sub_type=None)))), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=responses, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=response)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BitfinexTradingFeeResponse, sub_type=None))), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[CurrencyPair] , identifier[Fee] operator[>] identifier[adaptDynamicTradingFees] operator[SEP] identifier[BitfinexTradingFeeResponse] operator[SEP] operator[SEP] identifier[responses] , identifier[List] operator[<] identifier[CurrencyPair] operator[>] identifier[currencyPairs] operator[SEP] { identifier[Map] operator[<] identifier[CurrencyPair] , identifier[Fee] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[BitfinexTradingFeeResponse] identifier[response] operator[:] identifier[responses] operator[SEP] { identifier[BitfinexTradingFeeResponse] operator[SEP] identifier[BitfinexTradingFeeResponseRow] operator[SEP] operator[SEP] identifier[responseRows] operator[=] identifier[response] operator[SEP] identifier[getTradingFees] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[BitfinexTradingFeeResponse] operator[SEP] identifier[BitfinexTradingFeeResponseRow] identifier[responseRow] operator[:] identifier[responseRows] operator[SEP] { identifier[Currency] identifier[currency] operator[=] identifier[Currency] operator[SEP] identifier[getInstance] operator[SEP] identifier[responseRow] operator[SEP] identifier[getCurrency] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[BigDecimal] identifier[percentToFraction] operator[=] identifier[BigDecimal] operator[SEP] identifier[ONE] operator[SEP] identifier[divide] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[ONE] operator[SEP] identifier[scaleByPowerOfTen] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[Fee] identifier[fee] operator[=] Keyword[new] identifier[Fee] operator[SEP] identifier[responseRow] operator[SEP] identifier[getMakerFee] operator[SEP] operator[SEP] operator[SEP] identifier[multiply] operator[SEP] identifier[percentToFraction] operator[SEP] , identifier[responseRow] operator[SEP] identifier[getTakerFee] operator[SEP] operator[SEP] operator[SEP] identifier[multiply] operator[SEP] identifier[percentToFraction] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[CurrencyPair] identifier[pair] operator[:] identifier[currencyPairs] operator[SEP] { Keyword[if] operator[SEP] identifier[pair] operator[SEP] identifier[base] operator[SEP] identifier[equals] operator[SEP] identifier[currency] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[pair] , identifier[fee] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] identifier[pair] operator[+] literal[String] operator[SEP] operator[SEP] } } } } } Keyword[return] identifier[result] operator[SEP] }
public EEnum getIfcSoundScaleEnum() { if (ifcSoundScaleEnumEEnum == null) { ifcSoundScaleEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(899); } return ifcSoundScaleEnumEEnum; }
class class_name[name] begin[{] method[getIfcSoundScaleEnum, return_type[type[EEnum]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcSoundScaleEnumEEnum], ==, literal[null]]] begin[{] assign[member[.ifcSoundScaleEnumEEnum], 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=899)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EEnum, sub_type=None))] else begin[{] None end[}] return[member[.ifcSoundScaleEnumEEnum]] end[}] END[}]
Keyword[public] identifier[EEnum] identifier[getIfcSoundScaleEnum] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcSoundScaleEnumEEnum] operator[==] Other[null] operator[SEP] { identifier[ifcSoundScaleEnumEEnum] operator[=] operator[SEP] identifier[EEnum] 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[899] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcSoundScaleEnumEEnum] operator[SEP] }
public static Object resolveResponseObject(ResponseCommand responseCommand, String addr) throws RemotingException { preProcess(responseCommand, addr); if (responseCommand.getResponseStatus() == ResponseStatus.SUCCESS) { return toResponseObject(responseCommand); } else { String msg = String.format("Rpc invocation exception: %s, the address is %s, id=%s", responseCommand.getResponseStatus(), addr, responseCommand.getId()); logger.warn(msg); if (responseCommand.getCause() != null) { throw new InvokeException(msg, responseCommand.getCause()); } else { throw new InvokeException(msg + ", please check the server log for more."); } } }
class class_name[name] begin[{] method[resolveResponseObject, return_type[type[Object]], modifier[public static], parameter[responseCommand, addr]] begin[{] call[.preProcess, parameter[member[.responseCommand], member[.addr]]] if[binary_operation[call[responseCommand.getResponseStatus, parameter[]], ==, member[ResponseStatus.SUCCESS]]] begin[{] return[call[.toResponseObject, parameter[member[.responseCommand]]]] else begin[{] local_variable[type[String], msg] call[logger.warn, parameter[member[.msg]]] if[binary_operation[call[responseCommand.getCause, parameter[]], !=, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=responseCommand, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvokeException, sub_type=None)), label=None) else begin[{] ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=msg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=", please check the server log for more."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InvokeException, sub_type=None)), label=None) end[}] end[}] end[}] END[}]
Keyword[public] Keyword[static] identifier[Object] identifier[resolveResponseObject] operator[SEP] identifier[ResponseCommand] identifier[responseCommand] , identifier[String] identifier[addr] operator[SEP] Keyword[throws] identifier[RemotingException] { identifier[preProcess] operator[SEP] identifier[responseCommand] , identifier[addr] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[responseCommand] operator[SEP] identifier[getResponseStatus] operator[SEP] operator[SEP] operator[==] identifier[ResponseStatus] operator[SEP] identifier[SUCCESS] operator[SEP] { Keyword[return] identifier[toResponseObject] operator[SEP] identifier[responseCommand] operator[SEP] operator[SEP] } Keyword[else] { identifier[String] identifier[msg] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[responseCommand] operator[SEP] identifier[getResponseStatus] operator[SEP] operator[SEP] , identifier[addr] , identifier[responseCommand] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[warn] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[responseCommand] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[InvokeException] operator[SEP] identifier[msg] , identifier[responseCommand] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[InvokeException] operator[SEP] identifier[msg] operator[+] literal[String] operator[SEP] operator[SEP] } } }
protected static void generateWord(List<Vertex> linkedArray, WordNet wordNetOptimum) { fixResultByRule(linkedArray); //-------------------------------------------------------------------- // 建造新词网 wordNetOptimum.addAll(linkedArray); }
class class_name[name] begin[{] method[generateWord, return_type[void], modifier[static protected], parameter[linkedArray, wordNetOptimum]] begin[{] call[.fixResultByRule, parameter[member[.linkedArray]]] call[wordNetOptimum.addAll, parameter[member[.linkedArray]]] end[}] END[}]
Keyword[protected] Keyword[static] Keyword[void] identifier[generateWord] operator[SEP] identifier[List] operator[<] identifier[Vertex] operator[>] identifier[linkedArray] , identifier[WordNet] identifier[wordNetOptimum] operator[SEP] { identifier[fixResultByRule] operator[SEP] identifier[linkedArray] operator[SEP] operator[SEP] identifier[wordNetOptimum] operator[SEP] identifier[addAll] operator[SEP] identifier[linkedArray] operator[SEP] operator[SEP] }
private static String getMantissa(final String str, final int stopPos) { final char firstChar = str.charAt(0); final boolean hasSign = firstChar == '-' || firstChar == '+'; return hasSign ? str.substring(1, stopPos) : str.substring(0, stopPos); }
class class_name[name] begin[{] method[getMantissa, return_type[type[String]], modifier[private static], parameter[str, stopPos]] begin[{] local_variable[type[char], firstChar] local_variable[type[boolean], hasSign] return[TernaryExpression(condition=MemberReference(member=hasSign, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=stopPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), if_true=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), MemberReference(member=stopPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None))] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[getMantissa] operator[SEP] Keyword[final] identifier[String] identifier[str] , Keyword[final] Keyword[int] identifier[stopPos] operator[SEP] { Keyword[final] Keyword[char] identifier[firstChar] operator[=] identifier[str] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[final] Keyword[boolean] identifier[hasSign] operator[=] identifier[firstChar] operator[==] literal[String] operator[||] identifier[firstChar] operator[==] literal[String] operator[SEP] Keyword[return] identifier[hasSign] operator[?] identifier[str] operator[SEP] identifier[substring] operator[SEP] Other[1] , identifier[stopPos] operator[SEP] operator[:] identifier[str] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[stopPos] operator[SEP] operator[SEP] }
private boolean addResponsiveImageMediaFormats(MediaArgs mediaArgs) { Map<String, MediaFormat> additionalMediaFormats = new LinkedHashMap<>(); // check if additional on-the-fly generated media formats needs to be added for responsive image handling if (!resolveForImageSizes(mediaArgs, additionalMediaFormats)) { return false; } if (!resolveForResponsivePictureSources(mediaArgs, additionalMediaFormats)) { return false; } // if additional media formats where found add them to the media format list in media args if (!additionalMediaFormats.isEmpty()) { List<MediaFormat> allMediaFormats = new ArrayList<>(); if (mediaArgs.getMediaFormats() != null) { allMediaFormats.addAll(Arrays.asList(mediaArgs.getMediaFormats())); } allMediaFormats.addAll(additionalMediaFormats.values()); mediaArgs.mediaFormats(allMediaFormats.toArray(new MediaFormat[allMediaFormats.size()])); } return true; }
class class_name[name] begin[{] method[addResponsiveImageMediaFormats, return_type[type[boolean]], modifier[private], parameter[mediaArgs]] begin[{] local_variable[type[Map], additionalMediaFormats] if[call[.resolveForImageSizes, parameter[member[.mediaArgs], member[.additionalMediaFormats]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[.resolveForResponsivePictureSources, parameter[member[.mediaArgs], member[.additionalMediaFormats]]]] begin[{] return[literal[false]] else begin[{] None end[}] if[call[additionalMediaFormats.isEmpty, parameter[]]] begin[{] local_variable[type[List], allMediaFormats] if[binary_operation[call[mediaArgs.getMediaFormats, parameter[]], !=, literal[null]]] begin[{] call[allMediaFormats.addAll, parameter[call[Arrays.asList, parameter[call[mediaArgs.getMediaFormats, parameter[]]]]]] else begin[{] None end[}] call[allMediaFormats.addAll, parameter[call[additionalMediaFormats.values, parameter[]]]] call[mediaArgs.mediaFormats, parameter[call[allMediaFormats.toArray, parameter[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=allMediaFormats, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MediaFormat, sub_type=None))]]]] else begin[{] None end[}] return[literal[true]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[addResponsiveImageMediaFormats] operator[SEP] identifier[MediaArgs] identifier[mediaArgs] operator[SEP] { identifier[Map] operator[<] identifier[String] , identifier[MediaFormat] operator[>] identifier[additionalMediaFormats] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[resolveForImageSizes] operator[SEP] identifier[mediaArgs] , identifier[additionalMediaFormats] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[resolveForResponsivePictureSources] operator[SEP] identifier[mediaArgs] , identifier[additionalMediaFormats] operator[SEP] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[if] operator[SEP] operator[!] identifier[additionalMediaFormats] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] { identifier[List] operator[<] identifier[MediaFormat] operator[>] identifier[allMediaFormats] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mediaArgs] operator[SEP] identifier[getMediaFormats] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] { identifier[allMediaFormats] operator[SEP] identifier[addAll] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[mediaArgs] operator[SEP] identifier[getMediaFormats] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[allMediaFormats] operator[SEP] identifier[addAll] operator[SEP] identifier[additionalMediaFormats] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mediaArgs] operator[SEP] identifier[mediaFormats] operator[SEP] identifier[allMediaFormats] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[MediaFormat] operator[SEP] identifier[allMediaFormats] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] literal[boolean] operator[SEP] }
public EClass getIfcPlanarBox() { if (ifcPlanarBoxEClass == null) { ifcPlanarBoxEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(359); } return ifcPlanarBoxEClass; }
class class_name[name] begin[{] method[getIfcPlanarBox, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcPlanarBoxEClass], ==, literal[null]]] begin[{] assign[member[.ifcPlanarBoxEClass], 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=359)], 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[.ifcPlanarBoxEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcPlanarBox] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcPlanarBoxEClass] operator[==] Other[null] operator[SEP] { identifier[ifcPlanarBoxEClass] 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[359] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcPlanarBoxEClass] operator[SEP] }
private static String parseStandardRegionName(final String fragment) { Matcher matcher = S3_ENDPOINT_PATTERN.matcher(fragment); if (matcher.matches()) { // host was 'bucket.s3-[region].amazonaws.com'. return matcher.group(1); } matcher = STANDARD_CLOUDSEARCH_ENDPOINT_PATTERN.matcher(fragment); if (matcher.matches()) { // host was 'domain.[region].cloudsearch.amazonaws.com'. return matcher.group(1); } int index = fragment.lastIndexOf('.'); if (index == -1) { // host was 'service.amazonaws.com', guess us-east-1 // for lack of a better option. return "us-east-1"; } // host was 'service.[region].amazonaws.com'. String region = fragment.substring(index + 1); // Special case for iam.us-gov.amazonaws.com, which is actually // us-gov-west-1. if ("us-gov".equals(region)) { region = "us-gov-west-1"; } return region; }
class class_name[name] begin[{] method[parseStandardRegionName, return_type[type[String]], modifier[private static], parameter[fragment]] begin[{] local_variable[type[Matcher], matcher] if[call[matcher.matches, parameter[]]] begin[{] return[call[matcher.group, parameter[literal[1]]]] else begin[{] None end[}] assign[member[.matcher], call[STANDARD_CLOUDSEARCH_ENDPOINT_PATTERN.matcher, parameter[member[.fragment]]]] if[call[matcher.matches, parameter[]]] begin[{] return[call[matcher.group, parameter[literal[1]]]] else begin[{] None end[}] local_variable[type[int], index] if[binary_operation[member[.index], ==, literal[1]]] begin[{] return[literal["us-east-1"]] else begin[{] None end[}] local_variable[type[String], region] if[literal["us-gov"]] begin[{] assign[member[.region], literal["us-gov-west-1"]] else begin[{] None end[}] return[member[.region]] end[}] END[}]
Keyword[private] Keyword[static] identifier[String] identifier[parseStandardRegionName] operator[SEP] Keyword[final] identifier[String] identifier[fragment] operator[SEP] { identifier[Matcher] identifier[matcher] operator[=] identifier[S3_ENDPOINT_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[fragment] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] } identifier[matcher] operator[=] identifier[STANDARD_CLOUDSEARCH_ENDPOINT_PATTERN] operator[SEP] identifier[matcher] operator[SEP] identifier[fragment] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[matcher] operator[SEP] identifier[matches] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[matcher] operator[SEP] identifier[group] operator[SEP] Other[1] operator[SEP] operator[SEP] } Keyword[int] identifier[index] operator[=] identifier[fragment] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[==] operator[-] Other[1] operator[SEP] { Keyword[return] literal[String] operator[SEP] } identifier[String] identifier[region] operator[=] identifier[fragment] operator[SEP] identifier[substring] operator[SEP] identifier[index] operator[+] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[region] operator[SEP] operator[SEP] { identifier[region] operator[=] literal[String] operator[SEP] } Keyword[return] identifier[region] operator[SEP] }
@Override public void traverse(final ITreeNode<T> node, final List<ITreeNode<T>> list) { list.add(node); for (final ITreeNode<T> data : node.getChildren()) { traverse(data, list); } }
class class_name[name] begin[{] method[traverse, return_type[void], modifier[public], parameter[node, list]] begin[{] call[list.add, parameter[member[.node]]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=list, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=traverse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getChildren, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=data)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=ITreeNode, sub_type=None))), label=None) end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[traverse] operator[SEP] Keyword[final] identifier[ITreeNode] operator[<] identifier[T] operator[>] identifier[node] , Keyword[final] identifier[List] operator[<] identifier[ITreeNode] operator[<] identifier[T] operator[>] operator[>] identifier[list] operator[SEP] { identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[node] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[ITreeNode] operator[<] identifier[T] operator[>] identifier[data] operator[:] identifier[node] operator[SEP] identifier[getChildren] operator[SEP] operator[SEP] operator[SEP] { identifier[traverse] operator[SEP] identifier[data] , identifier[list] operator[SEP] operator[SEP] } }
public AuthenticationRequestBuilder getAuthorizationEndPoint() { for(Authentication auth : authentications.values()) { if (auth instanceof OAuth) { OAuth oauth = (OAuth) auth; return oauth.getAuthenticationRequestBuilder(); } } return null; }
class class_name[name] begin[{] method[getAuthorizationEndPoint, return_type[type[AuthenticationRequestBuilder]], modifier[public], parameter[]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=auth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=OAuth, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=auth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=OAuth, sub_type=None)), name=oauth)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=OAuth, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=getAuthenticationRequestBuilder, postfix_operators=[], prefix_operators=[], qualifier=oauth, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=authentications, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=auth)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Authentication, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[public] identifier[AuthenticationRequestBuilder] identifier[getAuthorizationEndPoint] operator[SEP] operator[SEP] { Keyword[for] operator[SEP] identifier[Authentication] identifier[auth] operator[:] identifier[authentications] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[auth] Keyword[instanceof] identifier[OAuth] operator[SEP] { identifier[OAuth] identifier[oauth] operator[=] operator[SEP] identifier[OAuth] operator[SEP] identifier[auth] operator[SEP] Keyword[return] identifier[oauth] operator[SEP] identifier[getAuthenticationRequestBuilder] operator[SEP] operator[SEP] operator[SEP] } } Keyword[return] Other[null] operator[SEP] }
public static double block_unsafe(GrayF64 integral , int x0 , int y0 , int x1 , int y1 ) { return ImplIntegralImageOps.block_unsafe(integral,x0,y0,x1,y1); }
class class_name[name] begin[{] method[block_unsafe, return_type[type[double]], modifier[public static], parameter[integral, x0, y0, x1, y1]] begin[{] return[call[ImplIntegralImageOps.block_unsafe, parameter[member[.integral], member[.x0], member[.y0], member[.x1], member[.y1]]]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[double] identifier[block_unsafe] operator[SEP] identifier[GrayF64] identifier[integral] , Keyword[int] identifier[x0] , Keyword[int] identifier[y0] , Keyword[int] identifier[x1] , Keyword[int] identifier[y1] operator[SEP] { Keyword[return] identifier[ImplIntegralImageOps] operator[SEP] identifier[block_unsafe] operator[SEP] identifier[integral] , identifier[x0] , identifier[y0] , identifier[x1] , identifier[y1] operator[SEP] operator[SEP] }
@NonNull public static Collection<ITypeface> getRegisteredFonts(@NonNull Context ctx) { init(ctx); return FONTS.values(); }
class class_name[name] begin[{] method[getRegisteredFonts, return_type[type[Collection]], modifier[public static], parameter[ctx]] begin[{] call[.init, parameter[member[.ctx]]] return[call[FONTS.values, parameter[]]] end[}] END[}]
annotation[@] identifier[NonNull] Keyword[public] Keyword[static] identifier[Collection] operator[<] identifier[ITypeface] operator[>] identifier[getRegisteredFonts] operator[SEP] annotation[@] identifier[NonNull] identifier[Context] identifier[ctx] operator[SEP] { identifier[init] operator[SEP] identifier[ctx] operator[SEP] operator[SEP] Keyword[return] identifier[FONTS] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] }
public static Class<?> findAnnotationDeclaringClass(Class<? extends Annotation> annotationType, Class<?> clazz) { Assert.notNull(annotationType, "Annotation type must not be null"); if (clazz == null || clazz.equals(Object.class)) { return null; } if (isAnnotationDeclaredLocally(annotationType, clazz)) { return clazz; } return findAnnotationDeclaringClass(annotationType, clazz.getSuperclass()); }
class class_name[name] begin[{] method[findAnnotationDeclaringClass, return_type[type[Class]], modifier[public static], parameter[annotationType, clazz]] begin[{] call[Assert.notNull, parameter[member[.annotationType], literal["Annotation type must not be null"]]] if[binary_operation[binary_operation[member[.clazz], ==, literal[null]], ||, call[clazz.equals, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]]] begin[{] return[literal[null]] else begin[{] None end[}] if[call[.isAnnotationDeclaredLocally, parameter[member[.annotationType], member[.clazz]]]] begin[{] return[member[.clazz]] else begin[{] None end[}] return[call[.findAnnotationDeclaringClass, parameter[member[.annotationType], call[clazz.getSuperclass, parameter[]]]]] end[}] END[}]
Keyword[public] Keyword[static] identifier[Class] operator[<] operator[?] operator[>] identifier[findAnnotationDeclaringClass] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[Annotation] operator[>] identifier[annotationType] , identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] { identifier[Assert] operator[SEP] identifier[notNull] operator[SEP] identifier[annotationType] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[clazz] operator[==] Other[null] operator[||] identifier[clazz] operator[SEP] identifier[equals] operator[SEP] identifier[Object] operator[SEP] Keyword[class] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[if] operator[SEP] identifier[isAnnotationDeclaredLocally] operator[SEP] identifier[annotationType] , identifier[clazz] operator[SEP] operator[SEP] { Keyword[return] identifier[clazz] operator[SEP] } Keyword[return] identifier[findAnnotationDeclaringClass] operator[SEP] identifier[annotationType] , identifier[clazz] operator[SEP] identifier[getSuperclass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
void markcanreach(State s, State okay, State mark) { Arc a; if (s.tmp != okay) { return; } s.tmp = mark; for (a = s.ins; a != null; a = a.inchain) { markcanreach(a.from, okay, mark); } }
class class_name[name] begin[{] method[markcanreach, return_type[void], modifier[default], parameter[s, okay, mark]] begin[{] local_variable[type[Arc], a] if[binary_operation[member[s.tmp], !=, member[.okay]]] begin[{] return[None] else begin[{] None end[}] assign[member[s.tmp], member[.mark]] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=from, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[]), MemberReference(member=okay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mark, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=markcanreach, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=[Assignment(expressionl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=ins, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[]))], update=[Assignment(expressionl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=inchain, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[]))]), label=None) end[}] END[}]
Keyword[void] identifier[markcanreach] operator[SEP] identifier[State] identifier[s] , identifier[State] identifier[okay] , identifier[State] identifier[mark] operator[SEP] { identifier[Arc] identifier[a] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[tmp] operator[!=] identifier[okay] operator[SEP] { Keyword[return] operator[SEP] } identifier[s] operator[SEP] identifier[tmp] operator[=] identifier[mark] operator[SEP] Keyword[for] operator[SEP] identifier[a] operator[=] identifier[s] operator[SEP] identifier[ins] operator[SEP] identifier[a] operator[!=] Other[null] operator[SEP] identifier[a] operator[=] identifier[a] operator[SEP] identifier[inchain] operator[SEP] { identifier[markcanreach] operator[SEP] identifier[a] operator[SEP] identifier[from] , identifier[okay] , identifier[mark] operator[SEP] operator[SEP] } }
@Override public SerializedRequestBuilder newRequestBuilder() { SerializedRequestBuilder b = new SerializedRequestBuilder(); return SerializedRequestBuilder.class.cast(b.resolver(FunctionResolver.DEFAULT)); }
class class_name[name] begin[{] method[newRequestBuilder, return_type[type[SerializedRequestBuilder]], modifier[public], parameter[]] begin[{] local_variable[type[SerializedRequestBuilder], b] return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=DEFAULT, postfix_operators=[], prefix_operators=[], qualifier=FunctionResolver, selectors=[])], member=resolver, postfix_operators=[], prefix_operators=[], qualifier=b, selectors=[], type_arguments=None)], member=cast, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=SerializedRequestBuilder, sub_type=None))] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[SerializedRequestBuilder] identifier[newRequestBuilder] operator[SEP] operator[SEP] { identifier[SerializedRequestBuilder] identifier[b] operator[=] Keyword[new] identifier[SerializedRequestBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[SerializedRequestBuilder] operator[SEP] Keyword[class] operator[SEP] identifier[cast] operator[SEP] identifier[b] operator[SEP] identifier[resolver] operator[SEP] identifier[FunctionResolver] operator[SEP] identifier[DEFAULT] operator[SEP] operator[SEP] operator[SEP] }
@Override public boolean offer(final E e) { if (null == e) { throw new NullPointerException(); } // use a cached view on consumer index (potentially updated in loop) final int mask = this.mask; final long capacity = mask + 1; long consumerIndexCache = lvConsumerIndexCache(); // LoadLoad long currentProducerIndex; do { currentProducerIndex = lvProducerIndex(); // LoadLoad final long wrapPoint = currentProducerIndex - capacity; if (consumerIndexCache <= wrapPoint) { final long currHead = lvConsumerIndex(); // LoadLoad if (currHead <= wrapPoint) { return false; // FULL :( } else { // update shared cached value of the consumerIndex svConsumerIndexCache(currHead); // StoreLoad // update on stack copy, we might need this value again if we lose the CAS. consumerIndexCache = currHead; } } } while (!casProducerIndex(currentProducerIndex, currentProducerIndex + 1)); /* * NOTE: the new producer index value is made visible BEFORE the element in the array. If we relied on * the index visibility to poll() we would need to handle the case where the element is not visible. */ // Won CAS, move on to storing final int offset = calcElementOffset(currentProducerIndex, mask); soElement(offset, e); // StoreStore return true; // AWESOME :) }
class class_name[name] begin[{] method[offer, return_type[type[boolean]], modifier[public], parameter[e]] begin[{] if[binary_operation[literal[null], ==, member[.e]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None) else begin[{] None end[}] local_variable[type[int], mask] local_variable[type[long], capacity] local_variable[type[long], consumerIndexCache] local_variable[type[long], currentProducerIndex] do[call[.casProducerIndex, parameter[member[.currentProducerIndex], binary_operation[member[.currentProducerIndex], +, literal[1]]]]] begin[{] assign[member[.currentProducerIndex], call[.lvProducerIndex, parameter[]]] local_variable[type[long], wrapPoint] if[binary_operation[member[.consumerIndexCache], <=, member[.wrapPoint]]] begin[{] local_variable[type[long], currHead] if[binary_operation[member[.currHead], <=, member[.wrapPoint]]] begin[{] return[literal[false]] else begin[{] call[.svConsumerIndexCache, parameter[member[.currHead]]] assign[member[.consumerIndexCache], member[.currHead]] end[}] else begin[{] None end[}] end[}] local_variable[type[int], offset] call[.soElement, parameter[member[.offset], member[.e]]] return[literal[true]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[offer] operator[SEP] Keyword[final] identifier[E] identifier[e] operator[SEP] { Keyword[if] operator[SEP] Other[null] operator[==] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] operator[SEP] operator[SEP] } Keyword[final] Keyword[int] identifier[mask] operator[=] Keyword[this] operator[SEP] identifier[mask] operator[SEP] Keyword[final] Keyword[long] identifier[capacity] operator[=] identifier[mask] operator[+] Other[1] operator[SEP] Keyword[long] identifier[consumerIndexCache] operator[=] identifier[lvConsumerIndexCache] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[currentProducerIndex] operator[SEP] Keyword[do] { identifier[currentProducerIndex] operator[=] identifier[lvProducerIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[wrapPoint] operator[=] identifier[currentProducerIndex] operator[-] identifier[capacity] operator[SEP] Keyword[if] operator[SEP] identifier[consumerIndexCache] operator[<=] identifier[wrapPoint] operator[SEP] { Keyword[final] Keyword[long] identifier[currHead] operator[=] identifier[lvConsumerIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currHead] operator[<=] identifier[wrapPoint] operator[SEP] { Keyword[return] literal[boolean] operator[SEP] } Keyword[else] { identifier[svConsumerIndexCache] operator[SEP] identifier[currHead] operator[SEP] operator[SEP] identifier[consumerIndexCache] operator[=] identifier[currHead] operator[SEP] } } } Keyword[while] operator[SEP] operator[!] identifier[casProducerIndex] operator[SEP] identifier[currentProducerIndex] , identifier[currentProducerIndex] operator[+] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[offset] operator[=] identifier[calcElementOffset] operator[SEP] identifier[currentProducerIndex] , identifier[mask] operator[SEP] operator[SEP] identifier[soElement] operator[SEP] identifier[offset] , identifier[e] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] }
public Tile getRight() { int x = tileX + 1; if (x > getMaxTileNumber(this.zoomLevel)) { x = 0; } return new Tile(x, this.tileY, this.zoomLevel, this.tileSize); }
class class_name[name] begin[{] method[getRight, return_type[type[Tile]], modifier[public], parameter[]] begin[{] local_variable[type[int], x] if[binary_operation[member[.x], >, call[.getMaxTileNumber, parameter[THIS[member[None.zoomLevel]]]]]] begin[{] assign[member[.x], literal[0]] else begin[{] None end[}] return[ClassCreator(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=tileY, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=zoomLevel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=tileSize, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Tile, sub_type=None))] end[}] END[}]
Keyword[public] identifier[Tile] identifier[getRight] operator[SEP] operator[SEP] { Keyword[int] identifier[x] operator[=] identifier[tileX] operator[+] Other[1] operator[SEP] Keyword[if] operator[SEP] identifier[x] operator[>] identifier[getMaxTileNumber] operator[SEP] Keyword[this] operator[SEP] identifier[zoomLevel] operator[SEP] operator[SEP] { identifier[x] operator[=] Other[0] operator[SEP] } Keyword[return] Keyword[new] identifier[Tile] operator[SEP] identifier[x] , Keyword[this] operator[SEP] identifier[tileY] , Keyword[this] operator[SEP] identifier[zoomLevel] , Keyword[this] operator[SEP] identifier[tileSize] operator[SEP] operator[SEP] }
private boolean isDownloadPDF(Map<String, String> map) { return StringUtils.hasText(map.get(RequestElements.REQ_PARAM_ENTITY_SELECTOR)) && map.get(RequestElements.REQ_PARAM_ENTITY_SELECTOR).equalsIgnoreCase(ContentTypes.PDF.name()); }
class class_name[name] begin[{] method[isDownloadPDF, return_type[type[boolean]], modifier[private], parameter[map]] begin[{] return[binary_operation[call[StringUtils.hasText, parameter[call[map.get, parameter[member[RequestElements.REQ_PARAM_ENTITY_SELECTOR]]]]], &&, call[map.get, parameter[member[RequestElements.REQ_PARAM_ENTITY_SELECTOR]]]]] end[}] END[}]
Keyword[private] Keyword[boolean] identifier[isDownloadPDF] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[map] operator[SEP] { Keyword[return] identifier[StringUtils] operator[SEP] identifier[hasText] operator[SEP] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[RequestElements] operator[SEP] identifier[REQ_PARAM_ENTITY_SELECTOR] operator[SEP] operator[SEP] operator[&&] identifier[map] operator[SEP] identifier[get] operator[SEP] identifier[RequestElements] operator[SEP] identifier[REQ_PARAM_ENTITY_SELECTOR] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[ContentTypes] operator[SEP] identifier[PDF] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] operator[SEP] }
@Nonnull public static String getRepeated (final char cElement, @Nonnegative final int nRepeats) { ValueEnforcer.isGE0 (nRepeats, "Repeats"); if (nRepeats == 0) return ""; if (nRepeats == 1) return Character.toString (cElement); final char [] aElement = new char [nRepeats]; Arrays.fill (aElement, cElement); return new String (aElement); }
class class_name[name] begin[{] method[getRepeated, return_type[type[String]], modifier[public static], parameter[cElement, nRepeats]] begin[{] call[ValueEnforcer.isGE0, parameter[member[.nRepeats], literal["Repeats"]]] if[binary_operation[member[.nRepeats], ==, literal[0]]] begin[{] return[literal[""]] else begin[{] None end[}] if[binary_operation[member[.nRepeats], ==, literal[1]]] begin[{] return[call[Character.toString, parameter[member[.cElement]]]] else begin[{] None end[}] local_variable[type[char], aElement] call[Arrays.fill, parameter[member[.aElement], member[.cElement]]] return[ClassCreator(arguments=[MemberReference(member=aElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))] end[}] END[}]
annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[String] identifier[getRepeated] operator[SEP] Keyword[final] Keyword[char] identifier[cElement] , annotation[@] identifier[Nonnegative] Keyword[final] Keyword[int] identifier[nRepeats] operator[SEP] { identifier[ValueEnforcer] operator[SEP] identifier[isGE0] operator[SEP] identifier[nRepeats] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nRepeats] operator[==] Other[0] operator[SEP] Keyword[return] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[nRepeats] operator[==] Other[1] operator[SEP] Keyword[return] identifier[Character] operator[SEP] identifier[toString] operator[SEP] identifier[cElement] operator[SEP] operator[SEP] Keyword[final] Keyword[char] operator[SEP] operator[SEP] identifier[aElement] operator[=] Keyword[new] Keyword[char] operator[SEP] identifier[nRepeats] operator[SEP] operator[SEP] identifier[Arrays] operator[SEP] identifier[fill] operator[SEP] identifier[aElement] , identifier[cElement] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[aElement] operator[SEP] operator[SEP] }
public static long[] unshuffleLongArray(byte[] input) throws IOException { long[] output = new long[input.length / 8]; int numProcessed = impl.unshuffle(input, 0, 8, input.length, output, 0); assert(numProcessed == input.length); return output; }
class class_name[name] begin[{] method[unshuffleLongArray, return_type[type[long]], modifier[public static], parameter[input]] begin[{] local_variable[type[long], output] local_variable[type[int], numProcessed] AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=numProcessed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[]), operator===), label=None, value=None) return[member[.output]] end[}] END[}]
Keyword[public] Keyword[static] Keyword[long] operator[SEP] operator[SEP] identifier[unshuffleLongArray] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[input] operator[SEP] Keyword[throws] identifier[IOException] { Keyword[long] operator[SEP] operator[SEP] identifier[output] operator[=] Keyword[new] Keyword[long] operator[SEP] identifier[input] operator[SEP] identifier[length] operator[/] Other[8] operator[SEP] operator[SEP] Keyword[int] identifier[numProcessed] operator[=] identifier[impl] operator[SEP] identifier[unshuffle] operator[SEP] identifier[input] , Other[0] , Other[8] , identifier[input] operator[SEP] identifier[length] , identifier[output] , Other[0] operator[SEP] operator[SEP] Keyword[assert] operator[SEP] identifier[numProcessed] operator[==] identifier[input] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[return] identifier[output] operator[SEP] }
private static BinaryMemcacheRequest handleRemoveRequest(final RemoveRequest msg) { byte[] key = msg.keyBytes(); short keyLength = (short) key.length; BinaryMemcacheRequest request = new DefaultBinaryMemcacheRequest(key); request.setOpcode(OP_REMOVE); request.setCAS(msg.cas()); request.setKeyLength(keyLength); request.setTotalBodyLength(keyLength); return request; }
class class_name[name] begin[{] method[handleRemoveRequest, return_type[type[BinaryMemcacheRequest]], modifier[private static], parameter[msg]] begin[{] local_variable[type[byte], key] local_variable[type[short], keyLength] local_variable[type[BinaryMemcacheRequest], request] call[request.setOpcode, parameter[member[.OP_REMOVE]]] call[request.setCAS, parameter[call[msg.cas, parameter[]]]] call[request.setKeyLength, parameter[member[.keyLength]]] call[request.setTotalBodyLength, parameter[member[.keyLength]]] return[member[.request]] end[}] END[}]
Keyword[private] Keyword[static] identifier[BinaryMemcacheRequest] identifier[handleRemoveRequest] operator[SEP] Keyword[final] identifier[RemoveRequest] identifier[msg] operator[SEP] { Keyword[byte] operator[SEP] operator[SEP] identifier[key] operator[=] identifier[msg] operator[SEP] identifier[keyBytes] operator[SEP] operator[SEP] operator[SEP] Keyword[short] identifier[keyLength] operator[=] operator[SEP] Keyword[short] operator[SEP] identifier[key] operator[SEP] identifier[length] operator[SEP] identifier[BinaryMemcacheRequest] identifier[request] operator[=] Keyword[new] identifier[DefaultBinaryMemcacheRequest] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setOpcode] operator[SEP] identifier[OP_REMOVE] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setCAS] operator[SEP] identifier[msg] operator[SEP] identifier[cas] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setKeyLength] operator[SEP] identifier[keyLength] operator[SEP] operator[SEP] identifier[request] operator[SEP] identifier[setTotalBodyLength] operator[SEP] identifier[keyLength] operator[SEP] operator[SEP] Keyword[return] identifier[request] operator[SEP] }
private static boolean isPosix() { Method getDefaultMethod = ZTZipReflectionUtil.getDeclaredMethod( ZTZipReflectionUtil.getClassForName("java.nio.file.FileSystems", Object.class), "getDefault"); Method supportedFileAttributeViewsMethod = ZTZipReflectionUtil.getDeclaredMethod( ZTZipReflectionUtil.getClassForName("java.nio.file.FileSystem", Object.class), "supportedFileAttributeViews"); Object fileSystem = ZTZipReflectionUtil.invoke(getDefaultMethod, null); @SuppressWarnings("unchecked") Set<String> views = (Set<String>) ZTZipReflectionUtil.invoke(supportedFileAttributeViewsMethod, fileSystem); return views.contains("posix"); }
class class_name[name] begin[{] method[isPosix, return_type[type[boolean]], modifier[private static], parameter[]] begin[{] local_variable[type[Method], getDefaultMethod] local_variable[type[Method], supportedFileAttributeViewsMethod] local_variable[type[Object], fileSystem] local_variable[type[Set], views] return[call[views.contains, parameter[literal["posix"]]]] end[}] END[}]
Keyword[private] Keyword[static] Keyword[boolean] identifier[isPosix] operator[SEP] operator[SEP] { identifier[Method] identifier[getDefaultMethod] operator[=] identifier[ZTZipReflectionUtil] operator[SEP] identifier[getDeclaredMethod] operator[SEP] identifier[ZTZipReflectionUtil] operator[SEP] identifier[getClassForName] operator[SEP] literal[String] , identifier[Object] operator[SEP] Keyword[class] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[Method] identifier[supportedFileAttributeViewsMethod] operator[=] identifier[ZTZipReflectionUtil] operator[SEP] identifier[getDeclaredMethod] operator[SEP] identifier[ZTZipReflectionUtil] operator[SEP] identifier[getClassForName] operator[SEP] literal[String] , identifier[Object] operator[SEP] Keyword[class] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[Object] identifier[fileSystem] operator[=] identifier[ZTZipReflectionUtil] operator[SEP] identifier[invoke] operator[SEP] identifier[getDefaultMethod] , Other[null] operator[SEP] operator[SEP] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[views] operator[=] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] operator[SEP] identifier[ZTZipReflectionUtil] operator[SEP] identifier[invoke] operator[SEP] identifier[supportedFileAttributeViewsMethod] , identifier[fileSystem] operator[SEP] operator[SEP] Keyword[return] identifier[views] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] }
public void init(ModeledAuthenticatedUser currentUser, ActiveConnectionRecord activeConnectionRecord, boolean includeSensitiveInformation) { super.init(currentUser); this.connectionRecord = activeConnectionRecord; // Copy all non-sensitive data from given record this.connection = activeConnectionRecord.getConnection(); this.sharingProfileIdentifier = activeConnectionRecord.getSharingProfileIdentifier(); this.identifier = activeConnectionRecord.getUUID().toString(); this.startDate = activeConnectionRecord.getStartDate(); // Include sensitive data, too, if requested if (includeSensitiveInformation) { this.remoteHost = activeConnectionRecord.getRemoteHost(); this.tunnel = activeConnectionRecord.getTunnel(); this.username = activeConnectionRecord.getUsername(); } }
class class_name[name] begin[{] method[init, return_type[void], modifier[public], parameter[currentUser, activeConnectionRecord, includeSensitiveInformation]] begin[{] SuperMethodInvocation(arguments=[MemberReference(member=currentUser, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=init, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None) assign[THIS[member[None.connectionRecord]], member[.activeConnectionRecord]] assign[THIS[member[None.connection]], call[activeConnectionRecord.getConnection, parameter[]]] assign[THIS[member[None.sharingProfileIdentifier]], call[activeConnectionRecord.getSharingProfileIdentifier, parameter[]]] assign[THIS[member[None.identifier]], call[activeConnectionRecord.getUUID, parameter[]]] assign[THIS[member[None.startDate]], call[activeConnectionRecord.getStartDate, parameter[]]] if[member[.includeSensitiveInformation]] begin[{] assign[THIS[member[None.remoteHost]], call[activeConnectionRecord.getRemoteHost, parameter[]]] assign[THIS[member[None.tunnel]], call[activeConnectionRecord.getTunnel, parameter[]]] assign[THIS[member[None.username]], call[activeConnectionRecord.getUsername, parameter[]]] else begin[{] None end[}] end[}] END[}]
Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[ModeledAuthenticatedUser] identifier[currentUser] , identifier[ActiveConnectionRecord] identifier[activeConnectionRecord] , Keyword[boolean] identifier[includeSensitiveInformation] operator[SEP] { Keyword[super] operator[SEP] identifier[init] operator[SEP] identifier[currentUser] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[connectionRecord] operator[=] identifier[activeConnectionRecord] operator[SEP] Keyword[this] operator[SEP] identifier[connection] operator[=] identifier[activeConnectionRecord] operator[SEP] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[sharingProfileIdentifier] operator[=] identifier[activeConnectionRecord] operator[SEP] identifier[getSharingProfileIdentifier] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[identifier] operator[=] identifier[activeConnectionRecord] operator[SEP] identifier[getUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[startDate] operator[=] identifier[activeConnectionRecord] operator[SEP] identifier[getStartDate] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[includeSensitiveInformation] operator[SEP] { Keyword[this] operator[SEP] identifier[remoteHost] operator[=] identifier[activeConnectionRecord] operator[SEP] identifier[getRemoteHost] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[tunnel] operator[=] identifier[activeConnectionRecord] operator[SEP] identifier[getTunnel] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[username] operator[=] identifier[activeConnectionRecord] operator[SEP] identifier[getUsername] operator[SEP] operator[SEP] operator[SEP] } }
public EmbeddedGobblin useStateStore(String rootDir) { this.setConfiguration(ConfigurationKeys.STATE_STORE_ENABLED, "true"); this.setConfiguration(ConfigurationKeys.STATE_STORE_ROOT_DIR_KEY, rootDir); return this; }
class class_name[name] begin[{] method[useStateStore, return_type[type[EmbeddedGobblin]], modifier[public], parameter[rootDir]] begin[{] THIS[call[None.setConfiguration, parameter[member[ConfigurationKeys.STATE_STORE_ENABLED], literal["true"]]]] THIS[call[None.setConfiguration, parameter[member[ConfigurationKeys.STATE_STORE_ROOT_DIR_KEY], member[.rootDir]]]] return[THIS[]] end[}] END[}]
Keyword[public] identifier[EmbeddedGobblin] identifier[useStateStore] operator[SEP] identifier[String] identifier[rootDir] operator[SEP] { Keyword[this] operator[SEP] identifier[setConfiguration] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[STATE_STORE_ENABLED] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[setConfiguration] operator[SEP] identifier[ConfigurationKeys] operator[SEP] identifier[STATE_STORE_ROOT_DIR_KEY] , identifier[rootDir] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public int getStatementCount() { int ret = 0; for (final StatementGroup sg : statementGroups) { ret += sg.getAllStatements().size(); } return ret; }
class class_name[name] begin[{] method[getStatementCount, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[int], ret] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=ret, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getAllStatements, postfix_operators=[], prefix_operators=[], qualifier=sg, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=statementGroups, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=sg)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=StatementGroup, sub_type=None))), label=None) return[member[.ret]] end[}] END[}]
Keyword[public] Keyword[int] identifier[getStatementCount] operator[SEP] operator[SEP] { Keyword[int] identifier[ret] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[StatementGroup] identifier[sg] operator[:] identifier[statementGroups] operator[SEP] { identifier[ret] operator[+=] identifier[sg] operator[SEP] identifier[getAllStatements] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[ret] operator[SEP] }
@Override public void addProcedure(Procedure procedure) { // TODO: verification of behaviour model // known behaviour -> accept // unknown behaviour -> issue warning // provide context procedure.setCoordinator(this); procedure.setStatementScope(dialogState); procedure.setRuntimeAPI(this); procedures.add(procedure); }
class class_name[name] begin[{] method[addProcedure, return_type[void], modifier[public], parameter[procedure]] begin[{] call[procedure.setCoordinator, parameter[THIS[]]] call[procedure.setStatementScope, parameter[member[.dialogState]]] call[procedure.setRuntimeAPI, parameter[THIS[]]] call[procedures.add, parameter[member[.procedure]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addProcedure] operator[SEP] identifier[Procedure] identifier[procedure] operator[SEP] { identifier[procedure] operator[SEP] identifier[setCoordinator] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[procedure] operator[SEP] identifier[setStatementScope] operator[SEP] identifier[dialogState] operator[SEP] operator[SEP] identifier[procedure] operator[SEP] identifier[setRuntimeAPI] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[procedures] operator[SEP] identifier[add] operator[SEP] identifier[procedure] operator[SEP] operator[SEP] }
public synchronized void addItem(T item) { synchronized (items) { items.add(item); } // clusterMarker.setMarkerBitmap(); if (center == null) { center = item.getLatLong(); } else { // computing the centroid double lat = 0, lon = 0; int n = 0; synchronized (items) { for (T object : items) { if (object == null) { throw new NullPointerException("object == null"); } if (object.getLatLong() == null) { throw new NullPointerException("object.getLatLong() == null"); } lat += object.getLatLong().latitude; lon += object.getLatLong().longitude; n++; } } center = new LatLong(lat / n, lon / n); } }
class class_name[name] begin[{] method[addItem, return_type[void], modifier[synchronized public], parameter[item]] begin[{] SYNCHRONIZED[member[.items]] BEGIN[{] call[items.add, parameter[member[.item]]] END[}] if[binary_operation[member[.center], ==, literal[null]]] begin[{] assign[member[.center], call[item.getLatLong, parameter[]]] else begin[{] local_variable[type[double], lat] local_variable[type[int], n] SYNCHRONIZED[member[.items]] BEGIN[{] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="object == null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLatLong, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="object.getLatLong() == null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getLatLong, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[MemberReference(member=latitude, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=lon, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=getLatLong, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[MemberReference(member=longitude, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=n, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=items, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))), label=None) END[}] assign[member[.center], ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=lat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), BinaryOperation(operandl=MemberReference(member=lon, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, 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=LatLong, sub_type=None))] end[}] end[}] END[}]
Keyword[public] Keyword[synchronized] Keyword[void] identifier[addItem] operator[SEP] identifier[T] identifier[item] operator[SEP] { Keyword[synchronized] operator[SEP] identifier[items] operator[SEP] { identifier[items] operator[SEP] identifier[add] operator[SEP] identifier[item] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[center] operator[==] Other[null] operator[SEP] { identifier[center] operator[=] identifier[item] operator[SEP] identifier[getLatLong] operator[SEP] operator[SEP] operator[SEP] } Keyword[else] { Keyword[double] identifier[lat] operator[=] Other[0] , identifier[lon] operator[=] Other[0] operator[SEP] Keyword[int] identifier[n] operator[=] Other[0] operator[SEP] Keyword[synchronized] operator[SEP] identifier[items] operator[SEP] { Keyword[for] operator[SEP] identifier[T] identifier[object] operator[:] identifier[items] operator[SEP] { Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[object] operator[SEP] identifier[getLatLong] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[lat] operator[+=] identifier[object] operator[SEP] identifier[getLatLong] operator[SEP] operator[SEP] operator[SEP] identifier[latitude] operator[SEP] identifier[lon] operator[+=] identifier[object] operator[SEP] identifier[getLatLong] operator[SEP] operator[SEP] operator[SEP] identifier[longitude] operator[SEP] identifier[n] operator[++] operator[SEP] } } identifier[center] operator[=] Keyword[new] identifier[LatLong] operator[SEP] identifier[lat] operator[/] identifier[n] , identifier[lon] operator[/] identifier[n] operator[SEP] operator[SEP] } }
public void onReceivedAuthCode(String code, String baseDomain) { if (authType == AUTH_TYPE_WEBVIEW) { oauthView.setVisibility(View.INVISIBLE); } startMakingOAuthAPICall(code, baseDomain); }
class class_name[name] begin[{] method[onReceivedAuthCode, return_type[void], modifier[public], parameter[code, baseDomain]] begin[{] if[binary_operation[member[.authType], ==, member[.AUTH_TYPE_WEBVIEW]]] begin[{] call[oauthView.setVisibility, parameter[member[View.INVISIBLE]]] else begin[{] None end[}] call[.startMakingOAuthAPICall, parameter[member[.code], member[.baseDomain]]] end[}] END[}]
Keyword[public] Keyword[void] identifier[onReceivedAuthCode] operator[SEP] identifier[String] identifier[code] , identifier[String] identifier[baseDomain] operator[SEP] { Keyword[if] operator[SEP] identifier[authType] operator[==] identifier[AUTH_TYPE_WEBVIEW] operator[SEP] { identifier[oauthView] operator[SEP] identifier[setVisibility] operator[SEP] identifier[View] operator[SEP] identifier[INVISIBLE] operator[SEP] operator[SEP] } identifier[startMakingOAuthAPICall] operator[SEP] identifier[code] , identifier[baseDomain] operator[SEP] operator[SEP] }
protected ObjectManagerByteArrayOutputStream serialize(java.io.Serializable serializableObject) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "serialize", new Object[] { serializableObject }); ObjectManagerByteArrayOutputStream byteArrayOutputStream = new ObjectManagerByteArrayOutputStream(); try { java.io.ObjectOutputStream objectOutputStream = new java.io.ObjectOutputStream(byteArrayOutputStream); objectOutputStream.writeObject(serializableObject); objectOutputStream.close(); } catch (java.io.IOException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(this, cclass, "serialize", exception, "1:303:1.8"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "serialize", exception); throw new PermanentIOException(this, exception); } // catch. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "serialize", new Object[] { byteArrayOutputStream }); return byteArrayOutputStream; }
class class_name[name] begin[{] method[serialize, return_type[type[ObjectManagerByteArrayOutputStream]], modifier[protected], parameter[serializableObject]] begin[{] if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{] call[trace.entry, parameter[THIS[], member[.cclass], literal["serialize"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=serializableObject, 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[ObjectManagerByteArrayOutputStream], byteArrayOutputStream] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=byteArrayOutputStream, 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=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=io, sub_type=ReferenceType(arguments=None, dimensions=None, name=ObjectOutputStream, sub_type=None)))), name=objectOutputStream)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=io, sub_type=ReferenceType(arguments=None, dimensions=None, name=ObjectOutputStream, sub_type=None)))), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=serializableObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=objectOutputStream, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=objectOutputStream, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=cclass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="serialize"), MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="1:303:1.8")], member=processException, postfix_operators=[], prefix_operators=[], qualifier=ObjectManager.ffdc, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=Tracing, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEntryEnabled, postfix_operators=[], prefix_operators=[], qualifier=trace, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=cclass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="serialize"), MemberReference(member=exception, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exit, postfix_operators=[], prefix_operators=[], qualifier=trace, selectors=[], type_arguments=None), label=None)), ThrowStatement(expression=ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=exception, 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=PermanentIOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=exception, types=['java.io.IOException']))], finally_block=None, label=None, resources=None) if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{] call[trace.exit, parameter[THIS[], member[.cclass], literal["serialize"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[MemberReference(member=byteArrayOutputStream, 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[.byteArrayOutputStream]] end[}] END[}]
Keyword[protected] identifier[ObjectManagerByteArrayOutputStream] identifier[serialize] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[Serializable] identifier[serializableObject] 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[serializableObject] } operator[SEP] operator[SEP] identifier[ObjectManagerByteArrayOutputStream] identifier[byteArrayOutputStream] operator[=] Keyword[new] identifier[ObjectManagerByteArrayOutputStream] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[ObjectOutputStream] identifier[objectOutputStream] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[ObjectOutputStream] operator[SEP] identifier[byteArrayOutputStream] operator[SEP] operator[SEP] identifier[objectOutputStream] operator[SEP] identifier[writeObject] operator[SEP] identifier[serializableObject] operator[SEP] operator[SEP] identifier[objectOutputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[IOException] identifier[exception] operator[SEP] { identifier[ObjectManager] operator[SEP] identifier[ffdc] operator[SEP] identifier[processException] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] , identifier[exception] , literal[String] 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] , identifier[exception] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[PermanentIOException] operator[SEP] Keyword[this] , identifier[exception] 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[byteArrayOutputStream] } operator[SEP] operator[SEP] Keyword[return] identifier[byteArrayOutputStream] operator[SEP] }
protected Transformer getTransformer() { TransformerFactory transformerFactory = domXmlDataFormat.getTransformerFactory(); try { Transformer transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2"); return transformer; } catch (TransformerConfigurationException e) { throw LOG.unableToCreateTransformer(e); } }
class class_name[name] begin[{] method[getTransformer, return_type[type[Transformer]], modifier[protected], parameter[]] begin[{] local_variable[type[TransformerFactory], transformerFactory] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=newTransformer, postfix_operators=[], prefix_operators=[], qualifier=transformerFactory, selectors=[], type_arguments=None), name=transformer)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Transformer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ENCODING, postfix_operators=[], prefix_operators=[], qualifier=OutputKeys, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], member=setOutputProperty, postfix_operators=[], prefix_operators=[], qualifier=transformer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=INDENT, postfix_operators=[], prefix_operators=[], qualifier=OutputKeys, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="yes")], member=setOutputProperty, postfix_operators=[], prefix_operators=[], qualifier=transformer, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="{http://xml.apache.org/xslt}indent-amount"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="2")], member=setOutputProperty, postfix_operators=[], prefix_operators=[], qualifier=transformer, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=transformer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unableToCreateTransformer, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TransformerConfigurationException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[protected] identifier[Transformer] identifier[getTransformer] operator[SEP] operator[SEP] { identifier[TransformerFactory] identifier[transformerFactory] operator[=] identifier[domXmlDataFormat] operator[SEP] identifier[getTransformerFactory] operator[SEP] operator[SEP] operator[SEP] Keyword[try] { identifier[Transformer] identifier[transformer] operator[=] identifier[transformerFactory] operator[SEP] identifier[newTransformer] operator[SEP] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[setOutputProperty] operator[SEP] identifier[OutputKeys] operator[SEP] identifier[ENCODING] , literal[String] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[setOutputProperty] operator[SEP] identifier[OutputKeys] operator[SEP] identifier[INDENT] , literal[String] operator[SEP] operator[SEP] identifier[transformer] operator[SEP] identifier[setOutputProperty] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[transformer] operator[SEP] } Keyword[catch] operator[SEP] identifier[TransformerConfigurationException] identifier[e] operator[SEP] { Keyword[throw] identifier[LOG] operator[SEP] identifier[unableToCreateTransformer] operator[SEP] identifier[e] operator[SEP] operator[SEP] } }
public Deferred<Boolean> processTSMetaThroughTrees(final TSMeta meta) { if (config.enable_tree_processing()) { return TreeBuilder.processAllTrees(this, meta); } return Deferred.fromResult(false); }
class class_name[name] begin[{] method[processTSMetaThroughTrees, return_type[type[Deferred]], modifier[public], parameter[meta]] begin[{] if[call[config.enable_tree_processing, parameter[]]] begin[{] return[call[TreeBuilder.processAllTrees, parameter[THIS[], member[.meta]]]] else begin[{] None end[}] return[call[Deferred.fromResult, parameter[literal[false]]]] end[}] END[}]
Keyword[public] identifier[Deferred] operator[<] identifier[Boolean] operator[>] identifier[processTSMetaThroughTrees] operator[SEP] Keyword[final] identifier[TSMeta] identifier[meta] operator[SEP] { Keyword[if] operator[SEP] identifier[config] operator[SEP] identifier[enable_tree_processing] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[TreeBuilder] operator[SEP] identifier[processAllTrees] operator[SEP] Keyword[this] , identifier[meta] operator[SEP] operator[SEP] } Keyword[return] identifier[Deferred] operator[SEP] identifier[fromResult] operator[SEP] literal[boolean] operator[SEP] operator[SEP] }
public OrMessageFilter add(IFeedbackMessageFilter... filters) { for (IFeedbackMessageFilter filter : filters) { this.filters.add(filter); } return this; }
class class_name[name] begin[{] method[add, return_type[type[OrMessageFilter]], modifier[public], parameter[filters]] begin[{] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=filters, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=filter, 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=filters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=filter)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IFeedbackMessageFilter, sub_type=None))), label=None) return[THIS[]] end[}] END[}]
Keyword[public] identifier[OrMessageFilter] identifier[add] operator[SEP] identifier[IFeedbackMessageFilter] operator[...] identifier[filters] operator[SEP] { Keyword[for] operator[SEP] identifier[IFeedbackMessageFilter] identifier[filter] operator[:] identifier[filters] operator[SEP] { Keyword[this] operator[SEP] identifier[filters] operator[SEP] identifier[add] operator[SEP] identifier[filter] operator[SEP] operator[SEP] } Keyword[return] Keyword[this] operator[SEP] }
protected boolean isSupported(ProfileRequestContext<?, ?> context, String uri, List<String> assuranceURIs) { return assuranceURIs.contains(uri); }
class class_name[name] begin[{] method[isSupported, return_type[type[boolean]], modifier[protected], parameter[context, uri, assuranceURIs]] begin[{] return[call[assuranceURIs.contains, parameter[member[.uri]]]] end[}] END[}]
Keyword[protected] Keyword[boolean] identifier[isSupported] operator[SEP] identifier[ProfileRequestContext] operator[<] operator[?] , operator[?] operator[>] identifier[context] , identifier[String] identifier[uri] , identifier[List] operator[<] identifier[String] operator[>] identifier[assuranceURIs] operator[SEP] { Keyword[return] identifier[assuranceURIs] operator[SEP] identifier[contains] operator[SEP] identifier[uri] operator[SEP] operator[SEP] }
public Result<V,E> get( K key, Refresher<? super K,? extends V,? extends E> refresher ) { Result<V,E> result = get(key); if(result == null) result = put(key, refresher); return result; }
class class_name[name] begin[{] method[get, return_type[type[Result]], modifier[public], parameter[key, refresher]] begin[{] local_variable[type[Result], result] if[binary_operation[member[.result], ==, literal[null]]] begin[{] assign[member[.result], call[.put, parameter[member[.key], member[.refresher]]]] else begin[{] None end[}] return[member[.result]] end[}] END[}]
Keyword[public] identifier[Result] operator[<] identifier[V] , identifier[E] operator[>] identifier[get] operator[SEP] identifier[K] identifier[key] , identifier[Refresher] operator[<] operator[?] Keyword[super] identifier[K] , operator[?] Keyword[extends] identifier[V] , operator[?] Keyword[extends] identifier[E] operator[>] identifier[refresher] operator[SEP] { identifier[Result] operator[<] identifier[V] , identifier[E] operator[>] identifier[result] operator[=] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] identifier[result] operator[=] identifier[put] operator[SEP] identifier[key] , identifier[refresher] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[SEP] }
public static TileMatrixSet createTileTableWithMetadata( GeoPackageCore geoPackage, String tableName, BoundingBox contentsBoundingBox, long contentsSrsId, BoundingBox tileMatrixSetBoundingBox, long tileMatrixSetSrsId) { TileMatrixSet tileMatrixSet = geoPackage.createTileTableWithMetadata( ContentsDataType.GRIDDED_COVERAGE, tableName, contentsBoundingBox, contentsSrsId, tileMatrixSetBoundingBox, tileMatrixSetSrsId); return tileMatrixSet; }
class class_name[name] begin[{] method[createTileTableWithMetadata, return_type[type[TileMatrixSet]], modifier[public static], parameter[geoPackage, tableName, contentsBoundingBox, contentsSrsId, tileMatrixSetBoundingBox, tileMatrixSetSrsId]] begin[{] local_variable[type[TileMatrixSet], tileMatrixSet] return[member[.tileMatrixSet]] end[}] END[}]
Keyword[public] Keyword[static] identifier[TileMatrixSet] identifier[createTileTableWithMetadata] operator[SEP] identifier[GeoPackageCore] identifier[geoPackage] , identifier[String] identifier[tableName] , identifier[BoundingBox] identifier[contentsBoundingBox] , Keyword[long] identifier[contentsSrsId] , identifier[BoundingBox] identifier[tileMatrixSetBoundingBox] , Keyword[long] identifier[tileMatrixSetSrsId] operator[SEP] { identifier[TileMatrixSet] identifier[tileMatrixSet] operator[=] identifier[geoPackage] operator[SEP] identifier[createTileTableWithMetadata] operator[SEP] identifier[ContentsDataType] operator[SEP] identifier[GRIDDED_COVERAGE] , identifier[tableName] , identifier[contentsBoundingBox] , identifier[contentsSrsId] , identifier[tileMatrixSetBoundingBox] , identifier[tileMatrixSetSrsId] operator[SEP] operator[SEP] Keyword[return] identifier[tileMatrixSet] operator[SEP] }
public Observable<VariableInner> createOrUpdateAsync(String resourceGroupName, String automationAccountName, String variableName, VariableCreateOrUpdateParameters parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, automationAccountName, variableName, parameters).map(new Func1<ServiceResponse<VariableInner>, VariableInner>() { @Override public VariableInner call(ServiceResponse<VariableInner> response) { return response.body(); } }); }
class class_name[name] begin[{] method[createOrUpdateAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, automationAccountName, variableName, parameters]] begin[{] return[call[.createOrUpdateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.automationAccountName], member[.variableName], member[.parameters]]]] end[}] END[}]
Keyword[public] identifier[Observable] operator[<] identifier[VariableInner] operator[>] identifier[createOrUpdateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[automationAccountName] , identifier[String] identifier[variableName] , identifier[VariableCreateOrUpdateParameters] identifier[parameters] operator[SEP] { Keyword[return] identifier[createOrUpdateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[automationAccountName] , identifier[variableName] , identifier[parameters] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[VariableInner] operator[>] , identifier[VariableInner] operator[>] operator[SEP] operator[SEP] { annotation[@] identifier[Override] Keyword[public] identifier[VariableInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[VariableInner] operator[>] identifier[response] operator[SEP] { Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] } } operator[SEP] operator[SEP] }
private StringBuilder idProcessing(final TmdbParameters params) { StringBuilder urlString = new StringBuilder(); // Append the ID if (params.has(Param.ID)) { urlString.append("/").append(params.get(Param.ID)); } if (params.has(Param.SEASON_NUMBER)) { urlString.append("/season/").append(params.get(Param.SEASON_NUMBER)); } if (params.has(Param.EPISODE_NUMBER)) { urlString.append("/episode/").append(params.get(Param.EPISODE_NUMBER)); } if (submethod != MethodSub.NONE) { urlString.append("/").append(submethod.getValue()); } // Append the key information urlString.append(DELIMITER_FIRST) .append(Param.API_KEY.getValue()) .append(apiKey); return urlString; }
class class_name[name] begin[{] method[idProcessing, return_type[type[StringBuilder]], modifier[private], parameter[params]] begin[{] local_variable[type[StringBuilder], urlString] if[call[params.has, parameter[member[Param.ID]]]] begin[{] call[urlString.append, parameter[literal["/"]]] else begin[{] None end[}] if[call[params.has, parameter[member[Param.SEASON_NUMBER]]]] begin[{] call[urlString.append, parameter[literal["/season/"]]] else begin[{] None end[}] if[call[params.has, parameter[member[Param.EPISODE_NUMBER]]]] begin[{] call[urlString.append, parameter[literal["/episode/"]]] else begin[{] None end[}] if[binary_operation[member[.submethod], !=, member[MethodSub.NONE]]] begin[{] call[urlString.append, parameter[literal["/"]]] else begin[{] None end[}] call[urlString.append, parameter[member[.DELIMITER_FIRST]]] return[member[.urlString]] end[}] END[}]
Keyword[private] identifier[StringBuilder] identifier[idProcessing] operator[SEP] Keyword[final] identifier[TmdbParameters] identifier[params] operator[SEP] { identifier[StringBuilder] identifier[urlString] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[params] operator[SEP] identifier[has] operator[SEP] identifier[Param] operator[SEP] identifier[ID] operator[SEP] operator[SEP] { identifier[urlString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[params] operator[SEP] identifier[get] operator[SEP] identifier[Param] operator[SEP] identifier[ID] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[params] operator[SEP] identifier[has] operator[SEP] identifier[Param] operator[SEP] identifier[SEASON_NUMBER] operator[SEP] operator[SEP] { identifier[urlString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[params] operator[SEP] identifier[get] operator[SEP] identifier[Param] operator[SEP] identifier[SEASON_NUMBER] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[params] operator[SEP] identifier[has] operator[SEP] identifier[Param] operator[SEP] identifier[EPISODE_NUMBER] operator[SEP] operator[SEP] { identifier[urlString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[params] operator[SEP] identifier[get] operator[SEP] identifier[Param] operator[SEP] identifier[EPISODE_NUMBER] operator[SEP] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[submethod] operator[!=] identifier[MethodSub] operator[SEP] identifier[NONE] operator[SEP] { identifier[urlString] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[submethod] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] } identifier[urlString] operator[SEP] identifier[append] operator[SEP] identifier[DELIMITER_FIRST] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[Param] operator[SEP] identifier[API_KEY] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[apiKey] operator[SEP] operator[SEP] Keyword[return] identifier[urlString] operator[SEP] }
public static BitStore asStore(SortedSet<Integer> set, int start, int finish, boolean mutable) { if (set == null) throw new IllegalArgumentException("null set"); if (start < 0L) throw new IllegalArgumentException("negative start"); if (finish < start) throw new IllegalArgumentException("start exceeds finish"); set = set.subSet(start, finish); return new IntSetBitStore(set, start, finish, mutable); }
class class_name[name] begin[{] method[asStore, return_type[type[BitStore]], modifier[public static], parameter[set, start, finish, mutable]] begin[{] if[binary_operation[member[.set], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="null set")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.start], <, literal[0L]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="negative start")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[member[.finish], <, member[.start]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="start exceeds finish")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None) else begin[{] None end[}] assign[member[.set], call[set.subSet, parameter[member[.start], member[.finish]]]] return[ClassCreator(arguments=[MemberReference(member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=finish, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mutable, 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=IntSetBitStore, sub_type=None))] end[}] END[}]
Keyword[public] Keyword[static] identifier[BitStore] identifier[asStore] operator[SEP] identifier[SortedSet] operator[<] identifier[Integer] operator[>] identifier[set] , Keyword[int] identifier[start] , Keyword[int] identifier[finish] , Keyword[boolean] identifier[mutable] operator[SEP] { Keyword[if] operator[SEP] identifier[set] operator[==] Other[null] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[start] operator[<] Other[0L] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[finish] operator[<] identifier[start] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[set] operator[=] identifier[set] operator[SEP] identifier[subSet] operator[SEP] identifier[start] , identifier[finish] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[IntSetBitStore] operator[SEP] identifier[set] , identifier[start] , identifier[finish] , identifier[mutable] operator[SEP] operator[SEP] }
@Override public ProxyBuilder<T> setDiscoveryQos(final DiscoveryQos discoveryQos) throws DiscoveryException { if (discoveryQos.getDiscoveryTimeoutMs() < 0 && discoveryQos.getDiscoveryTimeoutMs() != DiscoveryQos.NO_VALUE) { throw new DiscoveryException("Discovery timeout cannot be less than zero"); } if (discoveryQos.getRetryIntervalMs() < 0 && discoveryQos.getRetryIntervalMs() != DiscoveryQos.NO_VALUE) { throw new DiscoveryException("Discovery retry interval cannot be less than zero"); } applyDefaultValues(discoveryQos); this.discoveryQos = discoveryQos; // TODO which interfaceName should be used here? arbitrator = ArbitratorFactory.create(domains, interfaceName, interfaceVersion, discoveryQos, localDiscoveryAggregator); return this; }
class class_name[name] begin[{] method[setDiscoveryQos, return_type[type[ProxyBuilder]], modifier[public], parameter[discoveryQos]] begin[{] if[binary_operation[binary_operation[call[discoveryQos.getDiscoveryTimeoutMs, parameter[]], <, literal[0]], &&, binary_operation[call[discoveryQos.getDiscoveryTimeoutMs, parameter[]], !=, member[DiscoveryQos.NO_VALUE]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Discovery timeout cannot be less than zero")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DiscoveryException, sub_type=None)), label=None) else begin[{] None end[}] if[binary_operation[binary_operation[call[discoveryQos.getRetryIntervalMs, parameter[]], <, literal[0]], &&, binary_operation[call[discoveryQos.getRetryIntervalMs, parameter[]], !=, member[DiscoveryQos.NO_VALUE]]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Discovery retry interval cannot be less than zero")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DiscoveryException, sub_type=None)), label=None) else begin[{] None end[}] call[.applyDefaultValues, parameter[member[.discoveryQos]]] assign[THIS[member[None.discoveryQos]], member[.discoveryQos]] assign[member[.arbitrator], call[ArbitratorFactory.create, parameter[member[.domains], member[.interfaceName], member[.interfaceVersion], member[.discoveryQos], member[.localDiscoveryAggregator]]]] return[THIS[]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] identifier[ProxyBuilder] operator[<] identifier[T] operator[>] identifier[setDiscoveryQos] operator[SEP] Keyword[final] identifier[DiscoveryQos] identifier[discoveryQos] operator[SEP] Keyword[throws] identifier[DiscoveryException] { Keyword[if] operator[SEP] identifier[discoveryQos] operator[SEP] identifier[getDiscoveryTimeoutMs] operator[SEP] operator[SEP] operator[<] Other[0] operator[&&] identifier[discoveryQos] operator[SEP] identifier[getDiscoveryTimeoutMs] operator[SEP] operator[SEP] operator[!=] identifier[DiscoveryQos] operator[SEP] identifier[NO_VALUE] operator[SEP] { Keyword[throw] Keyword[new] identifier[DiscoveryException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[if] operator[SEP] identifier[discoveryQos] operator[SEP] identifier[getRetryIntervalMs] operator[SEP] operator[SEP] operator[<] Other[0] operator[&&] identifier[discoveryQos] operator[SEP] identifier[getRetryIntervalMs] operator[SEP] operator[SEP] operator[!=] identifier[DiscoveryQos] operator[SEP] identifier[NO_VALUE] operator[SEP] { Keyword[throw] Keyword[new] identifier[DiscoveryException] operator[SEP] literal[String] operator[SEP] operator[SEP] } identifier[applyDefaultValues] operator[SEP] identifier[discoveryQos] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[discoveryQos] operator[=] identifier[discoveryQos] operator[SEP] identifier[arbitrator] operator[=] identifier[ArbitratorFactory] operator[SEP] identifier[create] operator[SEP] identifier[domains] , identifier[interfaceName] , identifier[interfaceVersion] , identifier[discoveryQos] , identifier[localDiscoveryAggregator] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] }
public ResponseMessage getNextMessage(long time, TimeUnit timeunit) { try { Object m = rqueue.poll(time, timeunit); if (m == null) { return null; } else if (m instanceof ResponseMessage) { return (ResponseMessage) m; } else if (m instanceof TapAck) { TapAck ack = (TapAck) m; tapAck(ack.getConn(), ack.getNode(), ack.getOpcode(), ack.getOpaque(), ack.getCallback()); return null; } else { throw new RuntimeException("Unexpected tap message type"); } } catch (InterruptedException e) { shutdown(); return null; } }
class class_name[name] begin[{] method[getNextMessage, return_type[type[ResponseMessage]], modifier[public], parameter[time, timeunit]] begin[{] TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=time, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=timeunit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=poll, postfix_operators=[], prefix_operators=[], qualifier=rqueue, selectors=[], type_arguments=None), name=m)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=ResponseMessage, sub_type=None), operator=instanceof), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=TapAck, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected tap message type")], 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, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=TapAck, sub_type=None)), name=ack)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TapAck, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getConn, postfix_operators=[], prefix_operators=[], qualifier=ack, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getNode, postfix_operators=[], prefix_operators=[], qualifier=ack, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getOpcode, postfix_operators=[], prefix_operators=[], qualifier=ack, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getOpaque, postfix_operators=[], prefix_operators=[], qualifier=ack, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getCallback, postfix_operators=[], prefix_operators=[], qualifier=ack, selectors=[], type_arguments=None)], member=tapAck, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Cast(expression=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=ResponseMessage, sub_type=None)), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=shutdown, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InterruptedException']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] identifier[ResponseMessage] identifier[getNextMessage] operator[SEP] Keyword[long] identifier[time] , identifier[TimeUnit] identifier[timeunit] operator[SEP] { Keyword[try] { identifier[Object] identifier[m] operator[=] identifier[rqueue] operator[SEP] identifier[poll] operator[SEP] identifier[time] , identifier[timeunit] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m] operator[==] Other[null] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[m] Keyword[instanceof] identifier[ResponseMessage] operator[SEP] { Keyword[return] operator[SEP] identifier[ResponseMessage] operator[SEP] identifier[m] operator[SEP] } Keyword[else] Keyword[if] operator[SEP] identifier[m] Keyword[instanceof] identifier[TapAck] operator[SEP] { identifier[TapAck] identifier[ack] operator[=] operator[SEP] identifier[TapAck] operator[SEP] identifier[m] operator[SEP] identifier[tapAck] operator[SEP] identifier[ack] operator[SEP] identifier[getConn] operator[SEP] operator[SEP] , identifier[ack] operator[SEP] identifier[getNode] operator[SEP] operator[SEP] , identifier[ack] operator[SEP] identifier[getOpcode] operator[SEP] operator[SEP] , identifier[ack] operator[SEP] identifier[getOpaque] operator[SEP] operator[SEP] , identifier[ack] operator[SEP] identifier[getCallback] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } Keyword[else] { Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] literal[String] operator[SEP] operator[SEP] } } Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[e] operator[SEP] { identifier[shutdown] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] } }
protected void handleConfigureResponseFailure(MemberState member, ConfigureRequest request, Throwable error) { // Log the failed attempt to contact the member. failAttempt(member, error); }
class class_name[name] begin[{] method[handleConfigureResponseFailure, return_type[void], modifier[protected], parameter[member, request, error]] begin[{] call[.failAttempt, parameter[member[.member], member[.error]]] end[}] END[}]
Keyword[protected] Keyword[void] identifier[handleConfigureResponseFailure] operator[SEP] identifier[MemberState] identifier[member] , identifier[ConfigureRequest] identifier[request] , identifier[Throwable] identifier[error] operator[SEP] { identifier[failAttempt] operator[SEP] identifier[member] , identifier[error] operator[SEP] operator[SEP] }
public void marshall(ModifyWorkspaceStateRequest modifyWorkspaceStateRequest, ProtocolMarshaller protocolMarshaller) { if (modifyWorkspaceStateRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(modifyWorkspaceStateRequest.getWorkspaceId(), WORKSPACEID_BINDING); protocolMarshaller.marshall(modifyWorkspaceStateRequest.getWorkspaceState(), WORKSPACESTATE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
class class_name[name] begin[{] method[marshall, return_type[void], modifier[public], parameter[modifyWorkspaceStateRequest, protocolMarshaller]] begin[{] if[binary_operation[member[.modifyWorkspaceStateRequest], ==, literal[null]]] begin[{] ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Invalid argument passed to marshall(...)")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None) else begin[{] None end[}] TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWorkspaceId, postfix_operators=[], prefix_operators=[], qualifier=modifyWorkspaceStateRequest, selectors=[], type_arguments=None), MemberReference(member=WORKSPACEID_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getWorkspaceState, postfix_operators=[], prefix_operators=[], qualifier=modifyWorkspaceStateRequest, selectors=[], type_arguments=None), MemberReference(member=WORKSPACESTATE_BINDING, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=marshall, postfix_operators=[], prefix_operators=[], qualifier=protocolMarshaller, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to marshall request to JSON: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SdkClientException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) end[}] END[}]
Keyword[public] Keyword[void] identifier[marshall] operator[SEP] identifier[ModifyWorkspaceStateRequest] identifier[modifyWorkspaceStateRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] { Keyword[if] operator[SEP] identifier[modifyWorkspaceStateRequest] operator[==] Other[null] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[SEP] operator[SEP] } Keyword[try] { identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[modifyWorkspaceStateRequest] operator[SEP] identifier[getWorkspaceId] operator[SEP] operator[SEP] , identifier[WORKSPACEID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[modifyWorkspaceStateRequest] operator[SEP] identifier[getWorkspaceState] operator[SEP] operator[SEP] , identifier[WORKSPACESTATE_BINDING] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP] } }
private String extractNamespace(Node call, String... primitiveNames) { Node callee = call.getFirstChild(); if (!callee.isGetProp()) { return null; } for (String primitiveName : primitiveNames) { if (callee.matchesQualifiedName(primitiveName)) { Node target = callee.getNext(); if (target != null && target.isString()) { return target.getString(); } } } return null; }
class class_name[name] begin[{] method[extractNamespace, return_type[type[String]], modifier[private], parameter[call, primitiveNames]] begin[{] local_variable[type[Node], callee] if[call[callee.isGetProp, parameter[]]] begin[{] return[literal[null]] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=primitiveName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matchesQualifiedName, postfix_operators=[], prefix_operators=[], qualifier=callee, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getNext, postfix_operators=[], prefix_operators=[], qualifier=callee, selectors=[], type_arguments=None), name=target)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=target, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isString, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getString, postfix_operators=[], prefix_operators=[], qualifier=target, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=primitiveNames, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=primitiveName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None) return[literal[null]] end[}] END[}]
Keyword[private] identifier[String] identifier[extractNamespace] operator[SEP] identifier[Node] identifier[call] , identifier[String] operator[...] identifier[primitiveNames] operator[SEP] { identifier[Node] identifier[callee] operator[=] identifier[call] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[callee] operator[SEP] identifier[isGetProp] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] Other[null] operator[SEP] } Keyword[for] operator[SEP] identifier[String] identifier[primitiveName] operator[:] identifier[primitiveNames] operator[SEP] { Keyword[if] operator[SEP] identifier[callee] operator[SEP] identifier[matchesQualifiedName] operator[SEP] identifier[primitiveName] operator[SEP] operator[SEP] { identifier[Node] identifier[target] operator[=] identifier[callee] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[target] operator[!=] Other[null] operator[&&] identifier[target] operator[SEP] identifier[isString] operator[SEP] operator[SEP] operator[SEP] { Keyword[return] identifier[target] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] } } } Keyword[return] Other[null] operator[SEP] }
public int size() { int result = 0; // sum over all inner maps for ( Iterator<K1> keys1 = maps.keySet().iterator(); keys1.hasNext(); ) { Map2<K2,K3,V> inner_map = maps.get(keys1.next()); result += inner_map.size(); } return result; }
class class_name[name] begin[{] method[size, return_type[type[int]], modifier[public], parameter[]] begin[{] local_variable[type[int], result] ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=keys1, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=maps, selectors=[], type_arguments=None), name=inner_map)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K2, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K3, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=Map2, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=inner_map, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=keys1, selectors=[], type_arguments=None), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=maps, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=keys1)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K1, sub_type=None))], dimensions=[], name=Iterator, sub_type=None)), update=None), label=None) return[member[.result]] end[}] END[}]
Keyword[public] Keyword[int] identifier[size] operator[SEP] operator[SEP] { Keyword[int] identifier[result] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[Iterator] operator[<] identifier[K1] operator[>] identifier[keys1] operator[=] identifier[maps] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[keys1] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] { identifier[Map2] operator[<] identifier[K2] , identifier[K3] , identifier[V] operator[>] identifier[inner_map] operator[=] identifier[maps] operator[SEP] identifier[get] operator[SEP] identifier[keys1] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[+=] identifier[inner_map] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] } Keyword[return] identifier[result] operator[SEP] }
public int pushSegment(Segment seg) { assert (m_input_segments.size() < 2); m_input_segments.add(newIntersectionPart_(seg)); // m_param_1.resize(15); // m_param_2.resize(15); return (int) m_input_segments.size() - 1; }
class class_name[name] begin[{] method[pushSegment, return_type[type[int]], modifier[public], parameter[seg]] begin[{] AssertStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=m_input_segments, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=<), label=None, value=None) call[m_input_segments.add, parameter[call[.newIntersectionPart_, parameter[member[.seg]]]]] return[binary_operation[Cast(expression=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=m_input_segments, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int)), -, literal[1]]] end[}] END[}]
Keyword[public] Keyword[int] identifier[pushSegment] operator[SEP] identifier[Segment] identifier[seg] operator[SEP] { Keyword[assert] operator[SEP] identifier[m_input_segments] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] Other[2] operator[SEP] operator[SEP] identifier[m_input_segments] operator[SEP] identifier[add] operator[SEP] identifier[newIntersectionPart_] operator[SEP] identifier[seg] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[int] operator[SEP] identifier[m_input_segments] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] }
@Nullable public static CalendarDate parseUdunitsOrIso(String calendarName, String isoOrUdunits) { CalendarDate result; try { result = parseISOformat(calendarName, isoOrUdunits); } catch (Exception e) { try { result = parseUdunits(calendarName, isoOrUdunits); } catch (Exception e2) { return null; } } return result; }
class class_name[name] begin[{] method[parseUdunitsOrIso, return_type[type[CalendarDate]], modifier[public static], parameter[calendarName, isoOrUdunits]] begin[{] local_variable[type[CalendarDate], result] TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=calendarName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isoOrUdunits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseISOformat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=calendarName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=isoOrUdunits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseUdunits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e2, types=['Exception']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None) return[member[.result]] end[}] END[}]
annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[CalendarDate] identifier[parseUdunitsOrIso] operator[SEP] identifier[String] identifier[calendarName] , identifier[String] identifier[isoOrUdunits] operator[SEP] { identifier[CalendarDate] identifier[result] operator[SEP] Keyword[try] { identifier[result] operator[=] identifier[parseISOformat] operator[SEP] identifier[calendarName] , identifier[isoOrUdunits] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] { Keyword[try] { identifier[result] operator[=] identifier[parseUdunits] operator[SEP] identifier[calendarName] , identifier[isoOrUdunits] operator[SEP] operator[SEP] } Keyword[catch] operator[SEP] identifier[Exception] identifier[e2] operator[SEP] { Keyword[return] Other[null] operator[SEP] } } Keyword[return] identifier[result] operator[SEP] }
public static <E> List<Tuple2<E, Integer>> withIndex(Iterable<E> self) { return withIndex(self, 0); }
class class_name[name] begin[{] method[withIndex, return_type[type[List]], modifier[public static], parameter[self]] begin[{] return[call[.withIndex, parameter[member[.self], literal[0]]]] end[}] END[}]
Keyword[public] Keyword[static] operator[<] identifier[E] operator[>] identifier[List] operator[<] identifier[Tuple2] operator[<] identifier[E] , identifier[Integer] operator[>] operator[>] identifier[withIndex] operator[SEP] identifier[Iterable] operator[<] identifier[E] operator[>] identifier[self] operator[SEP] { Keyword[return] identifier[withIndex] operator[SEP] identifier[self] , Other[0] operator[SEP] operator[SEP] }
public Set<T> toImmutableSet() { Set<T> result = toSet(); if (result.size() == 0) return Collections.emptySet(); return Collections.unmodifiableSet(result); }
class class_name[name] begin[{] method[toImmutableSet, return_type[type[Set]], modifier[public], parameter[]] begin[{] local_variable[type[Set], result] if[binary_operation[call[result.size, parameter[]], ==, literal[0]]] begin[{] return[call[Collections.emptySet, parameter[]]] else begin[{] None end[}] return[call[Collections.unmodifiableSet, parameter[member[.result]]]] end[}] END[}]
Keyword[public] identifier[Set] operator[<] identifier[T] operator[>] identifier[toImmutableSet] operator[SEP] operator[SEP] { identifier[Set] operator[<] identifier[T] operator[>] identifier[result] operator[=] identifier[toSet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[emptySet] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableSet] operator[SEP] identifier[result] operator[SEP] operator[SEP] }
@Override public int compare(Row row1, Row row2) { Float score1 = rowService.score(row1); Float score2 = rowService.score(row2); return score2.compareTo(score1); }
class class_name[name] begin[{] method[compare, return_type[type[int]], modifier[public], parameter[row1, row2]] begin[{] local_variable[type[Float], score1] local_variable[type[Float], score2] return[call[score2.compareTo, parameter[member[.score1]]]] end[}] END[}]
annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[compare] operator[SEP] identifier[Row] identifier[row1] , identifier[Row] identifier[row2] operator[SEP] { identifier[Float] identifier[score1] operator[=] identifier[rowService] operator[SEP] identifier[score] operator[SEP] identifier[row1] operator[SEP] operator[SEP] identifier[Float] identifier[score2] operator[=] identifier[rowService] operator[SEP] identifier[score] operator[SEP] identifier[row2] operator[SEP] operator[SEP] Keyword[return] identifier[score2] operator[SEP] identifier[compareTo] operator[SEP] identifier[score1] operator[SEP] operator[SEP] }
public EClass getIfcRelAssociatesConstraint() { if (ifcRelAssociatesConstraintEClass == null) { ifcRelAssociatesConstraintEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(451); } return ifcRelAssociatesConstraintEClass; }
class class_name[name] begin[{] method[getIfcRelAssociatesConstraint, return_type[type[EClass]], modifier[public], parameter[]] begin[{] if[binary_operation[member[.ifcRelAssociatesConstraintEClass], ==, literal[null]]] begin[{] assign[member[.ifcRelAssociatesConstraintEClass], 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=451)], 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[.ifcRelAssociatesConstraintEClass]] end[}] END[}]
Keyword[public] identifier[EClass] identifier[getIfcRelAssociatesConstraint] operator[SEP] operator[SEP] { Keyword[if] operator[SEP] identifier[ifcRelAssociatesConstraintEClass] operator[==] Other[null] operator[SEP] { identifier[ifcRelAssociatesConstraintEClass] 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[451] operator[SEP] operator[SEP] } Keyword[return] identifier[ifcRelAssociatesConstraintEClass] operator[SEP] }
@SuppressWarnings("unchecked") public E[] toArray(E[] a) { int n = data.size(); if (a.length < n) { a = (E[]) java.lang.reflect.Array.newInstance(a.getClass().getComponentType(), n); } for (int i = 0; i < n; i++) { a[i] = get(i).x; } for (int i = n; i < a.length; i++) { a[i] = null; } return a; }
class class_name[name] begin[{] method[toArray, return_type[type[E]], modifier[public], parameter[a]] begin[{] local_variable[type[int], n] if[binary_operation[member[a.length], <, member[.n]]] begin[{] assign[member[.a], Cast(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=a, selectors=[MethodInvocation(arguments=[], member=getComponentType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=java.lang.reflect.Array, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[None], name=E, sub_type=None))] else begin[{] None end[}] ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MemberReference(member=x, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), 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=a, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None) return[member[.a]] end[}] END[}]
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[E] operator[SEP] operator[SEP] identifier[toArray] operator[SEP] identifier[E] operator[SEP] operator[SEP] identifier[a] operator[SEP] { Keyword[int] identifier[n] operator[=] identifier[data] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[a] operator[SEP] identifier[length] operator[<] identifier[n] operator[SEP] { identifier[a] operator[=] operator[SEP] identifier[E] operator[SEP] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[reflect] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[a] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getComponentType] operator[SEP] operator[SEP] , identifier[n] operator[SEP] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[n] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[a] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[x] operator[SEP] } Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[n] operator[SEP] identifier[i] operator[<] identifier[a] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] { identifier[a] operator[SEP] identifier[i] operator[SEP] operator[=] Other[null] operator[SEP] } Keyword[return] identifier[a] operator[SEP] }