code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
public void setEveryWorkingDay(final boolean isEveryWorkingDay) {
if (m_model.isEveryWorkingDay() != isEveryWorkingDay) {
removeExceptionsOnChange(new Command() {
public void execute() {
m_model.setEveryWorkingDay(Boolean.valueOf(isEveryWorkingDay));
m_model.setInterval(getPatternDefaultValues().getInterval());
onValueChange();
}
});
}
} | class class_name[name] begin[{]
method[setEveryWorkingDay, return_type[void], modifier[public], parameter[isEveryWorkingDay]] begin[{]
if[binary_operation[call[m_model.isEveryWorkingDay, parameter[]], !=, member[.isEveryWorkingDay]]] begin[{]
call[.removeExceptionsOnChange, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=isEveryWorkingDay, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Boolean, selectors=[], type_arguments=None)], member=setEveryWorkingDay, postfix_operators=[], prefix_operators=[], qualifier=m_model, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPatternDefaultValues, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getInterval, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=setInterval, postfix_operators=[], prefix_operators=[], qualifier=m_model, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=onValueChange, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=execute, 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=Command, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setEveryWorkingDay] operator[SEP] Keyword[final] Keyword[boolean] identifier[isEveryWorkingDay] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_model] operator[SEP] identifier[isEveryWorkingDay] operator[SEP] operator[SEP] operator[!=] identifier[isEveryWorkingDay] operator[SEP] {
identifier[removeExceptionsOnChange] operator[SEP] Keyword[new] identifier[Command] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[execute] operator[SEP] operator[SEP] {
identifier[m_model] operator[SEP] identifier[setEveryWorkingDay] operator[SEP] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[isEveryWorkingDay] operator[SEP] operator[SEP] operator[SEP] identifier[m_model] operator[SEP] identifier[setInterval] operator[SEP] identifier[getPatternDefaultValues] operator[SEP] operator[SEP] operator[SEP] identifier[getInterval] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[onValueChange] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
}
|
@Deprecated
public static <T> void sort(T[] array, int size, Comparator<? super T> comparator)
{
if (comparator == null)
{
Arrays.sort(array, 0, size); // handles case size < 2 in Java 8 ComparableTimSort
}
else
{
Arrays.sort(array, 0, size, comparator); // handles case size < 2 in Java 8 TimSort
}
} | class class_name[name] begin[{]
method[sort, return_type[void], modifier[public static], parameter[array, size, comparator]] begin[{]
if[binary_operation[member[.comparator], ==, literal[null]]] begin[{]
call[Arrays.sort, parameter[member[.array], literal[0], member[.size]]]
else begin[{]
call[Arrays.sort, parameter[member[.array], literal[0], member[.size], member[.comparator]]]
end[}]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] Keyword[void] identifier[sort] operator[SEP] identifier[T] operator[SEP] operator[SEP] identifier[array] , Keyword[int] identifier[size] , identifier[Comparator] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[comparator] operator[SEP] {
Keyword[if] operator[SEP] identifier[comparator] operator[==] Other[null] operator[SEP] {
identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[array] , Other[0] , identifier[size] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Arrays] operator[SEP] identifier[sort] operator[SEP] identifier[array] , Other[0] , identifier[size] , identifier[comparator] operator[SEP] operator[SEP]
}
}
|
public Pair<int[][][], int[]> documentToDataAndLabels(List<IN> document) {
int docSize = document.size();
// first index is position in the document also the index of the
// clique/factor table
// second index is the number of elements in the clique/window these
// features are for (starting with last element)
// third index is position of the feature in the array that holds them
// element in data[j][k][m] is the index of the mth feature occurring in
// position k of the jth clique
int[][][] data = new int[docSize][windowSize][];
// index is the position in the document
// element in labels[j] is the index of the correct label (if it exists) at
// position j of document
int[] labels = new int[docSize];
if (flags.useReverse) {
Collections.reverse(document);
}
// System.err.println("docSize:"+docSize);
for (int j = 0; j < docSize; j++) {
CRFDatum<List<String>, CRFLabel> d = makeDatum(document, j, featureFactory);
List<List<String>> features = d.asFeatures();
for (int k = 0, fSize = features.size(); k < fSize; k++) {
Collection<String> cliqueFeatures = features.get(k);
data[j][k] = new int[cliqueFeatures.size()];
int m = 0;
for (String feature : cliqueFeatures) {
int index = featureIndex.indexOf(feature);
if (index >= 0) {
data[j][k][m] = index;
m++;
} else {
// this is where we end up when we do feature threshold cutoffs
}
}
// Reduce memory use when some features were cut out by threshold
if (m < data[j][k].length) {
int[] f = new int[m];
System.arraycopy(data[j][k], 0, f, 0, m);
data[j][k] = f;
}
}
IN wi = document.get(j);
labels[j] = classIndex.indexOf(wi.get(AnswerAnnotation.class));
}
if (flags.useReverse) {
Collections.reverse(document);
}
// System.err.println("numClasses: "+classIndex.size()+" "+classIndex);
// System.err.println("numDocuments: 1");
// System.err.println("numDatums: "+data.length);
// System.err.println("numFeatures: "+featureIndex.size());
return new Pair<int[][][], int[]>(data, labels);
} | class class_name[name] begin[{]
method[documentToDataAndLabels, return_type[type[Pair]], modifier[public], parameter[document]] begin[{]
local_variable[type[int], docSize]
local_variable[type[int], data]
local_variable[type[int], labels]
if[member[flags.useReverse]] begin[{]
call[Collections.reverse, parameter[member[.document]]]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=document, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=featureFactory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=makeDatum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=d)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CRFLabel, sub_type=None))], dimensions=[], name=CRFDatum, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=asFeatures, postfix_operators=[], prefix_operators=[], qualifier=d, selectors=[], type_arguments=None), name=features)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=features, selectors=[], type_arguments=None), name=cliqueFeatures)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Collection, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ArrayCreator(dimensions=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=cliqueFeatures, selectors=[], type_arguments=None)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=m)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=feature, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=featureIndex, selectors=[], type_arguments=None), name=index)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), else_statement=BlockStatement(label=None, statements=[]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=index, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=MemberReference(member=m, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=cliqueFeatures, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=feature)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=length, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int)), name=f)], modifiers=set(), type=BasicType(dimensions=[None], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=arraycopy, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=f, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=fSize, 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=k), VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=features, selectors=[], type_arguments=None), name=fSize)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=document, selectors=[], type_arguments=None), name=wi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IN, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=labels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AnswerAnnotation, sub_type=None))], member=get, postfix_operators=[], prefix_operators=[], qualifier=wi, selectors=[], type_arguments=None)], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=classIndex, selectors=[], type_arguments=None)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=docSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[member[flags.useReverse]] begin[{]
call[Collections.reverse, parameter[member[.document]]]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=data, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=labels, 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=BasicType(dimensions=[None, None, None], name=int)), TypeArgument(pattern_type=None, type=BasicType(dimensions=[None], name=int))], dimensions=None, name=Pair, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[Pair] operator[<] Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , Keyword[int] operator[SEP] operator[SEP] operator[>] identifier[documentToDataAndLabels] operator[SEP] identifier[List] operator[<] identifier[IN] operator[>] identifier[document] operator[SEP] {
Keyword[int] identifier[docSize] operator[=] identifier[document] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[docSize] operator[SEP] operator[SEP] identifier[windowSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[labels] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[docSize] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[flags] operator[SEP] identifier[useReverse] operator[SEP] {
identifier[Collections] operator[SEP] identifier[reverse] operator[SEP] identifier[document] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[docSize] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[CRFDatum] operator[<] identifier[List] operator[<] identifier[String] operator[>] , identifier[CRFLabel] operator[>] identifier[d] operator[=] identifier[makeDatum] operator[SEP] identifier[document] , identifier[j] , identifier[featureFactory] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[List] operator[<] identifier[String] operator[>] operator[>] identifier[features] operator[=] identifier[d] operator[SEP] identifier[asFeatures] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] , identifier[fSize] operator[=] identifier[features] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[k] operator[<] identifier[fSize] operator[SEP] identifier[k] operator[++] operator[SEP] {
identifier[Collection] operator[<] identifier[String] operator[>] identifier[cliqueFeatures] operator[=] identifier[features] operator[SEP] identifier[get] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[cliqueFeatures] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[m] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[feature] operator[:] identifier[cliqueFeatures] operator[SEP] {
Keyword[int] identifier[index] operator[=] identifier[featureIndex] operator[SEP] identifier[indexOf] operator[SEP] identifier[feature] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[index] operator[>=] Other[0] operator[SEP] {
identifier[data] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[m] operator[SEP] operator[=] identifier[index] operator[SEP] identifier[m] operator[++] operator[SEP]
}
Keyword[else] {
}
}
Keyword[if] operator[SEP] identifier[m] operator[<] identifier[data] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[SEP] identifier[length] operator[SEP] {
Keyword[int] operator[SEP] operator[SEP] identifier[f] operator[=] Keyword[new] Keyword[int] operator[SEP] identifier[m] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[arraycopy] operator[SEP] identifier[data] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[k] operator[SEP] , Other[0] , identifier[f] , Other[0] , identifier[m] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[=] identifier[f] operator[SEP]
}
}
identifier[IN] identifier[wi] operator[=] identifier[document] operator[SEP] identifier[get] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[labels] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[classIndex] operator[SEP] identifier[indexOf] operator[SEP] identifier[wi] operator[SEP] identifier[get] operator[SEP] identifier[AnswerAnnotation] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[flags] operator[SEP] identifier[useReverse] operator[SEP] {
identifier[Collections] operator[SEP] identifier[reverse] operator[SEP] identifier[document] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[Pair] operator[<] Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] , Keyword[int] operator[SEP] operator[SEP] operator[>] operator[SEP] identifier[data] , identifier[labels] operator[SEP] operator[SEP]
}
|
@Override
public CommerceOrderItem findByCPInstanceId_First(long CPInstanceId,
OrderByComparator<CommerceOrderItem> orderByComparator)
throws NoSuchOrderItemException {
CommerceOrderItem commerceOrderItem = fetchByCPInstanceId_First(CPInstanceId,
orderByComparator);
if (commerceOrderItem != null) {
return commerceOrderItem;
}
StringBundler msg = new StringBundler(4);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("CPInstanceId=");
msg.append(CPInstanceId);
msg.append("}");
throw new NoSuchOrderItemException(msg.toString());
} | class class_name[name] begin[{]
method[findByCPInstanceId_First, return_type[type[CommerceOrderItem]], modifier[public], parameter[CPInstanceId, orderByComparator]] begin[{]
local_variable[type[CommerceOrderItem], commerceOrderItem]
if[binary_operation[member[.commerceOrderItem], !=, literal[null]]] begin[{]
return[member[.commerceOrderItem]]
else begin[{]
None
end[}]
local_variable[type[StringBundler], msg]
call[msg.append, parameter[member[._NO_SUCH_ENTITY_WITH_KEY]]]
call[msg.append, parameter[literal["CPInstanceId="]]]
call[msg.append, parameter[member[.CPInstanceId]]]
call[msg.append, parameter[literal["}"]]]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=msg, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NoSuchOrderItemException, sub_type=None)), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CommerceOrderItem] identifier[findByCPInstanceId_First] operator[SEP] Keyword[long] identifier[CPInstanceId] , identifier[OrderByComparator] operator[<] identifier[CommerceOrderItem] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[NoSuchOrderItemException] {
identifier[CommerceOrderItem] identifier[commerceOrderItem] operator[=] identifier[fetchByCPInstanceId_First] operator[SEP] identifier[CPInstanceId] , identifier[orderByComparator] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[commerceOrderItem] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[commerceOrderItem] operator[SEP]
}
identifier[StringBundler] identifier[msg] operator[=] Keyword[new] identifier[StringBundler] operator[SEP] Other[4] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[_NO_SUCH_ENTITY_WITH_KEY] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] identifier[CPInstanceId] operator[SEP] operator[SEP] identifier[msg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[NoSuchOrderItemException] operator[SEP] identifier[msg] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static String getServiceType() {
if (UNSET.equals(serviceType) && WARNED_UNSET.compareAndSet(false, true)) {
LoggerFactory.getLogger(ApplicationLogEvent.class).error("The application name was not set! Sending 'UNSET' instead :(");
}
return serviceType;
} | class class_name[name] begin[{]
method[getServiceType, return_type[type[String]], modifier[public static], parameter[]] begin[{]
if[binary_operation[call[UNSET.equals, parameter[member[.serviceType]]], &&, call[WARNED_UNSET.compareAndSet, parameter[literal[false], literal[true]]]]] begin[{]
call[LoggerFactory.getLogger, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ApplicationLogEvent, sub_type=None))]]
else begin[{]
None
end[}]
return[member[.serviceType]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getServiceType] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[UNSET] operator[SEP] identifier[equals] operator[SEP] identifier[serviceType] operator[SEP] operator[&&] identifier[WARNED_UNSET] operator[SEP] identifier[compareAndSet] operator[SEP] literal[boolean] , literal[boolean] operator[SEP] operator[SEP] {
identifier[LoggerFactory] operator[SEP] identifier[getLogger] operator[SEP] identifier[ApplicationLogEvent] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[serviceType] operator[SEP]
}
|
@Override
public com.liferay.commerce.wish.list.model.CommerceWishList updateCommerceWishList(
com.liferay.commerce.wish.list.model.CommerceWishList commerceWishList) {
return _commerceWishListLocalService.updateCommerceWishList(commerceWishList);
} | class class_name[name] begin[{]
method[updateCommerceWishList, return_type[type[com]], modifier[public], parameter[commerceWishList]] begin[{]
return[call[_commerceWishListLocalService.updateCommerceWishList, parameter[member[.commerceWishList]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[wish] operator[SEP] identifier[list] operator[SEP] identifier[model] operator[SEP] identifier[CommerceWishList] identifier[updateCommerceWishList] operator[SEP] identifier[com] operator[SEP] identifier[liferay] operator[SEP] identifier[commerce] operator[SEP] identifier[wish] operator[SEP] identifier[list] operator[SEP] identifier[model] operator[SEP] identifier[CommerceWishList] identifier[commerceWishList] operator[SEP] {
Keyword[return] identifier[_commerceWishListLocalService] operator[SEP] identifier[updateCommerceWishList] operator[SEP] identifier[commerceWishList] operator[SEP] operator[SEP]
}
|
@Override
public int countMaps(TargetProperties targetMolecule) {
IState state = new VFState(query, targetMolecule);
maps.clear();
mapAll(state);
return maps.size();
} | class class_name[name] begin[{]
method[countMaps, return_type[type[int]], modifier[public], parameter[targetMolecule]] begin[{]
local_variable[type[IState], state]
call[maps.clear, parameter[]]
call[.mapAll, parameter[member[.state]]]
return[call[maps.size, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[int] identifier[countMaps] operator[SEP] identifier[TargetProperties] identifier[targetMolecule] operator[SEP] {
identifier[IState] identifier[state] operator[=] Keyword[new] identifier[VFState] operator[SEP] identifier[query] , identifier[targetMolecule] operator[SEP] operator[SEP] identifier[maps] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[mapAll] operator[SEP] identifier[state] operator[SEP] operator[SEP] Keyword[return] identifier[maps] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP]
}
|
public PythonStreamExecutionEnvironment create_local_execution_environment(int parallelism, Configuration config) {
return new PythonStreamExecutionEnvironment(
StreamExecutionEnvironment.createLocalEnvironment(parallelism, config), new Path(localTmpPath), scriptName);
} | class class_name[name] begin[{]
method[create_local_execution_environment, return_type[type[PythonStreamExecutionEnvironment]], modifier[public], parameter[parallelism, config]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=parallelism, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=createLocalEnvironment, postfix_operators=[], prefix_operators=[], qualifier=StreamExecutionEnvironment, selectors=[], type_arguments=None), ClassCreator(arguments=[MemberReference(member=localTmpPath, 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=Path, sub_type=None)), MemberReference(member=scriptName, 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=PythonStreamExecutionEnvironment, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[PythonStreamExecutionEnvironment] identifier[create_local_execution_environment] operator[SEP] Keyword[int] identifier[parallelism] , identifier[Configuration] identifier[config] operator[SEP] {
Keyword[return] Keyword[new] identifier[PythonStreamExecutionEnvironment] operator[SEP] identifier[StreamExecutionEnvironment] operator[SEP] identifier[createLocalEnvironment] operator[SEP] identifier[parallelism] , identifier[config] operator[SEP] , Keyword[new] identifier[Path] operator[SEP] identifier[localTmpPath] operator[SEP] , identifier[scriptName] operator[SEP] operator[SEP]
}
|
public void addClassInfo(final ClassInfo classInfo) {
ArgUtils.notNull(classInfo, "classInfo");
removeClassInfo(classInfo.getClassName());
this.classInfos.add(classInfo);
} | class class_name[name] begin[{]
method[addClassInfo, return_type[void], modifier[public], parameter[classInfo]] begin[{]
call[ArgUtils.notNull, parameter[member[.classInfo], literal["classInfo"]]]
call[.removeClassInfo, parameter[call[classInfo.getClassName, parameter[]]]]
THIS[member[None.classInfos]call[None.add, parameter[member[.classInfo]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addClassInfo] operator[SEP] Keyword[final] identifier[ClassInfo] identifier[classInfo] operator[SEP] {
identifier[ArgUtils] operator[SEP] identifier[notNull] operator[SEP] identifier[classInfo] , literal[String] operator[SEP] operator[SEP] identifier[removeClassInfo] operator[SEP] identifier[classInfo] operator[SEP] identifier[getClassName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[classInfos] operator[SEP] identifier[add] operator[SEP] identifier[classInfo] operator[SEP] operator[SEP]
}
|
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public final Disposable subscribe(final Consumer<? super T> onSuccess, final Consumer<? super Throwable> onError) {
ObjectHelper.requireNonNull(onSuccess, "onSuccess is null");
ObjectHelper.requireNonNull(onError, "onError is null");
ConsumerSingleObserver<T> observer = new ConsumerSingleObserver<T>(onSuccess, onError);
subscribe(observer);
return observer;
} | class class_name[name] begin[{]
method[subscribe, return_type[type[Disposable]], modifier[final public], parameter[onSuccess, onError]] begin[{]
call[ObjectHelper.requireNonNull, parameter[member[.onSuccess], literal["onSuccess is null"]]]
call[ObjectHelper.requireNonNull, parameter[member[.onError], literal["onError is null"]]]
local_variable[type[ConsumerSingleObserver], observer]
call[.subscribe, parameter[member[.observer]]]
return[member[.observer]]
end[}]
END[}] | annotation[@] identifier[CheckReturnValue] annotation[@] identifier[NonNull] annotation[@] identifier[SchedulerSupport] operator[SEP] identifier[SchedulerSupport] operator[SEP] identifier[NONE] operator[SEP] Keyword[public] Keyword[final] identifier[Disposable] identifier[subscribe] operator[SEP] Keyword[final] identifier[Consumer] operator[<] operator[?] Keyword[super] identifier[T] operator[>] identifier[onSuccess] , Keyword[final] identifier[Consumer] operator[<] operator[?] Keyword[super] identifier[Throwable] operator[>] identifier[onError] operator[SEP] {
identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[onSuccess] , literal[String] operator[SEP] operator[SEP] identifier[ObjectHelper] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[onError] , literal[String] operator[SEP] operator[SEP] identifier[ConsumerSingleObserver] operator[<] identifier[T] operator[>] identifier[observer] operator[=] Keyword[new] identifier[ConsumerSingleObserver] operator[<] identifier[T] operator[>] operator[SEP] identifier[onSuccess] , identifier[onError] operator[SEP] operator[SEP] identifier[subscribe] operator[SEP] identifier[observer] operator[SEP] operator[SEP] Keyword[return] identifier[observer] operator[SEP]
}
|
@Override
public void startOperationSequence() throws GeometryOperationFailedException {
if (current != null) {
throw new GeometryOperationFailedException("An operation sequence has already been started.");
}
current = new OperationSequence();
redoQueue.clear();
} | class class_name[name] begin[{]
method[startOperationSequence, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.current], !=, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="An operation sequence has already been started.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GeometryOperationFailedException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.current], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OperationSequence, sub_type=None))]
call[redoQueue.clear, parameter[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[startOperationSequence] operator[SEP] operator[SEP] Keyword[throws] identifier[GeometryOperationFailedException] {
Keyword[if] operator[SEP] identifier[current] operator[!=] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[GeometryOperationFailedException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[current] operator[=] Keyword[new] identifier[OperationSequence] operator[SEP] operator[SEP] operator[SEP] identifier[redoQueue] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP]
}
|
@ReadOperation
public Map<String, Map> allMetrics() {
Map<String, Map> results = new HashMap<>();
// JVM stats
results.put("jvm", this.jvmMemoryMetrics());
// HTTP requests stats
results.put("http.server.requests", this.httpRequestsMetrics());
// Cache stats
results.put("cache", this.cacheMetrics());
// Service stats
results.put("services", this.serviceMetrics());
// Database stats
results.put("databases", this.databaseMetrics());
// Garbage collector
results.put("garbageCollector", this.garbageCollectorMetrics());
// Process stats
results.put("processMetrics", this.processMetrics());
return results;
} | class class_name[name] begin[{]
method[allMetrics, return_type[type[Map]], modifier[public], parameter[]] begin[{]
local_variable[type[Map], results]
call[results.put, parameter[literal["jvm"], THIS[call[None.jvmMemoryMetrics, parameter[]]]]]
call[results.put, parameter[literal["http.server.requests"], THIS[call[None.httpRequestsMetrics, parameter[]]]]]
call[results.put, parameter[literal["cache"], THIS[call[None.cacheMetrics, parameter[]]]]]
call[results.put, parameter[literal["services"], THIS[call[None.serviceMetrics, parameter[]]]]]
call[results.put, parameter[literal["databases"], THIS[call[None.databaseMetrics, parameter[]]]]]
call[results.put, parameter[literal["garbageCollector"], THIS[call[None.garbageCollectorMetrics, parameter[]]]]]
call[results.put, parameter[literal["processMetrics"], THIS[call[None.processMetrics, parameter[]]]]]
return[member[.results]]
end[}]
END[}] | annotation[@] identifier[ReadOperation] Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Map] operator[>] identifier[allMetrics] operator[SEP] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Map] operator[>] identifier[results] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[jvmMemoryMetrics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[httpRequestsMetrics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[cacheMetrics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[serviceMetrics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[databaseMetrics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[garbageCollectorMetrics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[results] operator[SEP] identifier[put] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[processMetrics] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[results] operator[SEP]
}
|
public void marshall(PartitionInput partitionInput, ProtocolMarshaller protocolMarshaller) {
if (partitionInput == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(partitionInput.getValues(), VALUES_BINDING);
protocolMarshaller.marshall(partitionInput.getLastAccessTime(), LASTACCESSTIME_BINDING);
protocolMarshaller.marshall(partitionInput.getStorageDescriptor(), STORAGEDESCRIPTOR_BINDING);
protocolMarshaller.marshall(partitionInput.getParameters(), PARAMETERS_BINDING);
protocolMarshaller.marshall(partitionInput.getLastAnalyzedTime(), LASTANALYZEDTIME_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[partitionInput, protocolMarshaller]] begin[{]
if[binary_operation[member[.partitionInput], ==, 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=getValues, postfix_operators=[], prefix_operators=[], qualifier=partitionInput, selectors=[], type_arguments=None), MemberReference(member=VALUES_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=getLastAccessTime, postfix_operators=[], prefix_operators=[], qualifier=partitionInput, selectors=[], type_arguments=None), MemberReference(member=LASTACCESSTIME_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=getStorageDescriptor, postfix_operators=[], prefix_operators=[], qualifier=partitionInput, selectors=[], type_arguments=None), MemberReference(member=STORAGEDESCRIPTOR_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=getParameters, postfix_operators=[], prefix_operators=[], qualifier=partitionInput, selectors=[], type_arguments=None), MemberReference(member=PARAMETERS_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=getLastAnalyzedTime, postfix_operators=[], prefix_operators=[], qualifier=partitionInput, selectors=[], type_arguments=None), MemberReference(member=LASTANALYZEDTIME_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[PartitionInput] identifier[partitionInput] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[partitionInput] 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[partitionInput] operator[SEP] identifier[getValues] operator[SEP] operator[SEP] , identifier[VALUES_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[partitionInput] operator[SEP] identifier[getLastAccessTime] operator[SEP] operator[SEP] , identifier[LASTACCESSTIME_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[partitionInput] operator[SEP] identifier[getStorageDescriptor] operator[SEP] operator[SEP] , identifier[STORAGEDESCRIPTOR_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[partitionInput] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] , identifier[PARAMETERS_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[partitionInput] operator[SEP] identifier[getLastAnalyzedTime] operator[SEP] operator[SEP] , identifier[LASTANALYZEDTIME_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 void addBodyToAction(ControllerRouteModel<Raml> elem, Action action) {
action.setBody(new LinkedHashMap<String, MimeType>(elem.getBodyMimes().size()));
//the samples must be define in the same order as the accept!
Iterator<String> bodySamples = elem.getBodySamples().iterator();
for (String mime : elem.getBodyMimes()) {
MimeType mimeType = new MimeType(mime);
if (bodySamples.hasNext()) {
mimeType.setExample(bodySamples.next());
}
action.getBody().put(mime, mimeType);
}
} | class class_name[name] begin[{]
method[addBodyToAction, return_type[void], modifier[private], parameter[elem, action]] begin[{]
call[action.setBody, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getBodyMimes, postfix_operators=[], prefix_operators=[], qualifier=elem, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=MimeType, sub_type=None))], dimensions=None, name=LinkedHashMap, sub_type=None))]]
local_variable[type[Iterator], bodySamples]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=mime, 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=MimeType, sub_type=None)), name=mimeType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MimeType, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=bodySamples, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=bodySamples, selectors=[], type_arguments=None)], member=setExample, postfix_operators=[], prefix_operators=[], qualifier=mimeType, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[], member=getBody, postfix_operators=[], prefix_operators=[], qualifier=action, selectors=[MethodInvocation(arguments=[MemberReference(member=mime, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=mimeType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getBodyMimes, postfix_operators=[], prefix_operators=[], qualifier=elem, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=mime)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addBodyToAction] operator[SEP] identifier[ControllerRouteModel] operator[<] identifier[Raml] operator[>] identifier[elem] , identifier[Action] identifier[action] operator[SEP] {
identifier[action] operator[SEP] identifier[setBody] operator[SEP] Keyword[new] identifier[LinkedHashMap] operator[<] identifier[String] , identifier[MimeType] operator[>] operator[SEP] identifier[elem] operator[SEP] identifier[getBodyMimes] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[String] operator[>] identifier[bodySamples] operator[=] identifier[elem] operator[SEP] identifier[getBodySamples] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[mime] operator[:] identifier[elem] operator[SEP] identifier[getBodyMimes] operator[SEP] operator[SEP] operator[SEP] {
identifier[MimeType] identifier[mimeType] operator[=] Keyword[new] identifier[MimeType] operator[SEP] identifier[mime] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bodySamples] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[mimeType] operator[SEP] identifier[setExample] operator[SEP] identifier[bodySamples] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[action] operator[SEP] identifier[getBody] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[mime] , identifier[mimeType] operator[SEP] operator[SEP]
}
}
|
public void handleCommandResources(EventModel eventModel) {
List<ResourceModel<String>> resourceModels = eventModel.getListResourceContainer()
.provideResource(CommandResource.ResourceID)
.stream()
.filter(resourceModel -> resourceModel.getResource() instanceof String)
.map(resourceModel -> {
try {
//noinspection unchecked
return (ResourceModel<String>) resourceModel;
} catch (ClassCastException e) {
return null;
}
})
.filter(Objects::nonNull)
.collect(Collectors.toList());
for (ResourceModel<String> resourceModel : resourceModels) {
if (!CommandResource.verifyCommand(resourceModel.getResource()))
continue;
if (!CommandResource.verifyCapabilities(resourceModel.getResource(), capabilities)) {
musicHelper.playerError(PlayerError.ERROR_NOT_ABLE + "command: " + resourceModel.getResource(),
resourceModel.getProvider());
continue;
}
switch (resourceModel.getResource()) {
case CommandResource.PLAY: if (!musicProvider.isPlaying())
playPause.accept(resourceModel.getResource());
break;
case CommandResource.PAUSE: if (musicProvider.isPlaying())
playPause.accept(resourceModel.getResource());
break;
case CommandResource.SELECT_TRACK: handleSelectTrack(eventModel, resourceModel);
break;
case CommandResource.NEXT: nextPrevious.accept(resourceModel.getResource());
break;
case CommandResource.PREVIOUS: nextPrevious.accept(resourceModel.getResource());
break;
case CommandResource.JUMP: handleJump(eventModel, resourceModel);
break;
case CommandResource.CHANGE_PLAYBACK: changePlayback.accept(resourceModel.getResource());
break;
case CommandResource.CHANGE_VOLUME: handleVolume(eventModel, resourceModel);
break;
case CommandResource.STOP: stopCallback.run();
break;
}
}
} | class class_name[name] begin[{]
method[handleCommandResources, return_type[void], modifier[public], parameter[eventModel]] begin[{]
local_variable[type[List], resourceModels]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None)], member=verifyCommand, postfix_operators=[], prefix_operators=['!'], qualifier=CommandResource, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), IfStatement(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None), MemberReference(member=capabilities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=verifyCapabilities, postfix_operators=[], prefix_operators=['!'], qualifier=CommandResource, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ERROR_NOT_ABLE, postfix_operators=[], prefix_operators=[], qualifier=PlayerError, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="command: "), operator=+), operandr=MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None), operator=+), MethodInvocation(arguments=[], member=getProvider, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None)], member=playerError, postfix_operators=[], prefix_operators=[], qualifier=musicHelper, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=None, label=None)])), SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=PLAY, postfix_operators=[], prefix_operators=[], qualifier=CommandResource, selectors=[])], statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isPlaying, postfix_operators=[], prefix_operators=['!'], qualifier=musicProvider, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None)], member=accept, postfix_operators=[], prefix_operators=[], qualifier=playPause, selectors=[], type_arguments=None), label=None)), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=PAUSE, postfix_operators=[], prefix_operators=[], qualifier=CommandResource, selectors=[])], statements=[IfStatement(condition=MethodInvocation(arguments=[], member=isPlaying, postfix_operators=[], prefix_operators=[], qualifier=musicProvider, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None)], member=accept, postfix_operators=[], prefix_operators=[], qualifier=playPause, selectors=[], type_arguments=None), label=None)), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=SELECT_TRACK, postfix_operators=[], prefix_operators=[], qualifier=CommandResource, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=eventModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resourceModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleSelectTrack, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=NEXT, postfix_operators=[], prefix_operators=[], qualifier=CommandResource, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None)], member=accept, postfix_operators=[], prefix_operators=[], qualifier=nextPrevious, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=PREVIOUS, postfix_operators=[], prefix_operators=[], qualifier=CommandResource, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None)], member=accept, postfix_operators=[], prefix_operators=[], qualifier=nextPrevious, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=JUMP, postfix_operators=[], prefix_operators=[], qualifier=CommandResource, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=eventModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resourceModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleJump, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=CHANGE_PLAYBACK, postfix_operators=[], prefix_operators=[], qualifier=CommandResource, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None)], member=accept, postfix_operators=[], prefix_operators=[], qualifier=changePlayback, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=CHANGE_VOLUME, postfix_operators=[], prefix_operators=[], qualifier=CommandResource, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=eventModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resourceModel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=handleVolume, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[MemberReference(member=STOP, postfix_operators=[], prefix_operators=[], qualifier=CommandResource, selectors=[])], statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=run, postfix_operators=[], prefix_operators=[], qualifier=stopCallback, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MethodInvocation(arguments=[], member=getResource, postfix_operators=[], prefix_operators=[], qualifier=resourceModel, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=resourceModels, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=resourceModel)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=ResourceModel, sub_type=None))), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[handleCommandResources] operator[SEP] identifier[EventModel] identifier[eventModel] operator[SEP] {
identifier[List] operator[<] identifier[ResourceModel] operator[<] identifier[String] operator[>] operator[>] identifier[resourceModels] operator[=] identifier[eventModel] operator[SEP] identifier[getListResourceContainer] operator[SEP] operator[SEP] operator[SEP] identifier[provideResource] operator[SEP] identifier[CommandResource] operator[SEP] identifier[ResourceID] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[resourceModel] operator[->] identifier[resourceModel] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] Keyword[instanceof] identifier[String] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[resourceModel] operator[->] {
Keyword[try] {
Keyword[return] operator[SEP] identifier[ResourceModel] operator[<] identifier[String] operator[>] operator[SEP] identifier[resourceModel] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassCastException] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[Objects] operator[::] identifier[nonNull] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[Collectors] operator[SEP] identifier[toList] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[ResourceModel] operator[<] identifier[String] operator[>] identifier[resourceModel] operator[:] identifier[resourceModels] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[CommandResource] operator[SEP] identifier[verifyCommand] operator[SEP] identifier[resourceModel] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[CommandResource] operator[SEP] identifier[verifyCapabilities] operator[SEP] identifier[resourceModel] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] , identifier[capabilities] operator[SEP] operator[SEP] {
identifier[musicHelper] operator[SEP] identifier[playerError] operator[SEP] identifier[PlayerError] operator[SEP] identifier[ERROR_NOT_ABLE] operator[+] literal[String] operator[+] identifier[resourceModel] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] , identifier[resourceModel] operator[SEP] identifier[getProvider] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[resourceModel] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] {
Keyword[case] identifier[CommandResource] operator[SEP] identifier[PLAY] operator[:] Keyword[if] operator[SEP] operator[!] identifier[musicProvider] operator[SEP] identifier[isPlaying] operator[SEP] operator[SEP] operator[SEP] identifier[playPause] operator[SEP] identifier[accept] operator[SEP] identifier[resourceModel] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CommandResource] operator[SEP] identifier[PAUSE] operator[:] Keyword[if] operator[SEP] identifier[musicProvider] operator[SEP] identifier[isPlaying] operator[SEP] operator[SEP] operator[SEP] identifier[playPause] operator[SEP] identifier[accept] operator[SEP] identifier[resourceModel] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CommandResource] operator[SEP] identifier[SELECT_TRACK] operator[:] identifier[handleSelectTrack] operator[SEP] identifier[eventModel] , identifier[resourceModel] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CommandResource] operator[SEP] identifier[NEXT] operator[:] identifier[nextPrevious] operator[SEP] identifier[accept] operator[SEP] identifier[resourceModel] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CommandResource] operator[SEP] identifier[PREVIOUS] operator[:] identifier[nextPrevious] operator[SEP] identifier[accept] operator[SEP] identifier[resourceModel] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CommandResource] operator[SEP] identifier[JUMP] operator[:] identifier[handleJump] operator[SEP] identifier[eventModel] , identifier[resourceModel] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CommandResource] operator[SEP] identifier[CHANGE_PLAYBACK] operator[:] identifier[changePlayback] operator[SEP] identifier[accept] operator[SEP] identifier[resourceModel] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CommandResource] operator[SEP] identifier[CHANGE_VOLUME] operator[:] identifier[handleVolume] operator[SEP] identifier[eventModel] , identifier[resourceModel] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] identifier[CommandResource] operator[SEP] identifier[STOP] operator[:] identifier[stopCallback] operator[SEP] identifier[run] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
}
|
private static <K, V> Collector<Map.Entry<K, V>, ?, List<Map<K, V>>> mapSizer(int limit) {
return Collector.of(ArrayList::new,
(l, e) -> {
if (l.isEmpty() || l.get(l.size() - 1).size() == limit) {
l.add(new HashMap<>());
}
l.get(l.size() - 1).put(e.getKey(), e.getValue());
},
(l1, l2) -> {
if (l1.isEmpty()) {
return l2;
}
if (l2.isEmpty()) {
return l1;
}
if (l1.get(l1.size() - 1).size() < limit) {
Map<K, V> map = l1.get(l1.size() - 1);
ListIterator<Map<K, V>> mapsIte = l2.listIterator(l2.size());
while (mapsIte.hasPrevious() && map.size() < limit) {
Iterator<Map.Entry<K, V>> ite = mapsIte.previous().entrySet().iterator();
while (ite.hasNext() && map.size() < limit) {
Map.Entry<K, V> entry = ite.next();
map.put(entry.getKey(), entry.getValue());
ite.remove();
}
if (!ite.hasNext()) {
mapsIte.remove();
}
}
}
l1.addAll(l2);
return l1;
}
);
} | class class_name[name] begin[{]
method[mapSizer, return_type[type[Collector]], modifier[private static], parameter[limit]] begin[{]
return[call[Collector.of, parameter[MethodReference(expression=MemberReference(member=ArrayList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=new, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), type_arguments=[]), LambdaExpression(body=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=get, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashMap, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=get, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None)], member=put, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], parameters=[InferredFormalParameter(name=l), InferredFormalParameter(name=e)]), LambdaExpression(body=[IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=l1, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=l2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=l2, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=l1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=l1, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=get, postfix_operators=[], prefix_operators=[], qualifier=l1, selectors=[MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=l1, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-)], member=get, postfix_operators=[], prefix_operators=[], qualifier=l1, selectors=[], type_arguments=None), name=map)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=l2, selectors=[], type_arguments=None)], member=listIterator, postfix_operators=[], prefix_operators=[], qualifier=l2, selectors=[], type_arguments=None), name=mapsIte)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=[], name=Map, sub_type=None))], dimensions=[], name=ListIterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=previous, postfix_operators=[], prefix_operators=[], qualifier=mapsIte, selectors=[MethodInvocation(arguments=[], member=entrySet, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=ite)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))], dimensions=[], name=Iterator, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=ite, selectors=[], type_arguments=None), name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=K, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=V, sub_type=None))], dimensions=None, name=Entry, sub_type=None))), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=ite, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=ite, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), operandr=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=['!'], qualifier=ite, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=remove, postfix_operators=[], prefix_operators=[], qualifier=mapsIte, selectors=[], type_arguments=None), label=None)]))]), condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=hasPrevious, postfix_operators=[], prefix_operators=[], qualifier=mapsIte, selectors=[], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=map, selectors=[], type_arguments=None), operandr=MemberReference(member=limit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), operator=&&), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=l2, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=l1, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=l1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], parameters=[InferredFormalParameter(name=l1), InferredFormalParameter(name=l2)])]]]
end[}]
END[}] | Keyword[private] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[Collector] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] , operator[?] , identifier[List] operator[<] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] operator[>] operator[>] identifier[mapSizer] operator[SEP] Keyword[int] identifier[limit] operator[SEP] {
Keyword[return] identifier[Collector] operator[SEP] identifier[of] operator[SEP] identifier[ArrayList] operator[::] Keyword[new] , operator[SEP] identifier[l] , identifier[e] operator[SEP] operator[->] {
Keyword[if] operator[SEP] identifier[l] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[||] identifier[l] operator[SEP] identifier[get] operator[SEP] identifier[l] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] identifier[limit] operator[SEP] {
identifier[l] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[l] operator[SEP] identifier[get] operator[SEP] identifier[l] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[e] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[e] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
} , operator[SEP] identifier[l1] , identifier[l2] operator[SEP] operator[->] {
Keyword[if] operator[SEP] identifier[l1] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[l2] operator[SEP]
}
Keyword[if] operator[SEP] identifier[l2] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[l1] operator[SEP]
}
Keyword[if] operator[SEP] identifier[l1] operator[SEP] identifier[get] operator[SEP] identifier[l1] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[limit] operator[SEP] {
identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] identifier[map] operator[=] identifier[l1] operator[SEP] identifier[get] operator[SEP] identifier[l1] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[ListIterator] operator[<] identifier[Map] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[mapsIte] operator[=] identifier[l2] operator[SEP] identifier[listIterator] operator[SEP] identifier[l2] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[mapsIte] operator[SEP] identifier[hasPrevious] operator[SEP] operator[SEP] operator[&&] identifier[map] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[limit] operator[SEP] {
identifier[Iterator] operator[<] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] operator[>] identifier[ite] operator[=] identifier[mapsIte] operator[SEP] identifier[previous] operator[SEP] operator[SEP] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[ite] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[&&] identifier[map] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[<] identifier[limit] operator[SEP] {
identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[K] , identifier[V] operator[>] identifier[entry] operator[=] identifier[ite] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[put] operator[SEP] identifier[entry] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] , identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ite] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[ite] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[mapsIte] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP]
}
}
}
identifier[l1] operator[SEP] identifier[addAll] operator[SEP] identifier[l2] operator[SEP] operator[SEP] Keyword[return] identifier[l1] operator[SEP]
} operator[SEP] operator[SEP]
}
|
protected void executeProgram(PackagedProgram program, ClusterClient<?> client, int parallelism) throws ProgramMissingJobException, ProgramInvocationException {
logAndSysout("Starting execution of program");
final JobSubmissionResult result = client.run(program, parallelism);
if (null == result) {
throw new ProgramMissingJobException("No JobSubmissionResult returned, please make sure you called " +
"ExecutionEnvironment.execute()");
}
if (result.isJobExecutionResult()) {
logAndSysout("Program execution finished");
JobExecutionResult execResult = result.getJobExecutionResult();
System.out.println("Job with JobID " + execResult.getJobID() + " has finished.");
System.out.println("Job Runtime: " + execResult.getNetRuntime() + " ms");
Map<String, Object> accumulatorsResult = execResult.getAllAccumulatorResults();
if (accumulatorsResult.size() > 0) {
System.out.println("Accumulator Results: ");
System.out.println(AccumulatorHelper.getResultsFormatted(accumulatorsResult));
}
} else {
logAndSysout("Job has been submitted with JobID " + result.getJobID());
}
} | class class_name[name] begin[{]
method[executeProgram, return_type[void], modifier[protected], parameter[program, client, parallelism]] begin[{]
call[.logAndSysout, parameter[literal["Starting execution of program"]]]
local_variable[type[JobSubmissionResult], result]
if[binary_operation[literal[null], ==, member[.result]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No JobSubmissionResult returned, please make sure you called "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ExecutionEnvironment.execute()"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ProgramMissingJobException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[result.isJobExecutionResult, parameter[]]] begin[{]
call[.logAndSysout, parameter[literal["Program execution finished"]]]
local_variable[type[JobExecutionResult], execResult]
call[System.out.println, parameter[binary_operation[binary_operation[literal["Job with JobID "], +, call[execResult.getJobID, parameter[]]], +, literal[" has finished."]]]]
call[System.out.println, parameter[binary_operation[binary_operation[literal["Job Runtime: "], +, call[execResult.getNetRuntime, parameter[]]], +, literal[" ms"]]]]
local_variable[type[Map], accumulatorsResult]
if[binary_operation[call[accumulatorsResult.size, parameter[]], >, literal[0]]] begin[{]
call[System.out.println, parameter[literal["Accumulator Results: "]]]
call[System.out.println, parameter[call[AccumulatorHelper.getResultsFormatted, parameter[member[.accumulatorsResult]]]]]
else begin[{]
None
end[}]
else begin[{]
call[.logAndSysout, parameter[binary_operation[literal["Job has been submitted with JobID "], +, call[result.getJobID, parameter[]]]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[executeProgram] operator[SEP] identifier[PackagedProgram] identifier[program] , identifier[ClusterClient] operator[<] operator[?] operator[>] identifier[client] , Keyword[int] identifier[parallelism] operator[SEP] Keyword[throws] identifier[ProgramMissingJobException] , identifier[ProgramInvocationException] {
identifier[logAndSysout] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[final] identifier[JobSubmissionResult] identifier[result] operator[=] identifier[client] operator[SEP] identifier[run] operator[SEP] identifier[program] , identifier[parallelism] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[==] identifier[result] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ProgramMissingJobException] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[isJobExecutionResult] operator[SEP] operator[SEP] operator[SEP] {
identifier[logAndSysout] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[JobExecutionResult] identifier[execResult] operator[=] identifier[result] operator[SEP] identifier[getJobExecutionResult] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[execResult] operator[SEP] identifier[getJobID] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[execResult] operator[SEP] identifier[getNetRuntime] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[accumulatorsResult] operator[=] identifier[execResult] operator[SEP] identifier[getAllAccumulatorResults] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[accumulatorsResult] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] identifier[AccumulatorHelper] operator[SEP] identifier[getResultsFormatted] operator[SEP] identifier[accumulatorsResult] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[logAndSysout] operator[SEP] literal[String] operator[+] identifier[result] operator[SEP] identifier[getJobID] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
@SuppressWarnings("squid:S00112") //suppress throwable warning
public Object onMethodInvoke(Class<?> targetType, Object target, Method method, Object[] args) throws Throwable {
LepService typeLepService = targetType.getAnnotation(LepService.class);
Objects.requireNonNull(typeLepService, "No " + LepService.class.getSimpleName()
+ " annotation for type " + targetType.getCanonicalName());
LogicExtensionPoint methodLep = AnnotationUtils.getAnnotation(method, LogicExtensionPoint.class);
// TODO methodLep can be null (if used interface method without @LogicExtensionPoint) !!!
// create/get key resolver instance
LepKeyResolver keyResolver = getKeyResolver(methodLep);
// create base LEP key instance
LepKey baseLepKey = getBaseLepKey(typeLepService, methodLep, method);
// create LEP method descriptor
LepMethod lepMethod = buildLepMethod(targetType, target, method, args);
// call LepManager to process LEP
try {
return getLepManager().processLep(baseLepKey, XmLepConstants.UNUSED_RESOURCE_VERSION, keyResolver, lepMethod);
} catch (LepInvocationCauseException e) {
log.debug("Error process target", e);
throw e.getCause();
} catch (Exception e) {
throw e;
}
} | class class_name[name] begin[{]
method[onMethodInvoke, return_type[type[Object]], modifier[public], parameter[targetType, target, method, args]] begin[{]
local_variable[type[LepService], typeLepService]
call[Objects.requireNonNull, parameter[member[.typeLepService], binary_operation[binary_operation[binary_operation[literal["No "], +, 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=LepService, sub_type=None))], +, literal[" annotation for type "]], +, call[targetType.getCanonicalName, parameter[]]]]]
local_variable[type[LogicExtensionPoint], methodLep]
local_variable[type[LepKeyResolver], keyResolver]
local_variable[type[LepKey], baseLepKey]
local_variable[type[LepMethod], lepMethod]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getLepManager, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=baseLepKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UNUSED_RESOURCE_VERSION, postfix_operators=[], prefix_operators=[], qualifier=XmLepConstants, selectors=[]), MemberReference(member=keyResolver, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lepMethod, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processLep, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error process target"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=debug, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None), ThrowStatement(expression=MethodInvocation(arguments=[], member=getCause, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['LepInvocationCauseException'])), CatchClause(block=[ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] identifier[Object] identifier[onMethodInvoke] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[targetType] , identifier[Object] identifier[target] , identifier[Method] identifier[method] , identifier[Object] operator[SEP] operator[SEP] identifier[args] operator[SEP] Keyword[throws] identifier[Throwable] {
identifier[LepService] identifier[typeLepService] operator[=] identifier[targetType] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[LepService] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[typeLepService] , literal[String] operator[+] identifier[LepService] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[targetType] operator[SEP] identifier[getCanonicalName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[LogicExtensionPoint] identifier[methodLep] operator[=] identifier[AnnotationUtils] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[method] , identifier[LogicExtensionPoint] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[LepKeyResolver] identifier[keyResolver] operator[=] identifier[getKeyResolver] operator[SEP] identifier[methodLep] operator[SEP] operator[SEP] identifier[LepKey] identifier[baseLepKey] operator[=] identifier[getBaseLepKey] operator[SEP] identifier[typeLepService] , identifier[methodLep] , identifier[method] operator[SEP] operator[SEP] identifier[LepMethod] identifier[lepMethod] operator[=] identifier[buildLepMethod] operator[SEP] identifier[targetType] , identifier[target] , identifier[method] , identifier[args] operator[SEP] operator[SEP] Keyword[try] {
Keyword[return] identifier[getLepManager] operator[SEP] operator[SEP] operator[SEP] identifier[processLep] operator[SEP] identifier[baseLepKey] , identifier[XmLepConstants] operator[SEP] identifier[UNUSED_RESOURCE_VERSION] , identifier[keyResolver] , identifier[lepMethod] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[LepInvocationCauseException] identifier[e] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] Keyword[throw] identifier[e] operator[SEP] identifier[getCause] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] identifier[e] operator[SEP]
}
}
|
public static Map<String, String> cleanupProperties(
final Map<String, String> rawProperties) {
return cleanupProperties(rawProperties, null);
} | class class_name[name] begin[{]
method[cleanupProperties, return_type[type[Map]], modifier[public static], parameter[rawProperties]] begin[{]
return[call[.cleanupProperties, parameter[member[.rawProperties], literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[cleanupProperties] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[rawProperties] operator[SEP] {
Keyword[return] identifier[cleanupProperties] operator[SEP] identifier[rawProperties] , Other[null] operator[SEP] operator[SEP]
}
|
public Node<E> append(E value, int maxSize)
{
Node<E> newTail = new Node<>(randomLevel(), value);
lock.writeLock().lock();
try
{
if (size >= maxSize)
return null;
size++;
Node<E> tail = head;
for (int i = maxHeight - 1 ; i >= newTail.height() ; i--)
{
Node<E> next;
while ((next = tail.next(i)) != null)
tail = next;
tail.size[i]++;
}
for (int i = newTail.height() - 1 ; i >= 0 ; i--)
{
Node<E> next;
while ((next = tail.next(i)) != null)
tail = next;
tail.setNext(i, newTail);
newTail.setPrev(i, tail);
}
return newTail;
}
finally
{
lock.writeLock().unlock();
}
} | class class_name[name] begin[{]
method[append, return_type[type[Node]], modifier[public], parameter[value, maxSize]] begin[{]
local_variable[type[Node], newTail]
call[lock.writeLock, parameter[]]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=maxSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)), StatementExpression(expression=MemberReference(member=size, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=head, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=tail)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=[], name=Node, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=next)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=[], name=Node, sub_type=None)), WhileStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=tail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=next, postfix_operators=[], prefix_operators=[], qualifier=tail, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=MemberReference(member=size, postfix_operators=['++'], prefix_operators=[], qualifier=tail, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=height, postfix_operators=[], prefix_operators=[], qualifier=newTail, selectors=[], type_arguments=None), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=maxHeight, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=next)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=[], name=Node, sub_type=None)), WhileStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=tail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=next, postfix_operators=[], prefix_operators=[], qualifier=tail, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newTail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setNext, postfix_operators=[], prefix_operators=[], qualifier=tail, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=tail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setPrev, postfix_operators=[], prefix_operators=[], qualifier=newTail, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=height, postfix_operators=[], prefix_operators=[], qualifier=newTail, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ReturnStatement(expression=MemberReference(member=newTail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=writeLock, postfix_operators=[], prefix_operators=[], qualifier=lock, selectors=[MethodInvocation(arguments=[], member=unlock, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[Node] operator[<] identifier[E] operator[>] identifier[append] operator[SEP] identifier[E] identifier[value] , Keyword[int] identifier[maxSize] operator[SEP] {
identifier[Node] operator[<] identifier[E] operator[>] identifier[newTail] operator[=] Keyword[new] identifier[Node] operator[<] operator[>] operator[SEP] identifier[randomLevel] operator[SEP] operator[SEP] , identifier[value] operator[SEP] operator[SEP] identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[lock] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[if] operator[SEP] identifier[size] operator[>=] identifier[maxSize] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[size] operator[++] operator[SEP] identifier[Node] operator[<] identifier[E] operator[>] identifier[tail] operator[=] identifier[head] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[maxHeight] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] identifier[newTail] operator[SEP] identifier[height] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[--] operator[SEP] {
identifier[Node] operator[<] identifier[E] operator[>] identifier[next] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[next] operator[=] identifier[tail] operator[SEP] identifier[next] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[tail] operator[=] identifier[next] operator[SEP] identifier[tail] operator[SEP] identifier[size] operator[SEP] identifier[i] operator[SEP] operator[++] operator[SEP]
}
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] identifier[newTail] operator[SEP] identifier[height] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] identifier[i] operator[>=] Other[0] operator[SEP] identifier[i] operator[--] operator[SEP] {
identifier[Node] operator[<] identifier[E] operator[>] identifier[next] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[next] operator[=] identifier[tail] operator[SEP] identifier[next] operator[SEP] identifier[i] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] identifier[tail] operator[=] identifier[next] operator[SEP] identifier[tail] operator[SEP] identifier[setNext] operator[SEP] identifier[i] , identifier[newTail] operator[SEP] operator[SEP] identifier[newTail] operator[SEP] identifier[setPrev] operator[SEP] identifier[i] , identifier[tail] operator[SEP] operator[SEP]
}
Keyword[return] identifier[newTail] operator[SEP]
}
Keyword[finally] {
identifier[lock] operator[SEP] identifier[writeLock] operator[SEP] operator[SEP] operator[SEP] identifier[unlock] operator[SEP] operator[SEP] operator[SEP]
}
}
|
void sendDirectory(HttpRequest request,
HttpResponse response,
Resource resource,
boolean parent)
throws IOException
{
if (!_dirAllowed)
{
response.sendError(HttpResponse.__403_Forbidden);
return;
}
request.setHandled(true);
if(log.isDebugEnabled())log.debug("sendDirectory: "+resource);
byte[] data=null;
if (resource instanceof CachedResource)
data=((CachedResource)resource).getCachedData();
if (data==null)
{
String base = URI.addPaths(request.getPath(),"/");
String dir = resource.getListHTML(URI.encodePath(base),parent);
if (dir==null)
{
response.sendError(HttpResponse.__403_Forbidden,
"No directory");
return;
}
data=dir.getBytes("UTF8");
if (resource instanceof CachedResource)
((CachedResource)resource).setCachedData(data);
}
response.setContentType("text/html; charset=UTF8");
response.setContentLength(data.length);
if (request.getMethod().equals(HttpRequest.__HEAD))
{
response.commit();
return;
}
response.getOutputStream().write(data,0,data.length);
response.commit();
} | class class_name[name] begin[{]
method[sendDirectory, return_type[void], modifier[default], parameter[request, response, resource, parent]] begin[{]
if[member[._dirAllowed]] begin[{]
call[response.sendError, parameter[member[HttpResponse.__403_Forbidden]]]
return[None]
else begin[{]
None
end[}]
call[request.setHandled, parameter[literal[true]]]
if[call[log.isDebugEnabled, parameter[]]] begin[{]
call[log.debug, parameter[binary_operation[literal["sendDirectory: "], +, member[.resource]]]]
else begin[{]
None
end[}]
local_variable[type[byte], data]
if[binary_operation[member[.resource], instanceof, type[CachedResource]]] begin[{]
assign[member[.data], Cast(expression=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CachedResource, sub_type=None))]
else begin[{]
None
end[}]
if[binary_operation[member[.data], ==, literal[null]]] begin[{]
local_variable[type[String], base]
local_variable[type[String], dir]
if[binary_operation[member[.dir], ==, literal[null]]] begin[{]
call[response.sendError, parameter[member[HttpResponse.__403_Forbidden], literal["No directory"]]]
return[None]
else begin[{]
None
end[}]
assign[member[.data], call[dir.getBytes, parameter[literal["UTF8"]]]]
if[binary_operation[member[.resource], instanceof, type[CachedResource]]] begin[{]
Cast(expression=MemberReference(member=resource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=CachedResource, sub_type=None))
else begin[{]
None
end[}]
else begin[{]
None
end[}]
call[response.setContentType, parameter[literal["text/html; charset=UTF8"]]]
call[response.setContentLength, parameter[member[data.length]]]
if[call[request.getMethod, parameter[]]] begin[{]
call[response.commit, parameter[]]
return[None]
else begin[{]
None
end[}]
call[response.getOutputStream, parameter[]]
call[response.commit, parameter[]]
end[}]
END[}] | Keyword[void] identifier[sendDirectory] operator[SEP] identifier[HttpRequest] identifier[request] , identifier[HttpResponse] identifier[response] , identifier[Resource] identifier[resource] , Keyword[boolean] identifier[parent] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] operator[!] identifier[_dirAllowed] operator[SEP] {
identifier[response] operator[SEP] identifier[sendError] operator[SEP] identifier[HttpResponse] operator[SEP] identifier[__403_Forbidden] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[request] operator[SEP] identifier[setHandled] operator[SEP] literal[boolean] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[log] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[resource] operator[SEP] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[data] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[resource] Keyword[instanceof] identifier[CachedResource] operator[SEP] identifier[data] operator[=] operator[SEP] operator[SEP] identifier[CachedResource] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[getCachedData] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[data] operator[==] Other[null] operator[SEP] {
identifier[String] identifier[base] operator[=] identifier[URI] operator[SEP] identifier[addPaths] operator[SEP] identifier[request] operator[SEP] identifier[getPath] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[dir] operator[=] identifier[resource] operator[SEP] identifier[getListHTML] operator[SEP] identifier[URI] operator[SEP] identifier[encodePath] operator[SEP] identifier[base] operator[SEP] , identifier[parent] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[dir] operator[==] Other[null] operator[SEP] {
identifier[response] operator[SEP] identifier[sendError] operator[SEP] identifier[HttpResponse] operator[SEP] identifier[__403_Forbidden] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[data] operator[=] identifier[dir] operator[SEP] identifier[getBytes] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resource] Keyword[instanceof] identifier[CachedResource] operator[SEP] operator[SEP] operator[SEP] identifier[CachedResource] operator[SEP] identifier[resource] operator[SEP] operator[SEP] identifier[setCachedData] operator[SEP] identifier[data] operator[SEP] operator[SEP]
}
identifier[response] operator[SEP] identifier[setContentType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[setContentLength] operator[SEP] identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[request] operator[SEP] identifier[getMethod] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[HttpRequest] operator[SEP] identifier[__HEAD] operator[SEP] operator[SEP] {
identifier[response] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[response] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] operator[SEP] identifier[write] operator[SEP] identifier[data] , Other[0] , identifier[data] operator[SEP] identifier[length] operator[SEP] operator[SEP] identifier[response] operator[SEP] identifier[commit] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean isARecord(boolean isAFile)
{
Record recFileHdr = (Record)this.getRecordOwner().getRecord(FileHdr.FILE_HDR_FILE);
if (recFileHdr == null)
{
recFileHdr = new FileHdr(this.getRecordOwner());
this.addListener(new FreeOnFreeHandler(recFileHdr));
}
if (!recFileHdr.getField(FileHdr.FILE_NAME).equals(this.getField(ClassInfo.CLASS_NAME)))
{
try {
recFileHdr.addNew();
recFileHdr.getField(FileHdr.FILE_NAME).moveFieldToThis(this.getField(ClassInfo.CLASS_NAME));
int oldKeyArea = recFileHdr.getDefaultOrder();
recFileHdr.setKeyArea(FileHdr.FILE_NAME_KEY);
recFileHdr.seek(null);
recFileHdr.setKeyArea(oldKeyArea);
} catch (Exception e) {
e.printStackTrace();
}
}
if ((recFileHdr.getEditMode() == DBConstants.EDIT_CURRENT) && (this.getField(ClassInfo.CLASS_NAME).toString().equals(recFileHdr.getField(FileHdr.FILE_NAME).getString())))
return true; // This is a file
if (isAFile)
return false; // Just looking for files
if (!"Record".equalsIgnoreCase(this.getField(ClassInfo.CLASS_TYPE).toString()))
return false; // If this isn't a physical file, don't build it.
if (this.getField(ClassInfo.BASE_CLASS_NAME).toString().contains("ScreenRecord"))
return false;
if ("Interface".equalsIgnoreCase(this.getField(ClassInfo.CLASS_TYPE).toString())) // An interface doesn't have an interface
return false; // If this isn't a physical file, don't build it.
if (RESOURCE_CLASS.equals(this.getField(ClassInfo.BASE_CLASS_NAME).toString()))
return false; // Resource only class
return true; // This is a record
} | class class_name[name] begin[{]
method[isARecord, return_type[type[boolean]], modifier[public], parameter[isAFile]] begin[{]
local_variable[type[Record], recFileHdr]
if[binary_operation[member[.recFileHdr], ==, literal[null]]] begin[{]
assign[member[.recFileHdr], ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecordOwner, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FileHdr, sub_type=None))]
THIS[call[None.addListener, parameter[ClassCreator(arguments=[MemberReference(member=recFileHdr, 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=FreeOnFreeHandler, sub_type=None))]]]
else begin[{]
None
end[}]
if[call[recFileHdr.getField, parameter[member[FileHdr.FILE_NAME]]]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=addNew, postfix_operators=[], prefix_operators=[], qualifier=recFileHdr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FILE_NAME, postfix_operators=[], prefix_operators=[], qualifier=FileHdr, selectors=[])], member=getField, postfix_operators=[], prefix_operators=[], qualifier=recFileHdr, selectors=[MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=ClassInfo, selectors=[])], member=getField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=moveFieldToThis, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDefaultOrder, postfix_operators=[], prefix_operators=[], qualifier=recFileHdr, selectors=[], type_arguments=None), name=oldKeyArea)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FILE_NAME_KEY, postfix_operators=[], prefix_operators=[], qualifier=FileHdr, selectors=[])], member=setKeyArea, postfix_operators=[], prefix_operators=[], qualifier=recFileHdr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=seek, postfix_operators=[], prefix_operators=[], qualifier=recFileHdr, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=oldKeyArea, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setKeyArea, postfix_operators=[], prefix_operators=[], qualifier=recFileHdr, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[recFileHdr.getEditMode, parameter[]], ==, member[DBConstants.EDIT_CURRENT]], &&, THIS[]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
if[member[.isAFile]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[literal["Record"]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[THIS[call[None.getField, parameter[member[ClassInfo.BASE_CLASS_NAME]]]call[None.toString, parameter[]]call[None.contains, parameter[literal["ScreenRecord"]]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[literal["Interface"]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[RESOURCE_CLASS.equals, parameter[THIS[call[None.getField, parameter[member[ClassInfo.BASE_CLASS_NAME]]]call[None.toString, parameter[]]]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isARecord] operator[SEP] Keyword[boolean] identifier[isAFile] operator[SEP] {
identifier[Record] identifier[recFileHdr] operator[=] operator[SEP] identifier[Record] operator[SEP] Keyword[this] operator[SEP] identifier[getRecordOwner] operator[SEP] operator[SEP] operator[SEP] identifier[getRecord] operator[SEP] identifier[FileHdr] operator[SEP] identifier[FILE_HDR_FILE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recFileHdr] operator[==] Other[null] operator[SEP] {
identifier[recFileHdr] operator[=] Keyword[new] identifier[FileHdr] operator[SEP] Keyword[this] operator[SEP] identifier[getRecordOwner] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[FreeOnFreeHandler] operator[SEP] identifier[recFileHdr] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[recFileHdr] operator[SEP] identifier[getField] operator[SEP] identifier[FileHdr] operator[SEP] identifier[FILE_NAME] operator[SEP] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[CLASS_NAME] operator[SEP] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[recFileHdr] operator[SEP] identifier[addNew] operator[SEP] operator[SEP] operator[SEP] identifier[recFileHdr] operator[SEP] identifier[getField] operator[SEP] identifier[FileHdr] operator[SEP] identifier[FILE_NAME] operator[SEP] operator[SEP] identifier[moveFieldToThis] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[CLASS_NAME] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[oldKeyArea] operator[=] identifier[recFileHdr] operator[SEP] identifier[getDefaultOrder] operator[SEP] operator[SEP] operator[SEP] identifier[recFileHdr] operator[SEP] identifier[setKeyArea] operator[SEP] identifier[FileHdr] operator[SEP] identifier[FILE_NAME_KEY] operator[SEP] operator[SEP] identifier[recFileHdr] operator[SEP] identifier[seek] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[recFileHdr] operator[SEP] identifier[setKeyArea] operator[SEP] identifier[oldKeyArea] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[SEP] identifier[recFileHdr] operator[SEP] identifier[getEditMode] operator[SEP] operator[SEP] operator[==] identifier[DBConstants] operator[SEP] identifier[EDIT_CURRENT] operator[SEP] operator[&&] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[CLASS_NAME] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[recFileHdr] operator[SEP] identifier[getField] operator[SEP] identifier[FileHdr] operator[SEP] identifier[FILE_NAME] operator[SEP] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[isAFile] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[CLASS_TYPE] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[BASE_CLASS_NAME] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[CLASS_TYPE] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[RESOURCE_CLASS] operator[SEP] identifier[equals] operator[SEP] Keyword[this] operator[SEP] identifier[getField] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[BASE_CLASS_NAME] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
public ServiceFuture<SubscriptionQuotasListResultInner> listQuotasAsync(String location, final ServiceCallback<SubscriptionQuotasListResultInner> serviceCallback) {
return ServiceFuture.fromResponse(listQuotasWithServiceResponseAsync(location), serviceCallback);
} | class class_name[name] begin[{]
method[listQuotasAsync, return_type[type[ServiceFuture]], modifier[public], parameter[location, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.listQuotasWithServiceResponseAsync, parameter[member[.location]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[SubscriptionQuotasListResultInner] operator[>] identifier[listQuotasAsync] operator[SEP] identifier[String] identifier[location] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[SubscriptionQuotasListResultInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[listQuotasWithServiceResponseAsync] operator[SEP] identifier[location] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
@Nullable
public <R> R collect(@NotNull Supplier<R> supplier,
@NotNull BiConsumer<R, ? super T> accumulator) {
final R result = supplier.get();
while (iterator.hasNext()) {
final T value = iterator.next();
accumulator.accept(result, value);
}
return result;
} | class class_name[name] begin[{]
method[collect, return_type[type[R]], modifier[public], parameter[supplier, accumulator]] begin[{]
local_variable[type[R], result]
while[call[iterator.hasNext, parameter[]]] begin[{]
local_variable[type[T], value]
call[accumulator.accept, parameter[member[.result], member[.value]]]
end[}]
return[member[.result]]
end[}]
END[}] | annotation[@] identifier[Nullable] Keyword[public] operator[<] identifier[R] operator[>] identifier[R] identifier[collect] operator[SEP] annotation[@] identifier[NotNull] identifier[Supplier] operator[<] identifier[R] operator[>] identifier[supplier] , annotation[@] identifier[NotNull] identifier[BiConsumer] operator[<] identifier[R] , operator[?] Keyword[super] identifier[T] operator[>] identifier[accumulator] operator[SEP] {
Keyword[final] identifier[R] identifier[result] operator[=] identifier[supplier] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[T] identifier[value] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] identifier[accumulator] operator[SEP] identifier[accept] operator[SEP] identifier[result] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void onShow() {
ListPanel operations = new ListPanel();
operations.setWidth("100%");
this.display.setHorizontalAlignment(DockPanel.ALIGN_CENTER);
this.display.setVerticalAlignment(DockPanel.ALIGN_TOP);
this.display.add(operations, DockPanel.CENTER);
this.display.setCellHeight(operations, "100%");
this.display.setCellWidth(operations, "100%");
operations.setHeader(0, "Operation name");
operations.setHeader(1, "Parameters");
operations.setHeader(2, "Operation trigger");
// operations.setHeader(3, "Operation detials");
operations.setColumnWidth(0, "33%");
operations.setColumnWidth(1, "33%");
operations.setColumnWidth(2, "33%");
// operations.setColumnWidth(3, "55%");
// Operations
// Set degault logger level
operations.setCellText(1, 0, "Default logger level");
operations.setCell(1, 1, null);
operations.setCell(1, 2, _defaultLoggerLevel);
// operations.setCellText(1, 3, _ll_Explanation);
_defaultLoggerLevel.setTitle(_ll_Explanation);
// Set default handler level
operations.setCellText(2, 0, "Default handler level");
operations.setCell(2, 1, null);
operations.setCell(2, 2, _defaultHandlerLevel);
// operations.setCell(2, 3, new Label(_hl_Explanation,true));
_defaultHandlerLevel.setTitle(_hl_Explanation);
// read cfg
Hyperlink readLink = new Hyperlink("Trigger", null);
// final TextBox uri=new TextBox();
operations.setCellText(3, 0, "Read logger cfg");
operations.setCell(3, 1, _readUri);
operations.setCell(3, 2, readLink);
// operations.setCellText(3, 3, _cfg_Explanation);
readLink.setTitle(_cfg_Explanation);
// reset loggers
Hyperlink resetLink = new Hyperlink("Trigger", null);
// final TextBox resetRegex=new TextBox();
operations.setCellText(4, 0, "Reset loggers level");
operations.setCell(4, 1, _resetLoggerList);
operations.setCell(4, 2, resetLink);
resetLink.setTitle(_reset_Explanation);
// clear loggers loggers
Hyperlink clearLink = new Hyperlink("Trigger", null);
// final TextBox clearRegex=new TextBox();
operations.setCellText(5, 0, "Turns off loggers");
operations.setCell(5, 1, _clearLoggerList);
operations.setCell(5, 2, clearLink);
clearLink.setTitle(_cclear_Explanation);
// clear loggers loggers
Hyperlink addLogger = new Hyperlink("Trigger", null);
// final TextBox clearRegex = new TextBox();
operations.setCellText(6, 0, "Add logger");
operations.setCell(6, 1, _newLoggerName);
operations.setCell(6, 2, addLogger);
addLogger.setTitle(_add_Logger_Explanation);
Hyperlink setInterval = new Hyperlink("Trigger", null);
// final TextBox clearRegex = new TextBox();
operations.setCellText(7, 0, "Default notification");
operations.setCell(7, 1, _defaultNotificationInterval);
operations.setCell(7, 2, setInterval);
// clearLink.setTitle(_add_Logger_Explanation);
// Click listeners
_defaultLoggerLevel.addClickListener(new ClickListener() {
public void onClick(Widget arg0) {
ServerConnection.logServiceAsync.setDefaultLoggerLevel(_defaultLoggerLevel.getItemText(_defaultLoggerLevel.getSelectedIndex()), new AsyncCallback() {
public void onFailure(Throwable t) {
UserInterface.getLogPanel().error("Failed to set value due to:" + t.getMessage());
}
public void onSuccess(Object arg0) {
// TODO Auto-generated method stub
}
});
}
});
_defaultHandlerLevel.addClickListener(new ClickListener() {
public void onClick(Widget arg0) {
ServerConnection.logServiceAsync.setDefaultHandlerLevel(_defaultHandlerLevel.getItemText(_defaultHandlerLevel.getSelectedIndex()), new AsyncCallback() {
public void onFailure(Throwable t) {
UserInterface.getLogPanel().error("Failed to set value due to:" + t.getMessage());
}
public void onSuccess(Object arg0) {
// TODO Auto-generated method stub
}
});
}
});
readLink.addClickListener(new ClickListener() {
public void onClick(Widget arg0) {
ServerConnection.logServiceAsync.reReadConf(_readUri.getText(), new AsyncCallback() {
public void onFailure(Throwable t) {
UserInterface.getLogPanel().error("Failed to set value due to:" + t.getMessage());
}
public void onSuccess(Object arg0) {
logStructureTreePanel.refreshData();
}
});
}
});
resetLink.addClickListener(new ClickListener() {
public void onClick(Widget arg0) {
ServerConnection.logServiceAsync.resetLoggerLevel(_resetLoggerList.getText(), new AsyncCallback() {
public void onFailure(Throwable t) {
UserInterface.getLogPanel().error("Failed to set value due to:" + t.getMessage());
}
public void onSuccess(Object arg0) {
logStructureTreePanel.refreshData();
}
});
}
});
clearLink.addClickListener(new ClickListener() {
public void onClick(Widget arg0) {
ServerConnection.logServiceAsync.clearLoggers(_clearLoggerList.getText(), new AsyncCallback() {
public void onFailure(Throwable t) {
UserInterface.getLogPanel().error("Failed to set value due to:" + t.getMessage());
}
public void onSuccess(Object arg0) {
logStructureTreePanel.refreshData();
}
});
}
});
addLogger.addClickListener(new ClickListener() {
public void onClick(Widget arg0) {
ServerConnection.logServiceAsync.addLogger(_newLoggerName.getText(), _defaultLoggerLevel.getItemText(_defaultLoggerLevel.getSelectedIndex()),
new AsyncCallback() {
public void onFailure(Throwable t) {
UserInterface.getLogPanel().error("Failed to set value due to:" + t.getMessage());
}
public void onSuccess(Object arg0) {
logStructureTreePanel.refreshData();
}
});
}
});
setInterval.addClickListener(new ClickListener() {
public void onClick(Widget arg0) {
int di = -1;
try {
di = Integer.valueOf(_defaultNotificationInterval.getText()).intValue();
}
catch (Exception e) {
UserInterface.getLogPanel().error("Failed to parse due:" + e.getMessage());
return;
}
ServerConnection.logServiceAsync.setDefaultNotificationInterval(di, new AsyncCallback() {
public void onFailure(Throwable t) {
UserInterface.getLogPanel().error("Failed to set value due to:" + t.getMessage());
}
public void onSuccess(Object arg0) {
// TODO Auto-generated method stub
}
});
}
});
// Some fetches:
ServerConnection.logServiceAsync.getDefaultNotificationInterval(new AsyncCallback() {
public void onFailure(Throwable t) {
UserInterface.getLogPanel().error("Failed to get value of default notification interval due to:" + t.getMessage());
}
public void onSuccess(Object o) {
_defaultNotificationInterval.setText(o + "");
}
});
ServerConnection.logServiceAsync.getDefaultHandlerLevel(new AsyncCallback() {
public void onFailure(Throwable t) {
UserInterface.getLogPanel().error("Failed to get value of default handler level due to:" + t.getMessage());
}
public void onSuccess(Object arg0) {
setValue((String) arg0, _defaultHandlerLevel);
}
});
ServerConnection.logServiceAsync.getDefaultLoggerLevel(new AsyncCallback() {
public void onFailure(Throwable t) {
UserInterface.getLogPanel().error("Failed to get value of default handler level due to:" + t.getMessage());
}
public void onSuccess(Object arg0) {
setValue((String) arg0, _defaultLoggerLevel);
}
});
} | class class_name[name] begin[{]
method[onShow, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[ListPanel], operations]
call[operations.setWidth, parameter[literal["100%"]]]
THIS[member[None.display]call[None.setHorizontalAlignment, parameter[member[DockPanel.ALIGN_CENTER]]]]
THIS[member[None.display]call[None.setVerticalAlignment, parameter[member[DockPanel.ALIGN_TOP]]]]
THIS[member[None.display]call[None.add, parameter[member[.operations], member[DockPanel.CENTER]]]]
THIS[member[None.display]call[None.setCellHeight, parameter[member[.operations], literal["100%"]]]]
THIS[member[None.display]call[None.setCellWidth, parameter[member[.operations], literal["100%"]]]]
call[operations.setHeader, parameter[literal[0], literal["Operation name"]]]
call[operations.setHeader, parameter[literal[1], literal["Parameters"]]]
call[operations.setHeader, parameter[literal[2], literal["Operation trigger"]]]
call[operations.setColumnWidth, parameter[literal[0], literal["33%"]]]
call[operations.setColumnWidth, parameter[literal[1], literal["33%"]]]
call[operations.setColumnWidth, parameter[literal[2], literal["33%"]]]
call[operations.setCellText, parameter[literal[1], literal[0], literal["Default logger level"]]]
call[operations.setCell, parameter[literal[1], literal[1], literal[null]]]
call[operations.setCell, parameter[literal[1], literal[2], member[._defaultLoggerLevel]]]
call[_defaultLoggerLevel.setTitle, parameter[member[._ll_Explanation]]]
call[operations.setCellText, parameter[literal[2], literal[0], literal["Default handler level"]]]
call[operations.setCell, parameter[literal[2], literal[1], literal[null]]]
call[operations.setCell, parameter[literal[2], literal[2], member[._defaultHandlerLevel]]]
call[_defaultHandlerLevel.setTitle, parameter[member[._hl_Explanation]]]
local_variable[type[Hyperlink], readLink]
call[operations.setCellText, parameter[literal[3], literal[0], literal["Read logger cfg"]]]
call[operations.setCell, parameter[literal[3], literal[1], member[._readUri]]]
call[operations.setCell, parameter[literal[3], literal[2], member[.readLink]]]
call[readLink.setTitle, parameter[member[._cfg_Explanation]]]
local_variable[type[Hyperlink], resetLink]
call[operations.setCellText, parameter[literal[4], literal[0], literal["Reset loggers level"]]]
call[operations.setCell, parameter[literal[4], literal[1], member[._resetLoggerList]]]
call[operations.setCell, parameter[literal[4], literal[2], member[.resetLink]]]
call[resetLink.setTitle, parameter[member[._reset_Explanation]]]
local_variable[type[Hyperlink], clearLink]
call[operations.setCellText, parameter[literal[5], literal[0], literal["Turns off loggers"]]]
call[operations.setCell, parameter[literal[5], literal[1], member[._clearLoggerList]]]
call[operations.setCell, parameter[literal[5], literal[2], member[.clearLink]]]
call[clearLink.setTitle, parameter[member[._cclear_Explanation]]]
local_variable[type[Hyperlink], addLogger]
call[operations.setCellText, parameter[literal[6], literal[0], literal["Add logger"]]]
call[operations.setCell, parameter[literal[6], literal[1], member[._newLoggerName]]]
call[operations.setCell, parameter[literal[6], literal[2], member[.addLogger]]]
call[addLogger.setTitle, parameter[member[._add_Logger_Explanation]]]
local_variable[type[Hyperlink], setInterval]
call[operations.setCellText, parameter[literal[7], literal[0], literal["Default notification"]]]
call[operations.setCell, parameter[literal[7], literal[1], member[._defaultNotificationInterval]]]
call[operations.setCell, parameter[literal[7], literal[2], member[.setInterval]]]
call[_defaultLoggerLevel.addClickListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSelectedIndex, postfix_operators=[], prefix_operators=[], qualifier=_defaultLoggerLevel, selectors=[], type_arguments=None)], member=getItemText, postfix_operators=[], prefix_operators=[], qualifier=_defaultLoggerLevel, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to set value due to:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AsyncCallback, sub_type=None))], member=setDefaultLoggerLevel, postfix_operators=[], prefix_operators=[], qualifier=ServerConnection.logServiceAsync, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Widget, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClickListener, sub_type=None))]]
call[_defaultHandlerLevel.addClickListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSelectedIndex, postfix_operators=[], prefix_operators=[], qualifier=_defaultHandlerLevel, selectors=[], type_arguments=None)], member=getItemText, postfix_operators=[], prefix_operators=[], qualifier=_defaultHandlerLevel, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to set value due to:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AsyncCallback, sub_type=None))], member=setDefaultHandlerLevel, postfix_operators=[], prefix_operators=[], qualifier=ServerConnection.logServiceAsync, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Widget, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClickListener, sub_type=None))]]
call[readLink.addClickListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=_readUri, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to set value due to:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=refreshData, postfix_operators=[], prefix_operators=[], qualifier=logStructureTreePanel, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AsyncCallback, sub_type=None))], member=reReadConf, postfix_operators=[], prefix_operators=[], qualifier=ServerConnection.logServiceAsync, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Widget, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClickListener, sub_type=None))]]
call[resetLink.addClickListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=_resetLoggerList, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to set value due to:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=refreshData, postfix_operators=[], prefix_operators=[], qualifier=logStructureTreePanel, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AsyncCallback, sub_type=None))], member=resetLoggerLevel, postfix_operators=[], prefix_operators=[], qualifier=ServerConnection.logServiceAsync, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Widget, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClickListener, sub_type=None))]]
call[clearLink.addClickListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=_clearLoggerList, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to set value due to:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=refreshData, postfix_operators=[], prefix_operators=[], qualifier=logStructureTreePanel, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AsyncCallback, sub_type=None))], member=clearLoggers, postfix_operators=[], prefix_operators=[], qualifier=ServerConnection.logServiceAsync, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Widget, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClickListener, sub_type=None))]]
call[addLogger.addClickListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=_newLoggerName, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getSelectedIndex, postfix_operators=[], prefix_operators=[], qualifier=_defaultLoggerLevel, selectors=[], type_arguments=None)], member=getItemText, postfix_operators=[], prefix_operators=[], qualifier=_defaultLoggerLevel, selectors=[], type_arguments=None), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to set value due to:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=refreshData, postfix_operators=[], prefix_operators=[], qualifier=logStructureTreePanel, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AsyncCallback, sub_type=None))], member=addLogger, postfix_operators=[], prefix_operators=[], qualifier=ServerConnection.logServiceAsync, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Widget, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClickListener, sub_type=None))]]
call[setInterval.addClickListener, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), name=di)], modifiers=set(), type=BasicType(dimensions=[], name=int)), TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=di, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=_defaultNotificationInterval, selectors=[], type_arguments=None)], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[MethodInvocation(arguments=[], member=intValue, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to parse due:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=di, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to set value due to:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AsyncCallback, sub_type=None))], member=setDefaultNotificationInterval, postfix_operators=[], prefix_operators=[], qualifier=ServerConnection.logServiceAsync, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onClick, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Widget, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ClickListener, sub_type=None))]]
call[ServerConnection.logServiceAsync.getDefaultNotificationInterval, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to get value of default notification interval due to:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), operator=+)], member=setText, postfix_operators=[], prefix_operators=[], qualifier=_defaultNotificationInterval, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=o, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AsyncCallback, sub_type=None))]]
call[ServerConnection.logServiceAsync.getDefaultHandlerLevel, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to get value of default handler level due to:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=arg0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), MemberReference(member=_defaultHandlerLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AsyncCallback, sub_type=None))]]
call[ServerConnection.logServiceAsync.getDefaultLoggerLevel, parameter[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=getLogPanel, postfix_operators=[], prefix_operators=[], qualifier=UserInterface, selectors=[MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to get value of default handler level due to:"), operandr=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onFailure, parameters=[FormalParameter(annotations=[], modifiers=set(), name=t, type=ReferenceType(arguments=None, dimensions=[], name=Throwable, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None), MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=arg0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), MemberReference(member=_defaultLoggerLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onSuccess, parameters=[FormalParameter(annotations=[], modifiers=set(), name=arg0, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=AsyncCallback, sub_type=None))]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[onShow] operator[SEP] operator[SEP] {
identifier[ListPanel] identifier[operations] operator[=] Keyword[new] identifier[ListPanel] operator[SEP] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setWidth] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[display] operator[SEP] identifier[setHorizontalAlignment] operator[SEP] identifier[DockPanel] operator[SEP] identifier[ALIGN_CENTER] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[display] operator[SEP] identifier[setVerticalAlignment] operator[SEP] identifier[DockPanel] operator[SEP] identifier[ALIGN_TOP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[display] operator[SEP] identifier[add] operator[SEP] identifier[operations] , identifier[DockPanel] operator[SEP] identifier[CENTER] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[display] operator[SEP] identifier[setCellHeight] operator[SEP] identifier[operations] , literal[String] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[display] operator[SEP] identifier[setCellWidth] operator[SEP] identifier[operations] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setHeader] operator[SEP] Other[0] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setHeader] operator[SEP] Other[1] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setHeader] operator[SEP] Other[2] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setColumnWidth] operator[SEP] Other[0] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setColumnWidth] operator[SEP] Other[1] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setColumnWidth] operator[SEP] Other[2] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCellText] operator[SEP] Other[1] , Other[0] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[1] , Other[1] , Other[null] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[1] , Other[2] , identifier[_defaultLoggerLevel] operator[SEP] operator[SEP] identifier[_defaultLoggerLevel] operator[SEP] identifier[setTitle] operator[SEP] identifier[_ll_Explanation] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCellText] operator[SEP] Other[2] , Other[0] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[2] , Other[1] , Other[null] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[2] , Other[2] , identifier[_defaultHandlerLevel] operator[SEP] operator[SEP] identifier[_defaultHandlerLevel] operator[SEP] identifier[setTitle] operator[SEP] identifier[_hl_Explanation] operator[SEP] operator[SEP] identifier[Hyperlink] identifier[readLink] operator[=] Keyword[new] identifier[Hyperlink] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCellText] operator[SEP] Other[3] , Other[0] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[3] , Other[1] , identifier[_readUri] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[3] , Other[2] , identifier[readLink] operator[SEP] operator[SEP] identifier[readLink] operator[SEP] identifier[setTitle] operator[SEP] identifier[_cfg_Explanation] operator[SEP] operator[SEP] identifier[Hyperlink] identifier[resetLink] operator[=] Keyword[new] identifier[Hyperlink] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCellText] operator[SEP] Other[4] , Other[0] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[4] , Other[1] , identifier[_resetLoggerList] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[4] , Other[2] , identifier[resetLink] operator[SEP] operator[SEP] identifier[resetLink] operator[SEP] identifier[setTitle] operator[SEP] identifier[_reset_Explanation] operator[SEP] operator[SEP] identifier[Hyperlink] identifier[clearLink] operator[=] Keyword[new] identifier[Hyperlink] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCellText] operator[SEP] Other[5] , Other[0] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[5] , Other[1] , identifier[_clearLoggerList] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[5] , Other[2] , identifier[clearLink] operator[SEP] operator[SEP] identifier[clearLink] operator[SEP] identifier[setTitle] operator[SEP] identifier[_cclear_Explanation] operator[SEP] operator[SEP] identifier[Hyperlink] identifier[addLogger] operator[=] Keyword[new] identifier[Hyperlink] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCellText] operator[SEP] Other[6] , Other[0] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[6] , Other[1] , identifier[_newLoggerName] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[6] , Other[2] , identifier[addLogger] operator[SEP] operator[SEP] identifier[addLogger] operator[SEP] identifier[setTitle] operator[SEP] identifier[_add_Logger_Explanation] operator[SEP] operator[SEP] identifier[Hyperlink] identifier[setInterval] operator[=] Keyword[new] identifier[Hyperlink] operator[SEP] literal[String] , Other[null] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCellText] operator[SEP] Other[7] , Other[0] , literal[String] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[7] , Other[1] , identifier[_defaultNotificationInterval] operator[SEP] operator[SEP] identifier[operations] operator[SEP] identifier[setCell] operator[SEP] Other[7] , Other[2] , identifier[setInterval] operator[SEP] operator[SEP] identifier[_defaultLoggerLevel] operator[SEP] identifier[addClickListener] operator[SEP] Keyword[new] identifier[ClickListener] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[Widget] identifier[arg0] operator[SEP] {
identifier[ServerConnection] operator[SEP] identifier[logServiceAsync] operator[SEP] identifier[setDefaultLoggerLevel] operator[SEP] identifier[_defaultLoggerLevel] operator[SEP] identifier[getItemText] operator[SEP] identifier[_defaultLoggerLevel] operator[SEP] identifier[getSelectedIndex] operator[SEP] operator[SEP] operator[SEP] , Keyword[new] identifier[AsyncCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[arg0] operator[SEP] {
}
} operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[_defaultHandlerLevel] operator[SEP] identifier[addClickListener] operator[SEP] Keyword[new] identifier[ClickListener] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[Widget] identifier[arg0] operator[SEP] {
identifier[ServerConnection] operator[SEP] identifier[logServiceAsync] operator[SEP] identifier[setDefaultHandlerLevel] operator[SEP] identifier[_defaultHandlerLevel] operator[SEP] identifier[getItemText] operator[SEP] identifier[_defaultHandlerLevel] operator[SEP] identifier[getSelectedIndex] operator[SEP] operator[SEP] operator[SEP] , Keyword[new] identifier[AsyncCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[arg0] operator[SEP] {
}
} operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[readLink] operator[SEP] identifier[addClickListener] operator[SEP] Keyword[new] identifier[ClickListener] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[Widget] identifier[arg0] operator[SEP] {
identifier[ServerConnection] operator[SEP] identifier[logServiceAsync] operator[SEP] identifier[reReadConf] operator[SEP] identifier[_readUri] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , Keyword[new] identifier[AsyncCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[arg0] operator[SEP] {
identifier[logStructureTreePanel] operator[SEP] identifier[refreshData] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[resetLink] operator[SEP] identifier[addClickListener] operator[SEP] Keyword[new] identifier[ClickListener] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[Widget] identifier[arg0] operator[SEP] {
identifier[ServerConnection] operator[SEP] identifier[logServiceAsync] operator[SEP] identifier[resetLoggerLevel] operator[SEP] identifier[_resetLoggerList] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , Keyword[new] identifier[AsyncCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[arg0] operator[SEP] {
identifier[logStructureTreePanel] operator[SEP] identifier[refreshData] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[clearLink] operator[SEP] identifier[addClickListener] operator[SEP] Keyword[new] identifier[ClickListener] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[Widget] identifier[arg0] operator[SEP] {
identifier[ServerConnection] operator[SEP] identifier[logServiceAsync] operator[SEP] identifier[clearLoggers] operator[SEP] identifier[_clearLoggerList] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , Keyword[new] identifier[AsyncCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[arg0] operator[SEP] {
identifier[logStructureTreePanel] operator[SEP] identifier[refreshData] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[addLogger] operator[SEP] identifier[addClickListener] operator[SEP] Keyword[new] identifier[ClickListener] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[Widget] identifier[arg0] operator[SEP] {
identifier[ServerConnection] operator[SEP] identifier[logServiceAsync] operator[SEP] identifier[addLogger] operator[SEP] identifier[_newLoggerName] operator[SEP] identifier[getText] operator[SEP] operator[SEP] , identifier[_defaultLoggerLevel] operator[SEP] identifier[getItemText] operator[SEP] identifier[_defaultLoggerLevel] operator[SEP] identifier[getSelectedIndex] operator[SEP] operator[SEP] operator[SEP] , Keyword[new] identifier[AsyncCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[arg0] operator[SEP] {
identifier[logStructureTreePanel] operator[SEP] identifier[refreshData] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[setInterval] operator[SEP] identifier[addClickListener] operator[SEP] Keyword[new] identifier[ClickListener] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onClick] operator[SEP] identifier[Widget] identifier[arg0] operator[SEP] {
Keyword[int] identifier[di] operator[=] operator[-] Other[1] operator[SEP] Keyword[try] {
identifier[di] operator[=] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[_defaultNotificationInterval] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
identifier[ServerConnection] operator[SEP] identifier[logServiceAsync] operator[SEP] identifier[setDefaultNotificationInterval] operator[SEP] identifier[di] , Keyword[new] identifier[AsyncCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[arg0] operator[SEP] {
}
} operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[ServerConnection] operator[SEP] identifier[logServiceAsync] operator[SEP] identifier[getDefaultNotificationInterval] operator[SEP] Keyword[new] identifier[AsyncCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[o] operator[SEP] {
identifier[_defaultNotificationInterval] operator[SEP] identifier[setText] operator[SEP] identifier[o] operator[+] literal[String] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[ServerConnection] operator[SEP] identifier[logServiceAsync] operator[SEP] identifier[getDefaultHandlerLevel] operator[SEP] Keyword[new] identifier[AsyncCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[arg0] operator[SEP] {
identifier[setValue] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[arg0] , identifier[_defaultHandlerLevel] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[ServerConnection] operator[SEP] identifier[logServiceAsync] operator[SEP] identifier[getDefaultLoggerLevel] operator[SEP] Keyword[new] identifier[AsyncCallback] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onFailure] operator[SEP] identifier[Throwable] identifier[t] operator[SEP] {
identifier[UserInterface] operator[SEP] identifier[getLogPanel] operator[SEP] operator[SEP] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[t] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[public] Keyword[void] identifier[onSuccess] operator[SEP] identifier[Object] identifier[arg0] operator[SEP] {
identifier[setValue] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[arg0] , identifier[_defaultLoggerLevel] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public static String convertToString(InputStream input) throws IOException {
try {
if (input == null) {
throw new IOException("Input Stream Cannot be NULL");
}
StringBuilder sb1 = new StringBuilder();
String line;
try {
BufferedReader r1 = new BufferedReader(new InputStreamReader(input, "UTF-8"));
while ((line = r1.readLine()) != null) {
sb1.append(line);
}
} finally {
input.close();
}
return sb1.toString();
} catch (IOException e) {
throw new JKException(e);
}
} | class class_name[name] begin[{]
method[convertToString, return_type[type[String]], modifier[public static], parameter[input]] begin[{]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Input Stream Cannot be NULL")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="UTF-8")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=InputStreamReader, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedReader, sub_type=None)), name=r1)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb1, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=readLine, postfix_operators=[], prefix_operators=[], qualifier=r1, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None)], catches=None, finally_block=[StatementExpression(expression=MethodInvocation(arguments=[], member=close, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None)], label=None, resources=None), ReturnStatement(expression=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=sb1, 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=JKException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[convertToString] operator[SEP] identifier[InputStream] identifier[input] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[try] {
Keyword[if] operator[SEP] identifier[input] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[StringBuilder] identifier[sb1] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[line] operator[SEP] Keyword[try] {
identifier[BufferedReader] identifier[r1] operator[=] Keyword[new] identifier[BufferedReader] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[input] , literal[String] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[r1] operator[SEP] identifier[readLine] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[sb1] operator[SEP] identifier[append] operator[SEP] identifier[line] operator[SEP] operator[SEP]
}
}
Keyword[finally] {
identifier[input] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb1] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[JKException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public static void setInputCQLPageRowSize(Configuration conf, String cqlPageRowSize)
{
if (cqlPageRowSize == null)
{
throw new UnsupportedOperationException("cql page row size may not be null");
}
conf.set(INPUT_CQL_PAGE_ROW_SIZE_CONFIG, cqlPageRowSize);
} | class class_name[name] begin[{]
method[setInputCQLPageRowSize, return_type[void], modifier[public static], parameter[conf, cqlPageRowSize]] begin[{]
if[binary_operation[member[.cqlPageRowSize], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="cql page row size may not be null")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=UnsupportedOperationException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[conf.set, parameter[member[.INPUT_CQL_PAGE_ROW_SIZE_CONFIG], member[.cqlPageRowSize]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[setInputCQLPageRowSize] operator[SEP] identifier[Configuration] identifier[conf] , identifier[String] identifier[cqlPageRowSize] operator[SEP] {
Keyword[if] operator[SEP] identifier[cqlPageRowSize] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[UnsupportedOperationException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[conf] operator[SEP] identifier[set] operator[SEP] identifier[INPUT_CQL_PAGE_ROW_SIZE_CONFIG] , identifier[cqlPageRowSize] operator[SEP] operator[SEP]
}
|
private int readChunkLength()
throws IOException
{
int length = 0;
int ch;
ReadStream is = _next;
// skip whitespace
for (ch = is.read();
ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n';
ch = is.read()) {
}
// XXX: This doesn't properly handle the case when when the browser
// sends headers at the end of the data. See the HTTP/1.1 spec.
for (; ch > 0 && ch != '\r' && ch != '\n'; ch = is.read()) {
if ('0' <= ch && ch <= '9')
length = 16 * length + ch - '0';
else if ('a' <= ch && ch <= 'f')
length = 16 * length + ch - 'a' + 10;
else if ('A' <= ch && ch <= 'F')
length = 16 * length + ch - 'A' + 10;
else if (ch == ' ' || ch == '\t') {
//if (dbg.canWrite())
// dbg.println("unexpected chunk whitespace.");
}
else {
StringBuilder sb = new StringBuilder();
sb.append((char) ch);
for (int ch1 = is.read();
ch1 >= 0 && ch1 != '\r' && ch1 != '\n';
ch1 = is.read()) {
sb.append((char) ch1);
}
throw new IOException("HTTP/1.1 protocol error: bad chunk at"
+ " '" + sb + "'"
+ " 0x" + Integer.toHexString(ch)
+ " length=" + length);
}
}
if (ch == '\r')
ch = is.read();
return length;
} | class class_name[name] begin[{]
method[readChunkLength, return_type[type[int]], modifier[private], parameter[]] begin[{]
local_variable[type[int], length]
local_variable[type[int], ch]
local_variable[type[ReadStream], is]
ForStatement(body=BlockStatement(label=None, statements=[]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), operator===), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t'), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r'), operator===), operator=||), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n'), operator===), operator=||), init=[Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None))], update=[Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None))]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operandr=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9'), operator=<=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operandr=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f'), operator=<=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operandr=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='F'), operator=<=), operator=&&), else_statement=IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' '), operator===), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\t'), operator===), operator=||), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringBuilder, sub_type=None)), name=sb)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringBuilder, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=ch1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=BasicType(dimensions=[], name=char))], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=ch1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r'), operator=!=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=ch1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n'), operator=!=), operator=&&), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None), name=ch1)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[Assignment(expressionl=MemberReference(member=ch1, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None))]), label=None), ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="HTTP/1.1 protocol error: bad chunk at"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" '"), operator=+), operandr=MemberReference(member=sb, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" 0x"), operator=+), operandr=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=toHexString, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" length="), operator=+), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[])), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=+)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=-), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), operator=+)), label=None)), label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*), operandr=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=-)), label=None))]), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\r'), operator=!=), operator=&&), operandr=BinaryOperation(operandl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='\n'), operator=!=), operator=&&), init=None, update=[Assignment(expressionl=MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=read, postfix_operators=[], prefix_operators=[], qualifier=is, selectors=[], type_arguments=None))]), label=None)
if[binary_operation[member[.ch], ==, literal['\r']]] begin[{]
assign[member[.ch], call[is.read, parameter[]]]
else begin[{]
None
end[}]
return[member[.length]]
end[}]
END[}] | Keyword[private] Keyword[int] identifier[readChunkLength] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[int] identifier[length] operator[=] Other[0] operator[SEP] Keyword[int] identifier[ch] operator[SEP] identifier[ReadStream] identifier[is] operator[=] identifier[_next] operator[SEP] Keyword[for] operator[SEP] identifier[ch] operator[=] identifier[is] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] identifier[ch] operator[==] literal[String] operator[||] identifier[ch] operator[==] literal[String] operator[||] identifier[ch] operator[==] literal[String] operator[||] identifier[ch] operator[==] literal[String] operator[SEP] identifier[ch] operator[=] identifier[is] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] {
}
Keyword[for] operator[SEP] operator[SEP] identifier[ch] operator[>] Other[0] operator[&&] identifier[ch] operator[!=] literal[String] operator[&&] identifier[ch] operator[!=] literal[String] operator[SEP] identifier[ch] operator[=] identifier[is] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[<=] identifier[ch] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] identifier[length] operator[=] Other[16] operator[*] identifier[length] operator[+] identifier[ch] operator[-] literal[String] operator[SEP] Keyword[else] Keyword[if] operator[SEP] literal[String] operator[<=] identifier[ch] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] identifier[length] operator[=] Other[16] operator[*] identifier[length] operator[+] identifier[ch] operator[-] literal[String] operator[+] Other[10] operator[SEP] Keyword[else] Keyword[if] operator[SEP] literal[String] operator[<=] identifier[ch] operator[&&] identifier[ch] operator[<=] literal[String] operator[SEP] identifier[length] operator[=] Other[16] operator[*] identifier[length] operator[+] identifier[ch] operator[-] literal[String] operator[+] Other[10] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[||] identifier[ch] operator[==] literal[String] operator[SEP] {
}
Keyword[else] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[ch] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[ch1] operator[=] identifier[is] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] identifier[ch1] operator[>=] Other[0] operator[&&] identifier[ch1] operator[!=] literal[String] operator[&&] identifier[ch1] operator[!=] literal[String] operator[SEP] identifier[ch1] operator[=] identifier[is] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] operator[SEP] Keyword[char] operator[SEP] identifier[ch1] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[sb] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[ch] operator[SEP] operator[+] literal[String] operator[+] identifier[length] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[ch] operator[==] literal[String] operator[SEP] identifier[ch] operator[=] identifier[is] operator[SEP] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[length] operator[SEP]
}
|
public OvhOrder overTheBox_new_duration_GET(String duration, String deviceId, String offer, String voucher) throws IOException {
String qPath = "/order/overTheBox/new/{duration}";
StringBuilder sb = path(qPath, duration);
query(sb, "deviceId", deviceId);
query(sb, "offer", offer);
query(sb, "voucher", voucher);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhOrder.class);
} | class class_name[name] begin[{]
method[overTheBox_new_duration_GET, return_type[type[OvhOrder]], modifier[public], parameter[duration, deviceId, offer, voucher]] begin[{]
local_variable[type[String], qPath]
local_variable[type[StringBuilder], sb]
call[.query, parameter[member[.sb], literal["deviceId"], member[.deviceId]]]
call[.query, parameter[member[.sb], literal["offer"], member[.offer]]]
call[.query, parameter[member[.sb], literal["voucher"], member[.voucher]]]
local_variable[type[String], resp]
return[call[.convertTo, parameter[member[.resp], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=OvhOrder, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[OvhOrder] identifier[overTheBox_new_duration_GET] operator[SEP] identifier[String] identifier[duration] , identifier[String] identifier[deviceId] , identifier[String] identifier[offer] , identifier[String] identifier[voucher] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[String] identifier[qPath] operator[=] literal[String] operator[SEP] identifier[StringBuilder] identifier[sb] operator[=] identifier[path] operator[SEP] identifier[qPath] , identifier[duration] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[deviceId] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[offer] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[sb] , literal[String] , identifier[voucher] operator[SEP] operator[SEP] identifier[String] identifier[resp] operator[=] identifier[exec] operator[SEP] identifier[qPath] , literal[String] , identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] , Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[convertTo] operator[SEP] identifier[resp] , identifier[OvhOrder] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
|
public boolean enQueue( int data )
{
Entry o = new Entry(data, tail.prev, tail);
tail.prev.next = o;
tail.prev = o;
//set the size
size++;
return true;
} | class class_name[name] begin[{]
method[enQueue, return_type[type[boolean]], modifier[public], parameter[data]] begin[{]
local_variable[type[Entry], o]
assign[member[tail.prev.next], member[.o]]
assign[member[tail.prev], member[.o]]
member[.size]
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[enQueue] operator[SEP] Keyword[int] identifier[data] operator[SEP] {
identifier[Entry] identifier[o] operator[=] Keyword[new] identifier[Entry] operator[SEP] identifier[data] , identifier[tail] operator[SEP] identifier[prev] , identifier[tail] operator[SEP] operator[SEP] identifier[tail] operator[SEP] identifier[prev] operator[SEP] identifier[next] operator[=] identifier[o] operator[SEP] identifier[tail] operator[SEP] identifier[prev] operator[=] identifier[o] operator[SEP] identifier[size] operator[++] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
private int positiveLongToInt(long value) {
if (!ColumnChunkMetaData.positiveLongFitsInAnInt(value)) {
throw new IllegalArgumentException("value should be positive and fit in an int: " + value);
}
return (int)(value + Integer.MIN_VALUE);
} | class class_name[name] begin[{]
method[positiveLongToInt, return_type[type[int]], modifier[private], parameter[value]] begin[{]
if[call[ColumnChunkMetaData.positiveLongFitsInAnInt, parameter[member[.value]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="value should be positive and fit in an int: "), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[Cast(expression=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=MIN_VALUE, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[]), operator=+), type=BasicType(dimensions=[], name=int))]
end[}]
END[}] | Keyword[private] Keyword[int] identifier[positiveLongToInt] operator[SEP] Keyword[long] identifier[value] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[ColumnChunkMetaData] operator[SEP] identifier[positiveLongFitsInAnInt] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP]
}
Keyword[return] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[value] operator[+] identifier[Integer] operator[SEP] identifier[MIN_VALUE] operator[SEP] operator[SEP]
}
|
public void encodeAMO(final MiniSatStyleSolver s, final LNGIntVector lits) {
switch (this.amoEncoding) {
case LADDER:
this.ladder.encode(s, lits);
break;
default:
throw new IllegalStateException("Unknown AMO encoding: " + this.amoEncoding);
}
} | class class_name[name] begin[{]
method[encodeAMO, return_type[void], modifier[public], parameter[s, lits]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=['LADDER'], statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=ladder, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=lits, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encode, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unknown AMO encoding: "), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=amoEncoding, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)])], expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=amoEncoding, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[encodeAMO] operator[SEP] Keyword[final] identifier[MiniSatStyleSolver] identifier[s] , Keyword[final] identifier[LNGIntVector] identifier[lits] operator[SEP] {
Keyword[switch] operator[SEP] Keyword[this] operator[SEP] identifier[amoEncoding] operator[SEP] {
Keyword[case] identifier[LADDER] operator[:] Keyword[this] operator[SEP] identifier[ladder] operator[SEP] identifier[encode] operator[SEP] identifier[s] , identifier[lits] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[+] Keyword[this] operator[SEP] identifier[amoEncoding] operator[SEP] operator[SEP]
}
}
|
protected void watchConnection(ConnectionHandle connectionHandle) {
String message = captureStackTrace(UNCLOSED_EXCEPTION_MESSAGE);
this.closeConnectionExecutor.submit(new CloseThreadMonitor(Thread.currentThread(), connectionHandle, message, this.closeConnectionWatchTimeoutInMs));
} | class class_name[name] begin[{]
method[watchConnection, return_type[void], modifier[protected], parameter[connectionHandle]] begin[{]
local_variable[type[String], message]
THIS[member[None.closeConnectionExecutor]call[None.submit, parameter[ClassCreator(arguments=[MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[], type_arguments=None), MemberReference(member=connectionHandle, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=closeConnectionWatchTimeoutInMs, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CloseThreadMonitor, sub_type=None))]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[watchConnection] operator[SEP] identifier[ConnectionHandle] identifier[connectionHandle] operator[SEP] {
identifier[String] identifier[message] operator[=] identifier[captureStackTrace] operator[SEP] identifier[UNCLOSED_EXCEPTION_MESSAGE] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[closeConnectionExecutor] operator[SEP] identifier[submit] operator[SEP] Keyword[new] identifier[CloseThreadMonitor] operator[SEP] identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] , identifier[connectionHandle] , identifier[message] , Keyword[this] operator[SEP] identifier[closeConnectionWatchTimeoutInMs] operator[SEP] operator[SEP] operator[SEP]
}
|
public Item process(Context context, CachingOptions cachingOptions, Item item) throws ItemProcessingException {
String descriptorUrl = item.getDescriptorUrl();
Document descriptorDom = item.getDescriptorDom();
if (descriptorDom != null) {
List<Node> templateNodes = templateNodeScanner.scan(descriptorDom);
if (CollectionUtils.isNotEmpty(templateNodes)) {
for (Node templateNode : templateNodes) {
String templateNodePath = templateNode.getUniquePath();
if (logger.isDebugEnabled()) {
logger.debug("Template found in " + descriptorUrl + " at " + templateNodePath);
}
String templateId = templateNodePath + "@" + descriptorUrl;
String template = templateNode.getText();
IdentifiableStringTemplateSource templateSource = new IdentifiableStringTemplateSource(templateId,
template);
Object model = modelFactory.getModel(item, templateNode, template);
StringWriter output = new StringWriter();
try {
CompiledTemplate compiledTemplate = templateCompiler.compile(templateSource);
compiledTemplate.process(model, output);
} catch (TemplateException e) {
throw new ItemProcessingException("Unable to process the template " + templateId, e);
}
templateNode.setText(output.toString());
}
}
}
return item;
} | class class_name[name] begin[{]
method[process, return_type[type[Item]], modifier[public], parameter[context, cachingOptions, item]] begin[{]
local_variable[type[String], descriptorUrl]
local_variable[type[Document], descriptorDom]
if[binary_operation[member[.descriptorDom], !=, literal[null]]] begin[{]
local_variable[type[List], templateNodes]
if[call[CollectionUtils.isNotEmpty, parameter[member[.templateNodes]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getUniquePath, postfix_operators=[], prefix_operators=[], qualifier=templateNode, selectors=[], type_arguments=None), name=templateNodePath)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Template found in "), operandr=MemberReference(member=descriptorUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" at "), operator=+), operandr=MemberReference(member=templateNodePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=templateNodePath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="@"), operator=+), operandr=MemberReference(member=descriptorUrl, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), name=templateId)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getText, postfix_operators=[], prefix_operators=[], qualifier=templateNode, selectors=[], type_arguments=None), name=template)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[MemberReference(member=templateId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=template, 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=IdentifiableStringTemplateSource, sub_type=None)), name=templateSource)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IdentifiableStringTemplateSource, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=templateNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=template, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getModel, postfix_operators=[], prefix_operators=[], qualifier=modelFactory, selectors=[], type_arguments=None), name=model)], 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=None, dimensions=None, name=StringWriter, sub_type=None)), name=output)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=StringWriter, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=templateSource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=compile, postfix_operators=[], prefix_operators=[], qualifier=templateCompiler, selectors=[], type_arguments=None), name=compiledTemplate)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CompiledTemplate, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=model, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=process, postfix_operators=[], prefix_operators=[], qualifier=compiledTemplate, 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 process the template "), operandr=MemberReference(member=templateId, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ItemProcessingException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['TemplateException']))], finally_block=None, label=None, resources=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=output, selectors=[], type_arguments=None)], member=setText, postfix_operators=[], prefix_operators=[], qualifier=templateNode, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=templateNodes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=templateNode)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Node, sub_type=None))), label=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.item]]
end[}]
END[}] | Keyword[public] identifier[Item] identifier[process] operator[SEP] identifier[Context] identifier[context] , identifier[CachingOptions] identifier[cachingOptions] , identifier[Item] identifier[item] operator[SEP] Keyword[throws] identifier[ItemProcessingException] {
identifier[String] identifier[descriptorUrl] operator[=] identifier[item] operator[SEP] identifier[getDescriptorUrl] operator[SEP] operator[SEP] operator[SEP] identifier[Document] identifier[descriptorDom] operator[=] identifier[item] operator[SEP] identifier[getDescriptorDom] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[descriptorDom] operator[!=] Other[null] operator[SEP] {
identifier[List] operator[<] identifier[Node] operator[>] identifier[templateNodes] operator[=] identifier[templateNodeScanner] operator[SEP] identifier[scan] operator[SEP] identifier[descriptorDom] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[CollectionUtils] operator[SEP] identifier[isNotEmpty] operator[SEP] identifier[templateNodes] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[Node] identifier[templateNode] operator[:] identifier[templateNodes] operator[SEP] {
identifier[String] identifier[templateNodePath] operator[=] identifier[templateNode] operator[SEP] identifier[getUniquePath] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logger] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[+] identifier[descriptorUrl] operator[+] literal[String] operator[+] identifier[templateNodePath] operator[SEP] operator[SEP]
}
identifier[String] identifier[templateId] operator[=] identifier[templateNodePath] operator[+] literal[String] operator[+] identifier[descriptorUrl] operator[SEP] identifier[String] identifier[template] operator[=] identifier[templateNode] operator[SEP] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[IdentifiableStringTemplateSource] identifier[templateSource] operator[=] Keyword[new] identifier[IdentifiableStringTemplateSource] operator[SEP] identifier[templateId] , identifier[template] operator[SEP] operator[SEP] identifier[Object] identifier[model] operator[=] identifier[modelFactory] operator[SEP] identifier[getModel] operator[SEP] identifier[item] , identifier[templateNode] , identifier[template] operator[SEP] operator[SEP] identifier[StringWriter] identifier[output] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[CompiledTemplate] identifier[compiledTemplate] operator[=] identifier[templateCompiler] operator[SEP] identifier[compile] operator[SEP] identifier[templateSource] operator[SEP] operator[SEP] identifier[compiledTemplate] operator[SEP] identifier[process] operator[SEP] identifier[model] , identifier[output] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[TemplateException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[ItemProcessingException] operator[SEP] literal[String] operator[+] identifier[templateId] , identifier[e] operator[SEP] operator[SEP]
}
identifier[templateNode] operator[SEP] identifier[setText] operator[SEP] identifier[output] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[item] operator[SEP]
}
|
@Override
public void applyPolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) {
policyService.applyPolicy(repositoryId, policyId, objectId, extension);
} | class class_name[name] begin[{]
method[applyPolicy, return_type[void], modifier[public], parameter[repositoryId, policyId, objectId, extension]] begin[{]
call[policyService.applyPolicy, parameter[member[.repositoryId], member[.policyId], member[.objectId], member[.extension]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[applyPolicy] operator[SEP] identifier[String] identifier[repositoryId] , identifier[String] identifier[policyId] , identifier[String] identifier[objectId] , identifier[ExtensionsData] identifier[extension] operator[SEP] {
identifier[policyService] operator[SEP] identifier[applyPolicy] operator[SEP] identifier[repositoryId] , identifier[policyId] , identifier[objectId] , identifier[extension] operator[SEP] operator[SEP]
}
|
@JsonIgnore
public boolean isValid() {
return StringUtils.isNotBlank(getMetadata())
&& StringUtils.isNotBlank(getSigningCertificate())
&& StringUtils.isNotBlank(getSigningKey())
&& StringUtils.isNotBlank(getEncryptionCertificate())
&& StringUtils.isNotBlank(getEncryptionKey());
} | class class_name[name] begin[{]
method[isValid, return_type[type[boolean]], modifier[public], parameter[]] begin[{]
return[binary_operation[binary_operation[binary_operation[binary_operation[call[StringUtils.isNotBlank, parameter[call[.getMetadata, parameter[]]]], &&, call[StringUtils.isNotBlank, parameter[call[.getSigningCertificate, parameter[]]]]], &&, call[StringUtils.isNotBlank, parameter[call[.getSigningKey, parameter[]]]]], &&, call[StringUtils.isNotBlank, parameter[call[.getEncryptionCertificate, parameter[]]]]], &&, call[StringUtils.isNotBlank, parameter[call[.getEncryptionKey, parameter[]]]]]]
end[}]
END[}] | annotation[@] identifier[JsonIgnore] Keyword[public] Keyword[boolean] identifier[isValid] operator[SEP] operator[SEP] {
Keyword[return] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getMetadata] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getSigningCertificate] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getSigningKey] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getEncryptionCertificate] operator[SEP] operator[SEP] operator[SEP] operator[&&] identifier[StringUtils] operator[SEP] identifier[isNotBlank] operator[SEP] identifier[getEncryptionKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private static final double scoreAfp(AFP afp, double badRmsd, double fragScore)
{
//longer AFP with low rmsd is better
double s, w;
//s = (rmsdCut - afptmp.rmsd) * afptmp.len; //the same scroing strategy as that in the post-processing
w = afp.getRmsd() / badRmsd;
w = w * w;
s = fragScore * (1.0 - w);
return s;
} | class class_name[name] begin[{]
method[scoreAfp, return_type[type[double]], modifier[final private static], parameter[afp, badRmsd, fragScore]] begin[{]
local_variable[type[double], s]
assign[member[.w], binary_operation[call[afp.getRmsd, parameter[]], /, member[.badRmsd]]]
assign[member[.w], binary_operation[member[.w], *, member[.w]]]
assign[member[.s], binary_operation[member[.fragScore], *, binary_operation[literal[1.0], -, member[.w]]]]
return[member[.s]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[final] Keyword[double] identifier[scoreAfp] operator[SEP] identifier[AFP] identifier[afp] , Keyword[double] identifier[badRmsd] , Keyword[double] identifier[fragScore] operator[SEP] {
Keyword[double] identifier[s] , identifier[w] operator[SEP] identifier[w] operator[=] identifier[afp] operator[SEP] identifier[getRmsd] operator[SEP] operator[SEP] operator[/] identifier[badRmsd] operator[SEP] identifier[w] operator[=] identifier[w] operator[*] identifier[w] operator[SEP] identifier[s] operator[=] identifier[fragScore] operator[*] operator[SEP] literal[Float] operator[-] identifier[w] operator[SEP] operator[SEP] Keyword[return] identifier[s] operator[SEP]
}
|
@Override
protected void submitFaxJobImpl(FaxJob faxJob)
{
//get connection
Connection<MailResourcesHolder> mailConnection=this.getMailConnection();
//get holder
MailResourcesHolder mailResourcesHolder=mailConnection.getResource();
//create message
Message message=this.createSubmitFaxJobMessage(faxJob,mailResourcesHolder);
//send message
this.sendMail(faxJob,mailConnection,message);
} | class class_name[name] begin[{]
method[submitFaxJobImpl, return_type[void], modifier[protected], parameter[faxJob]] begin[{]
local_variable[type[Connection], mailConnection]
local_variable[type[MailResourcesHolder], mailResourcesHolder]
local_variable[type[Message], message]
THIS[call[None.sendMail, parameter[member[.faxJob], member[.mailConnection], member[.message]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[submitFaxJobImpl] operator[SEP] identifier[FaxJob] identifier[faxJob] operator[SEP] {
identifier[Connection] operator[<] identifier[MailResourcesHolder] operator[>] identifier[mailConnection] operator[=] Keyword[this] operator[SEP] identifier[getMailConnection] operator[SEP] operator[SEP] operator[SEP] identifier[MailResourcesHolder] identifier[mailResourcesHolder] operator[=] identifier[mailConnection] operator[SEP] identifier[getResource] operator[SEP] operator[SEP] operator[SEP] identifier[Message] identifier[message] operator[=] Keyword[this] operator[SEP] identifier[createSubmitFaxJobMessage] operator[SEP] identifier[faxJob] , identifier[mailResourcesHolder] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[sendMail] operator[SEP] identifier[faxJob] , identifier[mailConnection] , identifier[message] operator[SEP] operator[SEP]
}
|
public static IndexChangeAdapter forNodeTypes( String propertyName,
ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
ProvidedIndex<?> index ) {
return new NodeTypesChangeAdapter(propertyName, context, matcher, workspaceName, index);
} | class class_name[name] begin[{]
method[forNodeTypes, return_type[type[IndexChangeAdapter]], modifier[public static], parameter[propertyName, context, matcher, workspaceName, index]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=context, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=matcher, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=workspaceName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=index, 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=NodeTypesChangeAdapter, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[IndexChangeAdapter] identifier[forNodeTypes] operator[SEP] identifier[String] identifier[propertyName] , identifier[ExecutionContext] identifier[context] , identifier[NodeTypePredicate] identifier[matcher] , identifier[String] identifier[workspaceName] , identifier[ProvidedIndex] operator[<] operator[?] operator[>] identifier[index] operator[SEP] {
Keyword[return] Keyword[new] identifier[NodeTypesChangeAdapter] operator[SEP] identifier[propertyName] , identifier[context] , identifier[matcher] , identifier[workspaceName] , identifier[index] operator[SEP] operator[SEP]
}
|
@Override
protected void performGlobalBundleLinksRendering(BundleRendererContext ctx, Writer out, boolean debugOn)
throws IOException {
if (isForcedToRenderIeCssBundleInDebug(ctx, debugOn)) {
ResourceBundlePathsIterator resourceBundleIterator = bundler.getGlobalResourceBundlePaths(
DebugMode.FORCE_NON_DEBUG_IN_IE, new ConditionalCommentRenderer(out), ctx.getVariants());
while (resourceBundleIterator.hasNext()) {
BundlePath globalBundlePath = resourceBundleIterator.nextPath();
renderIeCssBundleLink(ctx, out, globalBundlePath);
}
} else {
super.performGlobalBundleLinksRendering(ctx, out, debugOn);
}
} | class class_name[name] begin[{]
method[performGlobalBundleLinksRendering, return_type[void], modifier[protected], parameter[ctx, out, debugOn]] begin[{]
if[call[.isForcedToRenderIeCssBundleInDebug, parameter[member[.ctx], member[.debugOn]]]] begin[{]
local_variable[type[ResourceBundlePathsIterator], resourceBundleIterator]
while[call[resourceBundleIterator.hasNext, parameter[]]] begin[{]
local_variable[type[BundlePath], globalBundlePath]
call[.renderIeCssBundleLink, parameter[member[.ctx], member[.out], member[.globalBundlePath]]]
end[}]
else begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=ctx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=out, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=debugOn, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=performGlobalBundleLinksRendering, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[performGlobalBundleLinksRendering] operator[SEP] identifier[BundleRendererContext] identifier[ctx] , identifier[Writer] identifier[out] , Keyword[boolean] identifier[debugOn] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[isForcedToRenderIeCssBundleInDebug] operator[SEP] identifier[ctx] , identifier[debugOn] operator[SEP] operator[SEP] {
identifier[ResourceBundlePathsIterator] identifier[resourceBundleIterator] operator[=] identifier[bundler] operator[SEP] identifier[getGlobalResourceBundlePaths] operator[SEP] identifier[DebugMode] operator[SEP] identifier[FORCE_NON_DEBUG_IN_IE] , Keyword[new] identifier[ConditionalCommentRenderer] operator[SEP] identifier[out] operator[SEP] , identifier[ctx] operator[SEP] identifier[getVariants] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[resourceBundleIterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[BundlePath] identifier[globalBundlePath] operator[=] identifier[resourceBundleIterator] operator[SEP] identifier[nextPath] operator[SEP] operator[SEP] operator[SEP] identifier[renderIeCssBundleLink] operator[SEP] identifier[ctx] , identifier[out] , identifier[globalBundlePath] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[super] operator[SEP] identifier[performGlobalBundleLinksRendering] operator[SEP] identifier[ctx] , identifier[out] , identifier[debugOn] operator[SEP] operator[SEP]
}
}
|
public void setPrtFlags(Integer newPrtFlags) {
Integer oldPrtFlags = prtFlags;
prtFlags = newPrtFlags;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.CPIRG__PRT_FLAGS, oldPrtFlags, prtFlags));
} | class class_name[name] begin[{]
method[setPrtFlags, return_type[void], modifier[public], parameter[newPrtFlags]] begin[{]
local_variable[type[Integer], oldPrtFlags]
assign[member[.prtFlags], member[.newPrtFlags]]
if[call[.eNotificationRequired, parameter[]]] begin[{]
call[.eNotify, parameter[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=SET, postfix_operators=[], prefix_operators=[], qualifier=Notification, selectors=[]), MemberReference(member=CPIRG__PRT_FLAGS, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[]), MemberReference(member=oldPrtFlags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=prtFlags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ENotificationImpl, sub_type=None))]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setPrtFlags] operator[SEP] identifier[Integer] identifier[newPrtFlags] operator[SEP] {
identifier[Integer] identifier[oldPrtFlags] operator[=] identifier[prtFlags] operator[SEP] identifier[prtFlags] operator[=] identifier[newPrtFlags] operator[SEP] Keyword[if] operator[SEP] identifier[eNotificationRequired] operator[SEP] operator[SEP] operator[SEP] identifier[eNotify] operator[SEP] Keyword[new] identifier[ENotificationImpl] operator[SEP] Keyword[this] , identifier[Notification] operator[SEP] identifier[SET] , identifier[AfplibPackage] operator[SEP] identifier[CPIRG__PRT_FLAGS] , identifier[oldPrtFlags] , identifier[prtFlags] operator[SEP] operator[SEP] operator[SEP]
}
|
private void filterCategories() throws SQLException {
LOGGER.info("Filtering categories...");
PreparedStatement pStmtChildren = this.conn.prepareStatement("SELECT COUNT(*) FROM poi_categories WHERE parent = ?;");
PreparedStatement pStmtPoi = this.conn.prepareStatement("SELECT COUNT(*) FROM poi_category_map WHERE category = ?;");
PreparedStatement pStmtDel = this.conn.prepareStatement("DELETE FROM poi_categories WHERE id = ?;");
Statement stmt = this.conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT id FROM poi_categories ORDER BY id;");
while (rs.next()) {
int id = rs.getInt(1);
pStmtChildren.setInt(1, id);
ResultSet rsChildren = pStmtChildren.executeQuery();
if (rsChildren.next()) {
long nChildren = rsChildren.getLong(1);
if (nChildren == 0) {
pStmtPoi.setInt(1, id);
ResultSet rsPoi = pStmtPoi.executeQuery();
if (rsPoi.next()) {
long nPoi = rsPoi.getLong(1);
// If category not have POI, delete it from DB
if (nPoi == 0) {
pStmtDel.setInt(1, id);
pStmtDel.executeUpdate();
}
}
}
}
}
} | class class_name[name] begin[{]
method[filterCategories, return_type[void], modifier[private], parameter[]] begin[{]
call[LOGGER.info, parameter[literal["Filtering categories..."]]]
local_variable[type[PreparedStatement], pStmtChildren]
local_variable[type[PreparedStatement], pStmtPoi]
local_variable[type[PreparedStatement], pStmtDel]
local_variable[type[Statement], stmt]
local_variable[type[ResultSet], rs]
while[call[rs.next, parameter[]]] begin[{]
local_variable[type[int], id]
call[pStmtChildren.setInt, parameter[literal[1], member[.id]]]
local_variable[type[ResultSet], rsChildren]
if[call[rsChildren.next, parameter[]]] begin[{]
local_variable[type[long], nChildren]
if[binary_operation[member[.nChildren], ==, literal[0]]] begin[{]
call[pStmtPoi.setInt, parameter[literal[1], member[.id]]]
local_variable[type[ResultSet], rsPoi]
if[call[rsPoi.next, parameter[]]] begin[{]
local_variable[type[long], nPoi]
if[binary_operation[member[.nPoi], ==, literal[0]]] begin[{]
call[pStmtDel.setInt, parameter[literal[1], member[.id]]]
call[pStmtDel.executeUpdate, parameter[]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[filterCategories] operator[SEP] operator[SEP] Keyword[throws] identifier[SQLException] {
identifier[LOGGER] operator[SEP] identifier[info] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[PreparedStatement] identifier[pStmtChildren] operator[=] Keyword[this] operator[SEP] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[PreparedStatement] identifier[pStmtPoi] operator[=] Keyword[this] operator[SEP] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[PreparedStatement] identifier[pStmtDel] operator[=] Keyword[this] operator[SEP] identifier[conn] operator[SEP] identifier[prepareStatement] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Statement] identifier[stmt] operator[=] Keyword[this] operator[SEP] identifier[conn] operator[SEP] identifier[createStatement] operator[SEP] operator[SEP] operator[SEP] identifier[ResultSet] identifier[rs] operator[=] identifier[stmt] operator[SEP] identifier[executeQuery] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[rs] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[id] operator[=] identifier[rs] operator[SEP] identifier[getInt] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[pStmtChildren] operator[SEP] identifier[setInt] operator[SEP] Other[1] , identifier[id] operator[SEP] operator[SEP] identifier[ResultSet] identifier[rsChildren] operator[=] identifier[pStmtChildren] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rsChildren] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
Keyword[long] identifier[nChildren] operator[=] identifier[rsChildren] operator[SEP] identifier[getLong] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nChildren] operator[==] Other[0] operator[SEP] {
identifier[pStmtPoi] operator[SEP] identifier[setInt] operator[SEP] Other[1] , identifier[id] operator[SEP] operator[SEP] identifier[ResultSet] identifier[rsPoi] operator[=] identifier[pStmtPoi] operator[SEP] identifier[executeQuery] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[rsPoi] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] {
Keyword[long] identifier[nPoi] operator[=] identifier[rsPoi] operator[SEP] identifier[getLong] operator[SEP] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[nPoi] operator[==] Other[0] operator[SEP] {
identifier[pStmtDel] operator[SEP] identifier[setInt] operator[SEP] Other[1] , identifier[id] operator[SEP] operator[SEP] identifier[pStmtDel] operator[SEP] identifier[executeUpdate] operator[SEP] operator[SEP] operator[SEP]
}
}
}
}
}
}
|
@Override
public Template get(final TemplateSource source, final Parser parser) throws IOException {
Template template = getCache().get(source);
if (template == null) {
template = parser.parse(source);
getCache().put(source, template);
}
return template;
} | class class_name[name] begin[{]
method[get, return_type[type[Template]], modifier[public], parameter[source, parser]] begin[{]
local_variable[type[Template], template]
if[binary_operation[member[.template], ==, literal[null]]] begin[{]
assign[member[.template], call[parser.parse, parameter[member[.source]]]]
call[.getCache, parameter[]]
else begin[{]
None
end[}]
return[member[.template]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Template] identifier[get] operator[SEP] Keyword[final] identifier[TemplateSource] identifier[source] , Keyword[final] identifier[Parser] identifier[parser] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Template] identifier[template] operator[=] identifier[getCache] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[source] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[template] operator[==] Other[null] operator[SEP] {
identifier[template] operator[=] identifier[parser] operator[SEP] identifier[parse] operator[SEP] identifier[source] operator[SEP] operator[SEP] identifier[getCache] operator[SEP] operator[SEP] operator[SEP] identifier[put] operator[SEP] identifier[source] , identifier[template] operator[SEP] operator[SEP]
}
Keyword[return] identifier[template] operator[SEP]
}
|
@Override
protected void checkIfHeartbeatSkipped(String name, EventChannelStruct eventChannelStruct) {
// Check if heartbeat have been skipped, can happen if
// 1- the notifd is dead (if not ZMQ)
// 2- the server is dead
// 3- The network was down;
// 4- The server has been restarted on another host.
// long now = System.currentTimeMillis();
// boolean heartbeat_skipped =
// ((now - eventChannelStruct.last_heartbeat) > KeepAliveThread.getHeartBeatPeriod());
if (KeepAliveThread.heartbeatHasBeenSkipped(eventChannelStruct) ||
eventChannelStruct.heartbeat_skipped || eventChannelStruct.notifd_failed) {
eventChannelStruct.heartbeat_skipped = true;
// Check notifd by trying to read an attribute of the event channel
DevError dev_error = null;
try {
eventChannelStruct.eventChannel.MyFactory();
// Check if DS is now running on another host
if (checkIfHostHasChanged(eventChannelStruct))
eventChannelStruct.notifd_failed = true;
} catch (RuntimeException e1) {
// MyFactory has failed
dev_error = new DevError();
dev_error.severity = ErrSeverity.ERR;
dev_error.origin = "NotifdEventConsumer.checkIfHeartbeatSkipped()";
dev_error.reason = "API_EventException";
dev_error.desc = "Connection failed with notify daemon";
// Try to add reason
int pos = e1.toString().indexOf(":");
if (pos > 0) dev_error.desc += " (" + e1.toString().substring(0, pos) + ")";
eventChannelStruct.notifd_failed = true;
// reset the event import info stored in DeviceProxy object
// Until today, this feature is used only by Astor (import with external info).
try {
DeviceProxyFactory.get(name,
eventChannelStruct.dbase.getUrl().getTangoHost()).set_evt_import_info(null);
} catch (DevFailed e) {
System.err.println("API received a DevFailed : " + e.errors[0].desc);
}
}
// Force to reconnect if not using database
if (!eventChannelStruct.use_db)
eventChannelStruct.notifd_failed = true;
// Check if has_notifd_closed_the_connection many times (nework blank)
if (!eventChannelStruct.notifd_failed &&
eventChannelStruct.has_notifd_closed_the_connection >= 3)
eventChannelStruct.notifd_failed = true;
// If notifd_failed --> try to reconnect
if (eventChannelStruct.notifd_failed) {
eventChannelStruct.notifd_failed = !reconnect_to_channel(name);
if (!eventChannelStruct.notifd_failed)
reconnect_to_event(name);
}
Enumeration callback_structs = EventConsumer.getEventCallbackMap().elements();
while (callback_structs.hasMoreElements()) {
EventCallBackStruct callback_struct = (EventCallBackStruct) callback_structs.nextElement();
if (callback_struct.channel_name.equals(name)) {
// Push exception
if (dev_error != null)
pushReceivedException(eventChannelStruct, callback_struct, dev_error);
else
pushServerNotRespondingException(eventChannelStruct, callback_struct);
// If reconnection done, try to re subscribe
// and read attribute in synchronous mode
if (!callback_struct.event_name.equals(eventNames[DATA_READY_EVENT]))
if (!eventChannelStruct.notifd_failed)
if (eventChannelStruct.consumer.reSubscribe(eventChannelStruct, callback_struct))
readAttributeAndPush(eventChannelStruct, callback_struct);
}
}
}// end if heartbeat_skipped
else
eventChannelStruct.has_notifd_closed_the_connection = 0;
} | class class_name[name] begin[{]
method[checkIfHeartbeatSkipped, return_type[void], modifier[protected], parameter[name, eventChannelStruct]] begin[{]
if[binary_operation[binary_operation[call[KeepAliveThread.heartbeatHasBeenSkipped, parameter[member[.eventChannelStruct]]], ||, member[eventChannelStruct.heartbeat_skipped]], ||, member[eventChannelStruct.notifd_failed]]] begin[{]
assign[member[eventChannelStruct.heartbeat_skipped], literal[true]]
local_variable[type[DevError], dev_error]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=MyFactory, postfix_operators=[], prefix_operators=[], qualifier=eventChannelStruct.eventChannel, selectors=[], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=eventChannelStruct, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=checkIfHostHasChanged, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=StatementExpression(expression=Assignment(expressionl=MemberReference(member=notifd_failed, postfix_operators=[], prefix_operators=[], qualifier=eventChannelStruct, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None))], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=dev_error, 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=DevError, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=severity, postfix_operators=[], prefix_operators=[], qualifier=dev_error, selectors=[]), type==, value=MemberReference(member=ERR, postfix_operators=[], prefix_operators=[], qualifier=ErrSeverity, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=origin, postfix_operators=[], prefix_operators=[], qualifier=dev_error, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NotifdEventConsumer.checkIfHeartbeatSkipped()")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=reason, postfix_operators=[], prefix_operators=[], qualifier=dev_error, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="API_EventException")), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=desc, postfix_operators=[], prefix_operators=[], qualifier=dev_error, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Connection failed with notify daemon")), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e1, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":")], member=indexOf, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=pos)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=pos, 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=StatementExpression(expression=Assignment(expressionl=MemberReference(member=desc, postfix_operators=[], prefix_operators=[], qualifier=dev_error, selectors=[]), type=+=, value=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" ("), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=e1, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=pos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")"), operator=+)), label=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=notifd_failed, postfix_operators=[], prefix_operators=[], qualifier=eventChannelStruct, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getUrl, postfix_operators=[], prefix_operators=[], qualifier=eventChannelStruct.dbase, selectors=[MethodInvocation(arguments=[], member=getTangoHost, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=DeviceProxyFactory, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=set_evt_import_info, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="API received a DevFailed : "), operandr=MemberReference(member=errors, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)), MemberReference(member=desc, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), operator=+)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['DevFailed']))], finally_block=None, label=None, resources=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e1, types=['RuntimeException']))], finally_block=None, label=None, resources=None)
if[member[eventChannelStruct.use_db]] begin[{]
assign[member[eventChannelStruct.notifd_failed], literal[true]]
else begin[{]
None
end[}]
if[binary_operation[member[eventChannelStruct.notifd_failed], &&, binary_operation[member[eventChannelStruct.has_notifd_closed_the_connection], >=, literal[3]]]] begin[{]
assign[member[eventChannelStruct.notifd_failed], literal[true]]
else begin[{]
None
end[}]
if[member[eventChannelStruct.notifd_failed]] begin[{]
assign[member[eventChannelStruct.notifd_failed], call[.reconnect_to_channel, parameter[member[.name]]]]
if[member[eventChannelStruct.notifd_failed]] begin[{]
call[.reconnect_to_event, parameter[member[.name]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
local_variable[type[Enumeration], callback_structs]
while[call[callback_structs.hasMoreElements, parameter[]]] begin[{]
local_variable[type[EventCallBackStruct], callback_struct]
if[call[callback_struct.channel_name.equals, parameter[member[.name]]]] begin[{]
if[binary_operation[member[.dev_error], !=, literal[null]]] begin[{]
call[.pushReceivedException, parameter[member[.eventChannelStruct], member[.callback_struct], member[.dev_error]]]
else begin[{]
call[.pushServerNotRespondingException, parameter[member[.eventChannelStruct], member[.callback_struct]]]
end[}]
if[call[callback_struct.event_name.equals, parameter[member[.eventNames]]]] begin[{]
if[member[eventChannelStruct.notifd_failed]] begin[{]
if[call[eventChannelStruct.consumer.reSubscribe, parameter[member[.eventChannelStruct], member[.callback_struct]]]] begin[{]
call[.readAttributeAndPush, parameter[member[.eventChannelStruct], member[.callback_struct]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
else begin[{]
assign[member[eventChannelStruct.has_notifd_closed_the_connection], literal[0]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[checkIfHeartbeatSkipped] operator[SEP] identifier[String] identifier[name] , identifier[EventChannelStruct] identifier[eventChannelStruct] operator[SEP] {
Keyword[if] operator[SEP] identifier[KeepAliveThread] operator[SEP] identifier[heartbeatHasBeenSkipped] operator[SEP] identifier[eventChannelStruct] operator[SEP] operator[||] identifier[eventChannelStruct] operator[SEP] identifier[heartbeat_skipped] operator[||] identifier[eventChannelStruct] operator[SEP] identifier[notifd_failed] operator[SEP] {
identifier[eventChannelStruct] operator[SEP] identifier[heartbeat_skipped] operator[=] literal[boolean] operator[SEP] identifier[DevError] identifier[dev_error] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[eventChannelStruct] operator[SEP] identifier[eventChannel] operator[SEP] identifier[MyFactory] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[checkIfHostHasChanged] operator[SEP] identifier[eventChannelStruct] operator[SEP] operator[SEP] identifier[eventChannelStruct] operator[SEP] identifier[notifd_failed] operator[=] literal[boolean] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RuntimeException] identifier[e1] operator[SEP] {
identifier[dev_error] operator[=] Keyword[new] identifier[DevError] operator[SEP] operator[SEP] operator[SEP] identifier[dev_error] operator[SEP] identifier[severity] operator[=] identifier[ErrSeverity] operator[SEP] identifier[ERR] operator[SEP] identifier[dev_error] operator[SEP] identifier[origin] operator[=] literal[String] operator[SEP] identifier[dev_error] operator[SEP] identifier[reason] operator[=] literal[String] operator[SEP] identifier[dev_error] operator[SEP] identifier[desc] operator[=] literal[String] operator[SEP] Keyword[int] identifier[pos] operator[=] identifier[e1] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pos] operator[>] Other[0] operator[SEP] identifier[dev_error] operator[SEP] identifier[desc] operator[+=] literal[String] operator[+] identifier[e1] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[pos] operator[SEP] operator[+] literal[String] operator[SEP] identifier[eventChannelStruct] operator[SEP] identifier[notifd_failed] operator[=] literal[boolean] operator[SEP] Keyword[try] {
identifier[DeviceProxyFactory] operator[SEP] identifier[get] operator[SEP] identifier[name] , identifier[eventChannelStruct] operator[SEP] identifier[dbase] operator[SEP] identifier[getUrl] operator[SEP] operator[SEP] operator[SEP] identifier[getTangoHost] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[set_evt_import_info] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[DevFailed] identifier[e] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[errors] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[desc] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] operator[!] identifier[eventChannelStruct] operator[SEP] identifier[use_db] operator[SEP] identifier[eventChannelStruct] operator[SEP] identifier[notifd_failed] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[eventChannelStruct] operator[SEP] identifier[notifd_failed] operator[&&] identifier[eventChannelStruct] operator[SEP] identifier[has_notifd_closed_the_connection] operator[>=] Other[3] operator[SEP] identifier[eventChannelStruct] operator[SEP] identifier[notifd_failed] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[eventChannelStruct] operator[SEP] identifier[notifd_failed] operator[SEP] {
identifier[eventChannelStruct] operator[SEP] identifier[notifd_failed] operator[=] operator[!] identifier[reconnect_to_channel] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[eventChannelStruct] operator[SEP] identifier[notifd_failed] operator[SEP] identifier[reconnect_to_event] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
identifier[Enumeration] identifier[callback_structs] operator[=] identifier[EventConsumer] operator[SEP] identifier[getEventCallbackMap] operator[SEP] operator[SEP] operator[SEP] identifier[elements] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[callback_structs] operator[SEP] identifier[hasMoreElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[EventCallBackStruct] identifier[callback_struct] operator[=] operator[SEP] identifier[EventCallBackStruct] operator[SEP] identifier[callback_structs] operator[SEP] identifier[nextElement] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[callback_struct] operator[SEP] identifier[channel_name] operator[SEP] identifier[equals] operator[SEP] identifier[name] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[dev_error] operator[!=] Other[null] operator[SEP] identifier[pushReceivedException] operator[SEP] identifier[eventChannelStruct] , identifier[callback_struct] , identifier[dev_error] operator[SEP] operator[SEP] Keyword[else] identifier[pushServerNotRespondingException] operator[SEP] identifier[eventChannelStruct] , identifier[callback_struct] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[callback_struct] operator[SEP] identifier[event_name] operator[SEP] identifier[equals] operator[SEP] identifier[eventNames] operator[SEP] identifier[DATA_READY_EVENT] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[eventChannelStruct] operator[SEP] identifier[notifd_failed] operator[SEP] Keyword[if] operator[SEP] identifier[eventChannelStruct] operator[SEP] identifier[consumer] operator[SEP] identifier[reSubscribe] operator[SEP] identifier[eventChannelStruct] , identifier[callback_struct] operator[SEP] operator[SEP] identifier[readAttributeAndPush] operator[SEP] identifier[eventChannelStruct] , identifier[callback_struct] operator[SEP] operator[SEP]
}
}
}
Keyword[else] identifier[eventChannelStruct] operator[SEP] identifier[has_notifd_closed_the_connection] operator[=] Other[0] operator[SEP]
}
|
public DayPartitionBuilder addDailyRule(ClockInterval partition) {
for (Weekday dayOfWeek : Weekday.values()) {
this.addWeekdayRule(dayOfWeek, partition);
}
return this;
} | class class_name[name] begin[{]
method[addDailyRule, return_type[type[DayPartitionBuilder]], modifier[public], parameter[partition]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=dayOfWeek, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=partition, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addWeekdayRule, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=values, postfix_operators=[], prefix_operators=[], qualifier=Weekday, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=dayOfWeek)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Weekday, sub_type=None))), label=None)
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[DayPartitionBuilder] identifier[addDailyRule] operator[SEP] identifier[ClockInterval] identifier[partition] operator[SEP] {
Keyword[for] operator[SEP] identifier[Weekday] identifier[dayOfWeek] operator[:] identifier[Weekday] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[addWeekdayRule] operator[SEP] identifier[dayOfWeek] , identifier[partition] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
|
private void setupResource(List resource) throws ParsingException {
mapAttributes(resource, resourceMap);
// make sure there resource-id attribute was included
List<Attribute> resourceId = resourceMap.get(RESOURCE_ID);
if (resourceId == null) {
logger.warn("Resource must contain resource-id attr");
//throw new ParsingException("resource missing resource-id");
} else {
// make sure there's only one value for this
if (resourceId.size() != 1) {
logger.warn("Resource must contain only one resource-id Attribute");
//throw new ParsingException("too many resource-id attrs");
} else {
// keep track of the resource-id attribute
this.resourceId = resourceId.get(0).getValue();
}
}
//SECURITY-162: Relax resource-id requirement
if(this.resourceId == null)
this.resourceId = new StringAttribute("");
List<Attribute> resourceScope = resourceMap.get(RESOURCE_SCOPE);
// see if a resource-scope attribute was included
if (resourceScope != null && !resourceScope.isEmpty()) {
// make sure there's only one value for resource-scope
if (resourceScope.size() > 1) {
System.err.println("Resource may contain only one " +
"resource-scope Attribute");
throw new ParsingException("too many resource-scope attrs");
}
AttributeValue attrValue = resourceScope.get(0).getValue();
// scope must be a string, so throw an exception otherwise
if (! attrValue.getType().toString().
equals(StringAttribute.identifier))
throw new ParsingException("scope attr must be a string");
String value = ((StringAttribute)attrValue).getValue();
if (value.equals("Immediate")) {
scope = SCOPE_IMMEDIATE;
} else if (value.equals("Children")) {
scope = SCOPE_CHILDREN;
} else if (value.equals("Descendants")) {
scope = SCOPE_DESCENDANTS;
} else {
System.err.println("Unknown scope type: " + value);
throw new ParsingException("invalid scope type: " + value);
}
} else {
// by default, the scope is always Immediate
scope = SCOPE_IMMEDIATE;
}
} | class class_name[name] begin[{]
method[setupResource, return_type[void], modifier[private], parameter[resource]] begin[{]
call[.mapAttributes, parameter[member[.resource], member[.resourceMap]]]
local_variable[type[List], resourceId]
if[binary_operation[member[.resourceId], ==, literal[null]]] begin[{]
call[logger.warn, parameter[literal["Resource must contain resource-id attr"]]]
else begin[{]
if[binary_operation[call[resourceId.size, parameter[]], !=, literal[1]]] begin[{]
call[logger.warn, parameter[literal["Resource must contain only one resource-id Attribute"]]]
else begin[{]
assign[THIS[member[None.resourceId]], call[resourceId.get, parameter[literal[0]]]]
end[}]
end[}]
if[binary_operation[THIS[member[None.resourceId]], ==, literal[null]]] begin[{]
assign[THIS[member[None.resourceId]], ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=StringAttribute, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[List], resourceScope]
if[binary_operation[binary_operation[member[.resourceScope], !=, literal[null]], &&, call[resourceScope.isEmpty, parameter[]]]] begin[{]
if[binary_operation[call[resourceScope.size, parameter[]], >, literal[1]]] begin[{]
call[System.err.println, parameter[binary_operation[literal["Resource may contain only one "], +, literal["resource-scope Attribute"]]]]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="too many resource-scope attrs")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParsingException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[AttributeValue], attrValue]
if[call[attrValue.getType, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="scope attr must be a string")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ParsingException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], value]
if[call[value.equals, parameter[literal["Immediate"]]]] begin[{]
assign[member[.scope], member[.SCOPE_IMMEDIATE]]
else begin[{]
if[call[value.equals, parameter[literal["Children"]]]] begin[{]
assign[member[.scope], member[.SCOPE_CHILDREN]]
else begin[{]
if[call[value.equals, parameter[literal["Descendants"]]]] begin[{]
assign[member[.scope], member[.SCOPE_DESCENDANTS]]
else begin[{]
call[System.err.println, parameter[binary_operation[literal["Unknown scope type: "], +, member[.value]]]]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid scope type: "), operandr=MemberReference(member=value, 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=ParsingException, sub_type=None)), label=None)
end[}]
end[}]
end[}]
else begin[{]
assign[member[.scope], member[.SCOPE_IMMEDIATE]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[setupResource] operator[SEP] identifier[List] identifier[resource] operator[SEP] Keyword[throws] identifier[ParsingException] {
identifier[mapAttributes] operator[SEP] identifier[resource] , identifier[resourceMap] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Attribute] operator[>] identifier[resourceId] operator[=] identifier[resourceMap] operator[SEP] identifier[get] operator[SEP] identifier[RESOURCE_ID] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resourceId] operator[==] Other[null] operator[SEP] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[resourceId] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[!=] Other[1] operator[SEP] {
identifier[logger] operator[SEP] identifier[warn] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[resourceId] operator[=] identifier[resourceId] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[resourceId] operator[==] Other[null] operator[SEP] Keyword[this] operator[SEP] identifier[resourceId] operator[=] Keyword[new] identifier[StringAttribute] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[Attribute] operator[>] identifier[resourceScope] operator[=] identifier[resourceMap] operator[SEP] identifier[get] operator[SEP] identifier[RESOURCE_SCOPE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resourceScope] operator[!=] Other[null] operator[&&] operator[!] identifier[resourceScope] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[resourceScope] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[1] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ParsingException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[AttributeValue] identifier[attrValue] operator[=] identifier[resourceScope] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[attrValue] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[StringAttribute] operator[SEP] identifier[identifier] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ParsingException] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] operator[SEP] operator[SEP] identifier[StringAttribute] operator[SEP] identifier[attrValue] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[scope] operator[=] identifier[SCOPE_IMMEDIATE] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[scope] operator[=] identifier[SCOPE_CHILDREN] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[value] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[scope] operator[=] identifier[SCOPE_DESCENDANTS] operator[SEP]
}
Keyword[else] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ParsingException] operator[SEP] literal[String] operator[+] identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[scope] operator[=] identifier[SCOPE_IMMEDIATE] operator[SEP]
}
}
|
public Note createIssueNote(Object projectIdOrPath, Integer issueIid, String body, Date createdAt) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("body", body, true)
.withParam("created_at", createdAt);
Response response = post(Response.Status.CREATED, formData,
"projects", getProjectIdOrPath(projectIdOrPath), "issues", issueIid, "notes");
return (response.readEntity(Note.class));
} | class class_name[name] begin[{]
method[createIssueNote, return_type[type[Note]], modifier[public], parameter[projectIdOrPath, issueIid, body, createdAt]] begin[{]
local_variable[type[GitLabApiForm], formData]
local_variable[type[Response], response]
return[call[response.readEntity, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Note, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[Note] identifier[createIssueNote] operator[SEP] identifier[Object] identifier[projectIdOrPath] , identifier[Integer] identifier[issueIid] , identifier[String] identifier[body] , identifier[Date] identifier[createdAt] operator[SEP] Keyword[throws] identifier[GitLabApiException] {
identifier[GitLabApiForm] identifier[formData] operator[=] Keyword[new] identifier[GitLabApiForm] operator[SEP] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] literal[String] , identifier[body] , literal[boolean] operator[SEP] operator[SEP] identifier[withParam] operator[SEP] literal[String] , identifier[createdAt] operator[SEP] operator[SEP] identifier[Response] identifier[response] operator[=] identifier[post] operator[SEP] identifier[Response] operator[SEP] identifier[Status] operator[SEP] identifier[CREATED] , identifier[formData] , literal[String] , identifier[getProjectIdOrPath] operator[SEP] identifier[projectIdOrPath] operator[SEP] , literal[String] , identifier[issueIid] , literal[String] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[response] operator[SEP] identifier[readEntity] operator[SEP] identifier[Note] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public final void setItem(final ServiceToSale pItem) {
this.item = pItem;
if (getItsId() == null) {
setItsId(new ServiceCatalogId());
}
getItsId().setItem(this.item);
} | class class_name[name] begin[{]
method[setItem, return_type[void], modifier[final public], parameter[pItem]] begin[{]
assign[THIS[member[None.item]], member[.pItem]]
if[binary_operation[call[.getItsId, parameter[]], ==, literal[null]]] begin[{]
call[.setItsId, parameter[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ServiceCatalogId, sub_type=None))]]
else begin[{]
None
end[}]
call[.getItsId, parameter[]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[final] Keyword[void] identifier[setItem] operator[SEP] Keyword[final] identifier[ServiceToSale] identifier[pItem] operator[SEP] {
Keyword[this] operator[SEP] identifier[item] operator[=] identifier[pItem] operator[SEP] Keyword[if] operator[SEP] identifier[getItsId] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[setItsId] operator[SEP] Keyword[new] identifier[ServiceCatalogId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[getItsId] operator[SEP] operator[SEP] operator[SEP] identifier[setItem] operator[SEP] Keyword[this] operator[SEP] identifier[item] operator[SEP] operator[SEP]
}
|
public void send(String uri, String data) {
Objects.requireNonNull(uri, Required.URI.toString());
final Set<ServerSentEventConnection> uriConnections = getConnections(uri);
if (uriConnections != null) {
uriConnections.stream()
.filter(ServerSentEventConnection::isOpen)
.forEach((ServerSentEventConnection connection) -> connection.send(data));
}
} | class class_name[name] begin[{]
method[send, return_type[void], modifier[public], parameter[uri, data]] begin[{]
call[Objects.requireNonNull, parameter[member[.uri], call[Required.URI.toString, parameter[]]]]
local_variable[type[Set], uriConnections]
if[binary_operation[member[.uriConnections], !=, literal[null]]] begin[{]
call[uriConnections.stream, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[send] operator[SEP] identifier[String] identifier[uri] , identifier[String] identifier[data] operator[SEP] {
identifier[Objects] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[uri] , identifier[Required] operator[SEP] identifier[URI] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Set] operator[<] identifier[ServerSentEventConnection] operator[>] identifier[uriConnections] operator[=] identifier[getConnections] operator[SEP] identifier[uri] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[uriConnections] operator[!=] Other[null] operator[SEP] {
identifier[uriConnections] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[ServerSentEventConnection] operator[::] identifier[isOpen] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] operator[SEP] identifier[ServerSentEventConnection] identifier[connection] operator[SEP] operator[->] identifier[connection] operator[SEP] identifier[send] operator[SEP] identifier[data] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private boolean validMapunionExpression(Node expr) {
// The expression must have four children:
// - The mapunion keyword
// - A union type expression
// - A map function
if (!checkParameterCount(expr, Keywords.MAPUNION)) {
return false;
}
// The second child must be a valid union type expression
if (!validTypeTransformationExpression(getCallArgument(expr, 0))) {
warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 0));
return false;
}
// The third child must be a function
if (!getCallArgument(expr, 1).isFunction()) {
warnInvalid("map function", getCallArgument(expr, 1));
warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1));
return false;
}
Node mapFn = getCallArgument(expr, 1);
// The map function must have only one parameter
int mapFnParamCount = getFunctionParamCount(mapFn);
if (mapFnParamCount < 1) {
warnMissingParam("map function", mapFn);
warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1));
return false;
}
if (mapFnParamCount > 1) {
warnExtraParam("map function", mapFn);
warnInvalidInside(Keywords.MAPUNION.name, getCallArgument(expr, 1));
return false;
}
// The body must be a valid type transformation expression
Node mapFnBody = getFunctionBody(mapFn);
if (!validTypeTransformationExpression(mapFnBody)) {
warnInvalidInside("map function body", mapFnBody);
return false;
}
return true;
} | class class_name[name] begin[{]
method[validMapunionExpression, return_type[type[boolean]], modifier[private], parameter[expr]] begin[{]
if[call[.checkParameterCount, parameter[member[.expr], member[Keywords.MAPUNION]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[.validTypeTransformationExpression, parameter[call[.getCallArgument, parameter[member[.expr], literal[0]]]]]] begin[{]
call[.warnInvalidInside, parameter[member[Keywords.MAPUNION.name], call[.getCallArgument, parameter[member[.expr], literal[0]]]]]
return[literal[false]]
else begin[{]
None
end[}]
if[call[.getCallArgument, parameter[member[.expr], literal[1]]]] begin[{]
call[.warnInvalid, parameter[literal["map function"], call[.getCallArgument, parameter[member[.expr], literal[1]]]]]
call[.warnInvalidInside, parameter[member[Keywords.MAPUNION.name], call[.getCallArgument, parameter[member[.expr], literal[1]]]]]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[Node], mapFn]
local_variable[type[int], mapFnParamCount]
if[binary_operation[member[.mapFnParamCount], <, literal[1]]] begin[{]
call[.warnMissingParam, parameter[literal["map function"], member[.mapFn]]]
call[.warnInvalidInside, parameter[member[Keywords.MAPUNION.name], call[.getCallArgument, parameter[member[.expr], literal[1]]]]]
return[literal[false]]
else begin[{]
None
end[}]
if[binary_operation[member[.mapFnParamCount], >, literal[1]]] begin[{]
call[.warnExtraParam, parameter[literal["map function"], member[.mapFn]]]
call[.warnInvalidInside, parameter[member[Keywords.MAPUNION.name], call[.getCallArgument, parameter[member[.expr], literal[1]]]]]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[Node], mapFnBody]
if[call[.validTypeTransformationExpression, parameter[member[.mapFnBody]]]] begin[{]
call[.warnInvalidInside, parameter[literal["map function body"], member[.mapFnBody]]]
return[literal[false]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[validMapunionExpression] operator[SEP] identifier[Node] identifier[expr] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[checkParameterCount] operator[SEP] identifier[expr] , identifier[Keywords] operator[SEP] identifier[MAPUNION] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[validTypeTransformationExpression] operator[SEP] identifier[getCallArgument] operator[SEP] identifier[expr] , Other[0] operator[SEP] operator[SEP] operator[SEP] {
identifier[warnInvalidInside] operator[SEP] identifier[Keywords] operator[SEP] identifier[MAPUNION] operator[SEP] identifier[name] , identifier[getCallArgument] operator[SEP] identifier[expr] , Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[getCallArgument] operator[SEP] identifier[expr] , Other[1] operator[SEP] operator[SEP] identifier[isFunction] operator[SEP] operator[SEP] operator[SEP] {
identifier[warnInvalid] operator[SEP] literal[String] , identifier[getCallArgument] operator[SEP] identifier[expr] , Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[warnInvalidInside] operator[SEP] identifier[Keywords] operator[SEP] identifier[MAPUNION] operator[SEP] identifier[name] , identifier[getCallArgument] operator[SEP] identifier[expr] , Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
identifier[Node] identifier[mapFn] operator[=] identifier[getCallArgument] operator[SEP] identifier[expr] , Other[1] operator[SEP] operator[SEP] Keyword[int] identifier[mapFnParamCount] operator[=] identifier[getFunctionParamCount] operator[SEP] identifier[mapFn] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[mapFnParamCount] operator[<] Other[1] operator[SEP] {
identifier[warnMissingParam] operator[SEP] literal[String] , identifier[mapFn] operator[SEP] operator[SEP] identifier[warnInvalidInside] operator[SEP] identifier[Keywords] operator[SEP] identifier[MAPUNION] operator[SEP] identifier[name] , identifier[getCallArgument] operator[SEP] identifier[expr] , Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[mapFnParamCount] operator[>] Other[1] operator[SEP] {
identifier[warnExtraParam] operator[SEP] literal[String] , identifier[mapFn] operator[SEP] operator[SEP] identifier[warnInvalidInside] operator[SEP] identifier[Keywords] operator[SEP] identifier[MAPUNION] operator[SEP] identifier[name] , identifier[getCallArgument] operator[SEP] identifier[expr] , Other[1] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
identifier[Node] identifier[mapFnBody] operator[=] identifier[getFunctionBody] operator[SEP] identifier[mapFn] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[validTypeTransformationExpression] operator[SEP] identifier[mapFnBody] operator[SEP] operator[SEP] {
identifier[warnInvalidInside] operator[SEP] literal[String] , identifier[mapFnBody] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private void displaySuperToast(SuperToast superToast) {
// Make sure the SuperToast isn't already showing for some reason
if (superToast.isShowing()) return;
// If the SuperToast is a SuperActivityToast, show it via the supplied ViewGroup
if (superToast instanceof SuperActivityToast) {
if (((SuperActivityToast) superToast).getViewGroup() == null) {
Log.e(getClass().getName(), ERROR_SAT_VIEWGROUP_NULL);
return;
}
try {
((SuperActivityToast) superToast).getViewGroup().addView(superToast.getView());
// Do not use the show animation on the first SuperToast if from orientation change
if (!((SuperActivityToast) superToast).isFromOrientationChange()) {
AnimationUtils.getShowAnimation((SuperActivityToast) superToast).start();
}
} catch (IllegalStateException illegalStateException) {
Log.e(getClass().getName(), illegalStateException.toString());
}
if (!((SuperActivityToast) superToast).isIndeterminate()) {
// This will remove the SuperToast after the total duration
sendDelayedMessage(superToast, Messages.REMOVE_SUPERTOAST,
superToast.getDuration() + AnimationUtils.SHOW_DURATION);
}
// The SuperToast is NOT a SuperActivityToast, show it via the WindowManager
} else {
final WindowManager windowManager = (WindowManager) superToast.getContext()
.getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
if (windowManager != null) {
windowManager.addView(superToast.getView(), superToast.getWindowManagerParams());
}
// This will remove the SuperToast after a certain duration
sendDelayedMessage(superToast, Messages.REMOVE_SUPERTOAST,
superToast.getDuration() + AnimationUtils.SHOW_DURATION);
}
} | class class_name[name] begin[{]
method[displaySuperToast, return_type[void], modifier[private], parameter[superToast]] begin[{]
if[call[superToast.isShowing, parameter[]]] begin[{]
return[None]
else begin[{]
None
end[}]
if[binary_operation[member[.superToast], instanceof, type[SuperActivityToast]]] begin[{]
if[binary_operation[Cast(expression=MemberReference(member=superToast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SuperActivityToast, sub_type=None)), ==, literal[null]]] begin[{]
call[Log.e, parameter[call[.getClass, parameter[]], member[.ERROR_SAT_VIEWGROUP_NULL]]]
return[None]
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=Cast(expression=MemberReference(member=superToast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SuperActivityToast, sub_type=None)), label=None), IfStatement(condition=Cast(expression=MemberReference(member=superToast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SuperActivityToast, sub_type=None)), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=superToast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SuperActivityToast, sub_type=None))], member=getShowAnimation, postfix_operators=[], prefix_operators=[], qualifier=AnimationUtils, selectors=[MethodInvocation(arguments=[], member=start, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=illegalStateException, selectors=[], type_arguments=None)], member=e, postfix_operators=[], prefix_operators=[], qualifier=Log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=illegalStateException, types=['IllegalStateException']))], finally_block=None, label=None, resources=None)
if[Cast(expression=MemberReference(member=superToast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=SuperActivityToast, sub_type=None))] begin[{]
call[.sendDelayedMessage, parameter[member[.superToast], member[Messages.REMOVE_SUPERTOAST], binary_operation[call[superToast.getDuration, parameter[]], +, member[AnimationUtils.SHOW_DURATION]]]]
else begin[{]
None
end[}]
else begin[{]
local_variable[type[WindowManager], windowManager]
if[binary_operation[member[.windowManager], !=, literal[null]]] begin[{]
call[windowManager.addView, parameter[call[superToast.getView, parameter[]], call[superToast.getWindowManagerParams, parameter[]]]]
else begin[{]
None
end[}]
call[.sendDelayedMessage, parameter[member[.superToast], member[Messages.REMOVE_SUPERTOAST], binary_operation[call[superToast.getDuration, parameter[]], +, member[AnimationUtils.SHOW_DURATION]]]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[displaySuperToast] operator[SEP] identifier[SuperToast] identifier[superToast] operator[SEP] {
Keyword[if] operator[SEP] identifier[superToast] operator[SEP] identifier[isShowing] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP] Keyword[if] operator[SEP] identifier[superToast] Keyword[instanceof] identifier[SuperActivityToast] operator[SEP] {
Keyword[if] operator[SEP] operator[SEP] operator[SEP] identifier[SuperActivityToast] operator[SEP] identifier[superToast] operator[SEP] operator[SEP] identifier[getViewGroup] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[ERROR_SAT_VIEWGROUP_NULL] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[try] {
operator[SEP] operator[SEP] identifier[SuperActivityToast] operator[SEP] identifier[superToast] operator[SEP] operator[SEP] identifier[getViewGroup] operator[SEP] operator[SEP] operator[SEP] identifier[addView] operator[SEP] identifier[superToast] operator[SEP] identifier[getView] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] identifier[SuperActivityToast] operator[SEP] identifier[superToast] operator[SEP] operator[SEP] identifier[isFromOrientationChange] operator[SEP] operator[SEP] operator[SEP] {
identifier[AnimationUtils] operator[SEP] identifier[getShowAnimation] operator[SEP] operator[SEP] identifier[SuperActivityToast] operator[SEP] identifier[superToast] operator[SEP] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IllegalStateException] identifier[illegalStateException] operator[SEP] {
identifier[Log] operator[SEP] identifier[e] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[illegalStateException] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] operator[SEP] operator[SEP] identifier[SuperActivityToast] operator[SEP] identifier[superToast] operator[SEP] operator[SEP] identifier[isIndeterminate] operator[SEP] operator[SEP] operator[SEP] {
identifier[sendDelayedMessage] operator[SEP] identifier[superToast] , identifier[Messages] operator[SEP] identifier[REMOVE_SUPERTOAST] , identifier[superToast] operator[SEP] identifier[getDuration] operator[SEP] operator[SEP] operator[+] identifier[AnimationUtils] operator[SEP] identifier[SHOW_DURATION] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[final] identifier[WindowManager] identifier[windowManager] operator[=] operator[SEP] identifier[WindowManager] operator[SEP] identifier[superToast] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] identifier[getApplicationContext] operator[SEP] operator[SEP] operator[SEP] identifier[getSystemService] operator[SEP] identifier[Context] operator[SEP] identifier[WINDOW_SERVICE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[windowManager] operator[!=] Other[null] operator[SEP] {
identifier[windowManager] operator[SEP] identifier[addView] operator[SEP] identifier[superToast] operator[SEP] identifier[getView] operator[SEP] operator[SEP] , identifier[superToast] operator[SEP] identifier[getWindowManagerParams] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[sendDelayedMessage] operator[SEP] identifier[superToast] , identifier[Messages] operator[SEP] identifier[REMOVE_SUPERTOAST] , identifier[superToast] operator[SEP] identifier[getDuration] operator[SEP] operator[SEP] operator[+] identifier[AnimationUtils] operator[SEP] identifier[SHOW_DURATION] operator[SEP] operator[SEP]
}
}
|
@Deprecated
public static void find(String query, final ModelListener listener) {
ModelDelegate.findWith(modelClass(), listener, query);
} | class class_name[name] begin[{]
method[find, return_type[void], modifier[public static], parameter[query, listener]] begin[{]
call[ModelDelegate.findWith, parameter[call[.modelClass, parameter[]], member[.listener], member[.query]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[static] Keyword[void] identifier[find] operator[SEP] identifier[String] identifier[query] , Keyword[final] identifier[ModelListener] identifier[listener] operator[SEP] {
identifier[ModelDelegate] operator[SEP] identifier[findWith] operator[SEP] identifier[modelClass] operator[SEP] operator[SEP] , identifier[listener] , identifier[query] operator[SEP] operator[SEP]
}
|
final void resumeGlobalTx(Transaction control, int action) //LIDB1673.2.1.5
throws CSIException
{
try {
txCtrl.resumeGlobalTx(control, action);
// d165585 Begins
if (TraceComponent.isAnyTracingEnabled() && // d527372
TETxLifeCycleInfo.isTraceEnabled()) // PQ74774
{ // PQ74774
String idStr = txCtrl.txService.getTransaction().toString();
int idx;
idStr = (idStr != null)
? (((idx = idStr.indexOf("(")) != -1)
? idStr.substring(idx + 1, idStr.indexOf(")"))
: ((idx = idStr.indexOf("tid=")) != -1)
? idStr.substring(idx + 4)
: idStr)
: "NoTx";
TETxLifeCycleInfo.traceGlobalTxResume(idStr, "Resume Global Tx");
} // PQ74774
// d165585 Ends
} catch (Exception ex) { //LIDB1673.2.1.5
FFDCFilter.processException(ex, CLASS_NAME + ".resumeGlobalTx",
"335", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Global tx resume failed", ex);
}
throw new CSIException("", ex);
}
} | class class_name[name] begin[{]
method[resumeGlobalTx, return_type[void], modifier[final], parameter[control, action]] begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=control, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=action, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=resumeGlobalTx, postfix_operators=[], prefix_operators=[], qualifier=txCtrl, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=TETxLifeCycleInfo, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getTransaction, postfix_operators=[], prefix_operators=[], qualifier=txCtrl.txService, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=idStr)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=idx)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=idStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=idStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="NoTx"), if_true=TernaryExpression(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=idStr, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), if_false=TernaryExpression(condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="tid=")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=idStr, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator=!=), if_false=MemberReference(member=idStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=idStr, selectors=[], type_arguments=None)), if_true=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=idx, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=")")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=idStr, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=idStr, selectors=[], type_arguments=None)))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=idStr, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Resume Global Tx")], member=traceGlobalTxResume, postfix_operators=[], prefix_operators=[], qualifier=TETxLifeCycleInfo, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=MemberReference(member=CLASS_NAME, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".resumeGlobalTx"), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="335"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=FFDCFilter, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=isAnyTracingEnabled, postfix_operators=[], prefix_operators=[], qualifier=TraceComponent, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=isEventEnabled, postfix_operators=[], prefix_operators=[], qualifier=tc, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Global tx resume failed"), MemberReference(member=ex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=event, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), 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=CSIException, sub_type=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[final] Keyword[void] identifier[resumeGlobalTx] operator[SEP] identifier[Transaction] identifier[control] , Keyword[int] identifier[action] operator[SEP] Keyword[throws] identifier[CSIException] {
Keyword[try] {
identifier[txCtrl] operator[SEP] identifier[resumeGlobalTx] operator[SEP] identifier[control] , identifier[action] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[TETxLifeCycleInfo] operator[SEP] identifier[isTraceEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[idStr] operator[=] identifier[txCtrl] operator[SEP] identifier[txService] operator[SEP] identifier[getTransaction] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[idx] operator[SEP] identifier[idStr] operator[=] operator[SEP] identifier[idStr] operator[!=] Other[null] operator[SEP] operator[?] operator[SEP] operator[SEP] operator[SEP] identifier[idx] operator[=] identifier[idStr] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] operator[?] identifier[idStr] operator[SEP] identifier[substring] operator[SEP] identifier[idx] operator[+] Other[1] , identifier[idStr] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[:] operator[SEP] operator[SEP] identifier[idx] operator[=] identifier[idStr] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[!=] operator[-] Other[1] operator[SEP] operator[?] identifier[idStr] operator[SEP] identifier[substring] operator[SEP] identifier[idx] operator[+] Other[4] operator[SEP] operator[:] identifier[idStr] operator[SEP] operator[:] literal[String] operator[SEP] identifier[TETxLifeCycleInfo] operator[SEP] identifier[traceGlobalTxResume] operator[SEP] identifier[idStr] , literal[String] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[ex] operator[SEP] {
identifier[FFDCFilter] operator[SEP] identifier[processException] operator[SEP] identifier[ex] , identifier[CLASS_NAME] operator[+] literal[String] , literal[String] , Keyword[this] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEventEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[Tr] operator[SEP] identifier[event] operator[SEP] identifier[tc] , literal[String] , identifier[ex] operator[SEP] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[CSIException] operator[SEP] literal[String] , identifier[ex] operator[SEP] operator[SEP]
}
}
|
@Trivial
public static boolean isSymbol(String s) {
if (s.length() > 3 && s.charAt(0) == '$' && s.charAt(1) == '{')
return true;
return false;
} | class class_name[name] begin[{]
method[isSymbol, return_type[type[boolean]], modifier[public static], parameter[s]] begin[{]
if[binary_operation[binary_operation[binary_operation[call[s.length, parameter[]], >, literal[3]], &&, binary_operation[call[s.charAt, parameter[literal[0]]], ==, literal['$']]], &&, binary_operation[call[s.charAt, parameter[literal[1]]], ==, literal['{']]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | annotation[@] identifier[Trivial] Keyword[public] Keyword[static] Keyword[boolean] identifier[isSymbol] operator[SEP] identifier[String] identifier[s] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[3] operator[&&] identifier[s] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[==] literal[String] operator[&&] identifier[s] operator[SEP] identifier[charAt] operator[SEP] Other[1] operator[SEP] operator[==] literal[String] operator[SEP] Keyword[return] literal[boolean] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
|
@SuppressWarnings("unchecked")
@Override
public Object convert(Object source)
{
Object value = source;
for (Converter<Object, Object> converter : converters)
{
if (converter != null)
{
value = converter.convert(value);
}
}
return value;
} | class class_name[name] begin[{]
method[convert, return_type[type[Object]], modifier[public], parameter[source]] begin[{]
local_variable[type[Object], value]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=converter, 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=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=convert, postfix_operators=[], prefix_operators=[], qualifier=converter, selectors=[], type_arguments=None)), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=converters, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=converter)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Converter, sub_type=None))), label=None)
return[member[.value]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[convert] operator[SEP] identifier[Object] identifier[source] operator[SEP] {
identifier[Object] identifier[value] operator[=] identifier[source] operator[SEP] Keyword[for] operator[SEP] identifier[Converter] operator[<] identifier[Object] , identifier[Object] operator[>] identifier[converter] operator[:] identifier[converters] operator[SEP] {
Keyword[if] operator[SEP] identifier[converter] operator[!=] Other[null] operator[SEP] {
identifier[value] operator[=] identifier[converter] operator[SEP] identifier[convert] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[value] operator[SEP]
}
|
public static <T> String toXml(T obj, XAlias[] xAlias,
XAliasField[] xAliasFields, XAliasAttribute[] xAliasAttributes,
XOmitField[] xOmitFields) {
return toXml(obj, xAlias, xAliasFields, xAliasAttributes, xOmitFields,
null, null, null);
} | class class_name[name] begin[{]
method[toXml, return_type[type[String]], modifier[public static], parameter[obj, xAlias, xAliasFields, xAliasAttributes, xOmitFields]] begin[{]
return[call[.toXml, parameter[member[.obj], member[.xAlias], member[.xAliasFields], member[.xAliasAttributes], member[.xOmitFields], literal[null], literal[null], literal[null]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[String] identifier[toXml] operator[SEP] identifier[T] identifier[obj] , identifier[XAlias] operator[SEP] operator[SEP] identifier[xAlias] , identifier[XAliasField] operator[SEP] operator[SEP] identifier[xAliasFields] , identifier[XAliasAttribute] operator[SEP] operator[SEP] identifier[xAliasAttributes] , identifier[XOmitField] operator[SEP] operator[SEP] identifier[xOmitFields] operator[SEP] {
Keyword[return] identifier[toXml] operator[SEP] identifier[obj] , identifier[xAlias] , identifier[xAliasFields] , identifier[xAliasAttributes] , identifier[xOmitFields] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP]
}
|
public void set(String name, Object obj) throws IOException {
if (name.equalsIgnoreCase(NUMBER)) {
if (!(obj instanceof BigInteger)) {
throw new IOException("Attribute must be of type BigInteger.");
}
crlNumber = (BigInteger)obj;
} else {
throw new IOException("Attribute name not recognized by"
+ " CertAttrSet:" + extensionName + ".");
}
encodeThis();
} | class class_name[name] begin[{]
method[set, return_type[void], modifier[public], parameter[name, obj]] begin[{]
if[call[name.equalsIgnoreCase, parameter[member[.NUMBER]]]] begin[{]
if[binary_operation[member[.obj], instanceof, type[BigInteger]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attribute must be of type BigInteger.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
else begin[{]
None
end[}]
assign[member[.crlNumber], Cast(expression=MemberReference(member=obj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None))]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attribute name not recognized by"), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" CertAttrSet:"), operator=+), operandr=MemberReference(member=extensionName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IOException, sub_type=None)), label=None)
end[}]
call[.encodeThis, parameter[]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[set] operator[SEP] identifier[String] identifier[name] , identifier[Object] identifier[obj] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[NUMBER] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[obj] Keyword[instanceof] identifier[BigInteger] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
identifier[crlNumber] operator[=] operator[SEP] identifier[BigInteger] operator[SEP] identifier[obj] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[IOException] operator[SEP] literal[String] operator[+] literal[String] operator[+] identifier[extensionName] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[encodeThis] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(Allowed allowed, ProtocolMarshaller protocolMarshaller) {
if (allowed == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(allowed.getPolicies(), POLICIES_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[allowed, protocolMarshaller]] begin[{]
if[binary_operation[member[.allowed], ==, 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=getPolicies, postfix_operators=[], prefix_operators=[], qualifier=allowed, selectors=[], type_arguments=None), MemberReference(member=POLICIES_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[Allowed] identifier[allowed] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[allowed] 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[allowed] operator[SEP] identifier[getPolicies] operator[SEP] operator[SEP] , identifier[POLICIES_BINDING] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SdkClientException] operator[SEP] literal[String] operator[+] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
}
|
@Override
public List<MessageHistory> getKeyHistory(String key, Long startTime, Long endTime, int count) throws MessageQueueException {
List<MessageHistory> list = Lists.newArrayList();
ColumnList<UUID> columns;
try {
columns = keyspace.prepareQuery(historyColumnFamily)
.setConsistencyLevel(consistencyLevel)
.getRow(key)
.execute()
.getResult();
} catch (ConnectionException e) {
throw new MessageQueueException("Failed to load history for " + key, e);
}
for (Column<UUID> column : columns) {
try {
list.add(deserializeString(column.getStringValue(), MessageHistory.class));
} catch (Exception e) {
LOG.info("Error deserializing history entry", e);
}
}
return list;
} | class class_name[name] begin[{]
method[getKeyHistory, return_type[type[List]], modifier[public], parameter[key, startTime, endTime, count]] begin[{]
local_variable[type[List], list]
local_variable[type[ColumnList], columns]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=historyColumnFamily, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=prepareQuery, postfix_operators=[], prefix_operators=[], qualifier=keyspace, selectors=[MethodInvocation(arguments=[MemberReference(member=consistencyLevel, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setConsistencyLevel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getRow, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getResult, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to load history for "), operandr=MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MessageQueueException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ConnectionException']))], finally_block=None, label=None, resources=None)
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getStringValue, postfix_operators=[], prefix_operators=[], qualifier=column, selectors=[], type_arguments=None), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MessageHistory, sub_type=None))], member=deserializeString, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=list, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error deserializing history entry"), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=info, 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)]), control=EnhancedForControl(iterable=MemberReference(member=columns, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=column)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=UUID, sub_type=None))], dimensions=[], name=Column, sub_type=None))), label=None)
return[member[.list]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[MessageHistory] operator[>] identifier[getKeyHistory] operator[SEP] identifier[String] identifier[key] , identifier[Long] identifier[startTime] , identifier[Long] identifier[endTime] , Keyword[int] identifier[count] operator[SEP] Keyword[throws] identifier[MessageQueueException] {
identifier[List] operator[<] identifier[MessageHistory] operator[>] identifier[list] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[ColumnList] operator[<] identifier[UUID] operator[>] identifier[columns] operator[SEP] Keyword[try] {
identifier[columns] operator[=] identifier[keyspace] operator[SEP] identifier[prepareQuery] operator[SEP] identifier[historyColumnFamily] operator[SEP] operator[SEP] identifier[setConsistencyLevel] operator[SEP] identifier[consistencyLevel] operator[SEP] operator[SEP] identifier[getRow] operator[SEP] identifier[key] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] identifier[getResult] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ConnectionException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MessageQueueException] operator[SEP] literal[String] operator[+] identifier[key] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[Column] operator[<] identifier[UUID] operator[>] identifier[column] operator[:] identifier[columns] operator[SEP] {
Keyword[try] {
identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[deserializeString] operator[SEP] identifier[column] operator[SEP] identifier[getStringValue] operator[SEP] operator[SEP] , identifier[MessageHistory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[LOG] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[list] operator[SEP]
}
|
public PaymillList<Client> list( Integer count, Integer offset ) {
return this.list( null, null, count, offset );
} | class class_name[name] begin[{]
method[list, return_type[type[PaymillList]], modifier[public], parameter[count, offset]] begin[{]
return[THIS[call[None.list, parameter[literal[null], literal[null], member[.count], member[.offset]]]]]
end[}]
END[}] | Keyword[public] identifier[PaymillList] operator[<] identifier[Client] operator[>] identifier[list] operator[SEP] identifier[Integer] identifier[count] , identifier[Integer] identifier[offset] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[list] operator[SEP] Other[null] , Other[null] , identifier[count] , identifier[offset] operator[SEP] operator[SEP]
}
|
private void parseTagDependentBody(Node parent, String tag)
throws JasperException{
Mark bodyStart = reader.mark();
Mark bodyEnd = reader.skipUntilETag(tag);
if (bodyEnd == null) {
err.jspError(start, "jsp.error.unterminated", "<"+tag );
}
new Node.TemplateText(reader.getText(bodyStart, bodyEnd), bodyStart,
parent);
} | class class_name[name] begin[{]
method[parseTagDependentBody, return_type[void], modifier[private], parameter[parent, tag]] begin[{]
local_variable[type[Mark], bodyStart]
local_variable[type[Mark], bodyEnd]
if[binary_operation[member[.bodyEnd], ==, literal[null]]] begin[{]
call[err.jspError, parameter[member[.start], literal["jsp.error.unterminated"], binary_operation[literal["<"], +, member[.tag]]]]
else begin[{]
None
end[}]
ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=bodyStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=bodyEnd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getText, postfix_operators=[], prefix_operators=[], qualifier=reader, selectors=[], type_arguments=None), MemberReference(member=bodyStart, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=parent, 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=Node, sub_type=ReferenceType(arguments=None, dimensions=None, name=TemplateText, sub_type=None)))
end[}]
END[}] | Keyword[private] Keyword[void] identifier[parseTagDependentBody] operator[SEP] identifier[Node] identifier[parent] , identifier[String] identifier[tag] operator[SEP] Keyword[throws] identifier[JasperException] {
identifier[Mark] identifier[bodyStart] operator[=] identifier[reader] operator[SEP] identifier[mark] operator[SEP] operator[SEP] operator[SEP] identifier[Mark] identifier[bodyEnd] operator[=] identifier[reader] operator[SEP] identifier[skipUntilETag] operator[SEP] identifier[tag] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[bodyEnd] operator[==] Other[null] operator[SEP] {
identifier[err] operator[SEP] identifier[jspError] operator[SEP] identifier[start] , literal[String] , literal[String] operator[+] identifier[tag] operator[SEP] operator[SEP]
}
Keyword[new] identifier[Node] operator[SEP] identifier[TemplateText] operator[SEP] identifier[reader] operator[SEP] identifier[getText] operator[SEP] identifier[bodyStart] , identifier[bodyEnd] operator[SEP] , identifier[bodyStart] , identifier[parent] operator[SEP] operator[SEP]
}
|
public Observable<List<ImageList>> getAllImageListsAsync() {
return getAllImageListsWithServiceResponseAsync().map(new Func1<ServiceResponse<List<ImageList>>, List<ImageList>>() {
@Override
public List<ImageList> call(ServiceResponse<List<ImageList>> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[getAllImageListsAsync, return_type[type[Observable]], modifier[public], parameter[]] begin[{]
return[call[.getAllImageListsWithServiceResponseAsync, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[List] operator[<] identifier[ImageList] operator[>] operator[>] identifier[getAllImageListsAsync] operator[SEP] operator[SEP] {
Keyword[return] identifier[getAllImageListsWithServiceResponseAsync] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[ImageList] operator[>] operator[>] , identifier[List] operator[<] identifier[ImageList] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[ImageList] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[ImageList] operator[>] operator[>] identifier[response] operator[SEP] {
Keyword[return] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
public T withSubItems(IDrawerItem... subItems) {
if (mSubItems == null) {
mSubItems = new ArrayList<>();
}
for (IDrawerItem subItem : subItems) {
subItem.withParent(this);
}
Collections.addAll(mSubItems, subItems);
return (T) this;
} | class class_name[name] begin[{]
method[withSubItems, return_type[type[T]], modifier[public], parameter[subItems]] begin[{]
if[binary_operation[member[.mSubItems], ==, literal[null]]] begin[{]
assign[member[.mSubItems], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
None
end[}]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=withParent, postfix_operators=[], prefix_operators=[], qualifier=subItem, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=subItems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subItem)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IDrawerItem, sub_type=None))), label=None)
call[Collections.addAll, parameter[member[.mSubItems], member[.subItems]]]
return[Cast(expression=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[T] identifier[withSubItems] operator[SEP] identifier[IDrawerItem] operator[...] identifier[subItems] operator[SEP] {
Keyword[if] operator[SEP] identifier[mSubItems] operator[==] Other[null] operator[SEP] {
identifier[mSubItems] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[for] operator[SEP] identifier[IDrawerItem] identifier[subItem] operator[:] identifier[subItems] operator[SEP] {
identifier[subItem] operator[SEP] identifier[withParent] operator[SEP] Keyword[this] operator[SEP] operator[SEP]
}
identifier[Collections] operator[SEP] identifier[addAll] operator[SEP] identifier[mSubItems] , identifier[subItems] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] Keyword[this] operator[SEP]
}
|
public ServiceFuture<WorkspaceInner> beginCreateAsync(String resourceGroupName, String workspaceName, WorkspaceCreateParameters parameters, final ServiceCallback<WorkspaceInner> serviceCallback) {
return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, workspaceName, parameters), serviceCallback);
} | class class_name[name] begin[{]
method[beginCreateAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, workspaceName, parameters, serviceCallback]] begin[{]
return[call[ServiceFuture.fromResponse, parameter[call[.beginCreateWithServiceResponseAsync, parameter[member[.resourceGroupName], member[.workspaceName], member[.parameters]]], member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[WorkspaceInner] operator[>] identifier[beginCreateAsync] operator[SEP] identifier[String] identifier[resourceGroupName] , identifier[String] identifier[workspaceName] , identifier[WorkspaceCreateParameters] identifier[parameters] , Keyword[final] identifier[ServiceCallback] operator[<] identifier[WorkspaceInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[ServiceFuture] operator[SEP] identifier[fromResponse] operator[SEP] identifier[beginCreateWithServiceResponseAsync] operator[SEP] identifier[resourceGroupName] , identifier[workspaceName] , identifier[parameters] operator[SEP] , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public double overlapRelative(DoubleRange other) {
double lenThis = length();
double lenOther = other.length();
if (lenThis == 0 && lenOther == 0) {
// check for single points being compared, if it's the same point overlap is 1
// if points are different, overlap is 0
return this.equals(other) ? 1 : 0;
}
double overlapAbs = overlapAbsolute(other);
return overlapAbs / Math
.max(lenThis, lenOther); // one of the lengths is guaranteed to be non-zero
} | class class_name[name] begin[{]
method[overlapRelative, return_type[type[double]], modifier[public], parameter[other]] begin[{]
local_variable[type[double], lenThis]
local_variable[type[double], lenOther]
if[binary_operation[binary_operation[member[.lenThis], ==, literal[0]], &&, binary_operation[member[.lenOther], ==, literal[0]]]] begin[{]
return[TernaryExpression(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=other, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]
else begin[{]
None
end[}]
local_variable[type[double], overlapAbs]
return[binary_operation[member[.overlapAbs], /, call[Math.max, parameter[member[.lenThis], member[.lenOther]]]]]
end[}]
END[}] | Keyword[public] Keyword[double] identifier[overlapRelative] operator[SEP] identifier[DoubleRange] identifier[other] operator[SEP] {
Keyword[double] identifier[lenThis] operator[=] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[double] identifier[lenOther] operator[=] identifier[other] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[lenThis] operator[==] Other[0] operator[&&] identifier[lenOther] operator[==] Other[0] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[equals] operator[SEP] identifier[other] operator[SEP] operator[?] Other[1] operator[:] Other[0] operator[SEP]
}
Keyword[double] identifier[overlapAbs] operator[=] identifier[overlapAbsolute] operator[SEP] identifier[other] operator[SEP] operator[SEP] Keyword[return] identifier[overlapAbs] operator[/] identifier[Math] operator[SEP] identifier[max] operator[SEP] identifier[lenThis] , identifier[lenOther] operator[SEP] operator[SEP]
}
|
public List<String> getSuggestedReplacements() {
List<String> l = new ArrayList<>();
for (SuggestedReplacement repl : suggestedReplacements) {
l.add(repl.getReplacement());
}
return Collections.unmodifiableList(l);
} | class class_name[name] begin[{]
method[getSuggestedReplacements, return_type[type[List]], modifier[public], parameter[]] begin[{]
local_variable[type[List], l]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getReplacement, postfix_operators=[], prefix_operators=[], qualifier=repl, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=suggestedReplacements, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=repl)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SuggestedReplacement, sub_type=None))), label=None)
return[call[Collections.unmodifiableList, parameter[member[.l]]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[String] operator[>] identifier[getSuggestedReplacements] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[l] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SuggestedReplacement] identifier[repl] operator[:] identifier[suggestedReplacements] operator[SEP] {
identifier[l] operator[SEP] identifier[add] operator[SEP] identifier[repl] operator[SEP] identifier[getReplacement] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[Collections] operator[SEP] identifier[unmodifiableList] operator[SEP] identifier[l] operator[SEP] operator[SEP]
}
|
@Nullable
public static String valueOrPropertyAsString(@Nullable final String value, @Nonnull final Property property, @Nullable final String defaultValue) {
return SimpleConversions.convertToString(valueOrProperty(value, property, defaultValue));
} | class class_name[name] begin[{]
method[valueOrPropertyAsString, return_type[type[String]], modifier[public static], parameter[value, property, defaultValue]] begin[{]
return[call[SimpleConversions.convertToString, parameter[call[.valueOrProperty, parameter[member[.value], member[.property], member[.defaultValue]]]]]]
end[}]
END[}] | annotation[@] identifier[Nullable] Keyword[public] Keyword[static] identifier[String] identifier[valueOrPropertyAsString] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[value] , annotation[@] identifier[Nonnull] Keyword[final] identifier[Property] identifier[property] , annotation[@] identifier[Nullable] Keyword[final] identifier[String] identifier[defaultValue] operator[SEP] {
Keyword[return] identifier[SimpleConversions] operator[SEP] identifier[convertToString] operator[SEP] identifier[valueOrProperty] operator[SEP] identifier[value] , identifier[property] , identifier[defaultValue] operator[SEP] operator[SEP] operator[SEP]
}
|
private void addTimeZoneOffset(Calendar c, StringBuilder sb) {
int min = (c.get(Calendar.ZONE_OFFSET) + c.get(Calendar.DST_OFFSET)) / 60000;
char op;
if (min < 0) {
op = '-';
min = min - min - min;
}
else op = '+';
int hours = min / 60;
min = min - (hours * 60);
sb.append(op);
toString(sb, hours, 2);
sb.append(':');
toString(sb, min, 2);
} | class class_name[name] begin[{]
method[addTimeZoneOffset, return_type[void], modifier[private], parameter[c, sb]] begin[{]
local_variable[type[int], min]
local_variable[type[char], op]
if[binary_operation[member[.min], <, literal[0]]] begin[{]
assign[member[.op], literal['-']]
assign[member[.min], binary_operation[binary_operation[member[.min], -, member[.min]], -, member[.min]]]
else begin[{]
assign[member[.op], literal['+']]
end[}]
local_variable[type[int], hours]
assign[member[.min], binary_operation[member[.min], -, binary_operation[member[.hours], *, literal[60]]]]
call[sb.append, parameter[member[.op]]]
call[.toString, parameter[member[.sb], member[.hours], literal[2]]]
call[sb.append, parameter[literal[':']]]
call[.toString, parameter[member[.sb], member[.min], literal[2]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addTimeZoneOffset] operator[SEP] identifier[Calendar] identifier[c] , identifier[StringBuilder] identifier[sb] operator[SEP] {
Keyword[int] identifier[min] operator[=] operator[SEP] identifier[c] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[ZONE_OFFSET] operator[SEP] operator[+] identifier[c] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DST_OFFSET] operator[SEP] operator[SEP] operator[/] Other[60000] operator[SEP] Keyword[char] identifier[op] operator[SEP] Keyword[if] operator[SEP] identifier[min] operator[<] Other[0] operator[SEP] {
identifier[op] operator[=] literal[String] operator[SEP] identifier[min] operator[=] identifier[min] operator[-] identifier[min] operator[-] identifier[min] operator[SEP]
}
Keyword[else] identifier[op] operator[=] literal[String] operator[SEP] Keyword[int] identifier[hours] operator[=] identifier[min] operator[/] Other[60] operator[SEP] identifier[min] operator[=] identifier[min] operator[-] operator[SEP] identifier[hours] operator[*] Other[60] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[op] operator[SEP] operator[SEP] identifier[toString] operator[SEP] identifier[sb] , identifier[hours] , Other[2] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[toString] operator[SEP] identifier[sb] , identifier[min] , Other[2] operator[SEP] operator[SEP]
}
|
public WdrVideoDto parse(String jsUrl) {
WdrVideoDto dto = new WdrVideoDto();
String javascript = urlLoader.executeRequest(jsUrl);
if(javascript.isEmpty()) {
return dto;
}
// URL suchen
String url = getSubstring(javascript, JS_SEARCH_ALT, "\"");
String f4m = getSubstring(javascript, JS_SEARCH_DFLT, "\"");
// Fehlendes Protokoll ergänzen, wenn es fehlt. kommt teilweise vor.
String protocol = jsUrl.substring(0, jsUrl.indexOf(':'));
url = addProtocolIfMissing(url, protocol);
f4m = addProtocolIfMissing(f4m, protocol);
if (url.endsWith(".m3u8")) {
fillUrlsFromM3u8(dto, url);
}
if (!f4m.isEmpty() && url.contains("_") && url.endsWith(".mp4")) {
fillUrlsFromf4m(dto, f4m, url);
}
dto.setSubtitleUrl(addProtocolIfMissing(getSubstring(javascript, "\"captionURL\":\"", "\""), protocol));
return dto;
} | class class_name[name] begin[{]
method[parse, return_type[type[WdrVideoDto]], modifier[public], parameter[jsUrl]] begin[{]
local_variable[type[WdrVideoDto], dto]
local_variable[type[String], javascript]
if[call[javascript.isEmpty, parameter[]]] begin[{]
return[member[.dto]]
else begin[{]
None
end[}]
local_variable[type[String], url]
local_variable[type[String], f4m]
local_variable[type[String], protocol]
assign[member[.url], call[.addProtocolIfMissing, parameter[member[.url], member[.protocol]]]]
assign[member[.f4m], call[.addProtocolIfMissing, parameter[member[.f4m], member[.protocol]]]]
if[call[url.endsWith, parameter[literal[".m3u8"]]]] begin[{]
call[.fillUrlsFromM3u8, parameter[member[.dto], member[.url]]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[f4m.isEmpty, parameter[]], &&, call[url.contains, parameter[literal["_"]]]], &&, call[url.endsWith, parameter[literal[".mp4"]]]]] begin[{]
call[.fillUrlsFromf4m, parameter[member[.dto], member[.f4m], member[.url]]]
else begin[{]
None
end[}]
call[dto.setSubtitleUrl, parameter[call[.addProtocolIfMissing, parameter[call[.getSubstring, parameter[member[.javascript], literal["\"captionURL\":\""], literal["\""]]], member[.protocol]]]]]
return[member[.dto]]
end[}]
END[}] | Keyword[public] identifier[WdrVideoDto] identifier[parse] operator[SEP] identifier[String] identifier[jsUrl] operator[SEP] {
identifier[WdrVideoDto] identifier[dto] operator[=] Keyword[new] identifier[WdrVideoDto] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[javascript] operator[=] identifier[urlLoader] operator[SEP] identifier[executeRequest] operator[SEP] identifier[jsUrl] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[javascript] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[dto] operator[SEP]
}
identifier[String] identifier[url] operator[=] identifier[getSubstring] operator[SEP] identifier[javascript] , identifier[JS_SEARCH_ALT] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[f4m] operator[=] identifier[getSubstring] operator[SEP] identifier[javascript] , identifier[JS_SEARCH_DFLT] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[protocol] operator[=] identifier[jsUrl] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[jsUrl] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[url] operator[=] identifier[addProtocolIfMissing] operator[SEP] identifier[url] , identifier[protocol] operator[SEP] operator[SEP] identifier[f4m] operator[=] identifier[addProtocolIfMissing] operator[SEP] identifier[f4m] , identifier[protocol] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[url] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[fillUrlsFromM3u8] operator[SEP] identifier[dto] , identifier[url] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[f4m] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[&&] identifier[url] operator[SEP] identifier[contains] operator[SEP] literal[String] operator[SEP] operator[&&] identifier[url] operator[SEP] identifier[endsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[fillUrlsFromf4m] operator[SEP] identifier[dto] , identifier[f4m] , identifier[url] operator[SEP] operator[SEP]
}
identifier[dto] operator[SEP] identifier[setSubtitleUrl] operator[SEP] identifier[addProtocolIfMissing] operator[SEP] identifier[getSubstring] operator[SEP] identifier[javascript] , literal[String] , literal[String] operator[SEP] , identifier[protocol] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dto] operator[SEP]
}
|
@Override
public SipPacket frame(final TransportPacket parent, final Buffer buffer) throws IOException {
if (parent == null) {
throw new IllegalArgumentException("The parent frame cannot be null");
}
final SipMessage sip = SipParser.frame(buffer);
if (sip.isRequest()) {
return new SipRequestPacketImpl(parent, sip.toRequest());
}
return new SipResponsePacketImpl(parent, sip.toResponse());
} | class class_name[name] begin[{]
method[frame, return_type[type[SipPacket]], modifier[public], parameter[parent, buffer]] begin[{]
if[binary_operation[member[.parent], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The parent frame 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[SipMessage], sip]
if[call[sip.isRequest, parameter[]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toRequest, postfix_operators=[], prefix_operators=[], qualifier=sip, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SipRequestPacketImpl, sub_type=None))]
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=parent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=toResponse, postfix_operators=[], prefix_operators=[], qualifier=sip, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SipResponsePacketImpl, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[SipPacket] identifier[frame] operator[SEP] Keyword[final] identifier[TransportPacket] identifier[parent] , Keyword[final] identifier[Buffer] identifier[buffer] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[parent] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] identifier[SipMessage] identifier[sip] operator[=] identifier[SipParser] operator[SEP] identifier[frame] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[sip] operator[SEP] identifier[isRequest] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[SipRequestPacketImpl] operator[SEP] identifier[parent] , identifier[sip] operator[SEP] identifier[toRequest] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[SipResponsePacketImpl] operator[SEP] identifier[parent] , identifier[sip] operator[SEP] identifier[toResponse] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
private static void openDialog(String uploadTarget) {
try {
A_CmsUploadDialog dialog = GWT.create(CmsUploadDialogImpl.class);
dialog.setContext(new I_CmsUploadContext() {
public void onUploadFinished(List<String> uploadedFiles) {
Window.Location.reload();
}
});
dialog.setTargetFolder(uploadTarget);
dialog.loadAndShow();
} catch (Exception e) {
CmsErrorDialog.handleException(
new Exception(
"Deserialization of dialog data failed. This may be caused by expired java-script resources, please clear your browser cache and try again.",
e));
}
} | class class_name[name] begin[{]
method[openDialog, return_type[void], modifier[private static], parameter[uploadTarget]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CmsUploadDialogImpl, sub_type=None))], member=create, postfix_operators=[], prefix_operators=[], qualifier=GWT, selectors=[], type_arguments=None), name=dialog)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=A_CmsUploadDialog, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[], body=[StatementExpression(expression=MethodInvocation(arguments=[], member=reload, postfix_operators=[], prefix_operators=[], qualifier=Window.Location, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=onUploadFinished, parameters=[FormalParameter(annotations=[], modifiers=set(), name=uploadedFiles, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None), varargs=False)], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=I_CmsUploadContext, sub_type=None))], member=setContext, postfix_operators=[], prefix_operators=[], qualifier=dialog, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=uploadTarget, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setTargetFolder, postfix_operators=[], prefix_operators=[], qualifier=dialog, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[], member=loadAndShow, postfix_operators=[], prefix_operators=[], qualifier=dialog, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Deserialization of dialog data failed. This may be caused by expired java-script resources, please clear your browser cache and try again."), 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=Exception, sub_type=None))], member=handleException, postfix_operators=[], prefix_operators=[], qualifier=CmsErrorDialog, 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[}] | Keyword[private] Keyword[static] Keyword[void] identifier[openDialog] operator[SEP] identifier[String] identifier[uploadTarget] operator[SEP] {
Keyword[try] {
identifier[A_CmsUploadDialog] identifier[dialog] operator[=] identifier[GWT] operator[SEP] identifier[create] operator[SEP] identifier[CmsUploadDialogImpl] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[dialog] operator[SEP] identifier[setContext] operator[SEP] Keyword[new] identifier[I_CmsUploadContext] operator[SEP] operator[SEP] {
Keyword[public] Keyword[void] identifier[onUploadFinished] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[uploadedFiles] operator[SEP] {
identifier[Window] operator[SEP] identifier[Location] operator[SEP] identifier[reload] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[dialog] operator[SEP] identifier[setTargetFolder] operator[SEP] identifier[uploadTarget] operator[SEP] operator[SEP] identifier[dialog] operator[SEP] identifier[loadAndShow] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[CmsErrorDialog] operator[SEP] identifier[handleException] operator[SEP] Keyword[new] identifier[Exception] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private static void checkNamedOutput(JobConf conf, String namedOutput,
boolean alreadyDefined) {
List<String> definedChannels = getNamedOutputsList(conf);
if (alreadyDefined && definedChannels.contains(namedOutput)) {
throw new IllegalArgumentException("Named output '" + namedOutput +
"' already alreadyDefined");
} else if (!alreadyDefined && !definedChannels.contains(namedOutput)) {
throw new IllegalArgumentException("Named output '" + namedOutput +
"' not defined");
}
} | class class_name[name] begin[{]
method[checkNamedOutput, return_type[void], modifier[private static], parameter[conf, namedOutput, alreadyDefined]] begin[{]
local_variable[type[List], definedChannels]
if[binary_operation[member[.alreadyDefined], &&, call[definedChannels.contains, parameter[member[.namedOutput]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Named output '"), operandr=MemberReference(member=namedOutput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' already alreadyDefined"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
if[binary_operation[member[.alreadyDefined], &&, call[definedChannels.contains, parameter[member[.namedOutput]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Named output '"), operandr=MemberReference(member=namedOutput, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' not defined"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[checkNamedOutput] operator[SEP] identifier[JobConf] identifier[conf] , identifier[String] identifier[namedOutput] , Keyword[boolean] identifier[alreadyDefined] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[definedChannels] operator[=] identifier[getNamedOutputsList] operator[SEP] identifier[conf] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[alreadyDefined] operator[&&] identifier[definedChannels] operator[SEP] identifier[contains] operator[SEP] identifier[namedOutput] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[namedOutput] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[!] identifier[alreadyDefined] operator[&&] operator[!] identifier[definedChannels] operator[SEP] identifier[contains] operator[SEP] identifier[namedOutput] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[namedOutput] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
|
public static boolean isValid(String s) {
if (s == null) {
return false;
}
s = StrUtil.removeAll(s, "-");
final int len = s.length();
if (len != 24) {
return false;
}
char c;
for (int i = 0; i < len; i++) {
c = s.charAt(i);
if (c >= '0' && c <= '9') {
continue;
}
if (c >= 'a' && c <= 'f') {
continue;
}
if (c >= 'A' && c <= 'F') {
continue;
}
return false;
}
return true;
} | class class_name[name] begin[{]
method[isValid, return_type[type[boolean]], modifier[public static], parameter[s]] begin[{]
if[binary_operation[member[.s], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
assign[member[.s], call[StrUtil.removeAll, parameter[member[.s], literal["-"]]]]
local_variable[type[int], len]
if[binary_operation[member[.len], !=, literal[24]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
local_variable[type[char], c]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=charAt, postfix_operators=[], prefix_operators=[], qualifier=s, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='0'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='9'), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='a'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='f'), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='A'), operator=>=), operandr=BinaryOperation(operandl=MemberReference(member=c, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='F'), operator=<=), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[true]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isValid] operator[SEP] identifier[String] identifier[s] operator[SEP] {
Keyword[if] operator[SEP] identifier[s] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[s] operator[=] identifier[StrUtil] operator[SEP] identifier[removeAll] operator[SEP] identifier[s] , literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[len] operator[=] identifier[s] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[len] operator[!=] Other[24] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[char] identifier[c] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[len] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[c] operator[=] identifier[s] operator[SEP] identifier[charAt] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[>=] literal[String] operator[&&] identifier[c] operator[<=] literal[String] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[>=] literal[String] operator[&&] identifier[c] operator[<=] literal[String] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[if] operator[SEP] identifier[c] operator[>=] literal[String] operator[&&] identifier[c] operator[<=] literal[String] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
@Nonnull
public String getCodeWithTerritory(final int precision, @Nullable final Alphabet alphabet) throws IllegalArgumentException {
return territory.toString() + ' ' + getCode(precision, alphabet);
} | class class_name[name] begin[{]
method[getCodeWithTerritory, return_type[type[String]], modifier[public], parameter[precision, alphabet]] begin[{]
return[binary_operation[binary_operation[call[territory.toString, parameter[]], +, literal[' ']], +, call[.getCode, parameter[member[.precision], member[.alphabet]]]]]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] identifier[String] identifier[getCodeWithTerritory] operator[SEP] Keyword[final] Keyword[int] identifier[precision] , annotation[@] identifier[Nullable] Keyword[final] identifier[Alphabet] identifier[alphabet] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] {
Keyword[return] identifier[territory] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getCode] operator[SEP] identifier[precision] , identifier[alphabet] operator[SEP] operator[SEP]
}
|
private void adjustToCurrentFormat() {
// in case of a locked or fixed image ratio height and width need to be reset
int height = m_croppingParam.getOrgHeight();
int width = m_croppingParam.getOrgWidth();
if (m_croppingParam.isScaled()) {
if (m_croppingParam.getTargetHeight() == -1) {
height = (int)Math.floor(
((1.00 * m_croppingParam.getOrgHeight()) / m_croppingParam.getOrgWidth())
* m_croppingParam.getTargetWidth());
} else {
height = m_croppingParam.getTargetHeight();
}
if (m_croppingParam.getTargetWidth() == -1) {
width = (int)Math.floor(
((1.00 * m_croppingParam.getOrgWidth()) / m_croppingParam.getOrgHeight())
* m_croppingParam.getTargetHeight());
} else {
width = m_croppingParam.getTargetWidth();
}
} else {
m_croppingParam.setTargetHeight(height);
m_croppingParam.setTargetWidth(width);
}
m_formatForm.setHeightInput(height);
m_formatForm.setWidthInput(width);
// enabling/disabling ratio lock button
if (m_currentFormat.isFixedRatio()) {
m_formatForm.setRatioButton(false, false, Messages.get().key(Messages.GUI_PRIVIEW_BUTTON_RATIO_FIXED_0));
m_ratioLocked = true;
} else {
if (!m_currentFormat.isHeightEditable() && !m_currentFormat.isWidthEditable()) {
// neither height nor width are editable, disable ratio lock button
m_formatForm.setRatioButton(
false,
false,
Messages.get().key(Messages.GUI_PRIVIEW_BUTTON_NOT_EDITABLE_0));
} else {
m_formatForm.setRatioButton(false, true, null);
}
m_ratioLocked = true;
}
// enabling/disabling height and width input
m_formatForm.setHeightInputEnabled(m_currentFormat.isHeightEditable() || hasUserFormatRestriction());
m_formatForm.setWidthInputEnabled(m_currentFormat.isWidthEditable() || hasUserFormatRestriction());
} | class class_name[name] begin[{]
method[adjustToCurrentFormat, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[int], height]
local_variable[type[int], width]
if[call[m_croppingParam.isScaled, parameter[]]] begin[{]
if[binary_operation[call[m_croppingParam.getTargetHeight, parameter[]], ==, literal[1]]] begin[{]
assign[member[.height], Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.00), operandr=MethodInvocation(arguments=[], member=getOrgHeight, postfix_operators=[], prefix_operators=[], qualifier=m_croppingParam, selectors=[], type_arguments=None), operator=*), operandr=MethodInvocation(arguments=[], member=getOrgWidth, postfix_operators=[], prefix_operators=[], qualifier=m_croppingParam, selectors=[], type_arguments=None), operator=/), operandr=MethodInvocation(arguments=[], member=getTargetWidth, postfix_operators=[], prefix_operators=[], qualifier=m_croppingParam, selectors=[], type_arguments=None), operator=*)], member=floor, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]
else begin[{]
assign[member[.height], call[m_croppingParam.getTargetHeight, parameter[]]]
end[}]
if[binary_operation[call[m_croppingParam.getTargetWidth, parameter[]], ==, literal[1]]] begin[{]
assign[member[.width], Cast(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.00), operandr=MethodInvocation(arguments=[], member=getOrgWidth, postfix_operators=[], prefix_operators=[], qualifier=m_croppingParam, selectors=[], type_arguments=None), operator=*), operandr=MethodInvocation(arguments=[], member=getOrgHeight, postfix_operators=[], prefix_operators=[], qualifier=m_croppingParam, selectors=[], type_arguments=None), operator=/), operandr=MethodInvocation(arguments=[], member=getTargetHeight, postfix_operators=[], prefix_operators=[], qualifier=m_croppingParam, selectors=[], type_arguments=None), operator=*)], member=floor, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=int))]
else begin[{]
assign[member[.width], call[m_croppingParam.getTargetWidth, parameter[]]]
end[}]
else begin[{]
call[m_croppingParam.setTargetHeight, parameter[member[.height]]]
call[m_croppingParam.setTargetWidth, parameter[member[.width]]]
end[}]
call[m_formatForm.setHeightInput, parameter[member[.height]]]
call[m_formatForm.setWidthInput, parameter[member[.width]]]
if[call[m_currentFormat.isFixedRatio, parameter[]]] begin[{]
call[m_formatForm.setRatioButton, parameter[literal[false], literal[false], call[Messages.get, parameter[]]]]
assign[member[.m_ratioLocked], literal[true]]
else begin[{]
if[binary_operation[call[m_currentFormat.isHeightEditable, parameter[]], &&, call[m_currentFormat.isWidthEditable, parameter[]]]] begin[{]
call[m_formatForm.setRatioButton, parameter[literal[false], literal[false], call[Messages.get, parameter[]]]]
else begin[{]
call[m_formatForm.setRatioButton, parameter[literal[false], literal[true], literal[null]]]
end[}]
assign[member[.m_ratioLocked], literal[true]]
end[}]
call[m_formatForm.setHeightInputEnabled, parameter[binary_operation[call[m_currentFormat.isHeightEditable, parameter[]], ||, call[.hasUserFormatRestriction, parameter[]]]]]
call[m_formatForm.setWidthInputEnabled, parameter[binary_operation[call[m_currentFormat.isWidthEditable, parameter[]], ||, call[.hasUserFormatRestriction, parameter[]]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[adjustToCurrentFormat] operator[SEP] operator[SEP] {
Keyword[int] identifier[height] operator[=] identifier[m_croppingParam] operator[SEP] identifier[getOrgHeight] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[width] operator[=] identifier[m_croppingParam] operator[SEP] identifier[getOrgWidth] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_croppingParam] operator[SEP] identifier[isScaled] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[m_croppingParam] operator[SEP] identifier[getTargetHeight] operator[SEP] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] {
identifier[height] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[floor] operator[SEP] operator[SEP] operator[SEP] literal[Float] operator[*] identifier[m_croppingParam] operator[SEP] identifier[getOrgHeight] operator[SEP] operator[SEP] operator[SEP] operator[/] identifier[m_croppingParam] operator[SEP] identifier[getOrgWidth] operator[SEP] operator[SEP] operator[SEP] operator[*] identifier[m_croppingParam] operator[SEP] identifier[getTargetWidth] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[height] operator[=] identifier[m_croppingParam] operator[SEP] identifier[getTargetHeight] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[m_croppingParam] operator[SEP] identifier[getTargetWidth] operator[SEP] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] {
identifier[width] operator[=] operator[SEP] Keyword[int] operator[SEP] identifier[Math] operator[SEP] identifier[floor] operator[SEP] operator[SEP] operator[SEP] literal[Float] operator[*] identifier[m_croppingParam] operator[SEP] identifier[getOrgWidth] operator[SEP] operator[SEP] operator[SEP] operator[/] identifier[m_croppingParam] operator[SEP] identifier[getOrgHeight] operator[SEP] operator[SEP] operator[SEP] operator[*] identifier[m_croppingParam] operator[SEP] identifier[getTargetHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[width] operator[=] identifier[m_croppingParam] operator[SEP] identifier[getTargetWidth] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[m_croppingParam] operator[SEP] identifier[setTargetHeight] operator[SEP] identifier[height] operator[SEP] operator[SEP] identifier[m_croppingParam] operator[SEP] identifier[setTargetWidth] operator[SEP] identifier[width] operator[SEP] operator[SEP]
}
identifier[m_formatForm] operator[SEP] identifier[setHeightInput] operator[SEP] identifier[height] operator[SEP] operator[SEP] identifier[m_formatForm] operator[SEP] identifier[setWidthInput] operator[SEP] identifier[width] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[m_currentFormat] operator[SEP] identifier[isFixedRatio] operator[SEP] operator[SEP] operator[SEP] {
identifier[m_formatForm] operator[SEP] identifier[setRatioButton] operator[SEP] literal[boolean] , literal[boolean] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_PRIVIEW_BUTTON_RATIO_FIXED_0] operator[SEP] operator[SEP] operator[SEP] identifier[m_ratioLocked] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] operator[!] identifier[m_currentFormat] operator[SEP] identifier[isHeightEditable] operator[SEP] operator[SEP] operator[&&] operator[!] identifier[m_currentFormat] operator[SEP] identifier[isWidthEditable] operator[SEP] operator[SEP] operator[SEP] {
identifier[m_formatForm] operator[SEP] identifier[setRatioButton] operator[SEP] literal[boolean] , literal[boolean] , identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[GUI_PRIVIEW_BUTTON_NOT_EDITABLE_0] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[m_formatForm] operator[SEP] identifier[setRatioButton] operator[SEP] literal[boolean] , literal[boolean] , Other[null] operator[SEP] operator[SEP]
}
identifier[m_ratioLocked] operator[=] literal[boolean] operator[SEP]
}
identifier[m_formatForm] operator[SEP] identifier[setHeightInputEnabled] operator[SEP] identifier[m_currentFormat] operator[SEP] identifier[isHeightEditable] operator[SEP] operator[SEP] operator[||] identifier[hasUserFormatRestriction] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_formatForm] operator[SEP] identifier[setWidthInputEnabled] operator[SEP] identifier[m_currentFormat] operator[SEP] identifier[isWidthEditable] operator[SEP] operator[SEP] operator[||] identifier[hasUserFormatRestriction] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public final Stream<T> setTimeout(@Nullable final Long timestamp) {
Preconditions.checkArgument(timestamp == null || timestamp > System.currentTimeMillis());
synchronized (this.state) {
if (this.state.closed) {
return this; // NOP, already closed
}
if (this.state.timeoutFuture != null) {
if (!this.state.timeoutFuture.cancel(false)) {
return this; // NOP, timeout already occurred
}
}
if (timestamp != null) {
this.state.timeoutFuture = Data.getExecutor().schedule(new Runnable() {
@Override
public void run() {
close();
}
}, Math.max(0, timestamp - System.currentTimeMillis()), TimeUnit.MILLISECONDS);
}
return this;
}
} | class class_name[name] begin[{]
method[setTimeout, return_type[type[Stream]], modifier[final public], parameter[timestamp]] begin[{]
call[Preconditions.checkArgument, parameter[binary_operation[binary_operation[member[.timestamp], ==, literal[null]], ||, binary_operation[member[.timestamp], >, call[System.currentTimeMillis, parameter[]]]]]]
SYNCHRONIZED[THIS[member[None.state]]] BEGIN[{]
if[THIS[member[None.state]member[None.closed]]] begin[{]
return[THIS[]]
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.state]member[None.timeoutFuture]], !=, literal[null]]] begin[{]
if[THIS[member[None.state]member[None.timeoutFuture]call[None.cancel, parameter[literal[false]]]]] begin[{]
return[THIS[]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
if[binary_operation[member[.timestamp], !=, literal[null]]] begin[{]
assign[THIS[member[None.state]member[None.timeoutFuture]], call[Data.getExecutor, parameter[]]]
else begin[{]
None
end[}]
return[THIS[]]
END[}]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[Stream] operator[<] identifier[T] operator[>] identifier[setTimeout] operator[SEP] annotation[@] identifier[Nullable] Keyword[final] identifier[Long] identifier[timestamp] operator[SEP] {
identifier[Preconditions] operator[SEP] identifier[checkArgument] operator[SEP] identifier[timestamp] operator[==] Other[null] operator[||] identifier[timestamp] operator[>] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[state] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[closed] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[timeoutFuture] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] operator[!] Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[timeoutFuture] operator[SEP] identifier[cancel] operator[SEP] literal[boolean] operator[SEP] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[timestamp] operator[!=] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[timeoutFuture] operator[=] identifier[Data] operator[SEP] identifier[getExecutor] operator[SEP] operator[SEP] operator[SEP] identifier[schedule] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[close] operator[SEP] operator[SEP] operator[SEP]
}
} , identifier[Math] operator[SEP] identifier[max] operator[SEP] Other[0] , identifier[timestamp] operator[-] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] , identifier[TimeUnit] operator[SEP] identifier[MILLISECONDS] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[this] operator[SEP]
}
}
|
protected void setTTEClassDefinition(String tteClass, Identification id, Attributes attr) {
this.tteCD = ClassDefinitionImpl.toClassDefinition(tteClass, id, attr);
} | class class_name[name] begin[{]
method[setTTEClassDefinition, return_type[void], modifier[protected], parameter[tteClass, id, attr]] begin[{]
assign[THIS[member[None.tteCD]], call[ClassDefinitionImpl.toClassDefinition, parameter[member[.tteClass], member[.id], member[.attr]]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[setTTEClassDefinition] operator[SEP] identifier[String] identifier[tteClass] , identifier[Identification] identifier[id] , identifier[Attributes] identifier[attr] operator[SEP] {
Keyword[this] operator[SEP] identifier[tteCD] operator[=] identifier[ClassDefinitionImpl] operator[SEP] identifier[toClassDefinition] operator[SEP] identifier[tteClass] , identifier[id] , identifier[attr] operator[SEP] operator[SEP]
}
|
public static <V> Fiber<V> create(String name, int stackSize) {
return new Fiber<>(name, stackSize);
} | class class_name[name] begin[{]
method[create, return_type[type[Fiber]], modifier[public static], parameter[name, stackSize]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=stackSize, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=Fiber, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[V] operator[>] identifier[Fiber] operator[<] identifier[V] operator[>] identifier[create] operator[SEP] identifier[String] identifier[name] , Keyword[int] identifier[stackSize] operator[SEP] {
Keyword[return] Keyword[new] identifier[Fiber] operator[<] operator[>] operator[SEP] identifier[name] , identifier[stackSize] operator[SEP] operator[SEP]
}
|
@Override
TarBzInputStream getInputStreamForRawStream(final InputStream in) throws IOException {
assert in != null : "Specified inputstream was null";
return new TarBzInputStream(in);
} | class class_name[name] begin[{]
method[getInputStreamForRawStream, return_type[type[TarBzInputStream]], modifier[default], parameter[in]] begin[{]
AssertStatement(condition=BinaryOperation(operandl=MemberReference(member=in, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), label=None, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Specified inputstream was null"))
return[ClassCreator(arguments=[MemberReference(member=in, 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=TarBzInputStream, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Override] identifier[TarBzInputStream] identifier[getInputStreamForRawStream] operator[SEP] Keyword[final] identifier[InputStream] identifier[in] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[assert] identifier[in] operator[!=] Other[null] operator[:] literal[String] operator[SEP] Keyword[return] Keyword[new] identifier[TarBzInputStream] operator[SEP] identifier[in] operator[SEP] operator[SEP]
}
|
public WriteableLogRecord getWriteableLogRecord(int recordLength, long sequenceNumber) throws InternalLogException
{
if (!_headerFlushedFollowingRestart)
{
// ensure header is updated now we start to write records for the first time
// synchronization is assured through locks in LogHandle.getWriteableLogRecord
writeFileHeader(true);
_headerFlushedFollowingRestart = true;
}
if (tc.isEntryEnabled())
Tr.entry(tc, "getWriteableLogRecord", new Object[] { new Integer(recordLength), new Long(sequenceNumber), this });
// Create a slice of the file buffer and reset its limit to the size of the WriteableLogRecord.
// The view buffer's content is a shared subsequence of the file buffer.
// No other log records have access to this log record's view buffer.
ByteBuffer viewBuffer = (ByteBuffer) _fileBuffer.slice().limit(recordLength + WriteableLogRecord.HEADER_SIZE);
WriteableLogRecord writeableLogRecord = new WriteableLogRecord(viewBuffer, sequenceNumber, recordLength, _fileBuffer.position());
// Advance the file buffer's position to the end of the newly created WriteableLogRecord
_fileBuffer.position(_fileBuffer.position() + recordLength + WriteableLogRecord.HEADER_SIZE);
_outstandingWritableLogRecords.incrementAndGet();
if (tc.isEntryEnabled())
Tr.exit(tc, "getWriteableLogRecord", writeableLogRecord);
return writeableLogRecord;
} | class class_name[name] begin[{]
method[getWriteableLogRecord, return_type[type[WriteableLogRecord]], modifier[public], parameter[recordLength, sequenceNumber]] begin[{]
if[member[._headerFlushedFollowingRestart]] begin[{]
call[.writeFileHeader, parameter[literal[true]]]
assign[member[._headerFlushedFollowingRestart], literal[true]]
else begin[{]
None
end[}]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.entry, parameter[member[.tc], literal["getWriteableLogRecord"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[ClassCreator(arguments=[MemberReference(member=recordLength, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), ClassCreator(arguments=[MemberReference(member=sequenceNumber, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None)), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))]]
else begin[{]
None
end[}]
local_variable[type[ByteBuffer], viewBuffer]
local_variable[type[WriteableLogRecord], writeableLogRecord]
call[_fileBuffer.position, parameter[binary_operation[binary_operation[call[_fileBuffer.position, parameter[]], +, member[.recordLength]], +, member[WriteableLogRecord.HEADER_SIZE]]]]
call[_outstandingWritableLogRecords.incrementAndGet, parameter[]]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["getWriteableLogRecord"], member[.writeableLogRecord]]]
else begin[{]
None
end[}]
return[member[.writeableLogRecord]]
end[}]
END[}] | Keyword[public] identifier[WriteableLogRecord] identifier[getWriteableLogRecord] operator[SEP] Keyword[int] identifier[recordLength] , Keyword[long] identifier[sequenceNumber] operator[SEP] Keyword[throws] identifier[InternalLogException] {
Keyword[if] operator[SEP] operator[!] identifier[_headerFlushedFollowingRestart] operator[SEP] {
identifier[writeFileHeader] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[_headerFlushedFollowingRestart] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] , Keyword[new] identifier[Object] operator[SEP] operator[SEP] {
Keyword[new] identifier[Integer] operator[SEP] identifier[recordLength] operator[SEP] , Keyword[new] identifier[Long] operator[SEP] identifier[sequenceNumber] operator[SEP] , Keyword[this]
} operator[SEP] operator[SEP] identifier[ByteBuffer] identifier[viewBuffer] operator[=] operator[SEP] identifier[ByteBuffer] operator[SEP] identifier[_fileBuffer] operator[SEP] identifier[slice] operator[SEP] operator[SEP] operator[SEP] identifier[limit] operator[SEP] identifier[recordLength] operator[+] identifier[WriteableLogRecord] operator[SEP] identifier[HEADER_SIZE] operator[SEP] operator[SEP] identifier[WriteableLogRecord] identifier[writeableLogRecord] operator[=] Keyword[new] identifier[WriteableLogRecord] operator[SEP] identifier[viewBuffer] , identifier[sequenceNumber] , identifier[recordLength] , identifier[_fileBuffer] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[_fileBuffer] operator[SEP] identifier[position] operator[SEP] identifier[_fileBuffer] operator[SEP] identifier[position] operator[SEP] operator[SEP] operator[+] identifier[recordLength] operator[+] identifier[WriteableLogRecord] operator[SEP] identifier[HEADER_SIZE] operator[SEP] operator[SEP] identifier[_outstandingWritableLogRecords] operator[SEP] identifier[incrementAndGet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] , identifier[writeableLogRecord] operator[SEP] operator[SEP] Keyword[return] identifier[writeableLogRecord] operator[SEP]
}
|
public static Object createInstance(String className)
{
//get type
Class<?> type=ReflectionHelper.getType(className);
//create instance
Object instance=ReflectionHelper.createInstance(type);
return instance;
} | class class_name[name] begin[{]
method[createInstance, return_type[type[Object]], modifier[public static], parameter[className]] begin[{]
local_variable[type[Class], type]
local_variable[type[Object], instance]
return[member[.instance]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[createInstance] operator[SEP] identifier[String] identifier[className] operator[SEP] {
identifier[Class] operator[<] operator[?] operator[>] identifier[type] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[getType] operator[SEP] identifier[className] operator[SEP] operator[SEP] identifier[Object] identifier[instance] operator[=] identifier[ReflectionHelper] operator[SEP] identifier[createInstance] operator[SEP] identifier[type] operator[SEP] operator[SEP] Keyword[return] identifier[instance] operator[SEP]
}
|
public static String getHeaderUserAgent(@Nullable String clientAppName,
@NonNull String osName,
@NonNull String osVersion,
@NonNull String osArch) {
osName = osName.replaceAll(ONLY_PRINTABLE_CHARS, "");
osVersion = osVersion.replaceAll(ONLY_PRINTABLE_CHARS, "");
osArch = osArch.replaceAll(ONLY_PRINTABLE_CHARS, "");
String baseUa = String.format(
Locale.US, "%s %s/%s (%s)", Constants.HEADER_USER_AGENT, osName, osVersion, osArch);
return TextUtils.isEmpty(clientAppName) ? baseUa : String.format(Locale.US, "%s %s",
clientAppName, baseUa);
} | class class_name[name] begin[{]
method[getHeaderUserAgent, return_type[type[String]], modifier[public static], parameter[clientAppName, osName, osVersion, osArch]] begin[{]
assign[member[.osName], call[osName.replaceAll, parameter[member[.ONLY_PRINTABLE_CHARS], literal[""]]]]
assign[member[.osVersion], call[osVersion.replaceAll, parameter[member[.ONLY_PRINTABLE_CHARS], literal[""]]]]
assign[member[.osArch], call[osArch.replaceAll, parameter[member[.ONLY_PRINTABLE_CHARS], literal[""]]]]
local_variable[type[String], baseUa]
return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=clientAppName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=TextUtils, selectors=[], type_arguments=None), if_false=MethodInvocation(arguments=[MemberReference(member=US, postfix_operators=[], prefix_operators=[], qualifier=Locale, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="%s %s"), MemberReference(member=clientAppName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=baseUa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), if_true=MemberReference(member=baseUa, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getHeaderUserAgent] operator[SEP] annotation[@] identifier[Nullable] identifier[String] identifier[clientAppName] , annotation[@] identifier[NonNull] identifier[String] identifier[osName] , annotation[@] identifier[NonNull] identifier[String] identifier[osVersion] , annotation[@] identifier[NonNull] identifier[String] identifier[osArch] operator[SEP] {
identifier[osName] operator[=] identifier[osName] operator[SEP] identifier[replaceAll] operator[SEP] identifier[ONLY_PRINTABLE_CHARS] , literal[String] operator[SEP] operator[SEP] identifier[osVersion] operator[=] identifier[osVersion] operator[SEP] identifier[replaceAll] operator[SEP] identifier[ONLY_PRINTABLE_CHARS] , literal[String] operator[SEP] operator[SEP] identifier[osArch] operator[=] identifier[osArch] operator[SEP] identifier[replaceAll] operator[SEP] identifier[ONLY_PRINTABLE_CHARS] , literal[String] operator[SEP] operator[SEP] identifier[String] identifier[baseUa] operator[=] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[Locale] operator[SEP] identifier[US] , literal[String] , identifier[Constants] operator[SEP] identifier[HEADER_USER_AGENT] , identifier[osName] , identifier[osVersion] , identifier[osArch] operator[SEP] operator[SEP] Keyword[return] identifier[TextUtils] operator[SEP] identifier[isEmpty] operator[SEP] identifier[clientAppName] operator[SEP] operator[?] identifier[baseUa] operator[:] identifier[String] operator[SEP] identifier[format] operator[SEP] identifier[Locale] operator[SEP] identifier[US] , literal[String] , identifier[clientAppName] , identifier[baseUa] operator[SEP] operator[SEP]
}
|
public static Object autoMap(Object o, Class<?> cls) {
if (o == null)
return o;
else if (cls.isAssignableFrom(o.getClass())) {
return o;
} else {
if (o instanceof java.sql.Date) {
java.sql.Date d = (java.sql.Date) o;
if (cls.isAssignableFrom(Long.class))
return d.getTime();
else if (cls.isAssignableFrom(BigInteger.class))
return BigInteger.valueOf(d.getTime());
else
return o;
} else if (o instanceof java.sql.Timestamp) {
Timestamp t = (java.sql.Timestamp) o;
if (cls.isAssignableFrom(Long.class))
return t.getTime();
else if (cls.isAssignableFrom(BigInteger.class))
return BigInteger.valueOf(t.getTime());
else
return o;
} else if (o instanceof java.sql.Time) {
Time t = (java.sql.Time) o;
if (cls.isAssignableFrom(Long.class))
return t.getTime();
else if (cls.isAssignableFrom(BigInteger.class))
return BigInteger.valueOf(t.getTime());
else
return o;
} else if (o instanceof Blob && cls.isAssignableFrom(byte[].class)) {
return toBytes((Blob) o);
} else if (o instanceof Clob && cls.isAssignableFrom(String.class)) {
return toString((Clob) o);
} else if (o instanceof BigInteger && cls.isAssignableFrom(Long.class)) {
return ((BigInteger) o).longValue();
} else if (o instanceof BigInteger && cls.isAssignableFrom(Integer.class)) {
return ((BigInteger) o).intValue();
} else if (o instanceof BigInteger && cls.isAssignableFrom(Double.class)) {
return ((BigInteger) o).doubleValue();
} else if (o instanceof BigInteger && cls.isAssignableFrom(Float.class)) {
return ((BigInteger) o).floatValue();
} else if (o instanceof BigInteger && cls.isAssignableFrom(Short.class)) {
return ((BigInteger) o).shortValue();
} else if (o instanceof BigInteger && cls.isAssignableFrom(BigDecimal.class)) {
return new BigDecimal((BigInteger) o);
} else if (o instanceof BigDecimal && cls.isAssignableFrom(Double.class)) {
return ((BigDecimal) o).doubleValue();
} else if (o instanceof BigDecimal && cls.isAssignableFrom(Integer.class)) {
return ((BigDecimal) o).toBigInteger().intValue();
} else if (o instanceof BigDecimal && cls.isAssignableFrom(Float.class)) {
return ((BigDecimal) o).floatValue();
} else if (o instanceof BigDecimal && cls.isAssignableFrom(Short.class)) {
return ((BigDecimal) o).toBigInteger().shortValue();
} else if (o instanceof BigDecimal && cls.isAssignableFrom(Long.class)) {
return ((BigDecimal) o).toBigInteger().longValue();
} else if (o instanceof BigDecimal && cls.isAssignableFrom(BigInteger.class)) {
return ((BigDecimal) o).toBigInteger();
} else if ((o instanceof Short || o instanceof Integer || o instanceof Long)
&& cls.isAssignableFrom(BigInteger.class)) {
return new BigInteger(o.toString());
} else if (o instanceof Number && cls.isAssignableFrom(BigDecimal.class)) {
return new BigDecimal(o.toString());
} else if (o instanceof Number && cls.isAssignableFrom(Short.class))
return ((Number) o).shortValue();
else if (o instanceof Number && cls.isAssignableFrom(Integer.class))
return ((Number) o).intValue();
else if (o instanceof Number && cls.isAssignableFrom(Integer.class))
return ((Number) o).intValue();
else if (o instanceof Number && cls.isAssignableFrom(Long.class))
return ((Number) o).longValue();
else if (o instanceof Number && cls.isAssignableFrom(Float.class))
return ((Number) o).floatValue();
else if (o instanceof Number && cls.isAssignableFrom(Double.class))
return ((Number) o).doubleValue();
else
return o;
}
} | class class_name[name] begin[{]
method[autoMap, return_type[type[Object]], modifier[public static], parameter[o, cls]] begin[{]
if[binary_operation[member[.o], ==, literal[null]]] begin[{]
return[member[.o]]
else begin[{]
if[call[cls.isAssignableFrom, parameter[call[o.getClass, parameter[]]]]] begin[{]
return[member[.o]]
else begin[{]
if[binary_operation[member[.o], instanceof, type[java]]] begin[{]
local_variable[type[java], d]
if[call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]] begin[{]
return[call[d.getTime, parameter[]]]
else begin[{]
if[call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None))]]] begin[{]
return[call[BigInteger.valueOf, parameter[call[d.getTime, parameter[]]]]]
else begin[{]
return[member[.o]]
end[}]
end[}]
else begin[{]
if[binary_operation[member[.o], instanceof, type[java]]] begin[{]
local_variable[type[Timestamp], t]
if[call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]] begin[{]
return[call[t.getTime, parameter[]]]
else begin[{]
if[call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None))]]] begin[{]
return[call[BigInteger.valueOf, parameter[call[t.getTime, parameter[]]]]]
else begin[{]
return[member[.o]]
end[}]
end[}]
else begin[{]
if[binary_operation[member[.o], instanceof, type[java]]] begin[{]
local_variable[type[Time], t]
if[call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]] begin[{]
return[call[t.getTime, parameter[]]]
else begin[{]
if[call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None))]]] begin[{]
return[call[BigInteger.valueOf, parameter[call[t.getTime, parameter[]]]]]
else begin[{]
return[member[.o]]
end[}]
end[}]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[Blob]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[None], name=byte))]]]] begin[{]
return[call[.toBytes, parameter[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Blob, sub_type=None))]]]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[Clob]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]]]] begin[{]
return[call[.toString, parameter[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Clob, sub_type=None))]]]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigInteger]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigInteger]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigInteger]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigInteger]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigInteger]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigInteger]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))]]]] begin[{]
return[ClassCreator(arguments=[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigInteger, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigDecimal]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigDecimal]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigDecimal]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigDecimal]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigDecimal]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[BigDecimal]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=BigDecimal, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[binary_operation[binary_operation[member[.o], instanceof, type[Short]], ||, binary_operation[member[.o], instanceof, type[Integer]]], ||, binary_operation[member[.o], instanceof, type[Long]]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None))]]]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigInteger, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[Number]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))]]]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=o, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BigDecimal, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[Number]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[Number]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[Number]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[Number]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[Number]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))]
else begin[{]
if[binary_operation[binary_operation[member[.o], instanceof, type[Number]], &&, call[cls.isAssignableFrom, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None))]]]] begin[{]
return[Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Number, sub_type=None))]
else begin[{]
return[member[.o]]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[autoMap] operator[SEP] identifier[Object] identifier[o] , identifier[Class] operator[<] operator[?] operator[>] identifier[cls] operator[SEP] {
Keyword[if] operator[SEP] identifier[o] operator[==] Other[null] operator[SEP] Keyword[return] identifier[o] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[o] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[o] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Date] operator[SEP] {
identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Date] identifier[d] operator[=] operator[SEP] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Date] operator[SEP] identifier[o] operator[SEP] Keyword[if] operator[SEP] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[d] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[BigInteger] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[BigInteger] operator[SEP] identifier[valueOf] operator[SEP] identifier[d] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[o] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Timestamp] operator[SEP] {
identifier[Timestamp] identifier[t] operator[=] operator[SEP] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Timestamp] operator[SEP] identifier[o] operator[SEP] Keyword[if] operator[SEP] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[t] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[BigInteger] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[BigInteger] operator[SEP] identifier[valueOf] operator[SEP] identifier[t] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[o] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Time] operator[SEP] {
identifier[Time] identifier[t] operator[=] operator[SEP] identifier[java] operator[SEP] identifier[sql] operator[SEP] identifier[Time] operator[SEP] identifier[o] operator[SEP] Keyword[if] operator[SEP] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[t] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[BigInteger] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] identifier[BigInteger] operator[SEP] identifier[valueOf] operator[SEP] identifier[t] operator[SEP] identifier[getTime] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[o] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Blob] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] identifier[toBytes] operator[SEP] operator[SEP] identifier[Blob] operator[SEP] identifier[o] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Clob] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[String] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] identifier[toString] operator[SEP] operator[SEP] identifier[Clob] operator[SEP] identifier[o] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigInteger] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigInteger] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigInteger] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigInteger] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigInteger] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigInteger] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigInteger] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Float] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigInteger] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigInteger] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Short] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigInteger] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[shortValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigInteger] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[BigDecimal] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[BigDecimal] operator[SEP] operator[SEP] identifier[BigInteger] operator[SEP] identifier[o] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigDecimal] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigDecimal] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[toBigInteger] operator[SEP] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigDecimal] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Float] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigDecimal] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Short] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[toBigInteger] operator[SEP] operator[SEP] operator[SEP] identifier[shortValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigDecimal] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[toBigInteger] operator[SEP] operator[SEP] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[BigDecimal] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[BigInteger] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] operator[SEP] identifier[BigDecimal] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[toBigInteger] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] operator[SEP] identifier[o] Keyword[instanceof] identifier[Short] operator[||] identifier[o] Keyword[instanceof] identifier[Integer] operator[||] identifier[o] Keyword[instanceof] identifier[Long] operator[SEP] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[BigInteger] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[BigInteger] operator[SEP] identifier[o] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Number] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[BigDecimal] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[BigDecimal] operator[SEP] identifier[o] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Number] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Short] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[shortValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Number] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Number] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Integer] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Number] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Long] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[longValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Number] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Float] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[floatValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[o] Keyword[instanceof] identifier[Number] operator[&&] identifier[cls] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[Double] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[return] operator[SEP] operator[SEP] identifier[Number] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[doubleValue] operator[SEP] operator[SEP] operator[SEP] Keyword[else] Keyword[return] identifier[o] operator[SEP]
}
}
|
protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception {
appfw_stats[] resources = new appfw_stats[1];
appfw_response result = (appfw_response) service.get_payload_formatter().string_to_resource(appfw_response.class, response);
if(result.errorcode != 0) {
if (result.errorcode == 444) {
service.clear_session();
}
if(result.severity != null)
{
if (result.severity.equals("ERROR"))
throw new nitro_exception(result.message,result.errorcode);
}
else
{
throw new nitro_exception(result.message,result.errorcode);
}
}
resources[0] = result.appfw;
return resources;
} | class class_name[name] begin[{]
method[get_nitro_response, return_type[type[base_resource]], modifier[protected], parameter[service, response]] begin[{]
local_variable[type[appfw_stats], resources]
local_variable[type[appfw_response], result]
if[binary_operation[member[result.errorcode], !=, literal[0]]] begin[{]
if[binary_operation[member[result.errorcode], ==, literal[444]]] begin[{]
call[service.clear_session, parameter[]]
else begin[{]
None
end[}]
if[binary_operation[member[result.severity], !=, literal[null]]] begin[{]
if[call[result.severity.equals, parameter[literal["ERROR"]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), MemberReference(member=errorcode, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=nitro_exception, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[]), MemberReference(member=errorcode, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=nitro_exception, sub_type=None)), label=None)
end[}]
else begin[{]
None
end[}]
assign[member[.resources], member[result.appfw]]
return[member[.resources]]
end[}]
END[}] | Keyword[protected] identifier[base_resource] operator[SEP] operator[SEP] identifier[get_nitro_response] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[response] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[appfw_stats] operator[SEP] operator[SEP] identifier[resources] operator[=] Keyword[new] identifier[appfw_stats] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[appfw_response] identifier[result] operator[=] operator[SEP] identifier[appfw_response] operator[SEP] identifier[service] operator[SEP] identifier[get_payload_formatter] operator[SEP] operator[SEP] operator[SEP] identifier[string_to_resource] operator[SEP] identifier[appfw_response] operator[SEP] Keyword[class] , identifier[response] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[errorcode] operator[!=] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[errorcode] operator[==] Other[444] operator[SEP] {
identifier[service] operator[SEP] identifier[clear_session] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[severity] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[result] operator[SEP] identifier[severity] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[nitro_exception] operator[SEP] identifier[result] operator[SEP] identifier[message] , identifier[result] operator[SEP] identifier[errorcode] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[nitro_exception] operator[SEP] identifier[result] operator[SEP] identifier[message] , identifier[result] operator[SEP] identifier[errorcode] operator[SEP] operator[SEP]
}
}
identifier[resources] operator[SEP] Other[0] operator[SEP] operator[=] identifier[result] operator[SEP] identifier[appfw] operator[SEP] Keyword[return] identifier[resources] operator[SEP]
}
|
public synchronized void add(ClassConclusionCounter counter) {
this.countSubClassInclusionDecomposed += counter.countSubClassInclusionDecomposed;
this.countSubClassInclusionComposed += counter.countSubClassInclusionComposed;
this.countBackwardLink += counter.countBackwardLink;
this.countForwardLink += counter.countForwardLink;
this.countContradiction += counter.countContradiction;
this.countPropagation += counter.countPropagation;
this.countDisjointSubsumer += counter.countDisjointSubsumer;
this.countContextInitialization += counter.countContextInitialization;
this.countSubContextInitialization += counter.countSubContextInitialization;
} | class class_name[name] begin[{]
method[add, return_type[void], modifier[synchronized public], parameter[counter]] begin[{]
assign[THIS[member[None.countSubClassInclusionDecomposed]], member[counter.countSubClassInclusionDecomposed]]
assign[THIS[member[None.countSubClassInclusionComposed]], member[counter.countSubClassInclusionComposed]]
assign[THIS[member[None.countBackwardLink]], member[counter.countBackwardLink]]
assign[THIS[member[None.countForwardLink]], member[counter.countForwardLink]]
assign[THIS[member[None.countContradiction]], member[counter.countContradiction]]
assign[THIS[member[None.countPropagation]], member[counter.countPropagation]]
assign[THIS[member[None.countDisjointSubsumer]], member[counter.countDisjointSubsumer]]
assign[THIS[member[None.countContextInitialization]], member[counter.countContextInitialization]]
assign[THIS[member[None.countSubContextInitialization]], member[counter.countSubContextInitialization]]
end[}]
END[}] | Keyword[public] Keyword[synchronized] Keyword[void] identifier[add] operator[SEP] identifier[ClassConclusionCounter] identifier[counter] operator[SEP] {
Keyword[this] operator[SEP] identifier[countSubClassInclusionDecomposed] operator[+=] identifier[counter] operator[SEP] identifier[countSubClassInclusionDecomposed] operator[SEP] Keyword[this] operator[SEP] identifier[countSubClassInclusionComposed] operator[+=] identifier[counter] operator[SEP] identifier[countSubClassInclusionComposed] operator[SEP] Keyword[this] operator[SEP] identifier[countBackwardLink] operator[+=] identifier[counter] operator[SEP] identifier[countBackwardLink] operator[SEP] Keyword[this] operator[SEP] identifier[countForwardLink] operator[+=] identifier[counter] operator[SEP] identifier[countForwardLink] operator[SEP] Keyword[this] operator[SEP] identifier[countContradiction] operator[+=] identifier[counter] operator[SEP] identifier[countContradiction] operator[SEP] Keyword[this] operator[SEP] identifier[countPropagation] operator[+=] identifier[counter] operator[SEP] identifier[countPropagation] operator[SEP] Keyword[this] operator[SEP] identifier[countDisjointSubsumer] operator[+=] identifier[counter] operator[SEP] identifier[countDisjointSubsumer] operator[SEP] Keyword[this] operator[SEP] identifier[countContextInitialization] operator[+=] identifier[counter] operator[SEP] identifier[countContextInitialization] operator[SEP] Keyword[this] operator[SEP] identifier[countSubContextInitialization] operator[+=] identifier[counter] operator[SEP] identifier[countSubContextInitialization] operator[SEP]
}
|
public static Object getColumnValue(Object value, CmsDataViewColumn.Type type) {
if (type == Type.imageType) {
Image image = new Image("", new ExternalResource((String)value));
image.addStyleName("o-table-image");
return image;
} else {
return value;
}
} | class class_name[name] begin[{]
method[getColumnValue, return_type[type[Object]], modifier[public static], parameter[value, type]] begin[{]
if[binary_operation[member[.type], ==, member[Type.imageType]]] begin[{]
local_variable[type[Image], image]
call[image.addStyleName, parameter[literal["o-table-image"]]]
return[member[.image]]
else begin[{]
return[member[.value]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[getColumnValue] operator[SEP] identifier[Object] identifier[value] , identifier[CmsDataViewColumn] operator[SEP] identifier[Type] identifier[type] operator[SEP] {
Keyword[if] operator[SEP] identifier[type] operator[==] identifier[Type] operator[SEP] identifier[imageType] operator[SEP] {
identifier[Image] identifier[image] operator[=] Keyword[new] identifier[Image] operator[SEP] literal[String] , Keyword[new] identifier[ExternalResource] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP] identifier[image] operator[SEP] identifier[addStyleName] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[image] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[value] operator[SEP]
}
}
|
public long getPositiveMillisOrDefault(HazelcastProperty property, long defaultValue) {
long millis = getMillis(property);
return millis > 0 ? millis : defaultValue;
} | class class_name[name] begin[{]
method[getPositiveMillisOrDefault, return_type[type[long]], modifier[public], parameter[property, defaultValue]] begin[{]
local_variable[type[long], millis]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=millis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), if_false=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=millis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}] | Keyword[public] Keyword[long] identifier[getPositiveMillisOrDefault] operator[SEP] identifier[HazelcastProperty] identifier[property] , Keyword[long] identifier[defaultValue] operator[SEP] {
Keyword[long] identifier[millis] operator[=] identifier[getMillis] operator[SEP] identifier[property] operator[SEP] operator[SEP] Keyword[return] identifier[millis] operator[>] Other[0] operator[?] identifier[millis] operator[:] identifier[defaultValue] operator[SEP]
}
|
void recycle() {
flushed = false;
closed = false;
out = null;
nextChar = 0;
converterBuffer.clear(); //PM19500
response = null; //PM23029
} | class class_name[name] begin[{]
method[recycle, return_type[void], modifier[default], parameter[]] begin[{]
assign[member[.flushed], literal[false]]
assign[member[.closed], literal[false]]
assign[member[.out], literal[null]]
assign[member[.nextChar], literal[0]]
call[converterBuffer.clear, parameter[]]
assign[member[.response], literal[null]]
end[}]
END[}] | Keyword[void] identifier[recycle] operator[SEP] operator[SEP] {
identifier[flushed] operator[=] literal[boolean] operator[SEP] identifier[closed] operator[=] literal[boolean] operator[SEP] identifier[out] operator[=] Other[null] operator[SEP] identifier[nextChar] operator[=] Other[0] operator[SEP] identifier[converterBuffer] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] identifier[response] operator[=] Other[null] operator[SEP]
}
|
private String getMostRecentMatchingKey(AmazonS3 s3Client, String bucketName, String regex) {
ObjectListing objectListing = s3Client.listObjects(bucketName);
TreeMap<Date, String> keys = new TreeMap<>();
for (S3ObjectSummary objectSummary : objectListing.getObjectSummaries()) {
if (objectSummary.getKey().matches(regex)) {
keys.put(objectSummary.getLastModified(), objectSummary.getKey());
}
}
if (keys.size() == 0)
throw new MolgenisDataException("No key matching regular expression: " + regex);
return keys.lastEntry().getValue();
} | class class_name[name] begin[{]
method[getMostRecentMatchingKey, return_type[type[String]], modifier[private], parameter[s3Client, bucketName, regex]] begin[{]
local_variable[type[ObjectListing], objectListing]
local_variable[type[TreeMap], keys]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=objectSummary, selectors=[MethodInvocation(arguments=[MemberReference(member=regex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=matches, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getLastModified, postfix_operators=[], prefix_operators=[], qualifier=objectSummary, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getKey, postfix_operators=[], prefix_operators=[], qualifier=objectSummary, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=keys, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getObjectSummaries, postfix_operators=[], prefix_operators=[], qualifier=objectListing, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=objectSummary)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=S3ObjectSummary, sub_type=None))), label=None)
if[binary_operation[call[keys.size, parameter[]], ==, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No key matching regular expression: "), operandr=MemberReference(member=regex, 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=MolgenisDataException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[keys.lastEntry, parameter[]]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[getMostRecentMatchingKey] operator[SEP] identifier[AmazonS3] identifier[s3Client] , identifier[String] identifier[bucketName] , identifier[String] identifier[regex] operator[SEP] {
identifier[ObjectListing] identifier[objectListing] operator[=] identifier[s3Client] operator[SEP] identifier[listObjects] operator[SEP] identifier[bucketName] operator[SEP] operator[SEP] identifier[TreeMap] operator[<] identifier[Date] , identifier[String] operator[>] identifier[keys] operator[=] Keyword[new] identifier[TreeMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[S3ObjectSummary] identifier[objectSummary] operator[:] identifier[objectListing] operator[SEP] identifier[getObjectSummaries] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[objectSummary] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] identifier[matches] operator[SEP] identifier[regex] operator[SEP] operator[SEP] {
identifier[keys] operator[SEP] identifier[put] operator[SEP] identifier[objectSummary] operator[SEP] identifier[getLastModified] operator[SEP] operator[SEP] , identifier[objectSummary] operator[SEP] identifier[getKey] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[keys] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] Keyword[throw] Keyword[new] identifier[MolgenisDataException] operator[SEP] literal[String] operator[+] identifier[regex] operator[SEP] operator[SEP] Keyword[return] identifier[keys] operator[SEP] identifier[lastEntry] operator[SEP] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void abortJob(JobContext context, JobStatus.State state)
throws IOException {
cleanupJob(context);
} | class class_name[name] begin[{]
method[abortJob, return_type[void], modifier[public], parameter[context, state]] begin[{]
call[.cleanupJob, parameter[member[.context]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[abortJob] operator[SEP] identifier[JobContext] identifier[context] , identifier[JobStatus] operator[SEP] identifier[State] identifier[state] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[cleanupJob] operator[SEP] identifier[context] operator[SEP] operator[SEP]
}
|
public static boolean isCurrentTimeBetweenTowTimes(Date fromDate, Date fromTime, Date toDate, Date timeTo) {
JKTimeObject currntTime = getCurrntTime();
JKTimeObject fromTimeObject = new JKTimeObject();
JKTimeObject toTimeObject = new JKTimeObject();
if (currntTime.after(fromTimeObject.toTimeObject(fromDate, fromTime)) && currntTime.before(toTimeObject.toTimeObject(toDate, timeTo))) {
return true;
}
return false;
} | class class_name[name] begin[{]
method[isCurrentTimeBetweenTowTimes, return_type[type[boolean]], modifier[public static], parameter[fromDate, fromTime, toDate, timeTo]] begin[{]
local_variable[type[JKTimeObject], currntTime]
local_variable[type[JKTimeObject], fromTimeObject]
local_variable[type[JKTimeObject], toTimeObject]
if[binary_operation[call[currntTime.after, parameter[call[fromTimeObject.toTimeObject, parameter[member[.fromDate], member[.fromTime]]]]], &&, call[currntTime.before, parameter[call[toTimeObject.toTimeObject, parameter[member[.toDate], member[.timeTo]]]]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[boolean] identifier[isCurrentTimeBetweenTowTimes] operator[SEP] identifier[Date] identifier[fromDate] , identifier[Date] identifier[fromTime] , identifier[Date] identifier[toDate] , identifier[Date] identifier[timeTo] operator[SEP] {
identifier[JKTimeObject] identifier[currntTime] operator[=] identifier[getCurrntTime] operator[SEP] operator[SEP] operator[SEP] identifier[JKTimeObject] identifier[fromTimeObject] operator[=] Keyword[new] identifier[JKTimeObject] operator[SEP] operator[SEP] operator[SEP] identifier[JKTimeObject] identifier[toTimeObject] operator[=] Keyword[new] identifier[JKTimeObject] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currntTime] operator[SEP] identifier[after] operator[SEP] identifier[fromTimeObject] operator[SEP] identifier[toTimeObject] operator[SEP] identifier[fromDate] , identifier[fromTime] operator[SEP] operator[SEP] operator[&&] identifier[currntTime] operator[SEP] identifier[before] operator[SEP] identifier[toTimeObject] operator[SEP] identifier[toTimeObject] operator[SEP] identifier[toDate] , identifier[timeTo] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
protected void record( final FieldDeclaration field,
final Node parentNode ) throws Exception {
@SuppressWarnings( "unchecked" )
final List<VariableDeclarationFragment> frags = field.fragments();
final String name = frags.get(0).getName().getFullyQualifiedName();
final Node fieldNode = parentNode.addNode(name, ClassFileSequencerLexicon.FIELD);
fieldNode.setProperty(ClassFileSequencerLexicon.NAME, name);
{ // javadocs
final Javadoc javadoc = field.getJavadoc();
if (javadoc != null) {
record(javadoc, fieldNode);
}
}
{ // type
final Type type = field.getType();
final String typeName = getTypeName(type);
fieldNode.setProperty(ClassFileSequencerLexicon.TYPE_CLASS_NAME, typeName);
record(type, ClassFileSequencerLexicon.TYPE, fieldNode);
}
{ // modifiers
final int modifiers = field.getModifiers();
fieldNode.setProperty(ClassFileSequencerLexicon.FINAL, (modifiers & Modifier.FINAL) != 0);
fieldNode.setProperty(ClassFileSequencerLexicon.STATIC, (modifiers & Modifier.STATIC) != 0);
fieldNode.setProperty(ClassFileSequencerLexicon.TRANSIENT, (modifiers & Modifier.TRANSIENT) != 0);
fieldNode.setProperty(ClassFileSequencerLexicon.VISIBILITY, getVisibility(modifiers));
fieldNode.setProperty(ClassFileSequencerLexicon.VOLATILE, (modifiers & Modifier.VOLATILE) != 0);
}
{ // annotations
@SuppressWarnings( "unchecked" )
final List<IExtendedModifier> modifiers = field.modifiers();
recordAnnotations(modifiers, fieldNode);
}
{ // fragments
@SuppressWarnings( "unchecked" )
final List<VariableDeclarationFragment> fragments = field.fragments();
if ((fragments != null) && !fragments.isEmpty()) {
for (final VariableDeclarationFragment var : fragments) {
final Expression initializer = var.getInitializer();
if (initializer != null) {
recordExpression(initializer, ClassFileSequencerLexicon.INITIALIZER, fieldNode);
}
}
}
}
recordSourceReference(field, fieldNode);
} | class class_name[name] begin[{]
method[record, return_type[void], modifier[protected], parameter[field, parentNode]] begin[{]
local_variable[type[List], frags]
local_variable[type[String], name]
local_variable[type[Node], fieldNode]
call[fieldNode.setProperty, parameter[member[ClassFileSequencerLexicon.NAME], member[.name]]]
local_variable[type[Javadoc], javadoc]
if[binary_operation[member[.javadoc], !=, literal[null]]] begin[{]
call[.record, parameter[member[.javadoc], member[.fieldNode]]]
else begin[{]
None
end[}]
local_variable[type[Type], type]
local_variable[type[String], typeName]
call[fieldNode.setProperty, parameter[member[ClassFileSequencerLexicon.TYPE_CLASS_NAME], member[.typeName]]]
call[.record, parameter[member[.type], member[ClassFileSequencerLexicon.TYPE], member[.fieldNode]]]
local_variable[type[int], modifiers]
call[fieldNode.setProperty, parameter[member[ClassFileSequencerLexicon.FINAL], binary_operation[binary_operation[member[.modifiers], &, member[Modifier.FINAL]], !=, literal[0]]]]
call[fieldNode.setProperty, parameter[member[ClassFileSequencerLexicon.STATIC], binary_operation[binary_operation[member[.modifiers], &, member[Modifier.STATIC]], !=, literal[0]]]]
call[fieldNode.setProperty, parameter[member[ClassFileSequencerLexicon.TRANSIENT], binary_operation[binary_operation[member[.modifiers], &, member[Modifier.TRANSIENT]], !=, literal[0]]]]
call[fieldNode.setProperty, parameter[member[ClassFileSequencerLexicon.VISIBILITY], call[.getVisibility, parameter[member[.modifiers]]]]]
call[fieldNode.setProperty, parameter[member[ClassFileSequencerLexicon.VOLATILE], binary_operation[binary_operation[member[.modifiers], &, member[Modifier.VOLATILE]], !=, literal[0]]]]
local_variable[type[List], modifiers]
call[.recordAnnotations, parameter[member[.modifiers], member[.fieldNode]]]
local_variable[type[List], fragments]
if[binary_operation[binary_operation[member[.fragments], !=, literal[null]], &&, call[fragments.isEmpty, parameter[]]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInitializer, postfix_operators=[], prefix_operators=[], qualifier=var, selectors=[], type_arguments=None), name=initializer)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Expression, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=initializer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=initializer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=INITIALIZER, postfix_operators=[], prefix_operators=[], qualifier=ClassFileSequencerLexicon, selectors=[]), MemberReference(member=fieldNode, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recordExpression, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=fragments, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=var)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=VariableDeclarationFragment, sub_type=None))), label=None)
else begin[{]
None
end[}]
call[.recordSourceReference, parameter[member[.field], member[.fieldNode]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[record] operator[SEP] Keyword[final] identifier[FieldDeclaration] identifier[field] , Keyword[final] identifier[Node] identifier[parentNode] operator[SEP] Keyword[throws] identifier[Exception] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[VariableDeclarationFragment] operator[>] identifier[frags] operator[=] identifier[field] operator[SEP] identifier[fragments] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[name] operator[=] identifier[frags] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] identifier[getFullyQualifiedName] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[Node] identifier[fieldNode] operator[=] identifier[parentNode] operator[SEP] identifier[addNode] operator[SEP] identifier[name] , identifier[ClassFileSequencerLexicon] operator[SEP] identifier[FIELD] operator[SEP] operator[SEP] identifier[fieldNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[NAME] , identifier[name] operator[SEP] operator[SEP] {
Keyword[final] identifier[Javadoc] identifier[javadoc] operator[=] identifier[field] operator[SEP] identifier[getJavadoc] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[javadoc] operator[!=] Other[null] operator[SEP] {
identifier[record] operator[SEP] identifier[javadoc] , identifier[fieldNode] operator[SEP] operator[SEP]
}
} {
Keyword[final] identifier[Type] identifier[type] operator[=] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[typeName] operator[=] identifier[getTypeName] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[fieldNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[TYPE_CLASS_NAME] , identifier[typeName] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[type] , identifier[ClassFileSequencerLexicon] operator[SEP] identifier[TYPE] , identifier[fieldNode] operator[SEP] operator[SEP]
} {
Keyword[final] Keyword[int] identifier[modifiers] operator[=] identifier[field] operator[SEP] identifier[getModifiers] operator[SEP] operator[SEP] operator[SEP] identifier[fieldNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[FINAL] , operator[SEP] identifier[modifiers] operator[&] identifier[Modifier] operator[SEP] identifier[FINAL] operator[SEP] operator[!=] Other[0] operator[SEP] operator[SEP] identifier[fieldNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[STATIC] , operator[SEP] identifier[modifiers] operator[&] identifier[Modifier] operator[SEP] identifier[STATIC] operator[SEP] operator[!=] Other[0] operator[SEP] operator[SEP] identifier[fieldNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[TRANSIENT] , operator[SEP] identifier[modifiers] operator[&] identifier[Modifier] operator[SEP] identifier[TRANSIENT] operator[SEP] operator[!=] Other[0] operator[SEP] operator[SEP] identifier[fieldNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[VISIBILITY] , identifier[getVisibility] operator[SEP] identifier[modifiers] operator[SEP] operator[SEP] operator[SEP] identifier[fieldNode] operator[SEP] identifier[setProperty] operator[SEP] identifier[ClassFileSequencerLexicon] operator[SEP] identifier[VOLATILE] , operator[SEP] identifier[modifiers] operator[&] identifier[Modifier] operator[SEP] identifier[VOLATILE] operator[SEP] operator[!=] Other[0] operator[SEP] operator[SEP]
} {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[IExtendedModifier] operator[>] identifier[modifiers] operator[=] identifier[field] operator[SEP] identifier[modifiers] operator[SEP] operator[SEP] operator[SEP] identifier[recordAnnotations] operator[SEP] identifier[modifiers] , identifier[fieldNode] operator[SEP] operator[SEP]
} {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[final] identifier[List] operator[<] identifier[VariableDeclarationFragment] operator[>] identifier[fragments] operator[=] identifier[field] operator[SEP] identifier[fragments] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[fragments] operator[!=] Other[null] operator[SEP] operator[&&] operator[!] identifier[fragments] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] Keyword[final] identifier[VariableDeclarationFragment] identifier[var] operator[:] identifier[fragments] operator[SEP] {
Keyword[final] identifier[Expression] identifier[initializer] operator[=] identifier[var] operator[SEP] identifier[getInitializer] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[initializer] operator[!=] Other[null] operator[SEP] {
identifier[recordExpression] operator[SEP] identifier[initializer] , identifier[ClassFileSequencerLexicon] operator[SEP] identifier[INITIALIZER] , identifier[fieldNode] operator[SEP] operator[SEP]
}
}
}
}
identifier[recordSourceReference] operator[SEP] identifier[field] , identifier[fieldNode] operator[SEP] operator[SEP]
}
|
private static BufferedImage checkInputs(ImageBase src, BufferedImage dst) {
if (dst != null) {
if (dst.getWidth() != src.getWidth() || dst.getHeight() != src.getHeight()) {
throw new IllegalArgumentException("image dimension are different. src="
+src.width+"x"+src.height+" dst="+dst.getWidth()+"x"+dst.getHeight());
}
} else {
dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_RGB);
}
return dst;
} | class class_name[name] begin[{]
method[checkInputs, return_type[type[BufferedImage]], modifier[private static], parameter[src, dst]] begin[{]
if[binary_operation[member[.dst], !=, literal[null]]] begin[{]
if[binary_operation[binary_operation[call[dst.getWidth, parameter[]], !=, call[src.getWidth, parameter[]]], ||, binary_operation[call[dst.getHeight, parameter[]], !=, call[src.getHeight, parameter[]]]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="image dimension are different. src="), operandr=MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="x"), operator=+), operandr=MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" dst="), operator=+), operandr=MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=dst, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="x"), operator=+), operandr=MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=dst, selectors=[], type_arguments=None), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
assign[member[.dst], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getWidth, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getHeight, postfix_operators=[], prefix_operators=[], qualifier=src, selectors=[], type_arguments=None), MemberReference(member=TYPE_INT_RGB, postfix_operators=[], prefix_operators=[], qualifier=BufferedImage, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=BufferedImage, sub_type=None))]
end[}]
return[member[.dst]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[BufferedImage] identifier[checkInputs] operator[SEP] identifier[ImageBase] identifier[src] , identifier[BufferedImage] identifier[dst] operator[SEP] {
Keyword[if] operator[SEP] identifier[dst] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[dst] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[!=] identifier[src] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[||] identifier[dst] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[!=] identifier[src] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[src] operator[SEP] identifier[width] operator[+] literal[String] operator[+] identifier[src] operator[SEP] identifier[height] operator[+] literal[String] operator[+] identifier[dst] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[dst] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[dst] operator[=] Keyword[new] identifier[BufferedImage] operator[SEP] identifier[src] operator[SEP] identifier[getWidth] operator[SEP] operator[SEP] , identifier[src] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP] , identifier[BufferedImage] operator[SEP] identifier[TYPE_INT_RGB] operator[SEP] operator[SEP]
}
Keyword[return] identifier[dst] operator[SEP]
}
|
public long readLong()
throws IOException
{
int tag = read();
switch (tag) {
case 'T':
return 1;
case 'F':
return 0;
case 'I':
return parseInt();
case 'L':
return parseLong();
case 'D':
return (long) parseDouble();
default:
throw expect("long", tag);
}
} | class class_name[name] begin[{]
method[readLong, return_type[type[long]], modifier[public], parameter[]] begin[{]
local_variable[type[int], tag]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='T')], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='F')], statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='I')], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=parseInt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='L')], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=parseLong, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='D')], statements=[ReturnStatement(expression=Cast(expression=MethodInvocation(arguments=[], member=parseDouble, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=BasicType(dimensions=[], name=long)), label=None)]), SwitchStatementCase(case=[], statements=[ThrowStatement(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="long"), MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=expect, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=tag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
end[}]
END[}] | Keyword[public] Keyword[long] identifier[readLong] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[int] identifier[tag] operator[=] identifier[read] operator[SEP] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[tag] operator[SEP] {
Keyword[case] literal[String] operator[:] Keyword[return] Other[1] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] Other[0] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] identifier[parseInt] operator[SEP] operator[SEP] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] identifier[parseLong] operator[SEP] operator[SEP] operator[SEP] Keyword[case] literal[String] operator[:] Keyword[return] operator[SEP] Keyword[long] operator[SEP] identifier[parseDouble] operator[SEP] operator[SEP] operator[SEP] Keyword[default] operator[:] Keyword[throw] identifier[expect] operator[SEP] literal[String] , identifier[tag] operator[SEP] operator[SEP]
}
}
|
protected File[] getFiles( File pDir, String[] pIncludes, String[] pExcludes )
throws MojoFailureException, MojoExecutionException
{
return asFiles( pDir, getFileNames( pDir, pIncludes, pExcludes ) );
} | class class_name[name] begin[{]
method[getFiles, return_type[type[File]], modifier[protected], parameter[pDir, pIncludes, pExcludes]] begin[{]
return[call[.asFiles, parameter[member[.pDir], call[.getFileNames, parameter[member[.pDir], member[.pIncludes], member[.pExcludes]]]]]]
end[}]
END[}] | Keyword[protected] identifier[File] operator[SEP] operator[SEP] identifier[getFiles] operator[SEP] identifier[File] identifier[pDir] , identifier[String] operator[SEP] operator[SEP] identifier[pIncludes] , identifier[String] operator[SEP] operator[SEP] identifier[pExcludes] operator[SEP] Keyword[throws] identifier[MojoFailureException] , identifier[MojoExecutionException] {
Keyword[return] identifier[asFiles] operator[SEP] identifier[pDir] , identifier[getFileNames] operator[SEP] identifier[pDir] , identifier[pIncludes] , identifier[pExcludes] operator[SEP] operator[SEP] operator[SEP]
}
|
public void removeOverride(String operation) {
if (this.overrideOnce.containsKey(operation) == true) {
this.overrideOnce.remove(operation);
}
if (this.override.containsKey(operation) == true) {
this.override.remove(operation);
}
} | class class_name[name] begin[{]
method[removeOverride, return_type[void], modifier[public], parameter[operation]] begin[{]
if[binary_operation[THIS[member[None.overrideOnce]call[None.containsKey, parameter[member[.operation]]]], ==, literal[true]]] begin[{]
THIS[member[None.overrideOnce]call[None.remove, parameter[member[.operation]]]]
else begin[{]
None
end[}]
if[binary_operation[THIS[member[None.override]call[None.containsKey, parameter[member[.operation]]]], ==, literal[true]]] begin[{]
THIS[member[None.override]call[None.remove, parameter[member[.operation]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[removeOverride] operator[SEP] identifier[String] identifier[operation] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[overrideOnce] operator[SEP] identifier[containsKey] operator[SEP] identifier[operation] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[this] operator[SEP] identifier[overrideOnce] operator[SEP] identifier[remove] operator[SEP] identifier[operation] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[override] operator[SEP] identifier[containsKey] operator[SEP] identifier[operation] operator[SEP] operator[==] literal[boolean] operator[SEP] {
Keyword[this] operator[SEP] identifier[override] operator[SEP] identifier[remove] operator[SEP] identifier[operation] operator[SEP] operator[SEP]
}
}
|
public static int getIntValueRounded(String value, int defaultValue, String key) {
int result;
try {
result = Math.round(Float.parseFloat(value));
} catch (Exception e) {
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.get().getBundle().key(Messages.ERR_UNABLE_TO_PARSE_INT_2, value, key));
}
result = defaultValue;
}
return result;
} | class class_name[name] begin[{]
method[getIntValueRounded, return_type[type[int]], modifier[public static], parameter[value, defaultValue, key]] begin[{]
local_variable[type[int], result]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None)], member=round, postfix_operators=[], prefix_operators=[], qualifier=Math, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isDebugEnabled, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=get, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[MethodInvocation(arguments=[], member=getBundle, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=ERR_UNABLE_TO_PARSE_INT_2, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=None, label=None, resources=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[int] identifier[getIntValueRounded] operator[SEP] identifier[String] identifier[value] , Keyword[int] identifier[defaultValue] , identifier[String] identifier[key] operator[SEP] {
Keyword[int] identifier[result] operator[SEP] Keyword[try] {
identifier[result] operator[=] identifier[Math] operator[SEP] identifier[round] operator[SEP] identifier[Float] operator[SEP] identifier[parseFloat] operator[SEP] identifier[value] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] identifier[Messages] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[getBundle] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[Messages] operator[SEP] identifier[ERR_UNABLE_TO_PARSE_INT_2] , identifier[value] , identifier[key] operator[SEP] operator[SEP] operator[SEP]
}
identifier[result] operator[=] identifier[defaultValue] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void newObject(TypeDesc type) {
if (type.isArray()) {
newObject(type, 1);
}
else {
ConstantInfo info = mCp.addConstantClass(type);
addCode(1, Opcode.NEW, info);
}
} | class class_name[name] begin[{]
method[newObject, return_type[void], modifier[public], parameter[type]] begin[{]
if[call[type.isArray, parameter[]]] begin[{]
call[.newObject, parameter[member[.type], literal[1]]]
else begin[{]
local_variable[type[ConstantInfo], info]
call[.addCode, parameter[literal[1], member[Opcode.NEW], member[.info]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[newObject] operator[SEP] identifier[TypeDesc] identifier[type] operator[SEP] {
Keyword[if] operator[SEP] identifier[type] operator[SEP] identifier[isArray] operator[SEP] operator[SEP] operator[SEP] {
identifier[newObject] operator[SEP] identifier[type] , Other[1] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[ConstantInfo] identifier[info] operator[=] identifier[mCp] operator[SEP] identifier[addConstantClass] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[addCode] operator[SEP] Other[1] , identifier[Opcode] operator[SEP] identifier[NEW] , identifier[info] operator[SEP] operator[SEP]
}
}
|
public static Diagram diagram( String name, Figure figure )
{
return new Diagram( requireNonNull( name, "name" ), FigureBuilder.root( requireNonNull( figure, "figure" ) ) );
} | class class_name[name] begin[{]
method[diagram, return_type[type[Diagram]], modifier[public static], parameter[name, figure]] begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="name")], member=requireNonNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=figure, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="figure")], member=requireNonNull, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=root, postfix_operators=[], prefix_operators=[], qualifier=FigureBuilder, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Diagram, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Diagram] identifier[diagram] operator[SEP] identifier[String] identifier[name] , identifier[Figure] identifier[figure] operator[SEP] {
Keyword[return] Keyword[new] identifier[Diagram] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[name] , literal[String] operator[SEP] , identifier[FigureBuilder] operator[SEP] identifier[root] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[figure] , literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Map<String, Object> read(InputStream stream)
throws IOException
{
ConfigJsonInput input = new ConfigJsonInput(new InputStreamReader(stream, StandardCharsets.UTF_8));
return read(input);
} | class class_name[name] begin[{]
method[read, return_type[type[Map]], modifier[public static], parameter[stream]] begin[{]
local_variable[type[ConfigJsonInput], input]
return[call[.read, parameter[member[.input]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[read] operator[SEP] identifier[InputStream] identifier[stream] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[ConfigJsonInput] identifier[input] operator[=] Keyword[new] identifier[ConfigJsonInput] operator[SEP] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[stream] , identifier[StandardCharsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[read] operator[SEP] identifier[input] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.