code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
|---|---|---|
public void setParmsToDirectBuffer() {
if (oByteBuffer.isDirect()) {
this.oWsBBDirect = this.oByteBuffer;
return;
}
if (oWsBBDirect == null) {
this.oWsBBDirect = ByteBuffer.allocateDirect(oByteBuffer.capacity());
}
// set the position and limit
this.oWsBBDirect.limit(oByteBuffer.limit());
this.oWsBBDirect.position(oByteBuffer.position());
}
|
class class_name[name] begin[{]
method[setParmsToDirectBuffer, return_type[void], modifier[public], parameter[]] begin[{]
if[call[oByteBuffer.isDirect, parameter[]]] begin[{]
assign[THIS[member[None.oWsBBDirect]], THIS[member[None.oByteBuffer]]]
return[None]
else begin[{]
None
end[}]
if[binary_operation[member[.oWsBBDirect], ==, literal[null]]] begin[{]
assign[THIS[member[None.oWsBBDirect]], call[ByteBuffer.allocateDirect, parameter[call[oByteBuffer.capacity, parameter[]]]]]
else begin[{]
None
end[}]
THIS[member[None.oWsBBDirect]call[None.limit, parameter[call[oByteBuffer.limit, parameter[]]]]]
THIS[member[None.oWsBBDirect]call[None.position, parameter[call[oByteBuffer.position, parameter[]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setParmsToDirectBuffer] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[oByteBuffer] operator[SEP] identifier[isDirect] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[oWsBBDirect] operator[=] Keyword[this] operator[SEP] identifier[oByteBuffer] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[if] operator[SEP] identifier[oWsBBDirect] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[oWsBBDirect] operator[=] identifier[ByteBuffer] operator[SEP] identifier[allocateDirect] operator[SEP] identifier[oByteBuffer] operator[SEP] identifier[capacity] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[this] operator[SEP] identifier[oWsBBDirect] operator[SEP] identifier[limit] operator[SEP] identifier[oByteBuffer] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[oWsBBDirect] operator[SEP] identifier[position] operator[SEP] identifier[oByteBuffer] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public Key ceil(Key k) {
SortedMap<Key, Value> tail = st.tailMap(k);
if (tail.isEmpty()) return null;
else return tail.firstKey();
}
|
class class_name[name] begin[{]
method[ceil, return_type[type[Key]], modifier[public], parameter[k]] begin[{]
local_variable[type[SortedMap], tail]
if[call[tail.isEmpty, parameter[]]] begin[{]
return[literal[null]]
else begin[{]
return[call[tail.firstKey, parameter[]]]
end[}]
end[}]
END[}]
|
Keyword[public] identifier[Key] identifier[ceil] operator[SEP] identifier[Key] identifier[k] operator[SEP] {
identifier[SortedMap] operator[<] identifier[Key] , identifier[Value] operator[>] identifier[tail] operator[=] identifier[st] operator[SEP] identifier[tailMap] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tail] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[else] Keyword[return] identifier[tail] operator[SEP] identifier[firstKey] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Pair<Integer, Integer> getParentCellForElement( Element root, Element element )
{
Element tbody = getTBodyElement( root );
// Is the element in our table ? and what's the path from the table to it ?
ArrayList<Element> path = TemplateUtils.isDescendant( tbody, element );
if( path == null )
return null;
// we know that path[0] is tbody and that path[1] is a tr template
int row = DOM.getChildIndex( path.get( 0 ), path.get( 1 ) );
int col = DOM.getChildIndex( path.get( 1 ), path.get( 2 ) );
return new Pair<Integer, Integer>( col, row );
}
|
class class_name[name] begin[{]
method[getParentCellForElement, return_type[type[Pair]], modifier[public static], parameter[root, element]] begin[{]
local_variable[type[Element], tbody]
local_variable[type[ArrayList], path]
if[binary_operation[member[.path], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[int], row]
local_variable[type[int], col]
return[ClassCreator(arguments=[MemberReference(member=col, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=row, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=None, name=Pair, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Pair] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[getParentCellForElement] operator[SEP] identifier[Element] identifier[root] , identifier[Element] identifier[element] operator[SEP] {
identifier[Element] identifier[tbody] operator[=] identifier[getTBodyElement] operator[SEP] identifier[root] operator[SEP] operator[SEP] identifier[ArrayList] operator[<] identifier[Element] operator[>] identifier[path] operator[=] identifier[TemplateUtils] operator[SEP] identifier[isDescendant] operator[SEP] identifier[tbody] , identifier[element] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[path] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[int] identifier[row] operator[=] identifier[DOM] operator[SEP] identifier[getChildIndex] operator[SEP] identifier[path] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] , identifier[path] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[col] operator[=] identifier[DOM] operator[SEP] identifier[getChildIndex] operator[SEP] identifier[path] operator[SEP] identifier[get] operator[SEP] Other[1] operator[SEP] , identifier[path] operator[SEP] identifier[get] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[Pair] operator[<] identifier[Integer] , identifier[Integer] operator[>] operator[SEP] identifier[col] , identifier[row] operator[SEP] operator[SEP]
}
|
@Override
public <C> Choice3<L, R, C> diverge() {
return match(Choice3::a, Choice3::b);
}
|
class class_name[name] begin[{]
method[diverge, return_type[type[Choice3]], modifier[public], parameter[]] begin[{]
return[call[.match, parameter[MethodReference(expression=MemberReference(member=Choice3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[]), MethodReference(expression=MemberReference(member=Choice3, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[C] operator[>] identifier[Choice3] operator[<] identifier[L] , identifier[R] , identifier[C] operator[>] identifier[diverge] operator[SEP] operator[SEP] {
Keyword[return] identifier[match] operator[SEP] identifier[Choice3] operator[::] identifier[a] , identifier[Choice3] operator[::] identifier[b] operator[SEP] operator[SEP]
}
|
protected boolean doesRelationshipMatch(final TargetRelationship relationship, final CSRelatedNodeWrapper relatedNode) {
// If the relationship node is a node that can't be related to (ie a comment or meta data), than the relationship cannot match
if (relatedNode.getNodeType().equals(CommonConstants.CS_NODE_COMMENT) || relatedNode.getNodeType().equals(
CommonConstants.CS_NODE_META_DATA)) {
return false;
}
// Check if the type matches first
if (!RelationshipType.getRelationshipTypeId(relationship.getType()).equals(relatedNode.getRelationshipType())) return false;
// If the unique id is not from the parser, in which case it will start with a number than use the unique id to compare
if (relationship.getSecondaryRelationship().getUniqueId() != null && relationship.getSecondaryRelationship().getUniqueId().matches(
"^\\d.*")) {
return relationship.getSecondaryRelationship().getUniqueId().equals(Integer.toString(relatedNode.getId()));
} else if (relationship.getSecondaryRelationship() instanceof Level) {
return ((Level) relationship.getSecondaryRelationship()).getTargetId().equals(relatedNode.getTargetId());
} else if (relationship.getSecondaryRelationship() instanceof SpecTopic) {
return ((SpecTopic) relationship.getSecondaryRelationship()).getTargetId().equals(relatedNode.getTargetId());
} else {
return false;
}
}
|
class class_name[name] begin[{]
method[doesRelationshipMatch, return_type[type[boolean]], modifier[protected], parameter[relationship, relatedNode]] begin[{]
if[binary_operation[call[relatedNode.getNodeType, parameter[]], ||, call[relatedNode.getNodeType, parameter[]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[RelationshipType.getRelationshipTypeId, parameter[call[relationship.getType, parameter[]]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[relationship.getSecondaryRelationship, parameter[]], !=, literal[null]], &&, call[relationship.getSecondaryRelationship, parameter[]]]] begin[{]
return[call[relationship.getSecondaryRelationship, parameter[]]]
else begin[{]
if[binary_operation[call[relationship.getSecondaryRelationship, parameter[]], instanceof, type[Level]]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[], member=getSecondaryRelationship, postfix_operators=[], prefix_operators=[], qualifier=relationship, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Level, sub_type=None))]
else begin[{]
if[binary_operation[call[relationship.getSecondaryRelationship, parameter[]], instanceof, type[SpecTopic]]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[], member=getSecondaryRelationship, postfix_operators=[], prefix_operators=[], qualifier=relationship, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=SpecTopic, sub_type=None))]
else begin[{]
return[literal[false]]
end[}]
end[}]
end[}]
end[}]
END[}]
|
Keyword[protected] Keyword[boolean] identifier[doesRelationshipMatch] operator[SEP] Keyword[final] identifier[TargetRelationship] identifier[relationship] , Keyword[final] identifier[CSRelatedNodeWrapper] identifier[relatedNode] operator[SEP] {
Keyword[if] operator[SEP] identifier[relatedNode] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[CommonConstants] operator[SEP] identifier[CS_NODE_COMMENT] operator[SEP] operator[||] identifier[relatedNode] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[CommonConstants] operator[SEP] identifier[CS_NODE_META_DATA] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[RelationshipType] operator[SEP] identifier[getRelationshipTypeId] operator[SEP] identifier[relationship] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[relatedNode] operator[SEP] identifier[getRelationshipType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[relationship] operator[SEP] identifier[getSecondaryRelationship] operator[SEP] operator[SEP] operator[SEP] identifier[getUniqueId] operator[SEP] operator[SEP] operator[!=] Other[null] operator[&&] identifier[relationship] operator[SEP] identifier[getSecondaryRelationship] operator[SEP] operator[SEP] operator[SEP] identifier[getUniqueId] operator[SEP] operator[SEP] operator[SEP] identifier[matches] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] identifier[relationship] operator[SEP] identifier[getSecondaryRelationship] operator[SEP] operator[SEP] operator[SEP] identifier[getUniqueId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[relatedNode] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[relationship] operator[SEP] identifier[getSecondaryRelationship] operator[SEP] operator[SEP] Keyword[instanceof] identifier[Level] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[Level] operator[SEP] identifier[relationship] operator[SEP] identifier[getSecondaryRelationship] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getTargetId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[relatedNode] operator[SEP] identifier[getTargetId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[relationship] operator[SEP] identifier[getSecondaryRelationship] operator[SEP] operator[SEP] Keyword[instanceof] identifier[SpecTopic] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[SpecTopic] operator[SEP] identifier[relationship] operator[SEP] identifier[getSecondaryRelationship] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[getTargetId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[relatedNode] operator[SEP] identifier[getTargetId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] literal[boolean] operator[SEP]
}
}
|
private void parseAttrDefaultValue(DefaultAttrValue defVal, char quoteChar, PrefixedName attrName,
Location loc, boolean gotFixed)
throws XMLStreamException
{
if (quoteChar != '"' && quoteChar != '\'') { // caller doesn't test it
String msg = "; expected a single or double quote to enclose the default value";
if (!gotFixed) {
msg += ", or one of keywords (#REQUIRED, #IMPLIED, #FIXED)";
}
msg += " (for attribute '"+attrName+"')";
throwDTDUnexpectedChar(quoteChar, msg);
}
/* Let's mark the current input source as the scope, so we can both
* make sure it ends in this input context (DTD subset), and that
* embedded single/double quotes in potentially expanded entities do
* not end the value definition (as per XML 1.0/3, 4.4.5)
*/
WstxInputSource currScope = mInput;
TextBuffer tb = mValueBuffer;
if (tb == null) {
tb = TextBuffer.createTemporaryBuffer();
}
tb.resetInitialized();
int outPtr = 0;
char[] outBuf = tb.getCurrentSegment();
int outLen = outBuf.length;
/* One more note: this is mostly cut'n pasted from stream reader's
* parseNormalizedAttrValue...
*/
main_loop:
while (true) {
if (mInputPtr >= mInputEnd) {
boolean check = (mInput == currScope);
loadMore(getErrorMsg());
// Did we get out of the scope?
if (check && (mInput != currScope)) {
_reportWFCViolation("Unterminated attribute default value for attribute '"
+attrName+"' (definition started at "
+loc+")");
}
}
char c = mInputBuffer[mInputPtr++];
// Let's do a quick for most attribute content chars:
if (c < CHAR_FIRST_PURE_TEXT) {
if (c <= CHAR_SPACE) {
if (c == '\n') {
markLF();
} else if (c == '\r') {
c = getNextChar(SUFFIX_IN_DEF_ATTR_VALUE);
if (c != '\n') { // nope, not 2-char lf (Mac?)
--mInputPtr;
c = mNormalizeLFs ? '\n' : '\r';
} else {
// Fine if we are to normalize lfs
/* !!! 20-Jan-2007, TSa: Hmmh. Not sure if and
* how to preserve: for now, let's assume there's
* no need.
*/
/*
if (!mNormalizeLFs) {
if (outPtr >= outLen) { // need more room?
outBuf = tb.finishCurrentSegment();
outPtr = 0;
outLen = outBuf.length;
}
outBuf[outPtr++] = '\r';
// c is fine to continue
}
*/
}
markLF();
} else if (c != CHAR_SPACE && c != '\t') {
throwInvalidSpace(c);
}
c = CHAR_SPACE;
} else if (c == quoteChar) {
/* It is possible to get these via expanded entities;
* need to make sure this is the same input level as
* the one that had starting quote
*/
if (mInput == currScope) {
break;
}
} else if (c == '&') { // an entity of some sort...
/* Will need to expand char entities and pre-defd
* int. entities (amp, lt, apos, gt): first method
* is just more optimized than the second
*/
int d;
if (inputInBuffer() >= 3) {
d = resolveSimpleEntity(true);
} else {
d = resolveCharOnlyEntity(true);
}
// Only get null if it's a 'real' general entity...
if (d == 0) {
c = getNextChar(SUFFIX_IN_ENTITY_REF);
String id = parseEntityName(c);
try {
mCurrAttrDefault = defVal;
mExpandingPE = false;
expandEntity(id, false, ENTITY_EXP_GE);
} finally {
mCurrAttrDefault = null;
}
// Ok, should have updated the input source by now
continue main_loop;
}
if (c <= 0xFFFF) {
} else{
if (d <= 0xFFFF) {
c = (char) d;
} else {
// Need more room?
if (outPtr >= outBuf.length) {
outBuf = tb.finishCurrentSegment();
outPtr = 0;
}
d -= 0x10000;
outBuf[outPtr++] = (char) ((d >> 10) + 0xD800);;
c = (char) ((d & 0x3FF) + 0xDC00);
}
}
} else if (c == '<') {
throwDTDUnexpectedChar(c, SUFFIX_IN_DEF_ATTR_VALUE);
}
} // if (c < CHAR_FIRST_PURE_TEXT)
// Ok, let's just add char in, whatever it was
if (outPtr >= outLen) { // need more room?
outBuf = tb.finishCurrentSegment();
outPtr = 0;
outLen = outBuf.length;
}
outBuf[outPtr++] = c;
}
tb.setCurrentLength(outPtr);
defVal.setValue(tb.contentsAsString());
mValueBuffer = tb;
}
|
class class_name[name] begin[{]
method[parseAttrDefaultValue, return_type[void], modifier[private], parameter[defVal, quoteChar, attrName, loc, gotFixed]] begin[{]
if[binary_operation[binary_operation[member[.quoteChar], !=, literal['"']], &&, binary_operation[member[.quoteChar], !=, literal['\'']]]] begin[{]
local_variable[type[String], msg]
if[member[.gotFixed]] begin[{]
assign[member[.msg], literal[", or one of keywords (#REQUIRED, #IMPLIED, #FIXED)"]]
else begin[{]
None
end[}]
assign[member[.msg], binary_operation[binary_operation[literal[" (for attribute '"], +, member[.attrName]], +, literal["')"]]]
call[.throwDTDUnexpectedChar, parameter[member[.quoteChar], member[.msg]]]
else begin[{]
None
end[}]
local_variable[type[WstxInputSource], currScope]
local_variable[type[TextBuffer], tb]
if[binary_operation[member[.tb], ==, literal[null]]] begin[{]
assign[member[.tb], call[TextBuffer.createTemporaryBuffer, parameter[]]]
else begin[{]
None
end[}]
call[tb.resetInitialized, parameter[]]
local_variable[type[int], outPtr]
local_variable[type[char], outBuf]
local_variable[type[int], outLen]
while[literal[true]] begin[{]
if[binary_operation[member[.mInputPtr], >=, member[.mInputEnd]]] begin[{]
local_variable[type[boolean], check]
call[.loadMore, parameter[call[.getErrorMsg, parameter[]]]]
if[binary_operation[member[.check], &&, binary_operation[member[.mInput], !=, member[.currScope]]]] begin[{]
call[._reportWFCViolation, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Unterminated attribute default value for attribute '"], +, member[.attrName]], +, literal["' (definition started at "]], +, member[.loc]], +, literal[")"]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[char], c]
if[binary_operation[member[.c], <, member[.CHAR_FIRST_PURE_TEXT]]] begin[{]
if[binary_operation[member[.c], <=, member[.CHAR_SPACE]]] begin[{]
if[binary_operation[member[.c], ==, literal['\n']]] begin[{]
call[.markLF, parameter[]]
else begin[{]
if[binary_operation[member[.c], ==, literal['\r']]] begin[{]
assign[member[.c], call[.getNextChar, parameter[member[.SUFFIX_IN_DEF_ATTR_VALUE]]]]
if[binary_operation[member[.c], !=, literal['\n']]] begin[{]
member[.mInputPtr]
assign[member[.c], TernaryExpression(condition=MemberReference(member=mNormalizeLFs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r'), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n'))]
else begin[{]
end[}]
call[.markLF, parameter[]]
else begin[{]
if[binary_operation[binary_operation[member[.c], !=, member[.CHAR_SPACE]], &&, binary_operation[member[.c], !=, literal['\t']]]] begin[{]
call[.throwInvalidSpace, parameter[member[.c]]]
else begin[{]
None
end[}]
end[}]
end[}]
assign[member[.c], member[.CHAR_SPACE]]
else begin[{]
if[binary_operation[member[.c], ==, member[.quoteChar]]] begin[{]
if[binary_operation[member[.mInput], ==, member[.currScope]]] begin[{]
BreakStatement(goto=None, label=None)
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[member[.c], ==, literal['&']]] begin[{]
local_variable[type[int], d]
if[binary_operation[call[.inputInBuffer, parameter[]], >=, literal[3]]] begin[{]
assign[member[.d], call[.resolveSimpleEntity, parameter[literal[true]]]]
else begin[{]
assign[member[.d], call[.resolveCharOnlyEntity, parameter[literal[true]]]]
end[}]
if[binary_operation[member[.d], ==, literal[0]]] begin[{]
assign[member[.c], call[.getNextChar, parameter[member[.SUFFIX_IN_ENTITY_REF]]]]
local_variable[type[String], id]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mCurrAttrDefault, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=defVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=mExpandingPE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=ENTITY_EXP_GE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=expandEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=mCurrAttrDefault, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)), label=None)], label=None, resources=None)
ContinueStatement(goto=main_loop, label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.c], <=, literal[0xFFFF]]] begin[{]
else begin[{]
if[binary_operation[member[.d], <=, literal[0xFFFF]]] begin[{]
assign[member[.c], Cast(expression=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))]
else begin[{]
if[binary_operation[member[.outPtr], >=, member[outBuf.length]]] begin[{]
assign[member[.outBuf], call[tb.finishCurrentSegment, parameter[]]]
assign[member[.outPtr], literal[0]]
else begin[{]
None
end[}]
assign[member[.d], literal[0x10000]]
assign[member[.outBuf], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=>>), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xD800), operator=+), type=BasicType(dimensions=[], name=char))]
Statement(label=None)
assign[member[.c], Cast(expression=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=d, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x3FF), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xDC00), operator=+), type=BasicType(dimensions=[], name=char))]
end[}]
end[}]
else begin[{]
if[binary_operation[member[.c], ==, literal['<']]] begin[{]
call[.throwDTDUnexpectedChar, parameter[member[.c], member[.SUFFIX_IN_DEF_ATTR_VALUE]]]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.outPtr], >=, member[.outLen]]] begin[{]
assign[member[.outBuf], call[tb.finishCurrentSegment, parameter[]]]
assign[member[.outPtr], literal[0]]
assign[member[.outLen], member[outBuf.length]]
else begin[{]
None
end[}]
assign[member[.outBuf], member[.c]]
end[}]
call[tb.setCurrentLength, parameter[member[.outPtr]]]
call[defVal.setValue, parameter[call[tb.contentsAsString, parameter[]]]]
assign[member[.mValueBuffer], member[.tb]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[parseAttrDefaultValue] operator[SEP] identifier[DefaultAttrValue] identifier[defVal] , Keyword[char] identifier[quoteChar] , identifier[PrefixedName] identifier[attrName] , identifier[Location] identifier[loc] , Keyword[boolean] identifier[gotFixed] operator[SEP] Keyword[throws] identifier[XMLStreamException] {
Keyword[if] operator[SEP] identifier[quoteChar] operator[!=] literal[String] operator[&&] identifier[quoteChar] operator[!=] literal[String] operator[SEP] {
identifier[String] identifier[msg] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[gotFixed] operator[SEP] {
identifier[msg] operator[+=] literal[String] operator[SEP]
}
identifier[msg] operator[+=] literal[String] operator[+] identifier[attrName] operator[+] literal[String] operator[SEP] identifier[throwDTDUnexpectedChar] operator[SEP] identifier[quoteChar] , identifier[msg] operator[SEP] operator[SEP]
}
identifier[WstxInputSource] identifier[currScope] operator[=] identifier[mInput] operator[SEP] identifier[TextBuffer] identifier[tb] operator[=] identifier[mValueBuffer] operator[SEP] Keyword[if] operator[SEP] identifier[tb] operator[==] Other[null] operator[SEP] {
identifier[tb] operator[=] identifier[TextBuffer] operator[SEP] identifier[createTemporaryBuffer] operator[SEP] operator[SEP] operator[SEP]
}
identifier[tb] operator[SEP] identifier[resetInitialized] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[outPtr] operator[=] Other[0] operator[SEP] Keyword[char] operator[SEP] operator[SEP] identifier[outBuf] operator[=] identifier[tb] operator[SEP] identifier[getCurrentSegment] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[outLen] operator[=] identifier[outBuf] operator[SEP] identifier[length] operator[SEP] identifier[main_loop] operator[:] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[if] operator[SEP] identifier[mInputPtr] operator[>=] identifier[mInputEnd] operator[SEP] {
Keyword[boolean] identifier[check] operator[=] operator[SEP] identifier[mInput] operator[==] identifier[currScope] operator[SEP] operator[SEP] identifier[loadMore] operator[SEP] identifier[getErrorMsg] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[check] operator[&&] operator[SEP] identifier[mInput] operator[!=] identifier[currScope] operator[SEP] operator[SEP] {
identifier[_reportWFCViolation] operator[SEP] literal[String] operator[+] identifier[attrName] operator[+] literal[String] operator[+] identifier[loc] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[char] identifier[c] operator[=] identifier[mInputBuffer] operator[SEP] identifier[mInputPtr] operator[++] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[<] identifier[CHAR_FIRST_PURE_TEXT] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] operator[<=] identifier[CHAR_SPACE] operator[SEP] {
Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[markLF] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[c] operator[=] identifier[getNextChar] operator[SEP] identifier[SUFFIX_IN_DEF_ATTR_VALUE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[!=] literal[String] operator[SEP] {
operator[--] identifier[mInputPtr] operator[SEP] identifier[c] operator[=] identifier[mNormalizeLFs] operator[?] literal[String] operator[:] literal[String] operator[SEP]
}
Keyword[else] {
}
identifier[markLF] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[!=] identifier[CHAR_SPACE] operator[&&] identifier[c] operator[!=] literal[String] operator[SEP] {
identifier[throwInvalidSpace] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
identifier[c] operator[=] identifier[CHAR_SPACE] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] identifier[quoteChar] operator[SEP] {
Keyword[if] operator[SEP] identifier[mInput] operator[==] identifier[currScope] operator[SEP] {
Keyword[break] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
Keyword[int] identifier[d] operator[SEP] Keyword[if] operator[SEP] identifier[inputInBuffer] operator[SEP] operator[SEP] operator[>=] Other[3] operator[SEP] {
identifier[d] operator[=] identifier[resolveSimpleEntity] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[d] operator[=] identifier[resolveCharOnlyEntity] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[d] operator[==] Other[0] operator[SEP] {
identifier[c] operator[=] identifier[getNextChar] operator[SEP] identifier[SUFFIX_IN_ENTITY_REF] operator[SEP] operator[SEP] identifier[String] identifier[id] operator[=] identifier[parseEntityName] operator[SEP] identifier[c] operator[SEP] operator[SEP] Keyword[try] {
identifier[mCurrAttrDefault] operator[=] identifier[defVal] operator[SEP] identifier[mExpandingPE] operator[=] literal[boolean] operator[SEP] identifier[expandEntity] operator[SEP] identifier[id] , literal[boolean] , identifier[ENTITY_EXP_GE] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[mCurrAttrDefault] operator[=] Other[null] operator[SEP]
}
Keyword[continue] identifier[main_loop] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[<=] literal[Integer] operator[SEP] {
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[d] operator[<=] literal[Integer] operator[SEP] {
identifier[c] operator[=] operator[SEP] Keyword[char] operator[SEP] identifier[d] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[outPtr] operator[>=] identifier[outBuf] operator[SEP] identifier[length] operator[SEP] {
identifier[outBuf] operator[=] identifier[tb] operator[SEP] identifier[finishCurrentSegment] operator[SEP] operator[SEP] operator[SEP] identifier[outPtr] operator[=] Other[0] operator[SEP]
}
identifier[d] operator[-=] literal[Integer] operator[SEP] identifier[outBuf] operator[SEP] identifier[outPtr] operator[++] operator[SEP] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] identifier[d] operator[>] operator[>] Other[10] operator[SEP] operator[+] literal[Integer] operator[SEP] operator[SEP] operator[SEP] identifier[c] operator[=] operator[SEP] Keyword[char] operator[SEP] operator[SEP] operator[SEP] identifier[d] operator[&] literal[Integer] operator[SEP] operator[+] literal[Integer] operator[SEP] operator[SEP]
}
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[c] operator[==] literal[String] operator[SEP] {
identifier[throwDTDUnexpectedChar] operator[SEP] identifier[c] , identifier[SUFFIX_IN_DEF_ATTR_VALUE] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[outPtr] operator[>=] identifier[outLen] operator[SEP] {
identifier[outBuf] operator[=] identifier[tb] operator[SEP] identifier[finishCurrentSegment] operator[SEP] operator[SEP] operator[SEP] identifier[outPtr] operator[=] Other[0] operator[SEP] identifier[outLen] operator[=] identifier[outBuf] operator[SEP] identifier[length] operator[SEP]
}
identifier[outBuf] operator[SEP] identifier[outPtr] operator[++] operator[SEP] operator[=] identifier[c] operator[SEP]
}
identifier[tb] operator[SEP] identifier[setCurrentLength] operator[SEP] identifier[outPtr] operator[SEP] operator[SEP] identifier[defVal] operator[SEP] identifier[setValue] operator[SEP] identifier[tb] operator[SEP] identifier[contentsAsString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[mValueBuffer] operator[=] identifier[tb] operator[SEP]
}
|
public static Random getRNG(long... seed) {
switch(_rngType) {
case JavaRNG: return new H2ORandomRNG(seed[0]);
case XorShiftRNG: return new XorShiftRNG (seed[0]);
case PCGRNG: return new PCGRNG (seed[0],seed.length > 1 ? seed[1] : 1);
case MersenneTwisterRNG:
// Do not copy the seeds - use them, and initialize the first two ints by
// seeds based given argument. The call is locked, and also
// MersenneTwisterRNG will just copy the seeds into its datastructures
return new MersenneTwisterRNG(ArrayUtils.unpackInts(seed));
}
throw H2O.fail();
}
|
class class_name[name] begin[{]
method[getRNG, return_type[type[Random]], modifier[public static], parameter[seed]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['JavaRNG'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=seed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=H2ORandomRNG, sub_type=None)), label=None)]), SwitchStatementCase(case=['XorShiftRNG'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=seed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=XorShiftRNG, sub_type=None)), label=None)]), SwitchStatementCase(case=['PCGRNG'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MemberReference(member=seed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=seed, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=>), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), if_true=MemberReference(member=seed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PCGRNG, sub_type=None)), label=None)]), SwitchStatementCase(case=['MersenneTwisterRNG'], statements=[ReturnStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=seed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unpackInts, postfix_operators=[], prefix_operators=[], qualifier=ArrayUtils, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MersenneTwisterRNG, sub_type=None)), label=None)])], expression=MemberReference(member=_rngType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
ThrowStatement(expression=MethodInvocation(arguments=[], member=fail, postfix_operators=[], prefix_operators=[], qualifier=H2O, selectors=[], type_arguments=None), label=None)
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[Random] identifier[getRNG] operator[SEP] Keyword[long] operator[...] identifier[seed] operator[SEP] {
Keyword[switch] operator[SEP] identifier[_rngType] operator[SEP] {
Keyword[case] identifier[JavaRNG] operator[:] Keyword[return] Keyword[new] identifier[H2ORandomRNG] operator[SEP] identifier[seed] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[XorShiftRNG] operator[:] Keyword[return] Keyword[new] identifier[XorShiftRNG] operator[SEP] identifier[seed] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[PCGRNG] operator[:] Keyword[return] Keyword[new] identifier[PCGRNG] operator[SEP] identifier[seed] operator[SEP] Other[0] operator[SEP] , identifier[seed] operator[SEP] identifier[length] operator[>] Other[1] operator[?] identifier[seed] operator[SEP] Other[1] operator[SEP] operator[:] Other[1] operator[SEP] operator[SEP] Keyword[case] identifier[MersenneTwisterRNG] operator[:] Keyword[return] Keyword[new] identifier[MersenneTwisterRNG] operator[SEP] identifier[ArrayUtils] operator[SEP] identifier[unpackInts] operator[SEP] identifier[seed] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[H2O] operator[SEP] identifier[fail] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public RecordWriter<Void, T> getRecordWriter(TaskAttemptContext taskAttemptContext)
throws IOException, InterruptedException {
final Configuration conf = getConfiguration(taskAttemptContext);
CompressionCodecName codec = getCodec(taskAttemptContext);
String extension = codec.getExtension() + ".parquet";
Path file = getDefaultWorkFile(taskAttemptContext, extension);
return getRecordWriter(conf, file, codec);
}
|
class class_name[name] begin[{]
method[getRecordWriter, return_type[type[RecordWriter]], modifier[public], parameter[taskAttemptContext]] begin[{]
local_variable[type[Configuration], conf]
local_variable[type[CompressionCodecName], codec]
local_variable[type[String], extension]
local_variable[type[Path], file]
return[call[.getRecordWriter, parameter[member[.conf], member[.file], member[.codec]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[RecordWriter] operator[<] identifier[Void] , identifier[T] operator[>] identifier[getRecordWriter] operator[SEP] identifier[TaskAttemptContext] identifier[taskAttemptContext] operator[SEP] Keyword[throws] identifier[IOException] , identifier[InterruptedException] {
Keyword[final] identifier[Configuration] identifier[conf] operator[=] identifier[getConfiguration] operator[SEP] identifier[taskAttemptContext] operator[SEP] operator[SEP] identifier[CompressionCodecName] identifier[codec] operator[=] identifier[getCodec] operator[SEP] identifier[taskAttemptContext] operator[SEP] operator[SEP] identifier[String] identifier[extension] operator[=] identifier[codec] operator[SEP] identifier[getExtension] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] identifier[Path] identifier[file] operator[=] identifier[getDefaultWorkFile] operator[SEP] identifier[taskAttemptContext] , identifier[extension] operator[SEP] operator[SEP] Keyword[return] identifier[getRecordWriter] operator[SEP] identifier[conf] , identifier[file] , identifier[codec] operator[SEP] operator[SEP]
}
|
@Override
public List<CallDetailRecord> getCallDetailRecords(CallDetailRecordFilter filter) {
final SqlSession session = sessions.openSession();
try {
final List<Map<String, Object>> results = session.selectList(namespace + "getCallDetailRecordByUsingFilters",
filter);
final List<CallDetailRecord> cdrs = new ArrayList<CallDetailRecord>();
if (results != null && !results.isEmpty()) {
for (final Map<String, Object> result : results) {
cdrs.add(toCallDetailRecord(result));
}
}
return cdrs;
} finally {
session.close();
}
}
|
class class_name[name] begin[{]
method[getCallDetailRecords, return_type[type[List]], modifier[public], parameter[filter]] begin[{]
local_variable[type[SqlSession], session]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=namespace, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getCallDetailRecordByUsingFilters"), operator=+), MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=selectList, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), name=results)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CallDetailRecord, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None)), name=cdrs)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CallDetailRecord, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=results, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toCallDetailRecord, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=cdrs, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=results, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=result)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None))), label=None)])), ReturnStatement(expression=MemberReference(member=cdrs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[CallDetailRecord] operator[>] identifier[getCallDetailRecords] operator[SEP] identifier[CallDetailRecordFilter] identifier[filter] operator[SEP] {
Keyword[final] identifier[SqlSession] identifier[session] operator[=] identifier[sessions] operator[SEP] identifier[openSession] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[final] identifier[List] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[results] operator[=] identifier[session] operator[SEP] identifier[selectList] operator[SEP] identifier[namespace] operator[+] literal[String] , identifier[filter] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[CallDetailRecord] operator[>] identifier[cdrs] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[CallDetailRecord] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[results] operator[!=] Other[null] operator[&&] operator[!] identifier[results] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[result] operator[:] identifier[results] operator[SEP] {
identifier[cdrs] operator[SEP] identifier[add] operator[SEP] identifier[toCallDetailRecord] operator[SEP] identifier[result] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[cdrs] operator[SEP]
}
Keyword[finally] {
identifier[session] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private void addPropertyStateExtractMethod() {
MethodInfo mi = mClassFile.addMethod(Modifiers.PRIVATE, PROPERTY_STATE_EXTRACT_METHOD_NAME,
TypeDesc.INT, new TypeDesc[] {TypeDesc.STRING});
addPropertySwitch(new CodeBuilder(mi), SWITCH_FOR_STATE);
}
|
class class_name[name] begin[{]
method[addPropertyStateExtractMethod, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[MethodInfo], mi]
call[.addPropertySwitch, parameter[ClassCreator(arguments=[MemberReference(member=mi, 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=CodeBuilder, sub_type=None)), member[.SWITCH_FOR_STATE]]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[addPropertyStateExtractMethod] operator[SEP] operator[SEP] {
identifier[MethodInfo] identifier[mi] operator[=] identifier[mClassFile] operator[SEP] identifier[addMethod] operator[SEP] identifier[Modifiers] operator[SEP] identifier[PRIVATE] , identifier[PROPERTY_STATE_EXTRACT_METHOD_NAME] , identifier[TypeDesc] operator[SEP] identifier[INT] , Keyword[new] identifier[TypeDesc] operator[SEP] operator[SEP] {
identifier[TypeDesc] operator[SEP] identifier[STRING]
} operator[SEP] operator[SEP] identifier[addPropertySwitch] operator[SEP] Keyword[new] identifier[CodeBuilder] operator[SEP] identifier[mi] operator[SEP] , identifier[SWITCH_FOR_STATE] operator[SEP] operator[SEP]
}
|
public Dataset getDatasetFromId(String projectId, String datasetName) {
// [START bigquery_get_dataset]
DatasetId datasetId = DatasetId.of(projectId, datasetName);
Dataset dataset = bigquery.getDataset(datasetId);
// [END bigquery_get_dataset]
return dataset;
}
|
class class_name[name] begin[{]
method[getDatasetFromId, return_type[type[Dataset]], modifier[public], parameter[projectId, datasetName]] begin[{]
local_variable[type[DatasetId], datasetId]
local_variable[type[Dataset], dataset]
return[member[.dataset]]
end[}]
END[}]
|
Keyword[public] identifier[Dataset] identifier[getDatasetFromId] operator[SEP] identifier[String] identifier[projectId] , identifier[String] identifier[datasetName] operator[SEP] {
identifier[DatasetId] identifier[datasetId] operator[=] identifier[DatasetId] operator[SEP] identifier[of] operator[SEP] identifier[projectId] , identifier[datasetName] operator[SEP] operator[SEP] identifier[Dataset] identifier[dataset] operator[=] identifier[bigquery] operator[SEP] identifier[getDataset] operator[SEP] identifier[datasetId] operator[SEP] operator[SEP] Keyword[return] identifier[dataset] operator[SEP]
}
|
protected LayoutManager getLayOutManagerObj(ActionInvocation _invocation) {
if (layoutManager == null || "".equals(layoutManager)){
LOG.warn("No valid LayoutManager, using ClassicLayoutManager");
return new ClassicLayoutManager();
}
Object los = conditionalParse(layoutManager, _invocation);
if (los instanceof LayoutManager){
return (LayoutManager) los;
}
LayoutManager lo = null;
if (los instanceof String){
if (LAYOUT_CLASSIC.equalsIgnoreCase((String) los))
lo = new ClassicLayoutManager();
else if (LAYOUT_LIST.equalsIgnoreCase((String) los))
lo = new ListLayoutManager();
else {
try {
lo = (LayoutManager) Class.forName((String) los).newInstance();
} catch (Exception e) {
LOG.warn("No valid LayoutManager: " + e.getMessage(),e);
}
}
}
return lo;
}
|
class class_name[name] begin[{]
method[getLayOutManagerObj, return_type[type[LayoutManager]], modifier[protected], parameter[_invocation]] begin[{]
if[binary_operation[binary_operation[member[.layoutManager], ==, literal[null]], ||, literal[""]]] begin[{]
call[LOG.warn, parameter[literal["No valid LayoutManager, using ClassicLayoutManager"]]]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassicLayoutManager, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[Object], los]
if[binary_operation[member[.los], instanceof, type[LayoutManager]]] begin[{]
return[Cast(expression=MemberReference(member=los, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LayoutManager, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[LayoutManager], lo]
if[binary_operation[member[.los], instanceof, type[String]]] begin[{]
if[call[LAYOUT_CLASSIC.equalsIgnoreCase, parameter[Cast(expression=MemberReference(member=los, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]] begin[{]
assign[member[.lo], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClassicLayoutManager, sub_type=None))]
else begin[{]
if[call[LAYOUT_LIST.equalsIgnoreCase, parameter[Cast(expression=MemberReference(member=los, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))]]] begin[{]
assign[member[.lo], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ListLayoutManager, sub_type=None))]
else begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=lo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=los, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[MethodInvocation(arguments=[], member=newInstance, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=LayoutManager, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No valid LayoutManager: "), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=warn, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
end[}]
else begin[{]
None
end[}]
return[member[.lo]]
end[}]
END[}]
|
Keyword[protected] identifier[LayoutManager] identifier[getLayOutManagerObj] operator[SEP] identifier[ActionInvocation] identifier[_invocation] operator[SEP] {
Keyword[if] operator[SEP] identifier[layoutManager] operator[==] Other[null] operator[||] literal[String] operator[SEP] identifier[equals] operator[SEP] identifier[layoutManager] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[ClassicLayoutManager] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Object] identifier[los] operator[=] identifier[conditionalParse] operator[SEP] identifier[layoutManager] , identifier[_invocation] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[los] Keyword[instanceof] identifier[LayoutManager] operator[SEP] {
Keyword[return] operator[SEP] identifier[LayoutManager] operator[SEP] identifier[los] operator[SEP]
}
identifier[LayoutManager] identifier[lo] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[los] Keyword[instanceof] identifier[String] operator[SEP] {
Keyword[if] operator[SEP] identifier[LAYOUT_CLASSIC] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[los] operator[SEP] operator[SEP] identifier[lo] operator[=] Keyword[new] identifier[ClassicLayoutManager] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[LAYOUT_LIST] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[los] operator[SEP] operator[SEP] identifier[lo] operator[=] Keyword[new] identifier[ListLayoutManager] operator[SEP] operator[SEP] operator[SEP] Keyword[else] {
Keyword[try] {
identifier[lo] operator[=] operator[SEP] identifier[LayoutManager] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[los] operator[SEP] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[lo] operator[SEP]
}
|
public void setNetworkSourceIpV6(java.util.Collection<IpFilter> networkSourceIpV6) {
if (networkSourceIpV6 == null) {
this.networkSourceIpV6 = null;
return;
}
this.networkSourceIpV6 = new java.util.ArrayList<IpFilter>(networkSourceIpV6);
}
|
class class_name[name] begin[{]
method[setNetworkSourceIpV6, return_type[void], modifier[public], parameter[networkSourceIpV6]] begin[{]
if[binary_operation[member[.networkSourceIpV6], ==, literal[null]]] begin[{]
assign[THIS[member[None.networkSourceIpV6]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.networkSourceIpV6]], ClassCreator(arguments=[MemberReference(member=networkSourceIpV6, 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=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IpFilter, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setNetworkSourceIpV6] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[IpFilter] operator[>] identifier[networkSourceIpV6] operator[SEP] {
Keyword[if] operator[SEP] identifier[networkSourceIpV6] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[networkSourceIpV6] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[networkSourceIpV6] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[IpFilter] operator[>] operator[SEP] identifier[networkSourceIpV6] operator[SEP] operator[SEP]
}
|
public void addListenScope( Object scopeKey )
{
assert scopeKey != null;
if ( _listenScopes == null )
{
_listenScopes = new ArrayList();
}
_listenScopes.add( scopeKey );
}
|
class class_name[name] begin[{]
method[addListenScope, return_type[void], modifier[public], parameter[scopeKey]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=scopeKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=None)
if[binary_operation[member[._listenScopes], ==, literal[null]]] begin[{]
assign[member[._listenScopes], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
call[_listenScopes.add, parameter[member[.scopeKey]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[addListenScope] operator[SEP] identifier[Object] identifier[scopeKey] operator[SEP] {
Keyword[assert] identifier[scopeKey] operator[!=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[_listenScopes] operator[==] Other[null] operator[SEP] {
identifier[_listenScopes] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP]
}
identifier[_listenScopes] operator[SEP] identifier[add] operator[SEP] identifier[scopeKey] operator[SEP] operator[SEP]
}
|
public static ContentValues quoteWrap(ContentValues values) {
ContentValues quoteValues = null;
if (values != null) {
Map<String, Object> quoteMap = new HashMap<>();
for (Map.Entry<String, Object> value : values.valueSet()) {
quoteMap.put(CoreSQLUtils.quoteWrap(value.getKey()), value.getValue());
}
Parcel parcel = Parcel.obtain();
parcel.writeMap(quoteMap);
parcel.setDataPosition(0);
quoteValues = ContentValues.CREATOR.createFromParcel(parcel);
parcel.recycle();
}
return quoteValues;
}
|
class class_name[name] begin[{]
method[quoteWrap, return_type[type[ContentValues]], modifier[public static], parameter[values]] begin[{]
local_variable[type[ContentValues], quoteValues]
if[binary_operation[member[.values], !=, literal[null]]] begin[{]
local_variable[type[Map], quoteMap]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=quoteWrap, postfix_operators=[], prefix_operators=[], qualifier=CoreSQLUtils, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=quoteMap, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=valueSet, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
local_variable[type[Parcel], parcel]
call[parcel.writeMap, parameter[member[.quoteMap]]]
call[parcel.setDataPosition, parameter[literal[0]]]
assign[member[.quoteValues], call[ContentValues.CREATOR.createFromParcel, parameter[member[.parcel]]]]
call[parcel.recycle, parameter[]]
else begin[{]
None
end[}]
return[member[.quoteValues]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[ContentValues] identifier[quoteWrap] operator[SEP] identifier[ContentValues] identifier[values] operator[SEP] {
identifier[ContentValues] identifier[quoteValues] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[values] operator[!=] Other[null] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[quoteMap] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[String] , identifier[Object] operator[>] identifier[value] operator[:] identifier[values] operator[SEP] identifier[valueSet] operator[SEP] operator[SEP] operator[SEP] {
identifier[quoteMap] operator[SEP] identifier[put] operator[SEP] identifier[CoreSQLUtils] operator[SEP] identifier[quoteWrap] operator[SEP] identifier[value] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] , identifier[value] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[Parcel] identifier[parcel] operator[=] identifier[Parcel] operator[SEP] identifier[obtain] operator[SEP] operator[SEP] operator[SEP] identifier[parcel] operator[SEP] identifier[writeMap] operator[SEP] identifier[quoteMap] operator[SEP] operator[SEP] identifier[parcel] operator[SEP] identifier[setDataPosition] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[quoteValues] operator[=] identifier[ContentValues] operator[SEP] identifier[CREATOR] operator[SEP] identifier[createFromParcel] operator[SEP] identifier[parcel] operator[SEP] operator[SEP] identifier[parcel] operator[SEP] identifier[recycle] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[quoteValues] operator[SEP]
}
|
public static VcfHeader header(final Readable readable) throws IOException {
checkNotNull(readable);
ParseListener parseListener = new ParseListener();
VcfParser.parse(readable, parseListener);
return parseListener.getHeader();
}
|
class class_name[name] begin[{]
method[header, return_type[type[VcfHeader]], modifier[public static], parameter[readable]] begin[{]
call[.checkNotNull, parameter[member[.readable]]]
local_variable[type[ParseListener], parseListener]
call[VcfParser.parse, parameter[member[.readable], member[.parseListener]]]
return[call[parseListener.getHeader, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[VcfHeader] identifier[header] operator[SEP] Keyword[final] identifier[Readable] identifier[readable] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[checkNotNull] operator[SEP] identifier[readable] operator[SEP] operator[SEP] identifier[ParseListener] identifier[parseListener] operator[=] Keyword[new] identifier[ParseListener] operator[SEP] operator[SEP] operator[SEP] identifier[VcfParser] operator[SEP] identifier[parse] operator[SEP] identifier[readable] , identifier[parseListener] operator[SEP] operator[SEP] Keyword[return] identifier[parseListener] operator[SEP] identifier[getHeader] operator[SEP] operator[SEP] operator[SEP]
}
|
public int getPrintOptions()
throws DBException
{
int iHtmlOptions = super.getPrintOptions();
String strForms = this.getProperty(HtmlConstants.FORMS);
if ((strForms == null) || (strForms.length() == 0))
{
if (((DualReportScreen)this.getScreenField()).isPrintReport())
iHtmlOptions = iHtmlOptions & (~HtmlConstants.DONT_PRINT_SCREEN);
else
iHtmlOptions = iHtmlOptions | HtmlConstants.DONT_PRINT_SCREEN;
}
return iHtmlOptions;
}
|
class class_name[name] begin[{]
method[getPrintOptions, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[int], iHtmlOptions]
local_variable[type[String], strForms]
if[binary_operation[binary_operation[member[.strForms], ==, literal[null]], ||, binary_operation[call[strForms.length, parameter[]], ==, literal[0]]]] begin[{]
if[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getScreenField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=DualReportScreen, sub_type=None))] begin[{]
assign[member[.iHtmlOptions], binary_operation[member[.iHtmlOptions], &, member[HtmlConstants.DONT_PRINT_SCREEN]]]
else begin[{]
assign[member[.iHtmlOptions], binary_operation[member[.iHtmlOptions], |, member[HtmlConstants.DONT_PRINT_SCREEN]]]
end[}]
else begin[{]
None
end[}]
return[member[.iHtmlOptions]]
end[}]
END[}]
|
Keyword[public] Keyword[int] identifier[getPrintOptions] operator[SEP] operator[SEP] Keyword[throws] identifier[DBException] {
Keyword[int] identifier[iHtmlOptions] operator[=] Keyword[super] operator[SEP] identifier[getPrintOptions] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[strForms] operator[=] Keyword[this] operator[SEP] identifier[getProperty] operator[SEP] identifier[HtmlConstants] operator[SEP] identifier[FORMS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[strForms] operator[==] Other[null] operator[SEP] operator[||] operator[SEP] identifier[strForms] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[DualReportScreen] operator[SEP] Keyword[this] operator[SEP] identifier[getScreenField] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[isPrintReport] operator[SEP] operator[SEP] operator[SEP] identifier[iHtmlOptions] operator[=] identifier[iHtmlOptions] operator[&] operator[SEP] operator[~] identifier[HtmlConstants] operator[SEP] identifier[DONT_PRINT_SCREEN] operator[SEP] operator[SEP] Keyword[else] identifier[iHtmlOptions] operator[=] identifier[iHtmlOptions] operator[|] identifier[HtmlConstants] operator[SEP] identifier[DONT_PRINT_SCREEN] operator[SEP]
}
Keyword[return] identifier[iHtmlOptions] operator[SEP]
}
|
public void write(Variable v, Array values) throws java.io.IOException, InvalidRangeException {
if (ncfile != v.getNetcdfFile())
throw new IllegalArgumentException("Variable is not owned by this writer.");
write(v, new int[values.getRank()], values);
}
|
class class_name[name] begin[{]
method[write, return_type[void], modifier[public], parameter[v, values]] begin[{]
if[binary_operation[member[.ncfile], !=, call[v.getNetcdfFile, parameter[]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Variable is not owned by this writer.")], 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[.write, parameter[member[.v], ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=getRank, postfix_operators=[], prefix_operators=[], qualifier=values, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), member[.values]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[Variable] identifier[v] , identifier[Array] identifier[values] operator[SEP] Keyword[throws] identifier[java] operator[SEP] identifier[io] operator[SEP] identifier[IOException] , identifier[InvalidRangeException] {
Keyword[if] operator[SEP] identifier[ncfile] operator[!=] identifier[v] operator[SEP] identifier[getNetcdfFile] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[v] , Keyword[new] Keyword[int] operator[SEP] identifier[values] operator[SEP] identifier[getRank] operator[SEP] operator[SEP] operator[SEP] , identifier[values] operator[SEP] operator[SEP]
}
|
public static void unzip(String jarFile, Path destination) throws IOException {
Map<String, String> zipProperties = new HashMap<>();
/* We want to read an existing ZIP File, so we set this to false */
zipProperties.put("create", "false");
zipProperties.put("encoding", "UTF-8");
URI zipFile = URI.create("jar:" + jarFile);
try (FileSystem zipfs = FileSystems.newFileSystem(zipFile, zipProperties)) {
Path rootPath = zipfs.getPath("/");
Files.walkFileTree(rootPath, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {
Path targetPath = destination.resolve(rootPath.relativize(dir).toString());
if (!Files.exists(targetPath)) {
Files.createDirectory(targetPath);
}
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.copy(file, destination.resolve(rootPath.relativize(file).toString()), StandardCopyOption.COPY_ATTRIBUTES, StandardCopyOption.REPLACE_EXISTING);
return FileVisitResult.CONTINUE;
}
});
}
}
|
class class_name[name] begin[{]
method[unzip, return_type[void], modifier[public static], parameter[jarFile, destination]] begin[{]
local_variable[type[Map], zipProperties]
call[zipProperties.put, parameter[literal["create"], literal["false"]]]
call[zipProperties.put, parameter[literal["encoding"], literal["UTF-8"]]]
local_variable[type[URI], zipFile]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=getPath, postfix_operators=[], prefix_operators=[], qualifier=zipfs, selectors=[], type_arguments=None), name=rootPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=rootPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=dir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=relativize, postfix_operators=[], prefix_operators=[], qualifier=rootPath, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=destination, selectors=[], type_arguments=None), name=targetPath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=targetPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exists, postfix_operators=[], prefix_operators=['!'], qualifier=Files, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=targetPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createDirectory, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None)])), ReturnStatement(expression=MemberReference(member=CONTINUE, postfix_operators=[], prefix_operators=[], qualifier=FileVisitResult, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=preVisitDirectory, parameters=[FormalParameter(annotations=[], modifiers=set(), name=dir, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=attrs, type=ReferenceType(arguments=None, dimensions=[], name=BasicFileAttributes, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=FileVisitResult, sub_type=None), throws=['IOException'], type_parameters=None), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=file, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=relativize, postfix_operators=[], prefix_operators=[], qualifier=rootPath, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=destination, selectors=[], type_arguments=None), MemberReference(member=COPY_ATTRIBUTES, postfix_operators=[], prefix_operators=[], qualifier=StandardCopyOption, selectors=[]), MemberReference(member=REPLACE_EXISTING, postfix_operators=[], prefix_operators=[], qualifier=StandardCopyOption, selectors=[])], member=copy, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=CONTINUE, postfix_operators=[], prefix_operators=[], qualifier=FileVisitResult, selectors=[]), label=None)], documentation=None, modifiers={'public'}, name=visitFile, parameters=[FormalParameter(annotations=[], modifiers=set(), name=file, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers=set(), name=attrs, type=ReferenceType(arguments=None, dimensions=[], name=BasicFileAttributes, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=FileVisitResult, sub_type=None), throws=['IOException'], type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None))], dimensions=None, name=SimpleFileVisitor, sub_type=None))], member=walkFileTree, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=zipfs, type=ReferenceType(arguments=None, dimensions=[], name=FileSystem, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=zipFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=zipProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newFileSystem, postfix_operators=[], prefix_operators=[], qualifier=FileSystems, selectors=[], type_arguments=None))])
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[unzip] operator[SEP] identifier[String] identifier[jarFile] , identifier[Path] identifier[destination] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[zipProperties] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[zipProperties] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[zipProperties] operator[SEP] identifier[put] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[URI] identifier[zipFile] operator[=] identifier[URI] operator[SEP] identifier[create] operator[SEP] literal[String] operator[+] identifier[jarFile] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[FileSystem] identifier[zipfs] operator[=] identifier[FileSystems] operator[SEP] identifier[newFileSystem] operator[SEP] identifier[zipFile] , identifier[zipProperties] operator[SEP] operator[SEP] {
identifier[Path] identifier[rootPath] operator[=] identifier[zipfs] operator[SEP] identifier[getPath] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Files] operator[SEP] identifier[walkFileTree] operator[SEP] identifier[rootPath] , Keyword[new] identifier[SimpleFileVisitor] operator[<] identifier[Path] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[FileVisitResult] identifier[preVisitDirectory] operator[SEP] identifier[Path] identifier[dir] , identifier[BasicFileAttributes] identifier[attrs] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Path] identifier[targetPath] operator[=] identifier[destination] operator[SEP] identifier[resolve] operator[SEP] identifier[rootPath] operator[SEP] identifier[relativize] operator[SEP] identifier[dir] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[Files] operator[SEP] identifier[exists] operator[SEP] identifier[targetPath] operator[SEP] operator[SEP] {
identifier[Files] operator[SEP] identifier[createDirectory] operator[SEP] identifier[targetPath] operator[SEP] operator[SEP]
}
Keyword[return] identifier[FileVisitResult] operator[SEP] identifier[CONTINUE] operator[SEP]
} annotation[@] identifier[Override] Keyword[public] identifier[FileVisitResult] identifier[visitFile] operator[SEP] identifier[Path] identifier[file] , identifier[BasicFileAttributes] identifier[attrs] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Files] operator[SEP] identifier[copy] operator[SEP] identifier[file] , identifier[destination] operator[SEP] identifier[resolve] operator[SEP] identifier[rootPath] operator[SEP] identifier[relativize] operator[SEP] identifier[file] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] , identifier[StandardCopyOption] operator[SEP] identifier[COPY_ATTRIBUTES] , identifier[StandardCopyOption] operator[SEP] identifier[REPLACE_EXISTING] operator[SEP] operator[SEP] Keyword[return] identifier[FileVisitResult] operator[SEP] identifier[CONTINUE] operator[SEP]
}
} operator[SEP] operator[SEP]
}
}
|
@Override
protected void _to(final ObjectOutput out) throws IOException {
Term[] terms = index(Term.class, indexedTerms);
// 1: write number of terms
out.writeInt(terms.length);
for (int i = 0; i < terms.length; i++) {
// 1: write each term
out.writeObject(terms[i]);
}
// 2: write number of global terms
out.writeInt(globalTermIndex.size());
for (final Entry<Integer, Integer> e : entries(globalTermIndex)) {
Integer key = e.getKey();
Integer value = e.getValue();
// 1: write global term key
out.writeInt(key);
// 2: write global term value
out.writeInt(value);
}
}
|
class class_name[name] begin[{]
method[_to, return_type[void], modifier[protected], parameter[out]] begin[{]
local_variable[type[Term], terms]
call[out.writeInt, parameter[member[terms.length]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=terms, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=writeObject, postfix_operators=[], prefix_operators=[], qualifier=out, 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=terms, 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[out.writeInt, parameter[call[globalTermIndex.size, parameter[]]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=out, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=globalTermIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=entries, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=e)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=Entry, sub_type=None))), label=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[_to] operator[SEP] Keyword[final] identifier[ObjectOutput] identifier[out] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Term] operator[SEP] operator[SEP] identifier[terms] operator[=] identifier[index] operator[SEP] identifier[Term] operator[SEP] Keyword[class] , identifier[indexedTerms] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeInt] operator[SEP] identifier[terms] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[terms] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[out] operator[SEP] identifier[writeObject] operator[SEP] identifier[terms] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
identifier[out] operator[SEP] identifier[writeInt] operator[SEP] identifier[globalTermIndex] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[final] identifier[Entry] operator[<] identifier[Integer] , identifier[Integer] operator[>] identifier[e] operator[:] identifier[entries] operator[SEP] identifier[globalTermIndex] operator[SEP] operator[SEP] {
identifier[Integer] identifier[key] operator[=] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[Integer] identifier[value] operator[=] identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeInt] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[out] operator[SEP] identifier[writeInt] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
|
public String getAccuracyDescription(int numDigits) {
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMaximumFractionDigits(numDigits);
Triple<Double, Integer, Integer> accu = getAccuracyInfo();
return nf.format(accu.first()) + " (" + accu.second() + "/" + (accu.second() + accu.third()) + ")";
}
|
class class_name[name] begin[{]
method[getAccuracyDescription, return_type[type[String]], modifier[public], parameter[numDigits]] begin[{]
local_variable[type[NumberFormat], nf]
call[nf.setMaximumFractionDigits, parameter[member[.numDigits]]]
local_variable[type[Triple], accu]
return[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[call[nf.format, parameter[call[accu.first, parameter[]]]], +, literal[" ("]], +, call[accu.second, parameter[]]], +, literal["/"]], +, binary_operation[call[accu.second, parameter[]], +, call[accu.third, parameter[]]]], +, literal[")"]]]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[getAccuracyDescription] operator[SEP] Keyword[int] identifier[numDigits] operator[SEP] {
identifier[NumberFormat] identifier[nf] operator[=] identifier[NumberFormat] operator[SEP] identifier[getNumberInstance] operator[SEP] operator[SEP] operator[SEP] identifier[nf] operator[SEP] identifier[setMaximumFractionDigits] operator[SEP] identifier[numDigits] operator[SEP] operator[SEP] identifier[Triple] operator[<] identifier[Double] , identifier[Integer] , identifier[Integer] operator[>] identifier[accu] operator[=] identifier[getAccuracyInfo] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[nf] operator[SEP] identifier[format] operator[SEP] identifier[accu] operator[SEP] identifier[first] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[accu] operator[SEP] identifier[second] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] operator[SEP] identifier[accu] operator[SEP] identifier[second] operator[SEP] operator[SEP] operator[+] identifier[accu] operator[SEP] identifier[third] operator[SEP] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP]
}
|
public void setQuery(PrologCompiledClause query)
{
// Reset the search in order to initialize it.
resolutionSearch.reset();
// Keep a reference to the current query.
currentQuery = query;
// Create the starting point for the resolution, consisting of the queries to resolve as the intial goal stack,
// and an empty list of bindings.
goalStack = new StackQueue<BuiltInFunctor>();
// Create a fresh list to hold the results of the resolution in.
bindings = new StackQueue<Variable>();
// Create the initial state of the proof search.
ResolutionState initialState = new ResolutionStateImpl(query);
addStartState(initialState);
// If printing execution traces, ensure the execution indenter starts from zero.
/*if (TRACE)
{
indenter.reset();
}*/
}
|
class class_name[name] begin[{]
method[setQuery, return_type[void], modifier[public], parameter[query]] begin[{]
call[resolutionSearch.reset, parameter[]]
assign[member[.currentQuery], member[.query]]
assign[member[.goalStack], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=BuiltInFunctor, sub_type=None))], dimensions=None, name=StackQueue, sub_type=None))]
assign[member[.bindings], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Variable, sub_type=None))], dimensions=None, name=StackQueue, sub_type=None))]
local_variable[type[ResolutionState], initialState]
call[.addStartState, parameter[member[.initialState]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setQuery] operator[SEP] identifier[PrologCompiledClause] identifier[query] operator[SEP] {
identifier[resolutionSearch] operator[SEP] identifier[reset] operator[SEP] operator[SEP] operator[SEP] identifier[currentQuery] operator[=] identifier[query] operator[SEP] identifier[goalStack] operator[=] Keyword[new] identifier[StackQueue] operator[<] identifier[BuiltInFunctor] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[bindings] operator[=] Keyword[new] identifier[StackQueue] operator[<] identifier[Variable] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[ResolutionState] identifier[initialState] operator[=] Keyword[new] identifier[ResolutionStateImpl] operator[SEP] identifier[query] operator[SEP] operator[SEP] identifier[addStartState] operator[SEP] identifier[initialState] operator[SEP] operator[SEP]
}
|
@Override
public void addJob(final Job job) throws JobExistsException {
log.info("adding job: {}", job);
final JobId id = job.getId();
final UUID operationId = UUID.randomUUID();
final String creationPath = Paths.configJobCreation(id, operationId);
final ZooKeeperClient client = provider.get("addJob");
try {
try {
client.ensurePath(Paths.historyJob(id));
client.transaction(create(Paths.configJob(id), job),
create(Paths.configJobRefShort(id), id),
create(Paths.configJobHosts(id)),
create(creationPath),
// Touch the jobs root node so that its version is bumped on every job
// change down the tree. Effectively, make it that version == cVersion.
set(Paths.configJobs(), UUID.randomUUID().toString().getBytes()));
} catch (final NodeExistsException e) {
if (client.exists(creationPath) != null) {
// The job was created, we're done here
return;
}
throw new JobExistsException(id.toString());
}
} catch (NoNodeException e) {
throw new HeliosRuntimeException("adding job " + job + " failed due to missing ZK path: "
+ e.getPath(), e);
} catch (final KeeperException e) {
throw new HeliosRuntimeException("adding job " + job + " failed", e);
}
}
|
class class_name[name] begin[{]
method[addJob, return_type[void], modifier[public], parameter[job]] begin[{]
call[log.info, parameter[literal["adding job: {}"], member[.job]]]
local_variable[type[JobId], id]
local_variable[type[UUID], operationId]
local_variable[type[String], creationPath]
local_variable[type[ZooKeeperClient], client]
TryStatement(block=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=historyJob, postfix_operators=[], prefix_operators=[], qualifier=Paths, selectors=[], type_arguments=None)], member=ensurePath, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=configJob, postfix_operators=[], prefix_operators=[], qualifier=Paths, selectors=[], type_arguments=None), MemberReference(member=job, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=configJobRefShort, postfix_operators=[], prefix_operators=[], qualifier=Paths, selectors=[], type_arguments=None), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=configJobHosts, postfix_operators=[], prefix_operators=[], qualifier=Paths, selectors=[], type_arguments=None)], member=create, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=creationPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=configJobs, postfix_operators=[], prefix_operators=[], qualifier=Paths, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=randomUUID, postfix_operators=[], prefix_operators=[], qualifier=UUID, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getBytes, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=set, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=transaction, postfix_operators=[], prefix_operators=[], qualifier=client, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=creationPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=exists, postfix_operators=[], prefix_operators=[], qualifier=client, 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)])), ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=id, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JobExistsException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NodeExistsException']))], finally_block=None, label=None, resources=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="adding job "), operandr=MemberReference(member=job, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" failed due to missing ZK path: "), operator=+), operandr=MethodInvocation(arguments=[], member=getPath, 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=HeliosRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoNodeException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="adding job "), operandr=MemberReference(member=job, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" failed"), 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=HeliosRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['KeeperException']))], finally_block=None, label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[addJob] operator[SEP] Keyword[final] identifier[Job] identifier[job] operator[SEP] Keyword[throws] identifier[JobExistsException] {
identifier[log] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[job] operator[SEP] operator[SEP] Keyword[final] identifier[JobId] identifier[id] operator[=] identifier[job] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[UUID] identifier[operationId] operator[=] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[creationPath] operator[=] identifier[Paths] operator[SEP] identifier[configJobCreation] operator[SEP] identifier[id] , identifier[operationId] operator[SEP] operator[SEP] Keyword[final] identifier[ZooKeeperClient] identifier[client] operator[=] identifier[provider] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] {
Keyword[try] {
identifier[client] operator[SEP] identifier[ensurePath] operator[SEP] identifier[Paths] operator[SEP] identifier[historyJob] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP] identifier[client] operator[SEP] identifier[transaction] operator[SEP] identifier[create] operator[SEP] identifier[Paths] operator[SEP] identifier[configJob] operator[SEP] identifier[id] operator[SEP] , identifier[job] operator[SEP] , identifier[create] operator[SEP] identifier[Paths] operator[SEP] identifier[configJobRefShort] operator[SEP] identifier[id] operator[SEP] , identifier[id] operator[SEP] , identifier[create] operator[SEP] identifier[Paths] operator[SEP] identifier[configJobHosts] operator[SEP] identifier[id] operator[SEP] operator[SEP] , identifier[create] operator[SEP] identifier[creationPath] operator[SEP] , identifier[set] operator[SEP] identifier[Paths] operator[SEP] identifier[configJobs] operator[SEP] operator[SEP] , identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[getBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[NodeExistsException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[client] operator[SEP] identifier[exists] operator[SEP] identifier[creationPath] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[JobExistsException] operator[SEP] identifier[id] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[NoNodeException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[HeliosRuntimeException] operator[SEP] literal[String] operator[+] identifier[job] operator[+] literal[String] operator[+] identifier[e] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[KeeperException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[HeliosRuntimeException] operator[SEP] literal[String] operator[+] identifier[job] operator[+] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("unchecked")
public EList<IfcRelDefines> getIsDefinedBy() {
return (EList<IfcRelDefines>) eGet(Ifc2x3tc1Package.Literals.IFC_OBJECT__IS_DEFINED_BY, true);
}
|
class class_name[name] begin[{]
method[getIsDefinedBy, return_type[type[EList]], modifier[public], parameter[]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=IFC_OBJECT__IS_DEFINED_BY, postfix_operators=[], prefix_operators=[], qualifier=Ifc2x3tc1Package.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=IfcRelDefines, sub_type=None))], dimensions=[], name=EList, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[EList] operator[<] identifier[IfcRelDefines] operator[>] identifier[getIsDefinedBy] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[IfcRelDefines] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[Ifc2x3tc1Package] operator[SEP] identifier[Literals] operator[SEP] identifier[IFC_OBJECT__IS_DEFINED_BY] , literal[boolean] operator[SEP] operator[SEP]
}
|
public void setOwners(java.util.Collection<String> owners) {
if (owners == null) {
this.owners = null;
return;
}
this.owners = new com.amazonaws.internal.SdkInternalList<String>(owners);
}
|
class class_name[name] begin[{]
method[setOwners, return_type[void], modifier[public], parameter[owners]] begin[{]
if[binary_operation[member[.owners], ==, literal[null]]] begin[{]
assign[THIS[member[None.owners]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.owners]], ClassCreator(arguments=[MemberReference(member=owners, 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=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=String, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setOwners] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[owners] operator[SEP] {
Keyword[if] operator[SEP] identifier[owners] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[owners] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[owners] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[String] operator[>] operator[SEP] identifier[owners] operator[SEP] operator[SEP]
}
|
public static base_response update(nitro_service client, channel resource) throws Exception {
channel updateresource = new channel();
updateresource.id = resource.id;
updateresource.state = resource.state;
updateresource.mode = resource.mode;
updateresource.conndistr = resource.conndistr;
updateresource.macdistr = resource.macdistr;
updateresource.lamac = resource.lamac;
updateresource.speed = resource.speed;
updateresource.flowctl = resource.flowctl;
updateresource.hamonitor = resource.hamonitor;
updateresource.tagall = resource.tagall;
updateresource.trunk = resource.trunk;
updateresource.ifalias = resource.ifalias;
updateresource.throughput = resource.throughput;
updateresource.lrminthroughput = resource.lrminthroughput;
updateresource.bandwidthhigh = resource.bandwidthhigh;
updateresource.bandwidthnormal = resource.bandwidthnormal;
return updateresource.update_resource(client);
}
|
class class_name[name] begin[{]
method[update, return_type[type[base_response]], modifier[public static], parameter[client, resource]] begin[{]
local_variable[type[channel], updateresource]
assign[member[updateresource.id], member[resource.id]]
assign[member[updateresource.state], member[resource.state]]
assign[member[updateresource.mode], member[resource.mode]]
assign[member[updateresource.conndistr], member[resource.conndistr]]
assign[member[updateresource.macdistr], member[resource.macdistr]]
assign[member[updateresource.lamac], member[resource.lamac]]
assign[member[updateresource.speed], member[resource.speed]]
assign[member[updateresource.flowctl], member[resource.flowctl]]
assign[member[updateresource.hamonitor], member[resource.hamonitor]]
assign[member[updateresource.tagall], member[resource.tagall]]
assign[member[updateresource.trunk], member[resource.trunk]]
assign[member[updateresource.ifalias], member[resource.ifalias]]
assign[member[updateresource.throughput], member[resource.throughput]]
assign[member[updateresource.lrminthroughput], member[resource.lrminthroughput]]
assign[member[updateresource.bandwidthhigh], member[resource.bandwidthhigh]]
assign[member[updateresource.bandwidthnormal], member[resource.bandwidthnormal]]
return[call[updateresource.update_resource, parameter[member[.client]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[base_response] identifier[update] operator[SEP] identifier[nitro_service] identifier[client] , identifier[channel] identifier[resource] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[channel] identifier[updateresource] operator[=] Keyword[new] identifier[channel] operator[SEP] operator[SEP] operator[SEP] identifier[updateresource] operator[SEP] identifier[id] operator[=] identifier[resource] operator[SEP] identifier[id] operator[SEP] identifier[updateresource] operator[SEP] identifier[state] operator[=] identifier[resource] operator[SEP] identifier[state] operator[SEP] identifier[updateresource] operator[SEP] identifier[mode] operator[=] identifier[resource] operator[SEP] identifier[mode] operator[SEP] identifier[updateresource] operator[SEP] identifier[conndistr] operator[=] identifier[resource] operator[SEP] identifier[conndistr] operator[SEP] identifier[updateresource] operator[SEP] identifier[macdistr] operator[=] identifier[resource] operator[SEP] identifier[macdistr] operator[SEP] identifier[updateresource] operator[SEP] identifier[lamac] operator[=] identifier[resource] operator[SEP] identifier[lamac] operator[SEP] identifier[updateresource] operator[SEP] identifier[speed] operator[=] identifier[resource] operator[SEP] identifier[speed] operator[SEP] identifier[updateresource] operator[SEP] identifier[flowctl] operator[=] identifier[resource] operator[SEP] identifier[flowctl] operator[SEP] identifier[updateresource] operator[SEP] identifier[hamonitor] operator[=] identifier[resource] operator[SEP] identifier[hamonitor] operator[SEP] identifier[updateresource] operator[SEP] identifier[tagall] operator[=] identifier[resource] operator[SEP] identifier[tagall] operator[SEP] identifier[updateresource] operator[SEP] identifier[trunk] operator[=] identifier[resource] operator[SEP] identifier[trunk] operator[SEP] identifier[updateresource] operator[SEP] identifier[ifalias] operator[=] identifier[resource] operator[SEP] identifier[ifalias] operator[SEP] identifier[updateresource] operator[SEP] identifier[throughput] operator[=] identifier[resource] operator[SEP] identifier[throughput] operator[SEP] identifier[updateresource] operator[SEP] identifier[lrminthroughput] operator[=] identifier[resource] operator[SEP] identifier[lrminthroughput] operator[SEP] identifier[updateresource] operator[SEP] identifier[bandwidthhigh] operator[=] identifier[resource] operator[SEP] identifier[bandwidthhigh] operator[SEP] identifier[updateresource] operator[SEP] identifier[bandwidthnormal] operator[=] identifier[resource] operator[SEP] identifier[bandwidthnormal] operator[SEP] Keyword[return] identifier[updateresource] operator[SEP] identifier[update_resource] operator[SEP] identifier[client] operator[SEP] operator[SEP]
}
|
private void create(SegmentMeta []segmentMetaList,
ServicesAmp manager)
throws IOException
{
Objects.requireNonNull(segmentMetaList);
_store = buildStore(manager);
_store.create();
createMetaSegment(segmentMetaList);
_segmentId = 1;
}
|
class class_name[name] begin[{]
method[create, return_type[void], modifier[private], parameter[segmentMetaList, manager]] begin[{]
call[Objects.requireNonNull, parameter[member[.segmentMetaList]]]
assign[member[._store], call[.buildStore, parameter[member[.manager]]]]
call[_store.create, parameter[]]
call[.createMetaSegment, parameter[member[.segmentMetaList]]]
assign[member[._segmentId], literal[1]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[create] operator[SEP] identifier[SegmentMeta] operator[SEP] operator[SEP] identifier[segmentMetaList] , identifier[ServicesAmp] identifier[manager] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[segmentMetaList] operator[SEP] operator[SEP] identifier[_store] operator[=] identifier[buildStore] operator[SEP] identifier[manager] operator[SEP] operator[SEP] identifier[_store] operator[SEP] identifier[create] operator[SEP] operator[SEP] operator[SEP] identifier[createMetaSegment] operator[SEP] identifier[segmentMetaList] operator[SEP] operator[SEP] identifier[_segmentId] operator[=] Other[1] operator[SEP]
}
|
public static String removeFirst(final String text, final Pattern regex) {
return replaceFirst(text, regex, StringUtils.EMPTY);
}
|
class class_name[name] begin[{]
method[removeFirst, return_type[type[String]], modifier[public static], parameter[text, regex]] begin[{]
return[call[.replaceFirst, parameter[member[.text], member[.regex], member[StringUtils.EMPTY]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[removeFirst] operator[SEP] Keyword[final] identifier[String] identifier[text] , Keyword[final] identifier[Pattern] identifier[regex] operator[SEP] {
Keyword[return] identifier[replaceFirst] operator[SEP] identifier[text] , identifier[regex] , identifier[StringUtils] operator[SEP] identifier[EMPTY] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("unchecked")
public static <T> T unwrap(Parcelable input) {
if(input == null){
return null;
}
ParcelWrapper<T> wrapper = (ParcelWrapper<T>) input;
return wrapper.getParcel();
}
|
class class_name[name] begin[{]
method[unwrap, return_type[type[T]], modifier[public static], parameter[input]] begin[{]
if[binary_operation[member[.input], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[ParcelWrapper], wrapper]
return[call[wrapper.getParcel, parameter[]]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[unwrap] operator[SEP] identifier[Parcelable] identifier[input] operator[SEP] {
Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
identifier[ParcelWrapper] operator[<] identifier[T] operator[>] identifier[wrapper] operator[=] operator[SEP] identifier[ParcelWrapper] operator[<] identifier[T] operator[>] operator[SEP] identifier[input] operator[SEP] Keyword[return] identifier[wrapper] operator[SEP] identifier[getParcel] operator[SEP] operator[SEP] operator[SEP]
}
|
public void releasePermits(long number, Result result, long startNanos) {
releasePermits(number, result, startNanos, clock.nanoTime());
}
|
class class_name[name] begin[{]
method[releasePermits, return_type[void], modifier[public], parameter[number, result, startNanos]] begin[{]
call[.releasePermits, parameter[member[.number], member[.result], member[.startNanos], call[clock.nanoTime, parameter[]]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[releasePermits] operator[SEP] Keyword[long] identifier[number] , identifier[Result] identifier[result] , Keyword[long] identifier[startNanos] operator[SEP] {
identifier[releasePermits] operator[SEP] identifier[number] , identifier[result] , identifier[startNanos] , identifier[clock] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static int readCompressedInt(InputStream in) throws IOException {
int b1=in.read();
if(b1==-1) throw new EOFException();
if((b1&0x80)!=0) {
// 31 bit
int b2=in.read();
if(b2==-1) throw new EOFException();
int b3=in.read();
if(b3==-1) throw new EOFException();
int b4=in.read();
if(b4==-1) throw new EOFException();
return
((b1&0x40)==0 ? 0 : 0xc0000000)
| ((b1&0x3f)<<24)
| (b2<<16)
| (b3<<8)
| b4
;
} else if((b1&0x40)!=0) {
// 22 bit
int b2=in.read();
if(b2==-1) throw new EOFException();
int b3=in.read();
if(b3==-1) throw new EOFException();
return
((b1&0x20)==0 ? 0 : 0xffe00000)
| ((b1&0x1f)<<16)
| (b2<<8)
| b3
;
} else if((b1&0x20)!=0) {
// 13 bit
int b2=in.read();
if(b2==-1) throw new EOFException();
return
((b1&0x10)==0 ? 0 : 0xfffff000)
| ((b1&0x0f)<<8)
| b2
;
} else {
// 5 bit
return
((b1&0x10)==0 ? 0 : 0xfffffff0)
| (b1&0x0f)
;
}
}
|
class class_name[name] begin[{]
method[readCompressedInt, return_type[type[int]], modifier[public static], parameter[in]] begin[{]
local_variable[type[int], b1]
if[binary_operation[member[.b1], ==, literal[1]]] 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=EOFException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.b1], &, literal[0x80]], !=, literal[0]]] begin[{]
local_variable[type[int], b2]
if[binary_operation[member[.b2], ==, literal[1]]] 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=EOFException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], b3]
if[binary_operation[member[.b3], ==, literal[1]]] 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=EOFException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], b4]
if[binary_operation[member[.b4], ==, literal[1]]] 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=EOFException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[binary_operation[binary_operation[binary_operation[binary_operation[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=b1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x40), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xc0000000), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), |, binary_operation[binary_operation[member[.b1], &, literal[0x3f]], <<, literal[24]]], |, binary_operation[member[.b2], <<, literal[16]]], |, binary_operation[member[.b3], <<, literal[8]]], |, member[.b4]]]
else begin[{]
if[binary_operation[binary_operation[member[.b1], &, literal[0x40]], !=, literal[0]]] begin[{]
local_variable[type[int], b2]
if[binary_operation[member[.b2], ==, literal[1]]] 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=EOFException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[int], b3]
if[binary_operation[member[.b3], ==, literal[1]]] 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=EOFException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[binary_operation[binary_operation[binary_operation[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=b1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x20), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xffe00000), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), |, binary_operation[binary_operation[member[.b1], &, literal[0x1f]], <<, literal[16]]], |, binary_operation[member[.b2], <<, literal[8]]], |, member[.b3]]]
else begin[{]
if[binary_operation[binary_operation[member[.b1], &, literal[0x20]], !=, literal[0]]] begin[{]
local_variable[type[int], b2]
if[binary_operation[member[.b2], ==, literal[1]]] 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=EOFException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[binary_operation[binary_operation[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=b1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x10), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xfffff000), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), |, binary_operation[binary_operation[member[.b1], &, literal[0x0f]], <<, literal[8]]], |, member[.b2]]]
else begin[{]
return[binary_operation[TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=b1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0x10), operator=&), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0xfffffff0), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), |, binary_operation[member[.b1], &, literal[0x0f]]]]
end[}]
end[}]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[int] identifier[readCompressedInt] operator[SEP] identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[int] identifier[b1] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b1] operator[==] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[int] identifier[b2] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b2] operator[==] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[b3] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b3] operator[==] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[b4] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b4] operator[==] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[==] Other[0] operator[?] Other[0] operator[:] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[<<] Other[24] operator[SEP] operator[|] operator[SEP] identifier[b2] operator[<<] Other[16] operator[SEP] operator[|] operator[SEP] identifier[b3] operator[<<] Other[8] operator[SEP] operator[|] identifier[b4] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[int] identifier[b2] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b2] operator[==] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[b3] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b3] operator[==] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[==] Other[0] operator[?] Other[0] operator[:] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[<<] Other[16] operator[SEP] operator[|] operator[SEP] identifier[b2] operator[<<] Other[8] operator[SEP] operator[|] identifier[b3] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[int] identifier[b2] operator[=] identifier[in] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b2] operator[==] operator[-] Other[1] operator[SEP] Keyword[throw] Keyword[new] identifier[EOFException] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[==] Other[0] operator[?] Other[0] operator[:] literal[Integer] operator[SEP] operator[|] operator[SEP] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[<<] Other[8] operator[SEP] operator[|] identifier[b2] operator[SEP]
}
Keyword[else] {
Keyword[return] operator[SEP] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[==] Other[0] operator[?] Other[0] operator[:] literal[Integer] operator[SEP] operator[|] operator[SEP] identifier[b1] operator[&] literal[Integer] operator[SEP] operator[SEP]
}
}
|
public FASPConnectionInfo getFaspConnectionInfo(String bucketName) {
log.trace("AsperaTransferManager.getFaspConnectionInfo >> start " + System.nanoTime());
FASPConnectionInfo faspConnectionInfo = akCache.get(bucketName);
if (null == faspConnectionInfo) {
log.trace("AsperaTransferManager.getFaspConnectionInfo >> retrieve from COS " + System.nanoTime());
faspConnectionInfo = s3Client.getBucketFaspConnectionInfo(bucketName);
log.trace("AsperaTransferManager.getFaspConnectionInfo << retrieve from COS " + System.nanoTime());
if (null == faspConnectionInfo) {
throw new SdkClientException("Failed to retrieve faspConnectionInfo for bucket: " + bucketName);
}
akCache.put(bucketName, faspConnectionInfo);
}
log.trace("AsperaTransferManager.getFaspConnectionInfo << end " + System.nanoTime());
return faspConnectionInfo;
}
|
class class_name[name] begin[{]
method[getFaspConnectionInfo, return_type[type[FASPConnectionInfo]], modifier[public], parameter[bucketName]] begin[{]
call[log.trace, parameter[binary_operation[literal["AsperaTransferManager.getFaspConnectionInfo >> start "], +, call[System.nanoTime, parameter[]]]]]
local_variable[type[FASPConnectionInfo], faspConnectionInfo]
if[binary_operation[literal[null], ==, member[.faspConnectionInfo]]] begin[{]
call[log.trace, parameter[binary_operation[literal["AsperaTransferManager.getFaspConnectionInfo >> retrieve from COS "], +, call[System.nanoTime, parameter[]]]]]
assign[member[.faspConnectionInfo], call[s3Client.getBucketFaspConnectionInfo, parameter[member[.bucketName]]]]
call[log.trace, parameter[binary_operation[literal["AsperaTransferManager.getFaspConnectionInfo << retrieve from COS "], +, call[System.nanoTime, parameter[]]]]]
if[binary_operation[literal[null], ==, member[.faspConnectionInfo]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to retrieve faspConnectionInfo for bucket: "), operandr=MemberReference(member=bucketName, 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=SdkClientException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[akCache.put, parameter[member[.bucketName], member[.faspConnectionInfo]]]
else begin[{]
None
end[}]
call[log.trace, parameter[binary_operation[literal["AsperaTransferManager.getFaspConnectionInfo << end "], +, call[System.nanoTime, parameter[]]]]]
return[member[.faspConnectionInfo]]
end[}]
END[}]
|
Keyword[public] identifier[FASPConnectionInfo] identifier[getFaspConnectionInfo] operator[SEP] identifier[String] identifier[bucketName] operator[SEP] {
identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[FASPConnectionInfo] identifier[faspConnectionInfo] operator[=] identifier[akCache] operator[SEP] identifier[get] operator[SEP] identifier[bucketName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[faspConnectionInfo] operator[SEP] {
identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[faspConnectionInfo] operator[=] identifier[s3Client] operator[SEP] identifier[getBucketFaspConnectionInfo] operator[SEP] identifier[bucketName] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[faspConnectionInfo] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[bucketName] operator[SEP] operator[SEP]
}
identifier[akCache] operator[SEP] identifier[put] operator[SEP] identifier[bucketName] , identifier[faspConnectionInfo] operator[SEP] operator[SEP]
}
identifier[log] operator[SEP] identifier[trace] operator[SEP] literal[String] operator[+] identifier[System] operator[SEP] identifier[nanoTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[faspConnectionInfo] operator[SEP]
}
|
public static TableEntry unversioned(@NonNull ArrayView key, @NonNull ArrayView value) {
return new TableEntry(TableKey.unversioned(key), value);
}
|
class class_name[name] begin[{]
method[unversioned, return_type[type[TableEntry]], modifier[public static], parameter[key, value]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=unversioned, postfix_operators=[], prefix_operators=[], qualifier=TableKey, selectors=[], type_arguments=None), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TableEntry, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[TableEntry] identifier[unversioned] operator[SEP] annotation[@] identifier[NonNull] identifier[ArrayView] identifier[key] , annotation[@] identifier[NonNull] identifier[ArrayView] identifier[value] operator[SEP] {
Keyword[return] Keyword[new] identifier[TableEntry] operator[SEP] identifier[TableKey] operator[SEP] identifier[unversioned] operator[SEP] identifier[key] operator[SEP] , identifier[value] operator[SEP] operator[SEP]
}
|
public EquivalentParameter convert(Parameter p) {
if (p == null) return null;
return paramCvtr.convert(p);
}
|
class class_name[name] begin[{]
method[convert, return_type[type[EquivalentParameter]], modifier[public], parameter[p]] begin[{]
if[binary_operation[member[.p], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
return[call[paramCvtr.convert, parameter[member[.p]]]]
end[}]
END[}]
|
Keyword[public] identifier[EquivalentParameter] identifier[convert] operator[SEP] identifier[Parameter] identifier[p] operator[SEP] {
Keyword[if] operator[SEP] identifier[p] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[return] identifier[paramCvtr] operator[SEP] identifier[convert] operator[SEP] identifier[p] operator[SEP] operator[SEP]
}
|
public void reset() {
this.pp.setIndex(0);
this.pp.setErrorIndex(-1);
this.errorMessage = "";
this.warning = false;
this.rawValues = null;
}
|
class class_name[name] begin[{]
method[reset, return_type[void], modifier[public], parameter[]] begin[{]
THIS[member[None.pp]call[None.setIndex, parameter[literal[0]]]]
THIS[member[None.pp]call[None.setErrorIndex, parameter[literal[1]]]]
assign[THIS[member[None.errorMessage]], literal[""]]
assign[THIS[member[None.warning]], literal[false]]
assign[THIS[member[None.rawValues]], literal[null]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[reset] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[pp] operator[SEP] identifier[setIndex] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[pp] operator[SEP] identifier[setErrorIndex] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[errorMessage] operator[=] literal[String] operator[SEP] Keyword[this] operator[SEP] identifier[warning] operator[=] literal[boolean] operator[SEP] Keyword[this] operator[SEP] identifier[rawValues] operator[=] Other[null] operator[SEP]
}
|
@Override
public void generateReadProperty(Builder methodBuilder, String preferenceName, TypeName beanClass, String beanName, PrefsProperty property, boolean readAll, ReadType readType) {
if (readAll) {
methodBuilder.beginControlFlow("");
}
methodBuilder.addStatement("String temp=$L.getString($S, null)", preferenceName, property.getPreferenceKey());
if (readAll) {
methodBuilder.addCode(setter(beanClass, beanName, property) + (!property.isPublicField() && beanName!=null ? "(" : "="));
}
switch (readType) {
case NONE:
break;
case RETURN:
methodBuilder.addCode("return ");
break;
case VALUE:
methodBuilder.addCode("$T _value=", property.getPropertyType().getTypeName());
break;
}
methodBuilder.addCode("($T.hasText(temp)) ? ", StringUtils.class);
methodBuilder.addCode("$T.valueOf(temp)", typeName);
methodBuilder.addCode(": $L", getter(DEFAULT_BEAN_NAME, beanClass, property));
if (readAll) {
methodBuilder.addCode(!property.isPublicField() && beanName!=null ? ")" : "");
}
methodBuilder.addCode(";\n");
if (readAll) {
methodBuilder.endControlFlow();
}
}
|
class class_name[name] begin[{]
method[generateReadProperty, return_type[void], modifier[public], parameter[methodBuilder, preferenceName, beanClass, beanName, property, readAll, readType]] begin[{]
if[member[.readAll]] begin[{]
call[methodBuilder.beginControlFlow, parameter[literal[""]]]
else begin[{]
None
end[}]
call[methodBuilder.addStatement, parameter[literal["String temp=$L.getString($S, null)"], member[.preferenceName], call[property.getPreferenceKey, parameter[]]]]
if[member[.readAll]] begin[{]
call[methodBuilder.addCode, parameter[binary_operation[call[.setter, parameter[member[.beanClass], member[.beanName], member[.property]]], +, TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isPublicField, postfix_operators=[], prefix_operators=['!'], qualifier=property, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=beanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="="), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="("))]]]
else begin[{]
None
end[}]
SwitchStatement(cases=[SwitchStatementCase(case=['NONE'], statements=[BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['RETURN'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="return ")], member=addCode, postfix_operators=[], prefix_operators=[], qualifier=methodBuilder, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['VALUE'], statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="$T _value="), MethodInvocation(arguments=[], member=getPropertyType, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[MethodInvocation(arguments=[], member=getTypeName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=addCode, postfix_operators=[], prefix_operators=[], qualifier=methodBuilder, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=readType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
call[methodBuilder.addCode, parameter[literal["($T.hasText(temp)) ? "], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringUtils, sub_type=None))]]
call[methodBuilder.addCode, parameter[literal["$T.valueOf(temp)"], member[.typeName]]]
call[methodBuilder.addCode, parameter[literal[": $L"], call[.getter, parameter[member[.DEFAULT_BEAN_NAME], member[.beanClass], member[.property]]]]]
if[member[.readAll]] begin[{]
call[methodBuilder.addCode, parameter[TernaryExpression(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isPublicField, postfix_operators=[], prefix_operators=['!'], qualifier=property, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MemberReference(member=beanName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"))]]
else begin[{]
None
end[}]
call[methodBuilder.addCode, parameter[literal[";\n"]]]
if[member[.readAll]] begin[{]
call[methodBuilder.endControlFlow, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[generateReadProperty] operator[SEP] identifier[Builder] identifier[methodBuilder] , identifier[String] identifier[preferenceName] , identifier[TypeName] identifier[beanClass] , identifier[String] identifier[beanName] , identifier[PrefsProperty] identifier[property] , Keyword[boolean] identifier[readAll] , identifier[ReadType] identifier[readType] operator[SEP] {
Keyword[if] operator[SEP] identifier[readAll] operator[SEP] {
identifier[methodBuilder] operator[SEP] identifier[beginControlFlow] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[methodBuilder] operator[SEP] identifier[addStatement] operator[SEP] literal[String] , identifier[preferenceName] , identifier[property] operator[SEP] identifier[getPreferenceKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readAll] operator[SEP] {
identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] identifier[setter] operator[SEP] identifier[beanClass] , identifier[beanName] , identifier[property] operator[SEP] operator[+] operator[SEP] operator[!] identifier[property] operator[SEP] identifier[isPublicField] operator[SEP] operator[SEP] operator[&&] identifier[beanName] operator[!=] Other[null] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[readType] operator[SEP] {
Keyword[case] identifier[NONE] operator[:] Keyword[break] operator[SEP] Keyword[case] identifier[RETURN] operator[:] identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[VALUE] operator[:] identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] literal[String] , identifier[property] operator[SEP] identifier[getPropertyType] operator[SEP] operator[SEP] operator[SEP] identifier[getTypeName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] literal[String] , identifier[StringUtils] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] literal[String] , identifier[typeName] operator[SEP] operator[SEP] identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] literal[String] , identifier[getter] operator[SEP] identifier[DEFAULT_BEAN_NAME] , identifier[beanClass] , identifier[property] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readAll] operator[SEP] {
identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] operator[!] identifier[property] operator[SEP] identifier[isPublicField] operator[SEP] operator[SEP] operator[&&] identifier[beanName] operator[!=] Other[null] operator[?] literal[String] operator[:] literal[String] operator[SEP] operator[SEP]
}
identifier[methodBuilder] operator[SEP] identifier[addCode] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[readAll] operator[SEP] {
identifier[methodBuilder] operator[SEP] identifier[endControlFlow] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@Override
public QueueConnectionFactory createQueueConnectionFactory(JmsJcaConnectionFactory jcaConnectionFactory) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "createQueueConnectionFactory", jcaConnectionFactory);
QueueConnectionFactory qcf = new JmsManagedQueueConnectionFactoryImpl(jcaConnectionFactory);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "createQueueConnectionFactory", qcf);
return qcf;
}
|
class class_name[name] begin[{]
method[createQueueConnectionFactory, return_type[type[QueueConnectionFactory]], modifier[public], parameter[jcaConnectionFactory]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[THIS[], member[.tc], literal["createQueueConnectionFactory"], member[.jcaConnectionFactory]]]
else begin[{]
None
end[}]
local_variable[type[QueueConnectionFactory], qcf]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[THIS[], member[.tc], literal["createQueueConnectionFactory"], member[.qcf]]]
else begin[{]
None
end[}]
return[member[.qcf]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[QueueConnectionFactory] identifier[createQueueConnectionFactory] operator[SEP] identifier[JmsJcaConnectionFactory] identifier[jcaConnectionFactory] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[jcaConnectionFactory] operator[SEP] operator[SEP] identifier[QueueConnectionFactory] identifier[qcf] operator[=] Keyword[new] identifier[JmsManagedQueueConnectionFactoryImpl] operator[SEP] identifier[jcaConnectionFactory] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[tc] , literal[String] , identifier[qcf] operator[SEP] operator[SEP] Keyword[return] identifier[qcf] operator[SEP]
}
|
void registerKnownDrivers() {
if (appConfig.allowedDrivers == null) {
return;
}
for (String driverName : appConfig.allowedDrivers) {
try {
Class.forName(driverName);
} catch (Throwable t) {
// ignore
}
}
}
|
class class_name[name] begin[{]
method[registerKnownDrivers, return_type[void], modifier[default], parameter[]] begin[{]
if[binary_operation[member[appConfig.allowedDrivers], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=driverName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=t, types=['Throwable']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=allowedDrivers, postfix_operators=[], prefix_operators=[], qualifier=appConfig, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=driverName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
end[}]
END[}]
|
Keyword[void] identifier[registerKnownDrivers] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[appConfig] operator[SEP] identifier[allowedDrivers] operator[==] Other[null] operator[SEP] {
Keyword[return] operator[SEP]
}
Keyword[for] operator[SEP] identifier[String] identifier[driverName] operator[:] identifier[appConfig] operator[SEP] identifier[allowedDrivers] operator[SEP] {
Keyword[try] {
identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[driverName] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
}
}
}
|
public void register(Class src, Class target) {
List<BeanMappingObject> objects = BeanMappingParser.parseMapping(src, target);
for (BeanMappingObject object : objects) {
register(object);
}
}
|
class class_name[name] begin[{]
method[register, return_type[void], modifier[public], parameter[src, target]] begin[{]
local_variable[type[List], objects]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=register, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=objects, 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=BeanMappingObject, sub_type=None))), label=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[register] operator[SEP] identifier[Class] identifier[src] , identifier[Class] identifier[target] operator[SEP] {
identifier[List] operator[<] identifier[BeanMappingObject] operator[>] identifier[objects] operator[=] identifier[BeanMappingParser] operator[SEP] identifier[parseMapping] operator[SEP] identifier[src] , identifier[target] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[BeanMappingObject] identifier[object] operator[:] identifier[objects] operator[SEP] {
identifier[register] operator[SEP] identifier[object] operator[SEP] operator[SEP]
}
}
|
public static final Function<Object,Boolean> between(final Object min, final Object max) {
return new Between(min, max);
}
|
class class_name[name] begin[{]
method[between, return_type[type[Function]], modifier[final public static], parameter[min, max]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=min, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=max, 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=Between, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[final] identifier[Function] operator[<] identifier[Object] , identifier[Boolean] operator[>] identifier[between] operator[SEP] Keyword[final] identifier[Object] identifier[min] , Keyword[final] identifier[Object] identifier[max] operator[SEP] {
Keyword[return] Keyword[new] identifier[Between] operator[SEP] identifier[min] , identifier[max] operator[SEP] operator[SEP]
}
|
public static int deserializeTaskId(byte[] ser) {
Input _kryoInput = new Input(1);
_kryoInput.setBuffer(ser);
return _kryoInput.readInt();
}
|
class class_name[name] begin[{]
method[deserializeTaskId, return_type[type[int]], modifier[public static], parameter[ser]] begin[{]
local_variable[type[Input], _kryoInput]
call[_kryoInput.setBuffer, parameter[member[.ser]]]
return[call[_kryoInput.readInt, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[int] identifier[deserializeTaskId] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[ser] operator[SEP] {
identifier[Input] identifier[_kryoInput] operator[=] Keyword[new] identifier[Input] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[_kryoInput] operator[SEP] identifier[setBuffer] operator[SEP] identifier[ser] operator[SEP] operator[SEP] Keyword[return] identifier[_kryoInput] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP]
}
|
public static void navigateToActivity(Context A, Class<?> B, Bundle extras) {
Intent myIntent = new Intent(A, B);
myIntent.putExtras(extras);
A.startActivity(myIntent);
}
|
class class_name[name] begin[{]
method[navigateToActivity, return_type[void], modifier[public static], parameter[A, B, extras]] begin[{]
local_variable[type[Intent], myIntent]
call[myIntent.putExtras, parameter[member[.extras]]]
call[A.startActivity, parameter[member[.myIntent]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[navigateToActivity] operator[SEP] identifier[Context] identifier[A] , identifier[Class] operator[<] operator[?] operator[>] identifier[B] , identifier[Bundle] identifier[extras] operator[SEP] {
identifier[Intent] identifier[myIntent] operator[=] Keyword[new] identifier[Intent] operator[SEP] identifier[A] , identifier[B] operator[SEP] operator[SEP] identifier[myIntent] operator[SEP] identifier[putExtras] operator[SEP] identifier[extras] operator[SEP] operator[SEP] identifier[A] operator[SEP] identifier[startActivity] operator[SEP] identifier[myIntent] operator[SEP] operator[SEP]
}
|
public static String shuffle(String str, Random rnd)
{
return new String(XArrays.shuffle(str.toCharArray(), rnd));
}
|
class class_name[name] begin[{]
method[shuffle, return_type[type[String]], modifier[public static], parameter[str, rnd]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toCharArray, postfix_operators=[], prefix_operators=[], qualifier=str, selectors=[], type_arguments=None), MemberReference(member=rnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=shuffle, postfix_operators=[], prefix_operators=[], qualifier=XArrays, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[shuffle] operator[SEP] identifier[String] identifier[str] , identifier[Random] identifier[rnd] operator[SEP] {
Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[XArrays] operator[SEP] identifier[shuffle] operator[SEP] identifier[str] operator[SEP] identifier[toCharArray] operator[SEP] operator[SEP] , identifier[rnd] operator[SEP] operator[SEP] operator[SEP]
}
|
private void addRecentExample(final String text, final ExampleData data, final boolean select) {
WMenuItem item = new WMenuItem(text, new SelectExampleAction());
item.setCancel(true);
menu.add(item);
item.setActionObject(data);
if (select) {
menu.setSelectedMenuItem(item);
}
}
|
class class_name[name] begin[{]
method[addRecentExample, return_type[void], modifier[private], parameter[text, data, select]] begin[{]
local_variable[type[WMenuItem], item]
call[item.setCancel, parameter[literal[true]]]
call[menu.add, parameter[member[.item]]]
call[item.setActionObject, parameter[member[.data]]]
if[member[.select]] begin[{]
call[menu.setSelectedMenuItem, parameter[member[.item]]]
else begin[{]
None
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[addRecentExample] operator[SEP] Keyword[final] identifier[String] identifier[text] , Keyword[final] identifier[ExampleData] identifier[data] , Keyword[final] Keyword[boolean] identifier[select] operator[SEP] {
identifier[WMenuItem] identifier[item] operator[=] Keyword[new] identifier[WMenuItem] operator[SEP] identifier[text] , Keyword[new] identifier[SelectExampleAction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[setCancel] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[menu] operator[SEP] identifier[add] operator[SEP] identifier[item] operator[SEP] operator[SEP] identifier[item] operator[SEP] identifier[setActionObject] operator[SEP] identifier[data] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[select] operator[SEP] {
identifier[menu] operator[SEP] identifier[setSelectedMenuItem] operator[SEP] identifier[item] operator[SEP] operator[SEP]
}
}
|
public static String removeEndIgnoreCase(final String str, final String removeStr) {
if (N.isNullOrEmpty(str) || N.isNullOrEmpty(removeStr)) {
return str;
}
if (endsWithIgnoreCase(str, removeStr)) {
return str.substring(0, str.length() - removeStr.length());
}
return str;
}
|
class class_name[name] begin[{]
method[removeEndIgnoreCase, return_type[type[String]], modifier[public static], parameter[str, removeStr]] begin[{]
if[binary_operation[call[N.isNullOrEmpty, parameter[member[.str]]], ||, call[N.isNullOrEmpty, parameter[member[.removeStr]]]]] begin[{]
return[member[.str]]
else begin[{]
None
end[}]
if[call[.endsWithIgnoreCase, parameter[member[.str], member[.removeStr]]]] begin[{]
return[call[str.substring, parameter[literal[0], binary_operation[call[str.length, parameter[]], -, call[removeStr.length, parameter[]]]]]]
else begin[{]
None
end[}]
return[member[.str]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[removeEndIgnoreCase] operator[SEP] Keyword[final] identifier[String] identifier[str] , Keyword[final] identifier[String] identifier[removeStr] operator[SEP] {
Keyword[if] operator[SEP] identifier[N] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[str] operator[SEP] operator[||] identifier[N] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[removeStr] operator[SEP] operator[SEP] {
Keyword[return] identifier[str] operator[SEP]
}
Keyword[if] operator[SEP] identifier[endsWithIgnoreCase] operator[SEP] identifier[str] , identifier[removeStr] operator[SEP] operator[SEP] {
Keyword[return] identifier[str] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[str] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[-] identifier[removeStr] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[str] operator[SEP]
}
|
public final void setScrollableArea(@NonNull final ScrollableArea scrollableArea) {
Condition.INSTANCE.ensureNotNull(scrollableArea, "The scrollable area may not be null");
this.scrollableArea = scrollableArea;
addAreas();
}
|
class class_name[name] begin[{]
method[setScrollableArea, return_type[void], modifier[final public], parameter[scrollableArea]] begin[{]
call[Condition.INSTANCE.ensureNotNull, parameter[member[.scrollableArea], literal["The scrollable area may not be null"]]]
assign[THIS[member[None.scrollableArea]], member[.scrollableArea]]
call[.addAreas, parameter[]]
end[}]
END[}]
|
Keyword[public] Keyword[final] Keyword[void] identifier[setScrollableArea] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[ScrollableArea] identifier[scrollableArea] operator[SEP] {
identifier[Condition] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[ensureNotNull] operator[SEP] identifier[scrollableArea] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[scrollableArea] operator[=] identifier[scrollableArea] operator[SEP] identifier[addAreas] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <E, C extends Counter<E>> double saferL2Norm(C c) {
double maxVal = 0.0;
for (E key : c.keySet()) {
double value = Math.abs(c.getCount(key));
if (value > maxVal)
maxVal = value;
}
double sqrSum = 0.0;
for (E key : c.keySet()) {
double count = c.getCount(key);
sqrSum += Math.pow(count / maxVal, 2);
}
return maxVal * Math.sqrt(sqrSum);
}
|
class class_name[name] begin[{]
method[saferL2Norm, return_type[type[double]], modifier[public static], parameter[c]] begin[{]
local_variable[type[double], maxVal]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCount, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)], member=abs, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=double)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=maxVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))), label=None)
local_variable[type[double], sqrSum]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getCount, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), name=count)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sqrSum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], member=pow, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))), label=None)
return[binary_operation[member[.maxVal], *, call[Math.sqrt, parameter[member[.sqrSum]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[E] , identifier[C] Keyword[extends] identifier[Counter] operator[<] identifier[E] operator[>] operator[>] Keyword[double] identifier[saferL2Norm] operator[SEP] identifier[C] identifier[c] operator[SEP] {
Keyword[double] identifier[maxVal] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] identifier[E] identifier[key] operator[:] identifier[c] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[double] identifier[value] operator[=] identifier[Math] operator[SEP] identifier[abs] operator[SEP] identifier[c] operator[SEP] identifier[getCount] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[>] identifier[maxVal] operator[SEP] identifier[maxVal] operator[=] identifier[value] operator[SEP]
}
Keyword[double] identifier[sqrSum] operator[=] literal[Float] operator[SEP] Keyword[for] operator[SEP] identifier[E] identifier[key] operator[:] identifier[c] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] {
Keyword[double] identifier[count] operator[=] identifier[c] operator[SEP] identifier[getCount] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[sqrSum] operator[+=] identifier[Math] operator[SEP] identifier[pow] operator[SEP] identifier[count] operator[/] identifier[maxVal] , Other[2] operator[SEP] operator[SEP]
}
Keyword[return] identifier[maxVal] operator[*] identifier[Math] operator[SEP] identifier[sqrt] operator[SEP] identifier[sqrSum] operator[SEP] operator[SEP]
}
|
public static double intPow(double b, int e) {
double result = 1.0;
double currPow = b;
while (e > 0) {
if ((e & 1) != 0) {
result *= currPow;
}
currPow *= currPow;
e >>= 1;
}
return result;
}
|
class class_name[name] begin[{]
method[intPow, return_type[type[double]], modifier[public static], parameter[b, e]] begin[{]
local_variable[type[double], result]
local_variable[type[double], currPow]
while[binary_operation[member[.e], >, literal[0]]] begin[{]
if[binary_operation[binary_operation[member[.e], &, literal[1]], !=, literal[0]]] begin[{]
assign[member[.result], member[.currPow]]
else begin[{]
None
end[}]
assign[member[.currPow], member[.currPow]]
assign[member[.e], literal[1]]
end[}]
return[member[.result]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[double] identifier[intPow] operator[SEP] Keyword[double] identifier[b] , Keyword[int] identifier[e] operator[SEP] {
Keyword[double] identifier[result] operator[=] literal[Float] operator[SEP] Keyword[double] identifier[currPow] operator[=] identifier[b] operator[SEP] Keyword[while] operator[SEP] identifier[e] operator[>] Other[0] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] identifier[e] operator[&] Other[1] operator[SEP] operator[!=] Other[0] operator[SEP] {
identifier[result] operator[*=] identifier[currPow] operator[SEP]
}
identifier[currPow] operator[*=] identifier[currPow] operator[SEP] identifier[e] operator[>>=] Other[1] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void disableAll(){
javaMemoryProducers =
javaMemoryPoolProducers =
javaThreadingProducers =
osProducer =
runtimeProducer =
mbeanProducers =
gcProducer =
errorProducer =
false;
}
|
class class_name[name] begin[{]
method[disableAll, return_type[void], modifier[public], parameter[]] begin[{]
assign[member[.javaMemoryProducers], assign[member[.javaMemoryPoolProducers], assign[member[.javaThreadingProducers], assign[member[.osProducer], assign[member[.runtimeProducer], assign[member[.mbeanProducers], assign[member[.gcProducer], assign[member[.errorProducer], literal[false]]]]]]]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[disableAll] operator[SEP] operator[SEP] {
identifier[javaMemoryProducers] operator[=] identifier[javaMemoryPoolProducers] operator[=] identifier[javaThreadingProducers] operator[=] identifier[osProducer] operator[=] identifier[runtimeProducer] operator[=] identifier[mbeanProducers] operator[=] identifier[gcProducer] operator[=] identifier[errorProducer] operator[=] literal[boolean] operator[SEP]
}
|
public Hours toStandardHours() {
checkYearsAndMonths("Hours");
long millis = getMillis(); // assign to a long
millis += ((long) getSeconds()) * DateTimeConstants.MILLIS_PER_SECOND;
millis += ((long) getMinutes()) * DateTimeConstants.MILLIS_PER_MINUTE;
long hours = millis / DateTimeConstants.MILLIS_PER_HOUR;
hours = FieldUtils.safeAdd(hours, getHours());
hours = FieldUtils.safeAdd(hours, ((long) getDays()) * ((long) DateTimeConstants.HOURS_PER_DAY));
hours = FieldUtils.safeAdd(hours, ((long) getWeeks()) * ((long) DateTimeConstants.HOURS_PER_WEEK));
return Hours.hours(FieldUtils.safeToInt(hours));
}
|
class class_name[name] begin[{]
method[toStandardHours, return_type[type[Hours]], modifier[public], parameter[]] begin[{]
call[.checkYearsAndMonths, parameter[literal["Hours"]]]
local_variable[type[long], millis]
assign[member[.millis], binary_operation[Cast(expression=MethodInvocation(arguments=[], member=getSeconds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), *, member[DateTimeConstants.MILLIS_PER_SECOND]]]
assign[member[.millis], binary_operation[Cast(expression=MethodInvocation(arguments=[], member=getMinutes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), *, member[DateTimeConstants.MILLIS_PER_MINUTE]]]
local_variable[type[long], hours]
assign[member[.hours], call[FieldUtils.safeAdd, parameter[member[.hours], call[.getHours, parameter[]]]]]
assign[member[.hours], call[FieldUtils.safeAdd, parameter[member[.hours], binary_operation[Cast(expression=MethodInvocation(arguments=[], member=getDays, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), *, Cast(expression=MemberReference(member=HOURS_PER_DAY, postfix_operators=[], prefix_operators=[], qualifier=DateTimeConstants, selectors=[]), type=BasicType(dimensions=[], name=long))]]]]
assign[member[.hours], call[FieldUtils.safeAdd, parameter[member[.hours], binary_operation[Cast(expression=MethodInvocation(arguments=[], member=getWeeks, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), *, Cast(expression=MemberReference(member=HOURS_PER_WEEK, postfix_operators=[], prefix_operators=[], qualifier=DateTimeConstants, selectors=[]), type=BasicType(dimensions=[], name=long))]]]]
return[call[Hours.hours, parameter[call[FieldUtils.safeToInt, parameter[member[.hours]]]]]]
end[}]
END[}]
|
Keyword[public] identifier[Hours] identifier[toStandardHours] operator[SEP] operator[SEP] {
identifier[checkYearsAndMonths] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[long] identifier[millis] operator[=] identifier[getMillis] operator[SEP] operator[SEP] operator[SEP] identifier[millis] operator[+=] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getSeconds] operator[SEP] operator[SEP] operator[SEP] operator[*] identifier[DateTimeConstants] operator[SEP] identifier[MILLIS_PER_SECOND] operator[SEP] identifier[millis] operator[+=] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getMinutes] operator[SEP] operator[SEP] operator[SEP] operator[*] identifier[DateTimeConstants] operator[SEP] identifier[MILLIS_PER_MINUTE] operator[SEP] Keyword[long] identifier[hours] operator[=] identifier[millis] operator[/] identifier[DateTimeConstants] operator[SEP] identifier[MILLIS_PER_HOUR] operator[SEP] identifier[hours] operator[=] identifier[FieldUtils] operator[SEP] identifier[safeAdd] operator[SEP] identifier[hours] , identifier[getHours] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[hours] operator[=] identifier[FieldUtils] operator[SEP] identifier[safeAdd] operator[SEP] identifier[hours] , operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getDays] operator[SEP] operator[SEP] operator[SEP] operator[*] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[DateTimeConstants] operator[SEP] identifier[HOURS_PER_DAY] operator[SEP] operator[SEP] operator[SEP] identifier[hours] operator[=] identifier[FieldUtils] operator[SEP] identifier[safeAdd] operator[SEP] identifier[hours] , operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[getWeeks] operator[SEP] operator[SEP] operator[SEP] operator[*] operator[SEP] operator[SEP] Keyword[long] operator[SEP] identifier[DateTimeConstants] operator[SEP] identifier[HOURS_PER_WEEK] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Hours] operator[SEP] identifier[hours] operator[SEP] identifier[FieldUtils] operator[SEP] identifier[safeToInt] operator[SEP] identifier[hours] operator[SEP] operator[SEP] operator[SEP]
}
|
private void addDependency(DynamicProperty dynamic, String placeholder) {
List<DynamicProperty> l = placeholderToDynamics.get(placeholder);
if (l == null) {
l = new ArrayList<DynamicProperty>();
placeholderToDynamics.put(placeholder, l);
}
if (!l.contains(dynamic)) {
l.add(dynamic);
}
dynamic.addPlaceholder(placeholder);
}
|
class class_name[name] begin[{]
method[addDependency, return_type[void], modifier[private], parameter[dynamic, placeholder]] begin[{]
local_variable[type[List], l]
if[binary_operation[member[.l], ==, literal[null]]] begin[{]
assign[member[.l], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=DynamicProperty, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
call[placeholderToDynamics.put, parameter[member[.placeholder], member[.l]]]
else begin[{]
None
end[}]
if[call[l.contains, parameter[member[.dynamic]]]] begin[{]
call[l.add, parameter[member[.dynamic]]]
else begin[{]
None
end[}]
call[dynamic.addPlaceholder, parameter[member[.placeholder]]]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[addDependency] operator[SEP] identifier[DynamicProperty] identifier[dynamic] , identifier[String] identifier[placeholder] operator[SEP] {
identifier[List] operator[<] identifier[DynamicProperty] operator[>] identifier[l] operator[=] identifier[placeholderToDynamics] operator[SEP] identifier[get] operator[SEP] identifier[placeholder] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l] operator[==] Other[null] operator[SEP] {
identifier[l] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[DynamicProperty] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[placeholderToDynamics] operator[SEP] identifier[put] operator[SEP] identifier[placeholder] , identifier[l] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[l] operator[SEP] identifier[contains] operator[SEP] identifier[dynamic] operator[SEP] operator[SEP] {
identifier[l] operator[SEP] identifier[add] operator[SEP] identifier[dynamic] operator[SEP] operator[SEP]
}
identifier[dynamic] operator[SEP] identifier[addPlaceholder] operator[SEP] identifier[placeholder] operator[SEP] operator[SEP]
}
|
private synchronized String getCallerIdName10()
{
if (!callerIdCreated)
{
rawCallerId = request.get("callerid");
callerIdCreated = true;
}
return AstUtil.parseCallerId(rawCallerId)[0];
}
|
class class_name[name] begin[{]
method[getCallerIdName10, return_type[type[String]], modifier[synchronized private], parameter[]] begin[{]
if[member[.callerIdCreated]] begin[{]
assign[member[.rawCallerId], call[request.get, parameter[literal["callerid"]]]]
assign[member[.callerIdCreated], literal[true]]
else begin[{]
None
end[}]
return[call[AstUtil.parseCallerId, parameter[member[.rawCallerId]]]]
end[}]
END[}]
|
Keyword[private] Keyword[synchronized] identifier[String] identifier[getCallerIdName10] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[callerIdCreated] operator[SEP] {
identifier[rawCallerId] operator[=] identifier[request] operator[SEP] identifier[get] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[callerIdCreated] operator[=] literal[boolean] operator[SEP]
}
Keyword[return] identifier[AstUtil] operator[SEP] identifier[parseCallerId] operator[SEP] identifier[rawCallerId] operator[SEP] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("MissingPermission")
static boolean getWifiConnected(Context context) {
if (context != null && PackageManager.PERMISSION_GRANTED == context.checkCallingOrSelfPermission(Manifest.permission.ACCESS_NETWORK_STATE)) {
ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo wifiInfo = null;
if (connManager != null) {
wifiInfo = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
}
return ((wifiInfo != null) && wifiInfo.isConnected());
}
return false;
}
|
class class_name[name] begin[{]
method[getWifiConnected, return_type[type[boolean]], modifier[static], parameter[context]] begin[{]
if[binary_operation[binary_operation[member[.context], !=, literal[null]], &&, binary_operation[member[PackageManager.PERMISSION_GRANTED], ==, call[context.checkCallingOrSelfPermission, parameter[member[Manifest.permission.ACCESS_NETWORK_STATE]]]]]] begin[{]
local_variable[type[ConnectivityManager], connManager]
local_variable[type[NetworkInfo], wifiInfo]
if[binary_operation[member[.connManager], !=, literal[null]]] begin[{]
assign[member[.wifiInfo], call[connManager.getNetworkInfo, parameter[member[ConnectivityManager.TYPE_WIFI]]]]
else begin[{]
None
end[}]
return[binary_operation[binary_operation[member[.wifiInfo], !=, literal[null]], &&, call[wifiInfo.isConnected, parameter[]]]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[static] Keyword[boolean] identifier[getWifiConnected] operator[SEP] identifier[Context] identifier[context] operator[SEP] {
Keyword[if] operator[SEP] identifier[context] operator[!=] Other[null] operator[&&] identifier[PackageManager] operator[SEP] identifier[PERMISSION_GRANTED] operator[==] identifier[context] operator[SEP] identifier[checkCallingOrSelfPermission] operator[SEP] identifier[Manifest] operator[SEP] identifier[permission] operator[SEP] identifier[ACCESS_NETWORK_STATE] operator[SEP] operator[SEP] {
identifier[ConnectivityManager] identifier[connManager] operator[=] operator[SEP] identifier[ConnectivityManager] operator[SEP] identifier[context] operator[SEP] identifier[getSystemService] operator[SEP] identifier[Context] operator[SEP] identifier[CONNECTIVITY_SERVICE] operator[SEP] operator[SEP] identifier[NetworkInfo] identifier[wifiInfo] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[connManager] operator[!=] Other[null] operator[SEP] {
identifier[wifiInfo] operator[=] identifier[connManager] operator[SEP] identifier[getNetworkInfo] operator[SEP] identifier[ConnectivityManager] operator[SEP] identifier[TYPE_WIFI] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] operator[SEP] identifier[wifiInfo] operator[!=] Other[null] operator[SEP] operator[&&] identifier[wifiInfo] operator[SEP] identifier[isConnected] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public Observable<ServiceResponse<EventSubscriptionInner>> updateWithServiceResponseAsync(String scope, String eventSubscriptionName, EventSubscriptionUpdateParameters eventSubscriptionUpdateParameters) {
if (scope == null) {
throw new IllegalArgumentException("Parameter scope is required and cannot be null.");
}
if (eventSubscriptionName == null) {
throw new IllegalArgumentException("Parameter eventSubscriptionName is required and cannot be null.");
}
if (eventSubscriptionUpdateParameters == null) {
throw new IllegalArgumentException("Parameter eventSubscriptionUpdateParameters 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(eventSubscriptionUpdateParameters);
Observable<Response<ResponseBody>> observable = service.update(scope, eventSubscriptionName, eventSubscriptionUpdateParameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<EventSubscriptionInner>() { }.getType());
}
|
class class_name[name] begin[{]
method[updateWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[scope, eventSubscriptionName, eventSubscriptionUpdateParameters]] begin[{]
if[binary_operation[member[.scope], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter scope 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[.eventSubscriptionName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter eventSubscriptionName 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[.eventSubscriptionUpdateParameters], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter eventSubscriptionUpdateParameters 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[.eventSubscriptionUpdateParameters]]]
local_variable[type[Observable], observable]
return[call[client.getAzureClient, parameter[]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[EventSubscriptionInner] operator[>] operator[>] identifier[updateWithServiceResponseAsync] operator[SEP] identifier[String] identifier[scope] , identifier[String] identifier[eventSubscriptionName] , identifier[EventSubscriptionUpdateParameters] identifier[eventSubscriptionUpdateParameters] operator[SEP] {
Keyword[if] operator[SEP] identifier[scope] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[eventSubscriptionName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[eventSubscriptionUpdateParameters] 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[eventSubscriptionUpdateParameters] operator[SEP] operator[SEP] identifier[Observable] operator[<] identifier[Response] operator[<] identifier[ResponseBody] operator[>] operator[>] identifier[observable] operator[=] identifier[service] operator[SEP] identifier[update] operator[SEP] identifier[scope] , identifier[eventSubscriptionName] , identifier[eventSubscriptionUpdateParameters] , 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] Keyword[return] identifier[client] operator[SEP] identifier[getAzureClient] operator[SEP] operator[SEP] operator[SEP] identifier[getPutOrPatchResultAsync] operator[SEP] identifier[observable] , Keyword[new] identifier[TypeToken] operator[<] identifier[EventSubscriptionInner] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(Trust trust, ProtocolMarshaller protocolMarshaller) {
if (trust == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(trust.getDirectoryId(), DIRECTORYID_BINDING);
protocolMarshaller.marshall(trust.getTrustId(), TRUSTID_BINDING);
protocolMarshaller.marshall(trust.getRemoteDomainName(), REMOTEDOMAINNAME_BINDING);
protocolMarshaller.marshall(trust.getTrustType(), TRUSTTYPE_BINDING);
protocolMarshaller.marshall(trust.getTrustDirection(), TRUSTDIRECTION_BINDING);
protocolMarshaller.marshall(trust.getTrustState(), TRUSTSTATE_BINDING);
protocolMarshaller.marshall(trust.getCreatedDateTime(), CREATEDDATETIME_BINDING);
protocolMarshaller.marshall(trust.getLastUpdatedDateTime(), LASTUPDATEDDATETIME_BINDING);
protocolMarshaller.marshall(trust.getStateLastUpdatedDateTime(), STATELASTUPDATEDDATETIME_BINDING);
protocolMarshaller.marshall(trust.getTrustStateReason(), TRUSTSTATEREASON_BINDING);
protocolMarshaller.marshall(trust.getSelectiveAuth(), SELECTIVEAUTH_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[trust, protocolMarshaller]] begin[{]
if[binary_operation[member[.trust], ==, 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=getDirectoryId, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=DIRECTORYID_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=getTrustId, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=TRUSTID_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=getRemoteDomainName, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=REMOTEDOMAINNAME_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=getTrustType, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=TRUSTTYPE_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=getTrustDirection, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=TRUSTDIRECTION_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=getTrustState, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=TRUSTSTATE_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=getCreatedDateTime, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=CREATEDDATETIME_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=getLastUpdatedDateTime, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=LASTUPDATEDDATETIME_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=getStateLastUpdatedDateTime, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=STATELASTUPDATEDDATETIME_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=getTrustStateReason, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=TRUSTSTATEREASON_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=getSelectiveAuth, postfix_operators=[], prefix_operators=[], qualifier=trust, selectors=[], type_arguments=None), MemberReference(member=SELECTIVEAUTH_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[Trust] identifier[trust] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[trust] 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[trust] operator[SEP] identifier[getDirectoryId] operator[SEP] operator[SEP] , identifier[DIRECTORYID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trust] operator[SEP] identifier[getTrustId] operator[SEP] operator[SEP] , identifier[TRUSTID_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trust] operator[SEP] identifier[getRemoteDomainName] operator[SEP] operator[SEP] , identifier[REMOTEDOMAINNAME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trust] operator[SEP] identifier[getTrustType] operator[SEP] operator[SEP] , identifier[TRUSTTYPE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trust] operator[SEP] identifier[getTrustDirection] operator[SEP] operator[SEP] , identifier[TRUSTDIRECTION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trust] operator[SEP] identifier[getTrustState] operator[SEP] operator[SEP] , identifier[TRUSTSTATE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trust] operator[SEP] identifier[getCreatedDateTime] operator[SEP] operator[SEP] , identifier[CREATEDDATETIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trust] operator[SEP] identifier[getLastUpdatedDateTime] operator[SEP] operator[SEP] , identifier[LASTUPDATEDDATETIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trust] operator[SEP] identifier[getStateLastUpdatedDateTime] operator[SEP] operator[SEP] , identifier[STATELASTUPDATEDDATETIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trust] operator[SEP] identifier[getTrustStateReason] operator[SEP] operator[SEP] , identifier[TRUSTSTATEREASON_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[trust] operator[SEP] identifier[getSelectiveAuth] operator[SEP] operator[SEP] , identifier[SELECTIVEAUTH_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public static List validate(
InputSource xml, URL schemaURL, boolean skipTargetNamespaceException) {
return validate(xml, schemaURL, skipTargetNamespaceException, null);
}
|
class class_name[name] begin[{]
method[validate, return_type[type[List]], modifier[public static], parameter[xml, schemaURL, skipTargetNamespaceException]] begin[{]
return[call[.validate, parameter[member[.xml], member[.schemaURL], member[.skipTargetNamespaceException], literal[null]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[List] identifier[validate] operator[SEP] identifier[InputSource] identifier[xml] , identifier[URL] identifier[schemaURL] , Keyword[boolean] identifier[skipTargetNamespaceException] operator[SEP] {
Keyword[return] identifier[validate] operator[SEP] identifier[xml] , identifier[schemaURL] , identifier[skipTargetNamespaceException] , Other[null] operator[SEP] operator[SEP]
}
|
public static synchronized List<Class< ? >> locateAll(final String serviceName) {
if ( serviceName == null ) {
throw new IllegalArgumentException( "serviceName cannot be null" );
}
List<Class< ? >> classes = new ArrayList<Class< ? >>();
if ( factories != null ) {
List<Callable<Class< ? >>> l = factories.get( serviceName );
if ( l != null ) {
for ( Callable<Class< ? >> c : l ) {
try {
classes.add( c.call() );
} catch ( Exception e ) {
}
}
}
}
return classes;
}
|
class class_name[name] begin[{]
method[locateAll, return_type[type[List]], modifier[synchronized public static], parameter[serviceName]] begin[{]
if[binary_operation[member[.serviceName], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="serviceName 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[}]
local_variable[type[List], classes]
if[binary_operation[member[.factories], !=, literal[null]]] begin[{]
local_variable[type[List], l]
if[binary_operation[member[.l], !=, literal[null]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=call, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=classes, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=c)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=?, type=None)], dimensions=[], name=Class, sub_type=None))], dimensions=[], name=Callable, sub_type=None))), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.classes]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[synchronized] identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[locateAll] operator[SEP] Keyword[final] identifier[String] identifier[serviceName] operator[SEP] {
Keyword[if] operator[SEP] identifier[serviceName] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[List] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[classes] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[factories] operator[!=] Other[null] operator[SEP] {
identifier[List] operator[<] identifier[Callable] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] operator[>] identifier[l] operator[=] identifier[factories] operator[SEP] identifier[get] operator[SEP] identifier[serviceName] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[l] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[Callable] operator[<] identifier[Class] operator[<] operator[?] operator[>] operator[>] identifier[c] operator[:] identifier[l] operator[SEP] {
Keyword[try] {
identifier[classes] operator[SEP] identifier[add] operator[SEP] identifier[c] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
}
}
}
}
Keyword[return] identifier[classes] operator[SEP]
}
|
@Override
public void w(String tag, String message) {
Log.w(tag, message);
// writeToFile(Level.WARNING, tag, message);
// sendLogs("w", tag, message);
}
|
class class_name[name] begin[{]
method[w, return_type[void], modifier[public], parameter[tag, message]] begin[{]
call[Log.w, parameter[member[.tag], member[.message]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[w] operator[SEP] identifier[String] identifier[tag] , identifier[String] identifier[message] operator[SEP] {
identifier[Log] operator[SEP] identifier[w] operator[SEP] identifier[tag] , identifier[message] operator[SEP] operator[SEP]
}
|
public static EventModel createEvent(ModelForm form, Object model) throws Exception {
EventModel em = new EventModel();
try {
PropertyUtils.copyProperties(model, form);
em.setModelIF(model);
String action = form.getAction();
em.setActionName(action);
em.setActionType(FormBeanUtil.actionTransfer(action));
} catch (Exception ex) {
Debug.logError("[JdonFramework]create Event error:" + ex, module);
throw new Exception(ex);
}
return em;
}
|
class class_name[name] begin[{]
method[createEvent, return_type[type[EventModel]], modifier[public static], parameter[form, model]] begin[{]
local_variable[type[EventModel], em]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=form, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=copyProperties, postfix_operators=[], prefix_operators=[], qualifier=PropertyUtils, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setModelIF, postfix_operators=[], prefix_operators=[], qualifier=em, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getAction, postfix_operators=[], prefix_operators=[], qualifier=form, selectors=[], type_arguments=None), name=action)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setActionName, postfix_operators=[], prefix_operators=[], qualifier=em, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=actionTransfer, postfix_operators=[], prefix_operators=[], qualifier=FormBeanUtil, selectors=[], type_arguments=None)], member=setActionType, postfix_operators=[], prefix_operators=[], qualifier=em, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[JdonFramework]create Event error:"), operandr=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logError, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Exception, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['Exception']))], finally_block=None, label=None, resources=None)
return[member[.em]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[EventModel] identifier[createEvent] operator[SEP] identifier[ModelForm] identifier[form] , identifier[Object] identifier[model] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[EventModel] identifier[em] operator[=] Keyword[new] identifier[EventModel] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[PropertyUtils] operator[SEP] identifier[copyProperties] operator[SEP] identifier[model] , identifier[form] operator[SEP] operator[SEP] identifier[em] operator[SEP] identifier[setModelIF] operator[SEP] identifier[model] operator[SEP] operator[SEP] identifier[String] identifier[action] operator[=] identifier[form] operator[SEP] identifier[getAction] operator[SEP] operator[SEP] operator[SEP] identifier[em] operator[SEP] identifier[setActionName] operator[SEP] identifier[action] operator[SEP] operator[SEP] identifier[em] operator[SEP] identifier[setActionType] operator[SEP] identifier[FormBeanUtil] operator[SEP] identifier[actionTransfer] operator[SEP] identifier[action] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[Debug] operator[SEP] identifier[logError] operator[SEP] literal[String] operator[+] identifier[ex] , identifier[module] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[Exception] operator[SEP] identifier[ex] operator[SEP] operator[SEP]
}
Keyword[return] identifier[em] operator[SEP]
}
|
public synchronized void addConsumer(Consumer consumer, ConsumerConfiguration configuration, int instances) {
for (int i=0; i < instances; i++) {
this.consumerHolders.add(new ConsumerHolder(consumer, configuration));
}
}
|
class class_name[name] begin[{]
method[addConsumer, return_type[void], modifier[synchronized public], parameter[consumer, configuration, instances]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=consumerHolders, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=consumer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=configuration, 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=ConsumerHolder, sub_type=None))], member=add, 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=instances, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}]
|
Keyword[public] Keyword[synchronized] Keyword[void] identifier[addConsumer] operator[SEP] identifier[Consumer] identifier[consumer] , identifier[ConsumerConfiguration] identifier[configuration] , Keyword[int] identifier[instances] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[instances] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[this] operator[SEP] identifier[consumerHolders] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[ConsumerHolder] operator[SEP] identifier[consumer] , identifier[configuration] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@CheckForNull
public static Date parseDateQuietly(@Nullable String s) {
Date date = null;
if (s != null) {
try {
date = parseDate(s);
} catch (RuntimeException e) {
// ignore
}
}
return date;
}
|
class class_name[name] begin[{]
method[parseDateQuietly, return_type[type[Date]], modifier[public static], parameter[s]] begin[{]
local_variable[type[Date], date]
if[binary_operation[member[.s], !=, literal[null]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=date, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RuntimeException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
return[member[.date]]
end[}]
END[}]
|
annotation[@] identifier[CheckForNull] Keyword[public] Keyword[static] identifier[Date] identifier[parseDateQuietly] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[s] operator[SEP] {
identifier[Date] identifier[date] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[s] operator[!=] Other[null] operator[SEP] {
Keyword[try] {
identifier[date] operator[=] identifier[parseDate] operator[SEP] identifier[s] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[e] operator[SEP] {
}
}
Keyword[return] identifier[date] operator[SEP]
}
|
public StreamEx<T> peekFirst(Consumer<? super T> action) {
return mapFirst(x -> {
action.accept(x);
return x;
});
}
|
class class_name[name] begin[{]
method[peekFirst, return_type[type[StreamEx]], modifier[public], parameter[action]] begin[{]
return[call[.mapFirst, parameter[LambdaExpression(body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], parameters=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]]
end[}]
END[}]
|
Keyword[public] identifier[StreamEx] operator[<] identifier[T] operator[>] identifier[peekFirst] operator[SEP] identifier[Consumer] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[action] operator[SEP] {
Keyword[return] identifier[mapFirst] operator[SEP] identifier[x] operator[->] {
identifier[action] operator[SEP] identifier[accept] operator[SEP] identifier[x] operator[SEP] operator[SEP] Keyword[return] identifier[x] operator[SEP]
} operator[SEP] operator[SEP]
}
|
private List<CharSequence> getNavigationPreferenceTitles(
final Collection<NavigationPreference> navigationPreferences) {
List<CharSequence> titles = new LinkedList<>();
for (NavigationPreference navigationPreference : navigationPreferences) {
titles.add(navigationPreference.getTitle());
}
return titles;
}
|
class class_name[name] begin[{]
method[getNavigationPreferenceTitles, return_type[type[List]], modifier[private], parameter[navigationPreferences]] begin[{]
local_variable[type[List], titles]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getTitle, postfix_operators=[], prefix_operators=[], qualifier=navigationPreference, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=titles, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=navigationPreferences, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=navigationPreference)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NavigationPreference, sub_type=None))), label=None)
return[member[.titles]]
end[}]
END[}]
|
Keyword[private] identifier[List] operator[<] identifier[CharSequence] operator[>] identifier[getNavigationPreferenceTitles] operator[SEP] Keyword[final] identifier[Collection] operator[<] identifier[NavigationPreference] operator[>] identifier[navigationPreferences] operator[SEP] {
identifier[List] operator[<] identifier[CharSequence] operator[>] identifier[titles] operator[=] Keyword[new] identifier[LinkedList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[NavigationPreference] identifier[navigationPreference] operator[:] identifier[navigationPreferences] operator[SEP] {
identifier[titles] operator[SEP] identifier[add] operator[SEP] identifier[navigationPreference] operator[SEP] identifier[getTitle] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[titles] operator[SEP]
}
|
public static String getElementContent(final Element el,
final boolean trim) throws SAXException {
StringBuilder sb = new StringBuilder();
NodeList children = el.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node curnode = children.item(i);
if (curnode.getNodeType() == Node.TEXT_NODE) {
sb.append(curnode.getNodeValue());
} else if (curnode.getNodeType() == Node.CDATA_SECTION_NODE) {
sb.append(curnode.getNodeValue());
} else if (curnode.getNodeType() == Node.COMMENT_NODE) {
// Ignore
} else {
throw new SAXException("Unexpected child node " + curnode.getLocalName() +
" for " + el.getLocalName());
}
}
if (!trim) {
return sb.toString();
}
return sb.toString().trim();
}
|
class class_name[name] begin[{]
method[getElementContent, return_type[type[String]], modifier[public static], parameter[el, trim]] begin[{]
local_variable[type[StringBuilder], sb]
local_variable[type[NodeList], children]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), name=curnode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNodeType, postfix_operators=[], prefix_operators=[], qualifier=curnode, selectors=[], type_arguments=None), operandr=MemberReference(member=TEXT_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNodeType, postfix_operators=[], prefix_operators=[], qualifier=curnode, selectors=[], type_arguments=None), operandr=MemberReference(member=CDATA_SECTION_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[]), operator===), else_statement=IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getNodeType, postfix_operators=[], prefix_operators=[], qualifier=curnode, selectors=[], type_arguments=None), operandr=MemberReference(member=COMMENT_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[]), operator===), else_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unexpected child node "), operandr=MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=curnode, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for "), operator=+), operandr=MethodInvocation(arguments=[], member=getLocalName, postfix_operators=[], prefix_operators=[], qualifier=el, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SAXException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNodeValue, postfix_operators=[], prefix_operators=[], qualifier=curnode, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getNodeValue, postfix_operators=[], prefix_operators=[], qualifier=curnode, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=children, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[member[.trim]] begin[{]
return[call[sb.toString, parameter[]]]
else begin[{]
None
end[}]
return[call[sb.toString, parameter[]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[getElementContent] operator[SEP] Keyword[final] identifier[Element] identifier[el] , Keyword[final] Keyword[boolean] identifier[trim] operator[SEP] Keyword[throws] identifier[SAXException] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[children] operator[=] identifier[el] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[children] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Node] identifier[curnode] operator[=] identifier[children] operator[SEP] identifier[item] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[curnode] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[TEXT_NODE] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[curnode] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[curnode] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[CDATA_SECTION_NODE] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[curnode] operator[SEP] identifier[getNodeValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[curnode] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[COMMENT_NODE] operator[SEP] {
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[SAXException] operator[SEP] literal[String] operator[+] identifier[curnode] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[el] operator[SEP] identifier[getLocalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[trim] operator[SEP] {
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[trim] operator[SEP] operator[SEP] operator[SEP]
}
|
private void provideDocumentCreationTime(JCas jcas,
Date documentCreationTime)
throws DocumentCreationTimeMissingException {
if (documentCreationTime == null) {
// Document creation time is missing
if (documentType == DocumentType.NEWS) {
// But should be provided in case of news-document
throw new DocumentCreationTimeMissingException();
}
if (documentType == DocumentType.COLLOQUIAL) {
// But should be provided in case of colloquial-document
throw new DocumentCreationTimeMissingException();
}
} else {
// Document creation time provided
// Translate it to expected string format
SimpleDateFormat dateFormatter = new SimpleDateFormat(
"yyyy.MM.dd'T'HH:mm");
String formattedDCT = dateFormatter.format(documentCreationTime);
// Create dct object for jcas
Dct dct = new Dct(jcas);
dct.setValue(formattedDCT);
dct.addToIndexes();
}
}
|
class class_name[name] begin[{]
method[provideDocumentCreationTime, return_type[void], modifier[private], parameter[jcas, documentCreationTime]] begin[{]
if[binary_operation[member[.documentCreationTime], ==, literal[null]]] begin[{]
if[binary_operation[member[.documentType], ==, member[DocumentType.NEWS]]] 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=DocumentCreationTimeMissingException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.documentType], ==, member[DocumentType.COLLOQUIAL]]] 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=DocumentCreationTimeMissingException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
local_variable[type[SimpleDateFormat], dateFormatter]
local_variable[type[String], formattedDCT]
local_variable[type[Dct], dct]
call[dct.setValue, parameter[member[.formattedDCT]]]
call[dct.addToIndexes, parameter[]]
end[}]
end[}]
END[}]
|
Keyword[private] Keyword[void] identifier[provideDocumentCreationTime] operator[SEP] identifier[JCas] identifier[jcas] , identifier[Date] identifier[documentCreationTime] operator[SEP] Keyword[throws] identifier[DocumentCreationTimeMissingException] {
Keyword[if] operator[SEP] identifier[documentCreationTime] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[documentType] operator[==] identifier[DocumentType] operator[SEP] identifier[NEWS] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DocumentCreationTimeMissingException] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[documentType] operator[==] identifier[DocumentType] operator[SEP] identifier[COLLOQUIAL] operator[SEP] {
Keyword[throw] Keyword[new] identifier[DocumentCreationTimeMissingException] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[SimpleDateFormat] identifier[dateFormatter] operator[=] Keyword[new] identifier[SimpleDateFormat] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[formattedDCT] operator[=] identifier[dateFormatter] operator[SEP] identifier[format] operator[SEP] identifier[documentCreationTime] operator[SEP] operator[SEP] identifier[Dct] identifier[dct] operator[=] Keyword[new] identifier[Dct] operator[SEP] identifier[jcas] operator[SEP] operator[SEP] identifier[dct] operator[SEP] identifier[setValue] operator[SEP] identifier[formattedDCT] operator[SEP] operator[SEP] identifier[dct] operator[SEP] identifier[addToIndexes] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public static String getSqlFile(String fileName) {
String file = "/jk/sql/".concat(fileName);
logger.debug("Loading sql file: ", file);
return readFile(file);
}
|
class class_name[name] begin[{]
method[getSqlFile, return_type[type[String]], modifier[public static], parameter[fileName]] begin[{]
local_variable[type[String], file]
call[logger.debug, parameter[literal["Loading sql file: "], member[.file]]]
return[call[.readFile, parameter[member[.file]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[getSqlFile] operator[SEP] identifier[String] identifier[fileName] operator[SEP] {
identifier[String] identifier[file] operator[=] literal[String] operator[SEP] identifier[concat] operator[SEP] identifier[fileName] operator[SEP] operator[SEP] identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[file] operator[SEP] operator[SEP] Keyword[return] identifier[readFile] operator[SEP] identifier[file] operator[SEP] operator[SEP]
}
|
public void init(LblTree t1, LblTree t2) {
LabelDictionary ld = new LabelDictionary();
it1 = new InfoTree(t1, ld);
it2 = new InfoTree(t2, ld);
size1 = it1.getSize();
size2 = it2.getSize();
IJ = new int[Math.max(size1, size2)][Math.max(size1, size2)];
delta = new double[size1][size2];
deltaBit = new byte[size1][size2];
costV = new long[3][size1][size2];
costW = new long[3][size2];
// Calculate delta between every leaf in G (empty tree) and all the nodes in F.
// Calculate it both sides: leafs of F and nodes of G & leafs of G and nodes of
// F.
int[] labels1 = it1.getInfoArray(POST2_LABEL);
int[] labels2 = it2.getInfoArray(POST2_LABEL);
int[] sizes1 = it1.getInfoArray(POST2_SIZE);
int[] sizes2 = it2.getInfoArray(POST2_SIZE);
for (int x = 0; x < sizes1.length; x++) { // for all nodes of initially left tree
for (int y = 0; y < sizes2.length; y++) { // for all nodes of initially right tree
// This is an attempt for distances of single-node subtree and anything alse
// The differences between pairs of labels are stored
if (labels1[x] == labels2[y]) {
deltaBit[x][y] = 0;
} else {
deltaBit[x][y] =
1; // if this set, the labels differ, cost of relabeling is set
// to costMatch
}
if (sizes1[x] == 1 && sizes2[y] == 1) { // both nodes are leafs
delta[x][y] = 0;
} else {
if (sizes1[x] == 1) {
delta[x][y] = sizes2[y] - 1;
}
if (sizes2[y] == 1) {
delta[x][y] = sizes1[x] - 1;
}
}
}
}
}
|
class class_name[name] begin[{]
method[init, return_type[void], modifier[public], parameter[t1, t2]] begin[{]
local_variable[type[LabelDictionary], ld]
assign[member[.it1], ClassCreator(arguments=[MemberReference(member=t1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ld, 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=InfoTree, sub_type=None))]
assign[member[.it2], ClassCreator(arguments=[MemberReference(member=t2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ld, 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=InfoTree, sub_type=None))]
assign[member[.size1], call[it1.getSize, parameter[]]]
assign[member[.size2], call[it2.getSize, parameter[]]]
assign[member[.IJ], ArrayCreator(dimensions=[MethodInvocation(arguments=[MemberReference(member=size1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=size2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), MethodInvocation(arguments=[MemberReference(member=size1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=size2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=max, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]
assign[member[.delta], ArrayCreator(dimensions=[MemberReference(member=size1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=size2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=double))]
assign[member[.deltaBit], ArrayCreator(dimensions=[MemberReference(member=size1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=size2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=byte))]
assign[member[.costV], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=size1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=size2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long))]
assign[member[.costW], ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), MemberReference(member=size2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=long))]
local_variable[type[int], labels1]
local_variable[type[int], labels2]
local_variable[type[int], sizes1]
local_variable[type[int], sizes2]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=labels1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=labels2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator===), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=deltaBit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=deltaBit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=sizes1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operandr=BinaryOperation(operandl=MemberReference(member=sizes2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), operator=&&), else_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sizes1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=sizes2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), label=None)])), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=sizes2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=sizes1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)), label=None)]))]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=sizes2, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=sizes1, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[init] operator[SEP] identifier[LblTree] identifier[t1] , identifier[LblTree] identifier[t2] operator[SEP] {
identifier[LabelDictionary] identifier[ld] operator[=] Keyword[new] identifier[LabelDictionary] operator[SEP] operator[SEP] operator[SEP] identifier[it1] operator[=] Keyword[new] identifier[InfoTree] operator[SEP] identifier[t1] , identifier[ld] operator[SEP] operator[SEP] identifier[it2] operator[=] Keyword[new] identifier[InfoTree] operator[SEP] identifier[t2] , identifier[ld] operator[SEP] operator[SEP] identifier[size1] operator[=] identifier[it1] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] identifier[size2] operator[=] identifier[it2] operator[SEP] identifier[getSize] operator[SEP] operator[SEP] operator[SEP] identifier[IJ] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[size1] , identifier[size2] operator[SEP] operator[SEP] operator[SEP] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[size1] , identifier[size2] operator[SEP] operator[SEP] operator[SEP] identifier[delta] operator[=] Keyword[new] Keyword[double] operator[SEP] identifier[size1] operator[SEP] operator[SEP] identifier[size2] operator[SEP] operator[SEP] identifier[deltaBit] operator[=] Keyword[new] Keyword[byte] operator[SEP] identifier[size1] operator[SEP] operator[SEP] identifier[size2] operator[SEP] operator[SEP] identifier[costV] operator[=] Keyword[new] Keyword[long] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[size1] operator[SEP] operator[SEP] identifier[size2] operator[SEP] operator[SEP] identifier[costW] operator[=] Keyword[new] Keyword[long] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[size2] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[labels1] operator[=] identifier[it1] operator[SEP] identifier[getInfoArray] operator[SEP] identifier[POST2_LABEL] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[labels2] operator[=] identifier[it2] operator[SEP] identifier[getInfoArray] operator[SEP] identifier[POST2_LABEL] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[sizes1] operator[=] identifier[it1] operator[SEP] identifier[getInfoArray] operator[SEP] identifier[POST2_SIZE] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[sizes2] operator[=] identifier[it2] operator[SEP] identifier[getInfoArray] operator[SEP] identifier[POST2_SIZE] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[sizes1] operator[SEP] identifier[length] operator[SEP] identifier[x] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[sizes2] operator[SEP] identifier[length] operator[SEP] identifier[y] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[labels1] operator[SEP] identifier[x] operator[SEP] operator[==] identifier[labels2] operator[SEP] identifier[y] operator[SEP] operator[SEP] {
identifier[deltaBit] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[=] Other[0] operator[SEP]
}
Keyword[else] {
identifier[deltaBit] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[=] Other[1] operator[SEP]
}
Keyword[if] operator[SEP] identifier[sizes1] operator[SEP] identifier[x] operator[SEP] operator[==] Other[1] operator[&&] identifier[sizes2] operator[SEP] identifier[y] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[delta] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[=] Other[0] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[sizes1] operator[SEP] identifier[x] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[delta] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[=] identifier[sizes2] operator[SEP] identifier[y] operator[SEP] operator[-] Other[1] operator[SEP]
}
Keyword[if] operator[SEP] identifier[sizes2] operator[SEP] identifier[y] operator[SEP] operator[==] Other[1] operator[SEP] {
identifier[delta] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[y] operator[SEP] operator[=] identifier[sizes1] operator[SEP] identifier[x] operator[SEP] operator[-] Other[1] operator[SEP]
}
}
}
}
}
|
public boolean doLocalCriteria(StringBuffer strFilter, boolean bIncludeFileName, Vector<BaseField> vParamList)
{ // Default BaseListener
if (this.isTable()) // For tables, do the remote criteria now
return this.getRecord().handleRemoteCriteria(strFilter, bIncludeFileName, vParamList); // If can't handle remote
else
return true; // Record okay, don't skip it
}
|
class class_name[name] begin[{]
method[doLocalCriteria, return_type[type[boolean]], modifier[public], parameter[strFilter, bIncludeFileName, vParamList]] begin[{]
if[THIS[call[None.isTable, parameter[]]]] begin[{]
return[THIS[call[None.getRecord, parameter[]]call[None.handleRemoteCriteria, parameter[member[.strFilter], member[.bIncludeFileName], member[.vParamList]]]]]
else begin[{]
return[literal[true]]
end[}]
end[}]
END[}]
|
Keyword[public] Keyword[boolean] identifier[doLocalCriteria] operator[SEP] identifier[StringBuffer] identifier[strFilter] , Keyword[boolean] identifier[bIncludeFileName] , identifier[Vector] operator[<] identifier[BaseField] operator[>] identifier[vParamList] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[isTable] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[handleRemoteCriteria] operator[SEP] identifier[strFilter] , identifier[bIncludeFileName] , identifier[vParamList] operator[SEP] operator[SEP] Keyword[else] Keyword[return] literal[boolean] operator[SEP]
}
|
@Override
public T havingMethod(final Matcher<? super String> predicate) {
Validate.notNull(predicate, "predicate cannot be null");
return that(requestMethod(predicate));
}
|
class class_name[name] begin[{]
method[havingMethod, return_type[type[T]], modifier[public], parameter[predicate]] begin[{]
call[Validate.notNull, parameter[member[.predicate], literal["predicate cannot be null"]]]
return[call[.that, parameter[call[.requestMethod, parameter[member[.predicate]]]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[havingMethod] operator[SEP] Keyword[final] identifier[Matcher] operator[<] operator[?] Keyword[super] identifier[String] operator[>] identifier[predicate] operator[SEP] {
identifier[Validate] operator[SEP] identifier[notNull] operator[SEP] identifier[predicate] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[that] operator[SEP] identifier[requestMethod] operator[SEP] identifier[predicate] operator[SEP] operator[SEP] operator[SEP]
}
|
public <D> D oneToManyWithoutControl(Class<D> destinationClass, final T source) {
try{ return this.<D,T>getJMapper(relationalOneToManyMapper,destinationClass).getDestinationWithoutControl(source); }
catch (Exception e) { return (D) this.destinationClassControl(e,destinationClass); }
}
|
class class_name[name] begin[{]
method[oneToManyWithoutControl, return_type[type[D]], modifier[public], parameter[destinationClass, source]] begin[{]
TryStatement(block=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=relationalOneToManyMapper, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=destinationClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getJMapper, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=D, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))]), MethodInvocation(arguments=[MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getDestinationWithoutControl, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=destinationClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=destinationClassControl, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), type=ReferenceType(arguments=None, dimensions=[], name=D, 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] operator[<] identifier[D] operator[>] identifier[D] identifier[oneToManyWithoutControl] operator[SEP] identifier[Class] operator[<] identifier[D] operator[>] identifier[destinationClass] , Keyword[final] identifier[T] identifier[source] operator[SEP] {
Keyword[try] {
Keyword[return] Keyword[this] operator[SEP] operator[<] identifier[D] , identifier[T] operator[>] identifier[getJMapper] operator[SEP] identifier[relationalOneToManyMapper] , identifier[destinationClass] operator[SEP] operator[SEP] identifier[getDestinationWithoutControl] operator[SEP] identifier[source] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[return] operator[SEP] identifier[D] operator[SEP] Keyword[this] operator[SEP] identifier[destinationClassControl] operator[SEP] identifier[e] , identifier[destinationClass] operator[SEP] operator[SEP]
}
}
|
public static String post(String url, String body, Boolean isJson) {
ExceptionUtil.notNull(url);
return post(url, null, null, null, body, isJson);
}
|
class class_name[name] begin[{]
method[post, return_type[type[String]], modifier[public static], parameter[url, body, isJson]] begin[{]
call[ExceptionUtil.notNull, parameter[member[.url]]]
return[call[.post, parameter[member[.url], literal[null], literal[null], literal[null], member[.body], member[.isJson]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[post] operator[SEP] identifier[String] identifier[url] , identifier[String] identifier[body] , identifier[Boolean] identifier[isJson] operator[SEP] {
identifier[ExceptionUtil] operator[SEP] identifier[notNull] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[return] identifier[post] operator[SEP] identifier[url] , Other[null] , Other[null] , Other[null] , identifier[body] , identifier[isJson] operator[SEP] operator[SEP]
}
|
public static String decode(Geometry geometry, float scale) {
if (geometry == null) {
return "";
}
if (geometry instanceof LinearRing) {
return decodeLinearRing((LinearRing) geometry, scale);
} else if (geometry instanceof LineString) {
return decodeLine((LineString) geometry, scale);
} else if (geometry instanceof Polygon) {
return decodePolygon((Polygon) geometry, scale);
} else if (geometry instanceof MultiPolygon) {
return decodeMultiPolygon((MultiPolygon) geometry, scale);
} else if (geometry instanceof MultiLineString) {
return decodeMultiLine((MultiLineString) geometry, scale);
}
return "";
}
|
class class_name[name] begin[{]
method[decode, return_type[type[String]], modifier[public static], parameter[geometry, scale]] begin[{]
if[binary_operation[member[.geometry], ==, literal[null]]] begin[{]
return[literal[""]]
else begin[{]
None
end[}]
if[binary_operation[member[.geometry], instanceof, type[LinearRing]]] begin[{]
return[call[.decodeLinearRing, parameter[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LinearRing, sub_type=None)), member[.scale]]]]
else begin[{]
if[binary_operation[member[.geometry], instanceof, type[LineString]]] begin[{]
return[call[.decodeLine, parameter[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LineString, sub_type=None)), member[.scale]]]]
else begin[{]
if[binary_operation[member[.geometry], instanceof, type[Polygon]]] begin[{]
return[call[.decodePolygon, parameter[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Polygon, sub_type=None)), member[.scale]]]]
else begin[{]
if[binary_operation[member[.geometry], instanceof, type[MultiPolygon]]] begin[{]
return[call[.decodeMultiPolygon, parameter[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MultiPolygon, sub_type=None)), member[.scale]]]]
else begin[{]
if[binary_operation[member[.geometry], instanceof, type[MultiLineString]]] begin[{]
return[call[.decodeMultiLine, parameter[Cast(expression=MemberReference(member=geometry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MultiLineString, sub_type=None)), member[.scale]]]]
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
end[}]
return[literal[""]]
end[}]
END[}]
|
Keyword[public] Keyword[static] identifier[String] identifier[decode] operator[SEP] identifier[Geometry] identifier[geometry] , Keyword[float] identifier[scale] operator[SEP] {
Keyword[if] operator[SEP] identifier[geometry] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[LinearRing] operator[SEP] {
Keyword[return] identifier[decodeLinearRing] operator[SEP] operator[SEP] identifier[LinearRing] operator[SEP] identifier[geometry] , identifier[scale] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[LineString] operator[SEP] {
Keyword[return] identifier[decodeLine] operator[SEP] operator[SEP] identifier[LineString] operator[SEP] identifier[geometry] , identifier[scale] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[Polygon] operator[SEP] {
Keyword[return] identifier[decodePolygon] operator[SEP] operator[SEP] identifier[Polygon] operator[SEP] identifier[geometry] , identifier[scale] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[MultiPolygon] operator[SEP] {
Keyword[return] identifier[decodeMultiPolygon] operator[SEP] operator[SEP] identifier[MultiPolygon] operator[SEP] identifier[geometry] , identifier[scale] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[geometry] Keyword[instanceof] identifier[MultiLineString] operator[SEP] {
Keyword[return] identifier[decodeMultiLine] operator[SEP] operator[SEP] identifier[MultiLineString] operator[SEP] identifier[geometry] , identifier[scale] operator[SEP] operator[SEP]
}
Keyword[return] literal[String] operator[SEP]
}
|
public String generateAndSerialise(JAXBSerialiser serialiser) throws IOException
{
final MultiXSDSchemaFiles schemas = generate(serialiser);
if (schemas.files.size() == 1)
{
// Single schema, can be serialised as a simple XSD
return DOMUtils.serialise(schemas.files.get(0).schemaElement());
}
else
{
// Complex schema, needs to be represented with multi-xsd schema
return JAXBSerialiser.getInstance(MultiXSDSchemaFiles.class).serialise(schemas);
}
}
|
class class_name[name] begin[{]
method[generateAndSerialise, return_type[type[String]], modifier[public], parameter[serialiser]] begin[{]
local_variable[type[MultiXSDSchemaFiles], schemas]
if[binary_operation[call[schemas.files.size, parameter[]], ==, literal[1]]] begin[{]
return[call[DOMUtils.serialise, parameter[call[schemas.files.get, parameter[literal[0]]]]]]
else begin[{]
return[call[JAXBSerialiser.getInstance, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MultiXSDSchemaFiles, sub_type=None))]]]
end[}]
end[}]
END[}]
|
Keyword[public] identifier[String] identifier[generateAndSerialise] operator[SEP] identifier[JAXBSerialiser] identifier[serialiser] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[final] identifier[MultiXSDSchemaFiles] identifier[schemas] operator[=] identifier[generate] operator[SEP] identifier[serialiser] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[schemas] operator[SEP] identifier[files] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[1] operator[SEP] {
Keyword[return] identifier[DOMUtils] operator[SEP] identifier[serialise] operator[SEP] identifier[schemas] operator[SEP] identifier[files] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[schemaElement] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[JAXBSerialiser] operator[SEP] identifier[getInstance] operator[SEP] identifier[MultiXSDSchemaFiles] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[serialise] operator[SEP] identifier[schemas] operator[SEP] operator[SEP]
}
}
|
public SDVariable localResponseNormalization(String name, SDVariable inputs,
LocalResponseNormalizationConfig lrnConfig) {
SDVariable ret = f().localResponseNormalization(inputs, lrnConfig);
return updateVariableNameAndReference(ret, name);
}
|
class class_name[name] begin[{]
method[localResponseNormalization, return_type[type[SDVariable]], modifier[public], parameter[name, inputs, lrnConfig]] begin[{]
local_variable[type[SDVariable], ret]
return[call[.updateVariableNameAndReference, parameter[member[.ret], member[.name]]]]
end[}]
END[}]
|
Keyword[public] identifier[SDVariable] identifier[localResponseNormalization] operator[SEP] identifier[String] identifier[name] , identifier[SDVariable] identifier[inputs] , identifier[LocalResponseNormalizationConfig] identifier[lrnConfig] operator[SEP] {
identifier[SDVariable] identifier[ret] operator[=] identifier[f] operator[SEP] operator[SEP] operator[SEP] identifier[localResponseNormalization] operator[SEP] identifier[inputs] , identifier[lrnConfig] operator[SEP] operator[SEP] Keyword[return] identifier[updateVariableNameAndReference] operator[SEP] identifier[ret] , identifier[name] operator[SEP] operator[SEP]
}
|
private final V getImplicitVar(ImplicitVar var, boolean allowDeclaredVars) {
S scope = thisScope();
while (scope != null) {
if (var.isMadeByScope(scope)) {
V result = ((AbstractScope<S, V>) scope).implicitVars.get(var);
if (result == null) {
((AbstractScope<S, V>) scope).implicitVars.put(var, result = scope.makeImplicitVar(var));
}
return result;
}
V result = allowDeclaredVars ? scope.getOwnSlot(var.name) : null;
if (result != null) {
return result;
}
// Recurse up the parent Scope
scope = scope.getParent();
}
return null;
}
|
class class_name[name] begin[{]
method[getImplicitVar, return_type[type[V]], modifier[final private], parameter[var, allowDeclaredVars]] begin[{]
local_variable[type[S], scope]
while[binary_operation[member[.scope], !=, literal[null]]] begin[{]
if[call[var.isMadeByScope, parameter[member[.scope]]]] begin[{]
local_variable[type[V], result]
if[binary_operation[member[.result], ==, literal[null]]] begin[{]
Cast(expression=MemberReference(member=scope, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=S, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=AbstractScope, sub_type=None))
else begin[{]
None
end[}]
return[member[.result]]
else begin[{]
None
end[}]
local_variable[type[V], result]
if[binary_operation[member[.result], !=, literal[null]]] begin[{]
return[member[.result]]
else begin[{]
None
end[}]
assign[member[.scope], call[scope.getParent, parameter[]]]
end[}]
return[literal[null]]
end[}]
END[}]
|
Keyword[private] Keyword[final] identifier[V] identifier[getImplicitVar] operator[SEP] identifier[ImplicitVar] identifier[var] , Keyword[boolean] identifier[allowDeclaredVars] operator[SEP] {
identifier[S] identifier[scope] operator[=] identifier[thisScope] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[scope] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[var] operator[SEP] identifier[isMadeByScope] operator[SEP] identifier[scope] operator[SEP] operator[SEP] {
identifier[V] identifier[result] operator[=] operator[SEP] operator[SEP] identifier[AbstractScope] operator[<] identifier[S] , identifier[V] operator[>] operator[SEP] identifier[scope] operator[SEP] operator[SEP] identifier[implicitVars] operator[SEP] identifier[get] operator[SEP] identifier[var] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[==] Other[null] operator[SEP] {
operator[SEP] operator[SEP] identifier[AbstractScope] operator[<] identifier[S] , identifier[V] operator[>] operator[SEP] identifier[scope] operator[SEP] operator[SEP] identifier[implicitVars] operator[SEP] identifier[put] operator[SEP] identifier[var] , identifier[result] operator[=] identifier[scope] operator[SEP] identifier[makeImplicitVar] operator[SEP] identifier[var] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
identifier[V] identifier[result] operator[=] identifier[allowDeclaredVars] operator[?] identifier[scope] operator[SEP] identifier[getOwnSlot] operator[SEP] identifier[var] operator[SEP] identifier[name] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[result] operator[SEP]
}
identifier[scope] operator[=] identifier[scope] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
@Override
public <R> R transact(final ObjectifyImpl parent, final Work<R> work) {
return this.transactNew(parent, DEFAULT_TRY_LIMIT, work);
}
|
class class_name[name] begin[{]
method[transact, return_type[type[R]], modifier[public], parameter[parent, work]] begin[{]
return[THIS[call[None.transactNew, parameter[member[.parent], member[.DEFAULT_TRY_LIMIT], member[.work]]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] operator[<] identifier[R] operator[>] identifier[R] identifier[transact] operator[SEP] Keyword[final] identifier[ObjectifyImpl] identifier[parent] , Keyword[final] identifier[Work] operator[<] identifier[R] operator[>] identifier[work] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[transactNew] operator[SEP] identifier[parent] , identifier[DEFAULT_TRY_LIMIT] , identifier[work] operator[SEP] operator[SEP]
}
|
@SuppressWarnings({ "unchecked", "rawtypes" })
public static <E extends Exception> long importCSV(final Reader reader, long offset, final long count, final Try.Predicate<String[], E> filter,
final PreparedStatement stmt, final int batchSize, final int batchInterval, final Map<String, ? extends Type> columnTypeMap)
throws UncheckedSQLException, UncheckedIOException, E {
N.checkArgument(offset >= 0 && count >= 0, "'offset'=%s and 'count'=%s can't be negative", offset, count);
N.checkArgument(batchSize > 0 && batchInterval >= 0, "'batchSize'=%s must be greater than 0 and 'batchInterval'=%s can't be negative", batchSize,
batchInterval);
long result = 0;
final BufferedReader br = Objectory.createBufferedReader(reader);
try {
List<String> tmp = new ArrayList<>();
String line = br.readLine();
jsonParser.readString(tmp, line);
final String[] titles = tmp.toArray(new String[tmp.size()]);
final Type<Object>[] columnTypes = new Type[titles.length];
final List<String> columnNameList = new ArrayList<>(columnTypeMap.size());
for (int i = 0, columnCount = titles.length; i < columnCount; i++) {
if (columnTypeMap.containsKey(titles[i])) {
columnTypes[i] = columnTypeMap.get(titles[i]);
columnNameList.add(titles[i]);
}
}
if (columnNameList.size() != columnTypeMap.size()) {
final List<String> keys = new ArrayList<>(columnTypeMap.keySet());
keys.removeAll(columnNameList);
throw new AbacusException(keys + " are not included in titles: " + N.toString(titles));
}
while (offset-- > 0 && br.readLine() != null) {
}
final boolean isNullOrEmptyTypes = N.isNullOrEmpty(columnTypes);
final String[] strs = new String[titles.length];
Type<Object> type = null;
while (result < count && (line = br.readLine()) != null) {
jsonParser.readString(strs, line);
if (filter != null && filter.test(strs) == false) {
continue;
}
if (isNullOrEmptyTypes) {
for (int i = 0, len = strs.length; i < len; i++) {
stmt.setObject(i + 1, strs[i]);
}
} else {
for (int i = 0, parameterIndex = 1, len = strs.length; i < len; i++) {
type = columnTypes[i];
if (type == null) {
continue;
}
type.set(stmt, parameterIndex++, (strs[i] == null) ? null : type.valueOf(strs[i]));
}
}
stmt.addBatch();
result++;
if ((result % batchSize) == 0) {
stmt.executeBatch();
stmt.clearBatch();
if (batchInterval > 0) {
N.sleep(batchInterval);
}
}
}
if ((result % batchSize) > 0) {
stmt.executeBatch();
stmt.clearBatch();
}
} catch (SQLException e) {
throw new UncheckedSQLException(e);
} catch (IOException e) {
throw new UncheckedIOException(e);
} finally {
Objectory.recycle(br);
}
return result;
}
|
class class_name[name] begin[{]
method[importCSV, return_type[type[long]], modifier[public static], parameter[reader, offset, count, filter, stmt, batchSize, batchInterval, columnTypeMap]] begin[{]
call[N.checkArgument, parameter[binary_operation[binary_operation[member[.offset], >=, literal[0]], &&, binary_operation[member[.count], >=, literal[0]]], literal["'offset'=%s and 'count'=%s can't be negative"], member[.offset], member[.count]]]
call[N.checkArgument, parameter[binary_operation[binary_operation[member[.batchSize], >, literal[0]], &&, binary_operation[member[.batchInterval], >=, literal[0]]], literal["'batchSize'=%s must be greater than 0 and 'batchInterval'=%s can't be negative"], member[.batchSize], member[.batchInterval]]]
local_variable[type[long], result]
local_variable[type[BufferedReader], br]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=tmp)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=br, selectors=[], type_arguments=None), name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readString, postfix_operators=[], prefix_operators=[], qualifier=jsonParser, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))], member=toArray, postfix_operators=[], prefix_operators=[], qualifier=tmp, selectors=[], type_arguments=None), name=titles)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=titles, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Type, sub_type=None)), name=columnTypes)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[None], name=Type, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=columnTypeMap, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=columnNameList)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=titles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=columnTypeMap, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=columnTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MemberReference(member=titles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=get, postfix_operators=[], prefix_operators=[], qualifier=columnTypeMap, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=titles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=add, postfix_operators=[], prefix_operators=[], qualifier=columnNameList, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=columnCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=titles, selectors=[]), name=columnCount)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=columnNameList, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=columnTypeMap, selectors=[], type_arguments=None), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MethodInvocation(arguments=[], member=keySet, postfix_operators=[], prefix_operators=[], qualifier=columnTypeMap, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=keys)], modifiers={'final'}, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=columnNameList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=removeAll, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=keys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" are not included in titles: "), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=titles, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toString, postfix_operators=[], prefix_operators=[], qualifier=N, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AbacusException, sub_type=None)), label=None)])), WhileStatement(body=BlockStatement(label=None, statements=[]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=offset, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=br, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=columnTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isNullOrEmpty, postfix_operators=[], prefix_operators=[], qualifier=N, selectors=[], type_arguments=None), name=isNullOrEmptyTypes)], modifiers={'final'}, type=BasicType(dimensions=[], name=boolean)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=titles, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None)), name=strs)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[None], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=type)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Type, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=strs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readString, postfix_operators=[], prefix_operators=[], qualifier=jsonParser, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=filter, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=strs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=test, postfix_operators=[], prefix_operators=[], qualifier=filter, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=MemberReference(member=isNullOrEmptyTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=columnTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=type, 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=[ContinueStatement(goto=None, label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=stmt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parameterIndex, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=strs, 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===), if_false=MethodInvocation(arguments=[MemberReference(member=strs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))], member=set, postfix_operators=[], prefix_operators=[], qualifier=type, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=parameterIndex), VariableDeclarator(dimensions=[], initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=strs, selectors=[]), name=len)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MemberReference(member=strs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=setObject, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i), VariableDeclarator(dimensions=[], initializer=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=strs, selectors=[]), name=len)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=addBatch, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MemberReference(member=result, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=batchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=executeBatch, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clearBatch, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=batchInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=batchInterval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=sleep, postfix_operators=[], prefix_operators=[], qualifier=N, selectors=[], type_arguments=None), label=None)]))]))]), condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=count, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operandr=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=br, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operator=&&), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=batchSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=%), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=executeBatch, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=clearBatch, postfix_operators=[], prefix_operators=[], qualifier=stmt, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UncheckedSQLException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['SQLException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UncheckedIOException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=br, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recycle, postfix_operators=[], prefix_operators=[], qualifier=Objectory, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
return[member[.result]]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] {
literal[String] , literal[String]
} operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[E] Keyword[extends] identifier[Exception] operator[>] Keyword[long] identifier[importCSV] operator[SEP] Keyword[final] identifier[Reader] identifier[reader] , Keyword[long] identifier[offset] , Keyword[final] Keyword[long] identifier[count] , Keyword[final] identifier[Try] operator[SEP] identifier[Predicate] operator[<] identifier[String] operator[SEP] operator[SEP] , identifier[E] operator[>] identifier[filter] , Keyword[final] identifier[PreparedStatement] identifier[stmt] , Keyword[final] Keyword[int] identifier[batchSize] , Keyword[final] Keyword[int] identifier[batchInterval] , Keyword[final] identifier[Map] operator[<] identifier[String] , operator[?] Keyword[extends] identifier[Type] operator[>] identifier[columnTypeMap] operator[SEP] Keyword[throws] identifier[UncheckedSQLException] , identifier[UncheckedIOException] , identifier[E] {
identifier[N] operator[SEP] identifier[checkArgument] operator[SEP] identifier[offset] operator[>=] Other[0] operator[&&] identifier[count] operator[>=] Other[0] , literal[String] , identifier[offset] , identifier[count] operator[SEP] operator[SEP] identifier[N] operator[SEP] identifier[checkArgument] operator[SEP] identifier[batchSize] operator[>] Other[0] operator[&&] identifier[batchInterval] operator[>=] Other[0] , literal[String] , identifier[batchSize] , identifier[batchInterval] operator[SEP] operator[SEP] Keyword[long] identifier[result] operator[=] Other[0] operator[SEP] Keyword[final] identifier[BufferedReader] identifier[br] operator[=] identifier[Objectory] operator[SEP] identifier[createBufferedReader] operator[SEP] identifier[reader] operator[SEP] operator[SEP] Keyword[try] {
identifier[List] operator[<] identifier[String] operator[>] identifier[tmp] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[line] operator[=] identifier[br] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] identifier[jsonParser] operator[SEP] identifier[readString] operator[SEP] identifier[tmp] , identifier[line] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[titles] operator[=] identifier[tmp] operator[SEP] identifier[toArray] operator[SEP] Keyword[new] identifier[String] operator[SEP] identifier[tmp] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Type] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] identifier[columnTypes] operator[=] Keyword[new] identifier[Type] operator[SEP] identifier[titles] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[columnNameList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[columnTypeMap] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[columnCount] operator[=] identifier[titles] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[<] identifier[columnCount] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[columnTypeMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[titles] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] {
identifier[columnTypes] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[columnTypeMap] operator[SEP] identifier[get] operator[SEP] identifier[titles] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] identifier[columnNameList] operator[SEP] identifier[add] operator[SEP] identifier[titles] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[columnNameList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] identifier[columnTypeMap] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[List] operator[<] identifier[String] operator[>] identifier[keys] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[columnTypeMap] operator[SEP] identifier[keySet] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[keys] operator[SEP] identifier[removeAll] operator[SEP] identifier[columnNameList] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[AbacusException] operator[SEP] identifier[keys] operator[+] literal[String] operator[+] identifier[N] operator[SEP] identifier[toString] operator[SEP] identifier[titles] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] identifier[offset] operator[--] operator[>] Other[0] operator[&&] identifier[br] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
}
Keyword[final] Keyword[boolean] identifier[isNullOrEmptyTypes] operator[=] identifier[N] operator[SEP] identifier[isNullOrEmpty] operator[SEP] identifier[columnTypes] operator[SEP] operator[SEP] Keyword[final] identifier[String] operator[SEP] operator[SEP] identifier[strs] operator[=] Keyword[new] identifier[String] operator[SEP] identifier[titles] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[Type] operator[<] identifier[Object] operator[>] identifier[type] operator[=] Other[null] operator[SEP] Keyword[while] operator[SEP] identifier[result] operator[<] identifier[count] operator[&&] operator[SEP] identifier[line] operator[=] identifier[br] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[jsonParser] operator[SEP] identifier[readString] operator[SEP] identifier[strs] , identifier[line] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[filter] operator[!=] Other[null] operator[&&] identifier[filter] operator[SEP] identifier[test] operator[SEP] identifier[strs] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isNullOrEmptyTypes] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[len] operator[=] identifier[strs] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[stmt] operator[SEP] identifier[setObject] operator[SEP] identifier[i] operator[+] Other[1] , identifier[strs] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] , identifier[parameterIndex] operator[=] Other[1] , identifier[len] operator[=] identifier[strs] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[type] operator[=] identifier[columnTypes] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] {
Keyword[continue] operator[SEP]
}
identifier[type] operator[SEP] identifier[set] operator[SEP] identifier[stmt] , identifier[parameterIndex] operator[++] , operator[SEP] identifier[strs] operator[SEP] identifier[i] operator[SEP] operator[==] Other[null] operator[SEP] operator[?] Other[null] operator[:] identifier[type] operator[SEP] identifier[valueOf] operator[SEP] identifier[strs] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
identifier[stmt] operator[SEP] identifier[addBatch] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[++] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[result] operator[%] identifier[batchSize] operator[SEP] operator[==] Other[0] operator[SEP] {
identifier[stmt] operator[SEP] identifier[executeBatch] operator[SEP] operator[SEP] operator[SEP] identifier[stmt] operator[SEP] identifier[clearBatch] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[batchInterval] operator[>] Other[0] operator[SEP] {
identifier[N] operator[SEP] identifier[sleep] operator[SEP] identifier[batchInterval] operator[SEP] operator[SEP]
}
}
}
Keyword[if] operator[SEP] operator[SEP] identifier[result] operator[%] identifier[batchSize] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[stmt] operator[SEP] identifier[executeBatch] operator[SEP] operator[SEP] operator[SEP] identifier[stmt] operator[SEP] identifier[clearBatch] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[SQLException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UncheckedSQLException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UncheckedIOException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[Objectory] operator[SEP] identifier[recycle] operator[SEP] identifier[br] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
@SuppressWarnings("unchecked")
@Override
public EList<Long> getRelatedPriorities() {
return (EList<Long>) eGet(Ifc4Package.Literals.IFC_REL_CONNECTS_PATH_ELEMENTS__RELATED_PRIORITIES, true);
}
|
class class_name[name] begin[{]
method[getRelatedPriorities, return_type[type[EList]], modifier[public], parameter[]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=IFC_REL_CONNECTS_PATH_ELEMENTS__RELATED_PRIORITIES, postfix_operators=[], prefix_operators=[], qualifier=Ifc4Package.Literals, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], dimensions=[], name=EList, sub_type=None))]
end[}]
END[}]
|
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[EList] operator[<] identifier[Long] operator[>] identifier[getRelatedPriorities] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[EList] operator[<] identifier[Long] operator[>] operator[SEP] identifier[eGet] operator[SEP] identifier[Ifc4Package] operator[SEP] identifier[Literals] operator[SEP] identifier[IFC_REL_CONNECTS_PATH_ELEMENTS__RELATED_PRIORITIES] , literal[boolean] operator[SEP] operator[SEP]
}
|
protected final String getForRetrieveForEditDelete(final Class<?> pClass) {
if (this.seEntities.contains(pClass)) {
return null;
} else if (pClass == ServiceSpecifics.class
|| pClass == GoodsSpecifics.class) {
return PrcItemSpecificsRetrieve.class.getSimpleName();
} else if (IPersistableBase.class.isAssignableFrom(pClass)) {
return PrcEntityPbEditDelete.class.getSimpleName();
}
return PrcEntityRetrieve.class.getSimpleName();
}
|
class class_name[name] begin[{]
method[getForRetrieveForEditDelete, return_type[type[String]], modifier[final protected], parameter[pClass]] begin[{]
if[THIS[member[None.seEntities]call[None.contains, parameter[member[.pClass]]]]] begin[{]
return[literal[null]]
else begin[{]
if[binary_operation[binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceSpecifics, sub_type=None))], ||, binary_operation[member[.pClass], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GoodsSpecifics, sub_type=None))]]] begin[{]
return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PrcItemSpecificsRetrieve, sub_type=None))]
else begin[{]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=pClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=IPersistableBase, sub_type=None))] begin[{]
return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PrcEntityPbEditDelete, sub_type=None))]
else begin[{]
None
end[}]
end[}]
end[}]
return[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getSimpleName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=PrcEntityRetrieve, sub_type=None))]
end[}]
END[}]
|
Keyword[protected] Keyword[final] identifier[String] identifier[getForRetrieveForEditDelete] operator[SEP] Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[pClass] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[seEntities] operator[SEP] identifier[contains] operator[SEP] identifier[pClass] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[pClass] operator[==] identifier[ServiceSpecifics] operator[SEP] Keyword[class] operator[||] identifier[pClass] operator[==] identifier[GoodsSpecifics] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[PrcItemSpecificsRetrieve] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[IPersistableBase] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[pClass] operator[SEP] operator[SEP] {
Keyword[return] identifier[PrcEntityPbEditDelete] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[PrcEntityRetrieve] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[SEP]
}
|
public void run() {
if (fOperationTarget == null || fDocumentPartitioning == null || fPrefixesMap == null)
return;
ITextEditor editor= getTextEditor();
if (editor == null)
return;
if (!validateEditorInputState())
return;
final int operationCode;
if (isSelectionCommented(editor.getSelectionProvider().getSelection()))
operationCode= ITextOperationTarget.STRIP_PREFIX;
else
operationCode= ITextOperationTarget.PREFIX;
Shell shell= editor.getSite().getShell();
if (!fOperationTarget.canDoOperation(operationCode)) {
if (shell != null)
MessageDialog.openError(shell, "ToggleComment_error_title", "ToggleComment_error_message");
return;
}
Display display= null;
if (shell != null && !shell.isDisposed())
display= shell.getDisplay();
BusyIndicator.showWhile(display, new Runnable() {
public void run() {
fOperationTarget.doOperation(operationCode);
}
});
}
|
class class_name[name] begin[{]
method[run, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.fOperationTarget], ==, literal[null]], ||, binary_operation[member[.fDocumentPartitioning], ==, literal[null]]], ||, binary_operation[member[.fPrefixesMap], ==, literal[null]]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[ITextEditor], editor]
if[binary_operation[member[.editor], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[call[.validateEditorInputState, parameter[]]] begin[{]
return[None]
else begin[{]
None
end[}]
local_variable[type[int], operationCode]
if[call[.isSelectionCommented, parameter[call[editor.getSelectionProvider, parameter[]]]]] begin[{]
assign[member[.operationCode], member[ITextOperationTarget.STRIP_PREFIX]]
else begin[{]
assign[member[.operationCode], member[ITextOperationTarget.PREFIX]]
end[}]
local_variable[type[Shell], shell]
if[call[fOperationTarget.canDoOperation, parameter[member[.operationCode]]]] begin[{]
if[binary_operation[member[.shell], !=, literal[null]]] begin[{]
call[MessageDialog.openError, parameter[member[.shell], literal["ToggleComment_error_title"], literal["ToggleComment_error_message"]]]
else begin[{]
None
end[}]
return[None]
else begin[{]
None
end[}]
local_variable[type[Display], display]
if[binary_operation[binary_operation[member[.shell], !=, literal[null]], &&, call[shell.isDisposed, parameter[]]]] begin[{]
assign[member[.display], call[shell.getDisplay, parameter[]]]
else begin[{]
None
end[}]
call[BusyIndicator.showWhile, parameter[member[.display], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=operationCode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=doOperation, postfix_operators=[], prefix_operators=[], qualifier=fOperationTarget, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], 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=Runnable, sub_type=None))]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[fOperationTarget] operator[==] Other[null] operator[||] identifier[fDocumentPartitioning] operator[==] Other[null] operator[||] identifier[fPrefixesMap] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] identifier[ITextEditor] identifier[editor] operator[=] identifier[getTextEditor] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[editor] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[validateEditorInputState] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[final] Keyword[int] identifier[operationCode] operator[SEP] Keyword[if] operator[SEP] identifier[isSelectionCommented] operator[SEP] identifier[editor] operator[SEP] identifier[getSelectionProvider] operator[SEP] operator[SEP] operator[SEP] identifier[getSelection] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[operationCode] operator[=] identifier[ITextOperationTarget] operator[SEP] identifier[STRIP_PREFIX] operator[SEP] Keyword[else] identifier[operationCode] operator[=] identifier[ITextOperationTarget] operator[SEP] identifier[PREFIX] operator[SEP] identifier[Shell] identifier[shell] operator[=] identifier[editor] operator[SEP] identifier[getSite] operator[SEP] operator[SEP] operator[SEP] identifier[getShell] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[fOperationTarget] operator[SEP] identifier[canDoOperation] operator[SEP] identifier[operationCode] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[shell] operator[!=] Other[null] operator[SEP] identifier[MessageDialog] operator[SEP] identifier[openError] operator[SEP] identifier[shell] , literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[Display] identifier[display] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[shell] operator[!=] Other[null] operator[&&] operator[!] identifier[shell] operator[SEP] identifier[isDisposed] operator[SEP] operator[SEP] operator[SEP] identifier[display] operator[=] identifier[shell] operator[SEP] identifier[getDisplay] operator[SEP] operator[SEP] operator[SEP] identifier[BusyIndicator] operator[SEP] identifier[showWhile] operator[SEP] identifier[display] , Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[fOperationTarget] operator[SEP] identifier[doOperation] operator[SEP] identifier[operationCode] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public Observable<ApplicationSecurityGroupInner> getByResourceGroupAsync(String resourceGroupName, String applicationSecurityGroupName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, applicationSecurityGroupName).map(new Func1<ServiceResponse<ApplicationSecurityGroupInner>, ApplicationSecurityGroupInner>() {
@Override
public ApplicationSecurityGroupInner call(ServiceResponse<ApplicationSecurityGroupInner> response) {
return response.body();
}
});
}
|
class class_name[name] begin[{]
method[getByResourceGroupAsync, return_type[type[Observable]], modifier[public], parameter[resourceGroupName, applicationSecurityGroupName]] begin[{]
return[call[.getByResourceGroupWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.applicationSecurityGroupName]]]]
end[}]
END[}]
|
Keyword[public] identifier[Observable] operator[<] identifier[ApplicationSecurityGroupInner] operator[>] identifier[getByResourceGroupAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[applicationSecurityGroupName] operator[SEP] {
Keyword[return] identifier[getByResourceGroupWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[applicationSecurityGroupName] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[ApplicationSecurityGroupInner] operator[>] , identifier[ApplicationSecurityGroupInner] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[ApplicationSecurityGroupInner] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[ApplicationSecurityGroupInner] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public void marshall(UpdateDeviceInstanceRequest updateDeviceInstanceRequest, ProtocolMarshaller protocolMarshaller) {
if (updateDeviceInstanceRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateDeviceInstanceRequest.getArn(), ARN_BINDING);
protocolMarshaller.marshall(updateDeviceInstanceRequest.getProfileArn(), PROFILEARN_BINDING);
protocolMarshaller.marshall(updateDeviceInstanceRequest.getLabels(), LABELS_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[updateDeviceInstanceRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.updateDeviceInstanceRequest], ==, 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=getArn, postfix_operators=[], prefix_operators=[], qualifier=updateDeviceInstanceRequest, selectors=[], type_arguments=None), MemberReference(member=ARN_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=getProfileArn, postfix_operators=[], prefix_operators=[], qualifier=updateDeviceInstanceRequest, selectors=[], type_arguments=None), MemberReference(member=PROFILEARN_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=getLabels, postfix_operators=[], prefix_operators=[], qualifier=updateDeviceInstanceRequest, selectors=[], type_arguments=None), MemberReference(member=LABELS_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[UpdateDeviceInstanceRequest] identifier[updateDeviceInstanceRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[updateDeviceInstanceRequest] 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[updateDeviceInstanceRequest] operator[SEP] identifier[getArn] operator[SEP] operator[SEP] , identifier[ARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateDeviceInstanceRequest] operator[SEP] identifier[getProfileArn] operator[SEP] operator[SEP] , identifier[PROFILEARN_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateDeviceInstanceRequest] operator[SEP] identifier[getLabels] operator[SEP] operator[SEP] , identifier[LABELS_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public RawProperty setExperimentalProperty(String name, ICalDataType dataType, String value) {
removeExperimentalProperties(name);
return addExperimentalProperty(name, dataType, value);
}
|
class class_name[name] begin[{]
method[setExperimentalProperty, return_type[type[RawProperty]], modifier[public], parameter[name, dataType, value]] begin[{]
call[.removeExperimentalProperties, parameter[member[.name]]]
return[call[.addExperimentalProperty, parameter[member[.name], member[.dataType], member[.value]]]]
end[}]
END[}]
|
Keyword[public] identifier[RawProperty] identifier[setExperimentalProperty] operator[SEP] identifier[String] identifier[name] , identifier[ICalDataType] identifier[dataType] , identifier[String] identifier[value] operator[SEP] {
identifier[removeExperimentalProperties] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[return] identifier[addExperimentalProperty] operator[SEP] identifier[name] , identifier[dataType] , identifier[value] operator[SEP] operator[SEP]
}
|
boolean canUpdate(Table table, boolean[] columnCheckList) {
if (isFull || isFullUpdate) {
return true;
}
return containsAllColumns(updateColumnSet, table, columnCheckList);
}
|
class class_name[name] begin[{]
method[canUpdate, return_type[type[boolean]], modifier[default], parameter[table, columnCheckList]] begin[{]
if[binary_operation[member[.isFull], ||, member[.isFullUpdate]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
return[call[.containsAllColumns, parameter[member[.updateColumnSet], member[.table], member[.columnCheckList]]]]
end[}]
END[}]
|
Keyword[boolean] identifier[canUpdate] operator[SEP] identifier[Table] identifier[table] , Keyword[boolean] operator[SEP] operator[SEP] identifier[columnCheckList] operator[SEP] {
Keyword[if] operator[SEP] identifier[isFull] operator[||] identifier[isFullUpdate] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] identifier[containsAllColumns] operator[SEP] identifier[updateColumnSet] , identifier[table] , identifier[columnCheckList] operator[SEP] operator[SEP]
}
|
public static void info(Object... message) {
StringBuilder builder = new StringBuilder(APP_INFO);
for (Object object : message) {
builder.append(object.toString());
}
infoStream.println(builder.toString());
}
|
class class_name[name] begin[{]
method[info, return_type[void], modifier[public static], parameter[message]] begin[{]
local_variable[type[StringBuilder], builder]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=object, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=message, 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=Object, sub_type=None))), label=None)
call[infoStream.println, parameter[call[builder.toString, parameter[]]]]
end[}]
END[}]
|
Keyword[public] Keyword[static] Keyword[void] identifier[info] operator[SEP] identifier[Object] operator[...] identifier[message] operator[SEP] {
identifier[StringBuilder] identifier[builder] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] identifier[APP_INFO] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[object] operator[:] identifier[message] operator[SEP] {
identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[object] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[infoStream] operator[SEP] identifier[println] operator[SEP] identifier[builder] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public int[] executeBatch(String sql, List<Object> list) {
if (list.isEmpty() == true) {
return new int[] {};
}
Iterator<Object> iterator = list.iterator();
if (iterator.hasNext() == false) {
return new int[] {};
}
Connection connection = null;
PreparedStatement ps = null;
try {
PropertyDesc.cacheModeOn();
connection = getConnection();
Object object = iterator.next();
Map<String, ParameterValue> values = new HashMap<>();
addValues(values, object);
sql = getSql(sql, dialect);
ps = createPreparedStatement(connection, sql, values, ExecuteType.UPDATE, dialect, null);
PreparedStatementUtil.addBatch(ps, sqlLogRegistry);
while (iterator.hasNext()) {
object = iterator.next();
Node node = parse(sql);
values = new HashMap<>();
addValues(values, object);
CommandContext ctx = new CommandContext(dialect);
ctx.addArgs(values);
node.accept(ctx);
List<Object> bindVariables = ctx.getBindVariables();
List<Integer> bindVariableTypes = ctx.getBindVariableTypes();
bindArgs(ps, bindVariables, bindVariableTypes, ExecuteType.UPDATE, dialect);
PreparedStatementUtil.addBatch(ps, sqlLogRegistry);
}
return PreparedStatementUtil.executeBatch(ps, sqlLogRegistry);
} finally {
PropertyDesc.cacheModeOff();
try {
StatementUtil.close(ps);
} finally {
ConnectionUtil.close(connection);
}
}
}
|
class class_name[name] begin[{]
method[executeBatch, return_type[type[int]], modifier[public], parameter[sql, list]] begin[{]
if[binary_operation[call[list.isEmpty, parameter[]], ==, literal[true]]] begin[{]
return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]
else begin[{]
None
end[}]
local_variable[type[Iterator], iterator]
if[binary_operation[call[iterator.hasNext, parameter[]], ==, literal[false]]] begin[{]
return[ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]
else begin[{]
None
end[}]
local_variable[type[Connection], connection]
local_variable[type[PreparedStatement], ps]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=cacheModeOn, postfix_operators=[], prefix_operators=[], qualifier=PropertyDesc, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getConnection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None)), name=values)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ParameterValue, sub_type=None))], dimensions=[], name=Map, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=dialect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getSql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UPDATE, postfix_operators=[], prefix_operators=[], qualifier=ExecuteType, selectors=[]), MemberReference(member=dialect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=createPreparedStatement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sqlLogRegistry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addBatch, postfix_operators=[], prefix_operators=[], qualifier=PreparedStatementUtil, selectors=[], type_arguments=None), label=None), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=sql, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=node)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=dialect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommandContext, sub_type=None)), name=ctx)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CommandContext, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=values, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addArgs, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getBindVariables, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), name=bindVariables)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getBindVariableTypes, postfix_operators=[], prefix_operators=[], qualifier=ctx, selectors=[], type_arguments=None), name=bindVariableTypes)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bindVariables, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bindVariableTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UPDATE, postfix_operators=[], prefix_operators=[], qualifier=ExecuteType, selectors=[]), MemberReference(member=dialect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bindArgs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sqlLogRegistry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addBatch, postfix_operators=[], prefix_operators=[], qualifier=PreparedStatementUtil, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=sqlLogRegistry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=executeBatch, postfix_operators=[], prefix_operators=[], qualifier=PreparedStatementUtil, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=cacheModeOff, postfix_operators=[], prefix_operators=[], qualifier=PropertyDesc, selectors=[], type_arguments=None), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=StatementUtil, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=connection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=close, postfix_operators=[], prefix_operators=[], qualifier=ConnectionUtil, selectors=[], type_arguments=None), label=None)], label=None, resources=None)], label=None, resources=None)
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] Keyword[int] operator[SEP] operator[SEP] identifier[executeBatch] operator[SEP] identifier[String] identifier[sql] , identifier[List] operator[<] identifier[Object] operator[>] identifier[list] operator[SEP] {
Keyword[if] operator[SEP] identifier[list] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[return] Keyword[new] Keyword[int] operator[SEP] operator[SEP] {
} operator[SEP]
}
identifier[Iterator] operator[<] identifier[Object] operator[>] identifier[iterator] operator[=] identifier[list] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[return] Keyword[new] Keyword[int] operator[SEP] operator[SEP] {
} operator[SEP]
}
identifier[Connection] identifier[connection] operator[=] Other[null] operator[SEP] identifier[PreparedStatement] identifier[ps] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[PropertyDesc] operator[SEP] identifier[cacheModeOn] operator[SEP] operator[SEP] operator[SEP] identifier[connection] operator[=] identifier[getConnection] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[object] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[ParameterValue] operator[>] identifier[values] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addValues] operator[SEP] identifier[values] , identifier[object] operator[SEP] operator[SEP] identifier[sql] operator[=] identifier[getSql] operator[SEP] identifier[sql] , identifier[dialect] operator[SEP] operator[SEP] identifier[ps] operator[=] identifier[createPreparedStatement] operator[SEP] identifier[connection] , identifier[sql] , identifier[values] , identifier[ExecuteType] operator[SEP] identifier[UPDATE] , identifier[dialect] , Other[null] operator[SEP] operator[SEP] identifier[PreparedStatementUtil] operator[SEP] identifier[addBatch] operator[SEP] identifier[ps] , identifier[sqlLogRegistry] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[object] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[Node] identifier[node] operator[=] identifier[parse] operator[SEP] identifier[sql] operator[SEP] operator[SEP] identifier[values] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[addValues] operator[SEP] identifier[values] , identifier[object] operator[SEP] operator[SEP] identifier[CommandContext] identifier[ctx] operator[=] Keyword[new] identifier[CommandContext] operator[SEP] identifier[dialect] operator[SEP] operator[SEP] identifier[ctx] operator[SEP] identifier[addArgs] operator[SEP] identifier[values] operator[SEP] operator[SEP] identifier[node] operator[SEP] identifier[accept] operator[SEP] identifier[ctx] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] identifier[bindVariables] operator[=] identifier[ctx] operator[SEP] identifier[getBindVariables] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Integer] operator[>] identifier[bindVariableTypes] operator[=] identifier[ctx] operator[SEP] identifier[getBindVariableTypes] operator[SEP] operator[SEP] operator[SEP] identifier[bindArgs] operator[SEP] identifier[ps] , identifier[bindVariables] , identifier[bindVariableTypes] , identifier[ExecuteType] operator[SEP] identifier[UPDATE] , identifier[dialect] operator[SEP] operator[SEP] identifier[PreparedStatementUtil] operator[SEP] identifier[addBatch] operator[SEP] identifier[ps] , identifier[sqlLogRegistry] operator[SEP] operator[SEP]
}
Keyword[return] identifier[PreparedStatementUtil] operator[SEP] identifier[executeBatch] operator[SEP] identifier[ps] , identifier[sqlLogRegistry] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[PropertyDesc] operator[SEP] identifier[cacheModeOff] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[StatementUtil] operator[SEP] identifier[close] operator[SEP] identifier[ps] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[ConnectionUtil] operator[SEP] identifier[close] operator[SEP] identifier[connection] operator[SEP] operator[SEP]
}
}
}
|
void setOutputState(int s)
throws IOException
{
if (s<0)
{
_outputState=DISABLED;
if (_writer!=null)
_writer.disable();
_writer=null;
if (_out!=null)
_out.disable();
_out=null;
}
else
_outputState=s;
}
|
class class_name[name] begin[{]
method[setOutputState, return_type[void], modifier[default], parameter[s]] begin[{]
if[binary_operation[member[.s], <, literal[0]]] begin[{]
assign[member[._outputState], member[.DISABLED]]
if[binary_operation[member[._writer], !=, literal[null]]] begin[{]
call[_writer.disable, parameter[]]
else begin[{]
None
end[}]
assign[member[._writer], literal[null]]
if[binary_operation[member[._out], !=, literal[null]]] begin[{]
call[_out.disable, parameter[]]
else begin[{]
None
end[}]
assign[member[._out], literal[null]]
else begin[{]
assign[member[._outputState], member[.s]]
end[}]
end[}]
END[}]
|
Keyword[void] identifier[setOutputState] operator[SEP] Keyword[int] identifier[s] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[s] operator[<] Other[0] operator[SEP] {
identifier[_outputState] operator[=] identifier[DISABLED] operator[SEP] Keyword[if] operator[SEP] identifier[_writer] operator[!=] Other[null] operator[SEP] identifier[_writer] operator[SEP] identifier[disable] operator[SEP] operator[SEP] operator[SEP] identifier[_writer] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[_out] operator[!=] Other[null] operator[SEP] identifier[_out] operator[SEP] identifier[disable] operator[SEP] operator[SEP] operator[SEP] identifier[_out] operator[=] Other[null] operator[SEP]
}
Keyword[else] identifier[_outputState] operator[=] identifier[s] operator[SEP]
}
|
public DynamicReportBuilder setColspan(int colNumber, int colQuantity, String colspanTitle) {
this.setColspan(colNumber, colQuantity, colspanTitle, null);
return this;
}
|
class class_name[name] begin[{]
method[setColspan, return_type[type[DynamicReportBuilder]], modifier[public], parameter[colNumber, colQuantity, colspanTitle]] begin[{]
THIS[call[None.setColspan, parameter[member[.colNumber], member[.colQuantity], member[.colspanTitle], literal[null]]]]
return[THIS[]]
end[}]
END[}]
|
Keyword[public] identifier[DynamicReportBuilder] identifier[setColspan] operator[SEP] Keyword[int] identifier[colNumber] , Keyword[int] identifier[colQuantity] , identifier[String] identifier[colspanTitle] operator[SEP] {
Keyword[this] operator[SEP] identifier[setColspan] operator[SEP] identifier[colNumber] , identifier[colQuantity] , identifier[colspanTitle] , Other[null] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public List<CrowdAgent> getActiveAgents() {
List<CrowdAgent> agents = new ArrayList<>(m_maxAgents);
for (int i = 0; i < m_maxAgents; ++i) {
if (m_agents[i].active) {
agents.add(m_agents[i]);
}
}
return agents;
}
|
class class_name[name] begin[{]
method[getActiveAgents, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[List], agents]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=m_agents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=active, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=m_agents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))])], member=add, postfix_operators=[], prefix_operators=[], qualifier=agents, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m_maxAgents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=[], prefix_operators=['++'], qualifier=, selectors=[])]), label=None)
return[member[.agents]]
end[}]
END[}]
|
Keyword[public] identifier[List] operator[<] identifier[CrowdAgent] operator[>] identifier[getActiveAgents] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[CrowdAgent] operator[>] identifier[agents] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] identifier[m_maxAgents] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[m_maxAgents] operator[SEP] operator[++] identifier[i] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_agents] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[active] operator[SEP] {
identifier[agents] operator[SEP] identifier[add] operator[SEP] identifier[m_agents] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[agents] operator[SEP]
}
|
@Override
public RemoteIterator<Path> listCorruptFileBlocks(Path path)
throws IOException {
return fs.listCorruptFileBlocks(path);
}
|
class class_name[name] begin[{]
method[listCorruptFileBlocks, return_type[type[RemoteIterator]], modifier[public], parameter[path]] begin[{]
return[call[fs.listCorruptFileBlocks, parameter[member[.path]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[RemoteIterator] operator[<] identifier[Path] operator[>] identifier[listCorruptFileBlocks] operator[SEP] identifier[Path] identifier[path] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[fs] operator[SEP] identifier[listCorruptFileBlocks] operator[SEP] identifier[path] operator[SEP] operator[SEP]
}
|
public void addInput(Path path, InputFormat inputFormat, TupleMapper inputProcessor) {
multipleInputs.addInput(new Input(path, inputFormat, inputProcessor, new HashMap<String, String>()));
}
|
class class_name[name] begin[{]
method[addInput, return_type[void], modifier[public], parameter[path, inputFormat, inputProcessor]] begin[{]
call[multipleInputs.addInput, parameter[ClassCreator(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inputFormat, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inputProcessor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Input, sub_type=None))]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[addInput] operator[SEP] identifier[Path] identifier[path] , identifier[InputFormat] identifier[inputFormat] , identifier[TupleMapper] identifier[inputProcessor] operator[SEP] {
identifier[multipleInputs] operator[SEP] identifier[addInput] operator[SEP] Keyword[new] identifier[Input] operator[SEP] identifier[path] , identifier[inputFormat] , identifier[inputProcessor] , Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(EsamSignalProcessingNotification esamSignalProcessingNotification, ProtocolMarshaller protocolMarshaller) {
if (esamSignalProcessingNotification == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(esamSignalProcessingNotification.getSccXml(), SCCXML_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[esamSignalProcessingNotification, protocolMarshaller]] begin[{]
if[binary_operation[member[.esamSignalProcessingNotification], ==, 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=getSccXml, postfix_operators=[], prefix_operators=[], qualifier=esamSignalProcessingNotification, selectors=[], type_arguments=None), MemberReference(member=SCCXML_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[EsamSignalProcessingNotification] identifier[esamSignalProcessingNotification] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[esamSignalProcessingNotification] 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[esamSignalProcessingNotification] operator[SEP] identifier[getSccXml] operator[SEP] operator[SEP] , identifier[SCCXML_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 static List<Method> getAnnotatedMethods(Class<?> clazz){
List<Method> methods = new ArrayList<Method>();
for(Method method:getAllMethods(clazz))
if(!isNull(method.getAnnotation(JMapConversion.class)))
methods.add(method);
return methods;
}
|
class class_name[name] begin[{]
method[getAnnotatedMethods, return_type[type[List]], modifier[private static], parameter[clazz]] begin[{]
local_variable[type[List], methods]
ForStatement(body=IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JMapConversion, sub_type=None))], member=getAnnotation, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None)], member=isNull, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=method, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=methods, selectors=[], type_arguments=None), label=None)), control=EnhancedForControl(iterable=MethodInvocation(arguments=[MemberReference(member=clazz, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAllMethods, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None))), label=None)
return[member[.methods]]
end[}]
END[}]
|
Keyword[private] Keyword[static] identifier[List] operator[<] identifier[Method] operator[>] identifier[getAnnotatedMethods] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[clazz] operator[SEP] {
identifier[List] operator[<] identifier[Method] operator[>] identifier[methods] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Method] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Method] identifier[method] operator[:] identifier[getAllMethods] operator[SEP] identifier[clazz] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isNull] operator[SEP] identifier[method] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[JMapConversion] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[methods] operator[SEP] identifier[add] operator[SEP] identifier[method] operator[SEP] operator[SEP] Keyword[return] identifier[methods] operator[SEP]
}
|
public void setZoomableController(ZoomableController zoomableController) {
Preconditions.checkNotNull(zoomableController);
mZoomableController.setListener(null);
mZoomableController = zoomableController;
mZoomableController.setListener(mZoomableListener);
}
|
class class_name[name] begin[{]
method[setZoomableController, return_type[void], modifier[public], parameter[zoomableController]] begin[{]
call[Preconditions.checkNotNull, parameter[member[.zoomableController]]]
call[mZoomableController.setListener, parameter[literal[null]]]
assign[member[.mZoomableController], member[.zoomableController]]
call[mZoomableController.setListener, parameter[member[.mZoomableListener]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[setZoomableController] operator[SEP] identifier[ZoomableController] identifier[zoomableController] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkNotNull] operator[SEP] identifier[zoomableController] operator[SEP] operator[SEP] identifier[mZoomableController] operator[SEP] identifier[setListener] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[mZoomableController] operator[=] identifier[zoomableController] operator[SEP] identifier[mZoomableController] operator[SEP] identifier[setListener] operator[SEP] identifier[mZoomableListener] operator[SEP] operator[SEP]
}
|
public V put(K key, V value) {
typeCheck(key);
int index = key.ordinal();
Object oldValue = vals[index];
vals[index] = maskNull(value);
if (oldValue == null)
size++;
return unmaskNull(oldValue);
}
|
class class_name[name] begin[{]
method[put, return_type[type[V]], modifier[public], parameter[key, value]] begin[{]
call[.typeCheck, parameter[member[.key]]]
local_variable[type[int], index]
local_variable[type[Object], oldValue]
assign[member[.vals], call[.maskNull, parameter[member[.value]]]]
if[binary_operation[member[.oldValue], ==, literal[null]]] begin[{]
member[.size]
else begin[{]
None
end[}]
return[call[.unmaskNull, parameter[member[.oldValue]]]]
end[}]
END[}]
|
Keyword[public] identifier[V] identifier[put] operator[SEP] identifier[K] identifier[key] , identifier[V] identifier[value] operator[SEP] {
identifier[typeCheck] operator[SEP] identifier[key] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] identifier[key] operator[SEP] identifier[ordinal] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[oldValue] operator[=] identifier[vals] operator[SEP] identifier[index] operator[SEP] operator[SEP] identifier[vals] operator[SEP] identifier[index] operator[SEP] operator[=] identifier[maskNull] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oldValue] operator[==] Other[null] operator[SEP] identifier[size] operator[++] operator[SEP] Keyword[return] identifier[unmaskNull] operator[SEP] identifier[oldValue] operator[SEP] operator[SEP]
}
|
public void addUploadFile(HttpServletRequest request,
UploadFile uploadFile) {
if (uploadFile == null)
return;
try{
HttpSession session = request.getSession(true);
Collection uploadList = (Collection)session.getAttribute(PIC_NAME_PACKAGE);
if (uploadList == null) {
uploadList = new ArrayList();
session.setAttribute(PIC_NAME_PACKAGE, uploadList);
}
uploadList.add(uploadFile);
uploadFile.setTempId(Integer.toString(uploadList.size() - 1)); //临时给予id
}catch(Exception ex){
Debug.logError("[JdonFramework]addUploadFile error:" + ex, module);
}
}
|
class class_name[name] begin[{]
method[addUploadFile, return_type[void], modifier[public], parameter[request, uploadFile]] begin[{]
if[binary_operation[member[.uploadFile], ==, literal[null]]] begin[{]
return[None]
else begin[{]
None
end[}]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getSession, postfix_operators=[], prefix_operators=[], qualifier=request, selectors=[], type_arguments=None), name=session)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HttpSession, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=PIC_NAME_PACKAGE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Collection, sub_type=None)), name=uploadList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Collection, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=uploadList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=uploadList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ArrayList, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=PIC_NAME_PACKAGE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=uploadList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setAttribute, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=uploadFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=uploadList, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=uploadList, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=toString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None)], member=setTempId, postfix_operators=[], prefix_operators=[], qualifier=uploadFile, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="[JdonFramework]addUploadFile error:"), operandr=MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=module, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=logError, postfix_operators=[], prefix_operators=[], qualifier=Debug, selectors=[], type_arguments=None), 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] Keyword[void] identifier[addUploadFile] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[UploadFile] identifier[uploadFile] operator[SEP] {
Keyword[if] operator[SEP] identifier[uploadFile] operator[==] Other[null] operator[SEP] Keyword[return] operator[SEP] Keyword[try] {
identifier[HttpSession] identifier[session] operator[=] identifier[request] operator[SEP] identifier[getSession] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[Collection] identifier[uploadList] operator[=] operator[SEP] identifier[Collection] operator[SEP] identifier[session] operator[SEP] identifier[getAttribute] operator[SEP] identifier[PIC_NAME_PACKAGE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[uploadList] operator[==] Other[null] operator[SEP] {
identifier[uploadList] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[setAttribute] operator[SEP] identifier[PIC_NAME_PACKAGE] , identifier[uploadList] operator[SEP] operator[SEP]
}
identifier[uploadList] operator[SEP] identifier[add] operator[SEP] identifier[uploadFile] operator[SEP] operator[SEP] identifier[uploadFile] operator[SEP] identifier[setTempId] operator[SEP] identifier[Integer] operator[SEP] identifier[toString] operator[SEP] identifier[uploadList] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[Debug] operator[SEP] identifier[logError] operator[SEP] literal[String] operator[+] identifier[ex] , identifier[module] operator[SEP] operator[SEP]
}
}
|
public void translate (int dx, int dy)
{
setLocation(_bounds.x + dx, _bounds.y + dy);
}
|
class class_name[name] begin[{]
method[translate, return_type[void], modifier[public], parameter[dx, dy]] begin[{]
call[.setLocation, parameter[binary_operation[member[_bounds.x], +, member[.dx]], binary_operation[member[_bounds.y], +, member[.dy]]]]
end[}]
END[}]
|
Keyword[public] Keyword[void] identifier[translate] operator[SEP] Keyword[int] identifier[dx] , Keyword[int] identifier[dy] operator[SEP] {
identifier[setLocation] operator[SEP] identifier[_bounds] operator[SEP] identifier[x] operator[+] identifier[dx] , identifier[_bounds] operator[SEP] identifier[y] operator[+] identifier[dy] operator[SEP] operator[SEP]
}
|
@Override
public DescribeCertificateAuthorityResult describeCertificateAuthority(DescribeCertificateAuthorityRequest request) {
request = beforeClientExecution(request);
return executeDescribeCertificateAuthority(request);
}
|
class class_name[name] begin[{]
method[describeCertificateAuthority, return_type[type[DescribeCertificateAuthorityResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeDescribeCertificateAuthority, parameter[member[.request]]]]
end[}]
END[}]
|
annotation[@] identifier[Override] Keyword[public] identifier[DescribeCertificateAuthorityResult] identifier[describeCertificateAuthority] operator[SEP] identifier[DescribeCertificateAuthorityRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDescribeCertificateAuthority] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
@Transactional
public DeferredEvent removeDeferredEvent(ProcessInstance processInstance,
TaskBase task) {
List<DeferredEvent> deferredEvents = processInstance.getDeferredEvents();
for (DeferredEvent deferredEvent: deferredEvents) {
if (deferredEvent.getEventType() != EventType.DONE && deferredEvent.getTaskId().longValue() == task.getTaskId() && task.getProcessDefinitionName().equals(deferredEvent.getProcessDefinitionName())) {
log.debug("killed deferred event processId {} taskId {} status {} {}", deferredEvent.getProcessInstance().getId(), deferredEvent.getId(), deferredEvent.getEventType() ,deferredEvent.getComment() );
deferredEvent.setEventType(EventType.DONE);
return deferredEvent;
}
}
log.debug("failed to find deferred event processId {} {} taskId {}", processInstance.getId(), task.getProcessDefinitionName(), task.getTaskId());
return null;
}
|
class class_name[name] begin[{]
method[removeDeferredEvent, return_type[type[DeferredEvent]], modifier[public], parameter[processInstance, task]] begin[{]
local_variable[type[List], deferredEvents]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getEventType, postfix_operators=[], prefix_operators=[], qualifier=deferredEvent, selectors=[], type_arguments=None), operandr=MemberReference(member=DONE, postfix_operators=[], prefix_operators=[], qualifier=EventType, selectors=[]), operator=!=), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getTaskId, postfix_operators=[], prefix_operators=[], qualifier=deferredEvent, selectors=[MethodInvocation(arguments=[], member=longValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getTaskId, postfix_operators=[], prefix_operators=[], qualifier=task, selectors=[], type_arguments=None), operator===), operator=&&), operandr=MethodInvocation(arguments=[], member=getProcessDefinitionName, postfix_operators=[], prefix_operators=[], qualifier=task, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getProcessDefinitionName, postfix_operators=[], prefix_operators=[], qualifier=deferredEvent, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="killed deferred event processId {} taskId {} status {} {}"), MethodInvocation(arguments=[], member=getProcessInstance, postfix_operators=[], prefix_operators=[], qualifier=deferredEvent, selectors=[MethodInvocation(arguments=[], member=getId, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=getId, postfix_operators=[], prefix_operators=[], qualifier=deferredEvent, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getEventType, postfix_operators=[], prefix_operators=[], qualifier=deferredEvent, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getComment, postfix_operators=[], prefix_operators=[], qualifier=deferredEvent, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DONE, postfix_operators=[], prefix_operators=[], qualifier=EventType, selectors=[])], member=setEventType, postfix_operators=[], prefix_operators=[], qualifier=deferredEvent, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=deferredEvent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=deferredEvents, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=deferredEvent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=DeferredEvent, sub_type=None))), label=None)
call[log.debug, parameter[literal["failed to find deferred event processId {} {} taskId {}"], call[processInstance.getId, parameter[]], call[task.getProcessDefinitionName, parameter[]], call[task.getTaskId, parameter[]]]]
return[literal[null]]
end[}]
END[}]
|
annotation[@] identifier[Transactional] Keyword[public] identifier[DeferredEvent] identifier[removeDeferredEvent] operator[SEP] identifier[ProcessInstance] identifier[processInstance] , identifier[TaskBase] identifier[task] operator[SEP] {
identifier[List] operator[<] identifier[DeferredEvent] operator[>] identifier[deferredEvents] operator[=] identifier[processInstance] operator[SEP] identifier[getDeferredEvents] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[DeferredEvent] identifier[deferredEvent] operator[:] identifier[deferredEvents] operator[SEP] {
Keyword[if] operator[SEP] identifier[deferredEvent] operator[SEP] identifier[getEventType] operator[SEP] operator[SEP] operator[!=] identifier[EventType] operator[SEP] identifier[DONE] operator[&&] identifier[deferredEvent] operator[SEP] identifier[getTaskId] operator[SEP] operator[SEP] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[==] identifier[task] operator[SEP] identifier[getTaskId] operator[SEP] operator[SEP] operator[&&] identifier[task] operator[SEP] identifier[getProcessDefinitionName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[deferredEvent] operator[SEP] identifier[getProcessDefinitionName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[deferredEvent] operator[SEP] identifier[getProcessInstance] operator[SEP] operator[SEP] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[deferredEvent] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[deferredEvent] operator[SEP] identifier[getEventType] operator[SEP] operator[SEP] , identifier[deferredEvent] operator[SEP] identifier[getComment] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[deferredEvent] operator[SEP] identifier[setEventType] operator[SEP] identifier[EventType] operator[SEP] identifier[DONE] operator[SEP] operator[SEP] Keyword[return] identifier[deferredEvent] operator[SEP]
}
}
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[processInstance] operator[SEP] identifier[getId] operator[SEP] operator[SEP] , identifier[task] operator[SEP] identifier[getProcessDefinitionName] operator[SEP] operator[SEP] , identifier[task] operator[SEP] identifier[getTaskId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public static <T, U> JavaPairRDD<T, U>[] balancedRandomSplit(int totalObjectCount, int numObjectsPerSplit,
JavaPairRDD<T, U> data, long rngSeed) {
JavaPairRDD<T, U>[] splits;
if (totalObjectCount <= numObjectsPerSplit) {
splits = (JavaPairRDD<T, U>[]) Array.newInstance(JavaPairRDD.class, 1);
splits[0] = data;
} else {
int numSplits = totalObjectCount / numObjectsPerSplit; //Intentional round down
splits = (JavaPairRDD<T, U>[]) Array.newInstance(JavaPairRDD.class, numSplits);
for (int i = 0; i < numSplits; i++) {
//What we really need is a .mapPartitionsToPairWithIndex function
//but, of course Spark doesn't provide this
//So we need to do a two-step process here...
JavaRDD<Tuple2<T, U>> split = data.mapPartitionsWithIndex(
new SplitPartitionsFunction2<T, U>(i, numSplits, rngSeed), true);
splits[i] = split.mapPartitionsToPair(new MapTupleToPairFlatMap<T, U>(), true);
}
}
return splits;
}
|
class class_name[name] begin[{]
method[balancedRandomSplit, return_type[type[JavaPairRDD]], modifier[public static], parameter[totalObjectCount, numObjectsPerSplit, data, rngSeed]] begin[{]
local_variable[type[JavaPairRDD], splits]
if[binary_operation[member[.totalObjectCount], <=, member[.numObjectsPerSplit]]] begin[{]
assign[member[.splits], Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JavaPairRDD, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=Array, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None))], dimensions=[None], name=JavaPairRDD, sub_type=None))]
assign[member[.splits], member[.data]]
else begin[{]
local_variable[type[int], numSplits]
assign[member[.splits], Cast(expression=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=JavaPairRDD, sub_type=None)), MemberReference(member=numSplits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=Array, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None))], dimensions=[None], name=JavaPairRDD, sub_type=None))]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=numSplits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=rngSeed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None))], dimensions=None, name=SplitPartitionsFunction2, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=mapPartitionsWithIndex, postfix_operators=[], prefix_operators=[], qualifier=data, selectors=[], type_arguments=None), name=split)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None))], dimensions=[], name=Tuple2, sub_type=None))], dimensions=[], name=JavaRDD, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=splits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=U, sub_type=None))], dimensions=None, name=MapTupleToPairFlatMap, sub_type=None)), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=mapPartitionsToPair, postfix_operators=[], prefix_operators=[], qualifier=split, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=numSplits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
end[}]
return[member[.splits]]
end[}]
END[}]
|
Keyword[public] Keyword[static] operator[<] identifier[T] , identifier[U] operator[>] identifier[JavaPairRDD] operator[<] identifier[T] , identifier[U] operator[>] operator[SEP] operator[SEP] identifier[balancedRandomSplit] operator[SEP] Keyword[int] identifier[totalObjectCount] , Keyword[int] identifier[numObjectsPerSplit] , identifier[JavaPairRDD] operator[<] identifier[T] , identifier[U] operator[>] identifier[data] , Keyword[long] identifier[rngSeed] operator[SEP] {
identifier[JavaPairRDD] operator[<] identifier[T] , identifier[U] operator[>] operator[SEP] operator[SEP] identifier[splits] operator[SEP] Keyword[if] operator[SEP] identifier[totalObjectCount] operator[<=] identifier[numObjectsPerSplit] operator[SEP] {
identifier[splits] operator[=] operator[SEP] identifier[JavaPairRDD] operator[<] identifier[T] , identifier[U] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[JavaPairRDD] operator[SEP] Keyword[class] , Other[1] operator[SEP] operator[SEP] identifier[splits] operator[SEP] Other[0] operator[SEP] operator[=] identifier[data] operator[SEP]
}
Keyword[else] {
Keyword[int] identifier[numSplits] operator[=] identifier[totalObjectCount] operator[/] identifier[numObjectsPerSplit] operator[SEP] identifier[splits] operator[=] operator[SEP] identifier[JavaPairRDD] operator[<] identifier[T] , identifier[U] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[JavaPairRDD] operator[SEP] Keyword[class] , identifier[numSplits] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[numSplits] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[JavaRDD] operator[<] identifier[Tuple2] operator[<] identifier[T] , identifier[U] operator[>] operator[>] identifier[split] operator[=] identifier[data] operator[SEP] identifier[mapPartitionsWithIndex] operator[SEP] Keyword[new] identifier[SplitPartitionsFunction2] operator[<] identifier[T] , identifier[U] operator[>] operator[SEP] identifier[i] , identifier[numSplits] , identifier[rngSeed] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[splits] operator[SEP] identifier[i] operator[SEP] operator[=] identifier[split] operator[SEP] identifier[mapPartitionsToPair] operator[SEP] Keyword[new] identifier[MapTupleToPairFlatMap] operator[<] identifier[T] , identifier[U] operator[>] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[splits] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.