code stringlengths 63 466k | code_sememe stringlengths 141 3.79M | token_type stringlengths 274 1.23M |
|---|---|---|
private Boolean isInsideCITemplate(Page page) {
SourceCode sc = page.getSourceCode();
if (!(sc instanceof PageSourceCode)) return null;
PageSource psc = ((PageSourceCode) sc).getPageSource();
String src = psc.getDisplayPath();
return Constants.isComponentExtension(ResourceUtil.getExtension(src, ""));
// int pos=src.lastIndexOf(".");
// return pos!=-1 && pos<src.length() && src.substring(pos+1).equals(Constants.COMPONENT_EXTENSION);
} | class class_name[name] begin[{]
method[isInsideCITemplate, return_type[type[Boolean]], modifier[private], parameter[page]] begin[{]
local_variable[type[SourceCode], sc]
if[binary_operation[member[.sc], instanceof, type[PageSourceCode]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[PageSource], psc]
local_variable[type[String], src]
return[call[Constants.isComponentExtension, parameter[call[ResourceUtil.getExtension, parameter[member[.src], literal[""]]]]]]
end[}]
END[}] | Keyword[private] identifier[Boolean] identifier[isInsideCITemplate] operator[SEP] identifier[Page] identifier[page] operator[SEP] {
identifier[SourceCode] identifier[sc] operator[=] identifier[page] operator[SEP] identifier[getSourceCode] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] operator[SEP] identifier[sc] Keyword[instanceof] identifier[PageSourceCode] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP] identifier[PageSource] identifier[psc] operator[=] operator[SEP] operator[SEP] identifier[PageSourceCode] operator[SEP] identifier[sc] operator[SEP] operator[SEP] identifier[getPageSource] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[src] operator[=] identifier[psc] operator[SEP] identifier[getDisplayPath] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[Constants] operator[SEP] identifier[isComponentExtension] operator[SEP] identifier[ResourceUtil] operator[SEP] identifier[getExtension] operator[SEP] identifier[src] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
|
public String getConfigurationContentStringValue(String path) {
if (getConfigurationContent() != null) {
return getConfigurationContent().getStringValue(getCms(), path, getLocale());
}
return "";
} | class class_name[name] begin[{]
method[getConfigurationContentStringValue, return_type[type[String]], modifier[public], parameter[path]] begin[{]
if[binary_operation[call[.getConfigurationContent, parameter[]], !=, literal[null]]] begin[{]
return[call[.getConfigurationContent, parameter[]]]
else begin[{]
None
end[}]
return[literal[""]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getConfigurationContentStringValue] operator[SEP] identifier[String] identifier[path] operator[SEP] {
Keyword[if] operator[SEP] identifier[getConfigurationContent] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[getConfigurationContent] operator[SEP] operator[SEP] operator[SEP] identifier[getStringValue] operator[SEP] identifier[getCms] operator[SEP] operator[SEP] , identifier[path] , identifier[getLocale] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] literal[String] operator[SEP]
}
|
protected void validateEqualInteger(Integer i1, Integer i2, String errorKey, String errorMessage) {
if (i1 == null || i2 == null || (i1.intValue() != i2.intValue())) {
addError(errorKey, errorMessage);
}
} | class class_name[name] begin[{]
method[validateEqualInteger, return_type[void], modifier[protected], parameter[i1, i2, errorKey, errorMessage]] begin[{]
if[binary_operation[binary_operation[binary_operation[member[.i1], ==, literal[null]], ||, binary_operation[member[.i2], ==, literal[null]]], ||, binary_operation[call[i1.intValue, parameter[]], !=, call[i2.intValue, parameter[]]]]] begin[{]
call[.addError, parameter[member[.errorKey], member[.errorMessage]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[validateEqualInteger] operator[SEP] identifier[Integer] identifier[i1] , identifier[Integer] identifier[i2] , identifier[String] identifier[errorKey] , identifier[String] identifier[errorMessage] operator[SEP] {
Keyword[if] operator[SEP] identifier[i1] operator[==] Other[null] operator[||] identifier[i2] operator[==] Other[null] operator[||] operator[SEP] identifier[i1] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[!=] identifier[i2] operator[SEP] identifier[intValue] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[addError] operator[SEP] identifier[errorKey] , identifier[errorMessage] operator[SEP] operator[SEP]
}
}
|
public final ProtoParser.enum_body_return enum_body(Proto proto, Message message, EnumGroup enumGroup) throws RecognitionException {
ProtoParser.enum_body_return retval = new ProtoParser.enum_body_return();
retval.start = input.LT(1);
Object root_0 = null;
ProtoParser.enum_field_return enum_field124 = null;
ProtoParser.annotation_entry_return annotation_entry125 = null;
ProtoParser.option_entry_return option_entry126 = null;
try {
// com/dyuproject/protostuff/parser/ProtoParser.g:538:5: ( enum_field[proto, message, enumGroup] | annotation_entry[proto] | option_entry[proto, enumGroup] )
int alt24=3;
switch ( input.LA(1) ) {
case ID:
{
alt24=1;
}
break;
case AT:
{
alt24=2;
}
break;
case OPTION:
{
alt24=3;
}
break;
default:
if (state.backtracking>0) {state.failed=true; return retval;}
NoViableAltException nvae =
new NoViableAltException("", 24, 0, input);
throw nvae;
}
switch (alt24) {
case 1 :
// com/dyuproject/protostuff/parser/ProtoParser.g:538:9: enum_field[proto, message, enumGroup]
{
root_0 = (Object)adaptor.nil();
pushFollow(FOLLOW_enum_field_in_enum_body2132);
enum_field124=enum_field(proto, message, enumGroup);
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, enum_field124.getTree());
}
break;
case 2 :
// com/dyuproject/protostuff/parser/ProtoParser.g:539:9: annotation_entry[proto]
{
root_0 = (Object)adaptor.nil();
pushFollow(FOLLOW_annotation_entry_in_enum_body2143);
annotation_entry125=annotation_entry(proto);
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, annotation_entry125.getTree());
}
break;
case 3 :
// com/dyuproject/protostuff/parser/ProtoParser.g:540:9: option_entry[proto, enumGroup]
{
root_0 = (Object)adaptor.nil();
pushFollow(FOLLOW_option_entry_in_enum_body2154);
option_entry126=option_entry(proto, enumGroup);
state._fsp--;
if (state.failed) return retval;
if ( state.backtracking==0 ) adaptor.addChild(root_0, option_entry126.getTree());
}
break;
}
retval.stop = input.LT(-1);
if ( state.backtracking==0 ) {
retval.tree = (Object)adaptor.rulePostProcessing(root_0);
adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
}
finally {
}
return retval;
} | class class_name[name] begin[{]
method[enum_body, return_type[type[ProtoParser]], modifier[final public], parameter[proto, message, enumGroup]] begin[{]
local_variable[type[ProtoParser], retval]
assign[member[retval.start], call[input.LT, parameter[literal[1]]]]
local_variable[type[Object], root_0]
local_variable[type[ProtoParser], enum_field124]
local_variable[type[ProtoParser], annotation_entry125]
local_variable[type[ProtoParser], option_entry126]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), name=alt24)], modifiers=set(), type=BasicType(dimensions=[], name=int)), SwitchStatement(cases=[SwitchStatementCase(case=['ID'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt24, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['AT'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt24, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=['OPTION'], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=alt24, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)), label=None)]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[], statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None), ReturnStatement(expression=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=24), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=input, 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=NoViableAltException, sub_type=None)), name=nvae)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NoViableAltException, sub_type=None)), ThrowStatement(expression=MemberReference(member=nvae, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])], expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], member=LA, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), label=None), SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_enum_field_in_enum_body2132, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=enum_field124, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=proto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enumGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=enum_field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTree, postfix_operators=[], prefix_operators=[], qualifier=enum_field124, selectors=[], type_arguments=None)], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_annotation_entry_in_enum_body2143, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=annotation_entry125, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=proto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=annotation_entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTree, postfix_operators=[], prefix_operators=[], qualifier=annotation_entry125, selectors=[], type_arguments=None)], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None))]), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[], member=nil, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=FOLLOW_option_entry_in_enum_body2154, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=pushFollow, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=option_entry126, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=proto, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=enumGroup, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=option_entry, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MemberReference(member=_fsp, postfix_operators=['--'], prefix_operators=[], qualifier=state, selectors=[]), label=None), IfStatement(condition=MemberReference(member=failed, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=retval, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getTree, postfix_operators=[], prefix_operators=[], qualifier=option_entry126, selectors=[], type_arguments=None)], member=addChild, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None))]), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=alt24, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=backtracking, postfix_operators=[], prefix_operators=[], qualifier=state, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=root_0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=rulePostProcessing, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MemberReference(member=stop, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[])], member=setTokenBoundaries, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=reportError, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=recover, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=tree, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), type==, value=Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=start, postfix_operators=[], prefix_operators=[], qualifier=retval, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)], member=LT, postfix_operators=[], prefix_operators=[], qualifier=input, selectors=[], type_arguments=None), MemberReference(member=re, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=errorNode, postfix_operators=[], prefix_operators=[], qualifier=adaptor, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=re, types=['RecognitionException']))], finally_block=[], label=None, resources=None)
return[member[.retval]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[ProtoParser] operator[SEP] identifier[enum_body_return] identifier[enum_body] operator[SEP] identifier[Proto] identifier[proto] , identifier[Message] identifier[message] , identifier[EnumGroup] identifier[enumGroup] operator[SEP] Keyword[throws] identifier[RecognitionException] {
identifier[ProtoParser] operator[SEP] identifier[enum_body_return] identifier[retval] operator[=] Keyword[new] identifier[ProtoParser] operator[SEP] identifier[enum_body_return] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[start] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[Object] identifier[root_0] operator[=] Other[null] operator[SEP] identifier[ProtoParser] operator[SEP] identifier[enum_field_return] identifier[enum_field124] operator[=] Other[null] operator[SEP] identifier[ProtoParser] operator[SEP] identifier[annotation_entry_return] identifier[annotation_entry125] operator[=] Other[null] operator[SEP] identifier[ProtoParser] operator[SEP] identifier[option_entry_return] identifier[option_entry126] operator[=] Other[null] operator[SEP] Keyword[try] {
Keyword[int] identifier[alt24] operator[=] Other[3] operator[SEP] Keyword[switch] operator[SEP] identifier[input] operator[SEP] identifier[LA] operator[SEP] Other[1] operator[SEP] operator[SEP] {
Keyword[case] identifier[ID] operator[:] {
identifier[alt24] operator[=] Other[1] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[AT] operator[:] {
identifier[alt24] operator[=] Other[2] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] identifier[OPTION] operator[:] {
identifier[alt24] operator[=] Other[3] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[default] operator[:] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[>] Other[0] operator[SEP] {
identifier[state] operator[SEP] identifier[failed] operator[=] literal[boolean] operator[SEP] Keyword[return] identifier[retval] operator[SEP]
}
identifier[NoViableAltException] identifier[nvae] operator[=] Keyword[new] identifier[NoViableAltException] operator[SEP] literal[String] , Other[24] , Other[0] , identifier[input] operator[SEP] operator[SEP] Keyword[throw] identifier[nvae] operator[SEP]
}
Keyword[switch] operator[SEP] identifier[alt24] operator[SEP] {
Keyword[case] Other[1] operator[:] {
identifier[root_0] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FOLLOW_enum_field_in_enum_body2132] operator[SEP] operator[SEP] identifier[enum_field124] operator[=] identifier[enum_field] operator[SEP] identifier[proto] , identifier[message] , identifier[enumGroup] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[retval] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[enum_field124] operator[SEP] identifier[getTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] {
identifier[root_0] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FOLLOW_annotation_entry_in_enum_body2143] operator[SEP] operator[SEP] identifier[annotation_entry125] operator[=] identifier[annotation_entry] operator[SEP] identifier[proto] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[retval] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[annotation_entry125] operator[SEP] identifier[getTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] {
identifier[root_0] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[nil] operator[SEP] operator[SEP] operator[SEP] identifier[pushFollow] operator[SEP] identifier[FOLLOW_option_entry_in_enum_body2154] operator[SEP] operator[SEP] identifier[option_entry126] operator[=] identifier[option_entry] operator[SEP] identifier[proto] , identifier[enumGroup] operator[SEP] operator[SEP] identifier[state] operator[SEP] identifier[_fsp] operator[--] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[failed] operator[SEP] Keyword[return] identifier[retval] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] identifier[adaptor] operator[SEP] identifier[addChild] operator[SEP] identifier[root_0] , identifier[option_entry126] operator[SEP] identifier[getTree] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[break] operator[SEP]
}
identifier[retval] operator[SEP] identifier[stop] operator[=] identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[state] operator[SEP] identifier[backtracking] operator[==] Other[0] operator[SEP] {
identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[rulePostProcessing] operator[SEP] identifier[root_0] operator[SEP] operator[SEP] identifier[adaptor] operator[SEP] identifier[setTokenBoundaries] operator[SEP] identifier[retval] operator[SEP] identifier[tree] , identifier[retval] operator[SEP] identifier[start] , identifier[retval] operator[SEP] identifier[stop] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[RecognitionException] identifier[re] operator[SEP] {
identifier[reportError] operator[SEP] identifier[re] operator[SEP] operator[SEP] identifier[recover] operator[SEP] identifier[input] , identifier[re] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[tree] operator[=] operator[SEP] identifier[Object] operator[SEP] identifier[adaptor] operator[SEP] identifier[errorNode] operator[SEP] identifier[input] , identifier[retval] operator[SEP] identifier[start] , identifier[input] operator[SEP] identifier[LT] operator[SEP] operator[-] Other[1] operator[SEP] , identifier[re] operator[SEP] operator[SEP]
}
Keyword[finally] {
}
Keyword[return] identifier[retval] operator[SEP]
}
|
private boolean preparePending() {
// Copy the input queue into the write queue.
copyInputQueue();
// Now check the ops
Operation nextOp = getCurrentWriteOp();
while (nextOp != null && nextOp.isCancelled()) {
getLogger().info("Removing cancelled operation: %s", nextOp);
removeCurrentWriteOp();
nextOp = getCurrentWriteOp();
}
return nextOp != null;
} | class class_name[name] begin[{]
method[preparePending, return_type[type[boolean]], modifier[private], parameter[]] begin[{]
call[.copyInputQueue, parameter[]]
local_variable[type[Operation], nextOp]
while[binary_operation[binary_operation[member[.nextOp], !=, literal[null]], &&, call[nextOp.isCancelled, parameter[]]]] begin[{]
call[.getLogger, parameter[]]
call[.removeCurrentWriteOp, parameter[]]
assign[member[.nextOp], call[.getCurrentWriteOp, parameter[]]]
end[}]
return[binary_operation[member[.nextOp], !=, literal[null]]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[preparePending] operator[SEP] operator[SEP] {
identifier[copyInputQueue] operator[SEP] operator[SEP] operator[SEP] identifier[Operation] identifier[nextOp] operator[=] identifier[getCurrentWriteOp] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[nextOp] operator[!=] Other[null] operator[&&] identifier[nextOp] operator[SEP] identifier[isCancelled] operator[SEP] operator[SEP] operator[SEP] {
identifier[getLogger] operator[SEP] operator[SEP] operator[SEP] identifier[info] operator[SEP] literal[String] , identifier[nextOp] operator[SEP] operator[SEP] identifier[removeCurrentWriteOp] operator[SEP] operator[SEP] operator[SEP] identifier[nextOp] operator[=] identifier[getCurrentWriteOp] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[nextOp] operator[!=] Other[null] operator[SEP]
}
|
private static ModelExtractor tryLoadEngine(String engineClassName) {
try {
@SuppressWarnings("unchecked")
Class<? extends ModelExtractor> engineClass = (Class<? extends ModelExtractor>) Class.forName(engineClassName, false, ModelExtractors.class.getClassLoader());
return engineClass.newInstance();
} catch (ClassNotFoundException e) {
return null;
} catch (InstantiationException e) {
return null;
} catch (IllegalAccessException e) {
return null;
} catch (NoClassDefFoundError e) {
// a dependency of the engine may not be found on classpath
return null;
}
} | class class_name[name] begin[{]
method[tryLoadEngine, return_type[type[ModelExtractor]], modifier[private static], parameter[engineClassName]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[Annotation(element=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="unchecked"), name=SuppressWarnings)], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=engineClassName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getClassLoader, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=ModelExtractors, sub_type=None))], member=forName, postfix_operators=[], prefix_operators=[], qualifier=Class, selectors=[], type_arguments=None), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=ModelExtractor, sub_type=None))], dimensions=[], name=Class, sub_type=None)), name=engineClass)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=extends, type=ReferenceType(arguments=None, dimensions=[], name=ModelExtractor, sub_type=None))], dimensions=[], name=Class, sub_type=None)), ReturnStatement(expression=MethodInvocation(arguments=[], member=newInstance, postfix_operators=[], prefix_operators=[], qualifier=engineClass, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException'])), CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['InstantiationException'])), CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalAccessException'])), CatchClause(block=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NoClassDefFoundError']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[static] identifier[ModelExtractor] identifier[tryLoadEngine] operator[SEP] identifier[String] identifier[engineClassName] operator[SEP] {
Keyword[try] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ModelExtractor] operator[>] identifier[engineClass] operator[=] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[ModelExtractor] operator[>] operator[SEP] identifier[Class] operator[SEP] identifier[forName] operator[SEP] identifier[engineClassName] , literal[boolean] , identifier[ModelExtractors] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[engineClass] operator[SEP] identifier[newInstance] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InstantiationException] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalAccessException] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoClassDefFoundError] identifier[e] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
}
|
private static List<Element> getChildElements(Element node)
{
List<Element> elements = new Vector<Element>();
NodeList childs = node.getChildNodes();
for (int j = 0; j < childs.getLength(); j++)
{
// Node cNode = childs.item(j);
if (childs.item(j).getNodeName().equals(TAG_PROPERTY)
&& childs.item(j).getNodeType() == Node.ELEMENT_NODE)
{
elements.add((Element) childs.item(j));
}
}
return elements;
} | class class_name[name] begin[{]
method[getChildElements, return_type[type[List]], modifier[private static], parameter[node]] begin[{]
local_variable[type[List], elements]
local_variable[type[NodeList], childs]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=childs, selectors=[MethodInvocation(arguments=[], member=getNodeName, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=TAG_PROPERTY, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=childs, selectors=[MethodInvocation(arguments=[], member=getNodeType, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=ELEMENT_NODE, postfix_operators=[], prefix_operators=[], qualifier=Node, selectors=[]), operator===), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MethodInvocation(arguments=[MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=item, postfix_operators=[], prefix_operators=[], qualifier=childs, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Element, sub_type=None))], member=add, postfix_operators=[], prefix_operators=[], qualifier=elements, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=childs, selectors=[], type_arguments=None), 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)
return[member[.elements]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[List] operator[<] identifier[Element] operator[>] identifier[getChildElements] operator[SEP] identifier[Element] identifier[node] operator[SEP] {
identifier[List] operator[<] identifier[Element] operator[>] identifier[elements] operator[=] Keyword[new] identifier[Vector] operator[<] identifier[Element] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[NodeList] identifier[childs] operator[=] identifier[node] operator[SEP] identifier[getChildNodes] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[childs] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[childs] operator[SEP] identifier[item] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getNodeName] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[TAG_PROPERTY] operator[SEP] operator[&&] identifier[childs] operator[SEP] identifier[item] operator[SEP] identifier[j] operator[SEP] operator[SEP] identifier[getNodeType] operator[SEP] operator[SEP] operator[==] identifier[Node] operator[SEP] identifier[ELEMENT_NODE] operator[SEP] {
identifier[elements] operator[SEP] identifier[add] operator[SEP] operator[SEP] identifier[Element] operator[SEP] identifier[childs] operator[SEP] identifier[item] operator[SEP] identifier[j] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[elements] operator[SEP]
}
|
public UserManagedCacheBuilder<K, V, T> withSizeOfMaxObjectGraph(long size) {
UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
removeAnySizeOfEngine(otherBuilder);
otherBuilder.objectGraphSize = size;
otherBuilder.serviceCreationConfigurations.add(new DefaultSizeOfEngineProviderConfiguration(otherBuilder.maxObjectSize, otherBuilder.sizeOfUnit, otherBuilder.objectGraphSize));
return otherBuilder;
} | class class_name[name] begin[{]
method[withSizeOfMaxObjectGraph, return_type[type[UserManagedCacheBuilder]], modifier[public], parameter[size]] begin[{]
local_variable[type[UserManagedCacheBuilder], otherBuilder]
call[.removeAnySizeOfEngine, parameter[member[.otherBuilder]]]
assign[member[otherBuilder.objectGraphSize], member[.size]]
call[otherBuilder.serviceCreationConfigurations.add, parameter[ClassCreator(arguments=[MemberReference(member=maxObjectSize, postfix_operators=[], prefix_operators=[], qualifier=otherBuilder, selectors=[]), MemberReference(member=sizeOfUnit, postfix_operators=[], prefix_operators=[], qualifier=otherBuilder, selectors=[]), MemberReference(member=objectGraphSize, postfix_operators=[], prefix_operators=[], qualifier=otherBuilder, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=DefaultSizeOfEngineProviderConfiguration, sub_type=None))]]
return[member[.otherBuilder]]
end[}]
END[}] | Keyword[public] identifier[UserManagedCacheBuilder] operator[<] identifier[K] , identifier[V] , identifier[T] operator[>] identifier[withSizeOfMaxObjectGraph] operator[SEP] Keyword[long] identifier[size] operator[SEP] {
identifier[UserManagedCacheBuilder] operator[<] identifier[K] , identifier[V] , identifier[T] operator[>] identifier[otherBuilder] operator[=] Keyword[new] identifier[UserManagedCacheBuilder] operator[<] operator[>] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[removeAnySizeOfEngine] operator[SEP] identifier[otherBuilder] operator[SEP] operator[SEP] identifier[otherBuilder] operator[SEP] identifier[objectGraphSize] operator[=] identifier[size] operator[SEP] identifier[otherBuilder] operator[SEP] identifier[serviceCreationConfigurations] operator[SEP] identifier[add] operator[SEP] Keyword[new] identifier[DefaultSizeOfEngineProviderConfiguration] operator[SEP] identifier[otherBuilder] operator[SEP] identifier[maxObjectSize] , identifier[otherBuilder] operator[SEP] identifier[sizeOfUnit] , identifier[otherBuilder] operator[SEP] identifier[objectGraphSize] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[otherBuilder] operator[SEP]
}
|
public String getDivisionName(ProposalDevelopmentDocumentContract pdDoc) {
String divisionName = null;
if (pdDoc != null && pdDoc.getDevelopmentProposal().getOwnedByUnit() != null) {
UnitContract ownedByUnit = pdDoc.getDevelopmentProposal().getOwnedByUnit();
// traverse through the parent units till the top level unit
while (ownedByUnit.getParentUnit() != null) {
ownedByUnit = ownedByUnit.getParentUnit();
}
divisionName = ownedByUnit.getUnitName();
if (divisionName.length() > DIVISION_NAME_MAX_LENGTH) {
divisionName = divisionName.substring(0, DIVISION_NAME_MAX_LENGTH);
}
}
return divisionName;
} | class class_name[name] begin[{]
method[getDivisionName, return_type[type[String]], modifier[public], parameter[pdDoc]] begin[{]
local_variable[type[String], divisionName]
if[binary_operation[binary_operation[member[.pdDoc], !=, literal[null]], &&, binary_operation[call[pdDoc.getDevelopmentProposal, parameter[]], !=, literal[null]]]] begin[{]
local_variable[type[UnitContract], ownedByUnit]
while[binary_operation[call[ownedByUnit.getParentUnit, parameter[]], !=, literal[null]]] begin[{]
assign[member[.ownedByUnit], call[ownedByUnit.getParentUnit, parameter[]]]
end[}]
assign[member[.divisionName], call[ownedByUnit.getUnitName, parameter[]]]
if[binary_operation[call[divisionName.length, parameter[]], >, member[.DIVISION_NAME_MAX_LENGTH]]] begin[{]
assign[member[.divisionName], call[divisionName.substring, parameter[literal[0], member[.DIVISION_NAME_MAX_LENGTH]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.divisionName]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getDivisionName] operator[SEP] identifier[ProposalDevelopmentDocumentContract] identifier[pdDoc] operator[SEP] {
identifier[String] identifier[divisionName] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[pdDoc] operator[!=] Other[null] operator[&&] identifier[pdDoc] operator[SEP] identifier[getDevelopmentProposal] operator[SEP] operator[SEP] operator[SEP] identifier[getOwnedByUnit] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[UnitContract] identifier[ownedByUnit] operator[=] identifier[pdDoc] operator[SEP] identifier[getDevelopmentProposal] operator[SEP] operator[SEP] operator[SEP] identifier[getOwnedByUnit] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[ownedByUnit] operator[SEP] identifier[getParentUnit] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[ownedByUnit] operator[=] identifier[ownedByUnit] operator[SEP] identifier[getParentUnit] operator[SEP] operator[SEP] operator[SEP]
}
identifier[divisionName] operator[=] identifier[ownedByUnit] operator[SEP] identifier[getUnitName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[divisionName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] identifier[DIVISION_NAME_MAX_LENGTH] operator[SEP] {
identifier[divisionName] operator[=] identifier[divisionName] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[DIVISION_NAME_MAX_LENGTH] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[divisionName] operator[SEP]
}
|
public boolean containsKey(Long x, Long y)
{
// Extract the region containing the coordinates from the hash table
Bucket region = (Bucket) regions.get(new Coordinates(div(x, bucketSize), div(y, bucketSize)));
// Check if the whole region is empty
if (region == null)
{
return false;
}
// Check if the coordinates within the region contain data
return (region.array[mod(x, bucketSize)][mod(y, bucketSize)] != null);
} | class class_name[name] begin[{]
method[containsKey, return_type[type[boolean]], modifier[public], parameter[x, y]] begin[{]
local_variable[type[Bucket], region]
if[binary_operation[member[.region], ==, literal[null]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[binary_operation[member[region.array], !=, literal[null]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[containsKey] operator[SEP] identifier[Long] identifier[x] , identifier[Long] identifier[y] operator[SEP] {
identifier[Bucket] identifier[region] operator[=] operator[SEP] identifier[Bucket] operator[SEP] identifier[regions] operator[SEP] identifier[get] operator[SEP] Keyword[new] identifier[Coordinates] operator[SEP] identifier[div] operator[SEP] identifier[x] , identifier[bucketSize] operator[SEP] , identifier[div] operator[SEP] identifier[y] , identifier[bucketSize] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[region] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] operator[SEP] identifier[region] operator[SEP] identifier[array] operator[SEP] identifier[mod] operator[SEP] identifier[x] , identifier[bucketSize] operator[SEP] operator[SEP] operator[SEP] identifier[mod] operator[SEP] identifier[y] , identifier[bucketSize] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] operator[SEP]
}
|
public static JulianDate getJulianEasterSunday (final int nYear)
{
final int a = nYear % 4;
final int b = nYear % 7;
final int c = nYear % 19;
final int d = (19 * c + 15) % 30;
final int e = (2 * a + 4 * b - d + 34) % 7;
final int x = d + e + 114;
final int nMonth = x / 31;
final int nDay = (x % 31) + 1;
return JulianDate.of (nYear, (nMonth == 3 ? Month.MARCH : Month.APRIL).getValue (), nDay);
} | class class_name[name] begin[{]
method[getJulianEasterSunday, return_type[type[JulianDate]], modifier[public static], parameter[nYear]] begin[{]
local_variable[type[int], a]
local_variable[type[int], b]
local_variable[type[int], c]
local_variable[type[int], d]
local_variable[type[int], e]
local_variable[type[int], x]
local_variable[type[int], nMonth]
local_variable[type[int], nDay]
return[call[JulianDate.of, parameter[member[.nYear], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=nMonth, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3), operator===), if_false=MemberReference(member=APRIL, postfix_operators=[], prefix_operators=[], qualifier=Month, selectors=[]), if_true=MemberReference(member=MARCH, postfix_operators=[], prefix_operators=[], qualifier=Month, selectors=[])), member[.nDay]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[JulianDate] identifier[getJulianEasterSunday] operator[SEP] Keyword[final] Keyword[int] identifier[nYear] operator[SEP] {
Keyword[final] Keyword[int] identifier[a] operator[=] identifier[nYear] operator[%] Other[4] operator[SEP] Keyword[final] Keyword[int] identifier[b] operator[=] identifier[nYear] operator[%] Other[7] operator[SEP] Keyword[final] Keyword[int] identifier[c] operator[=] identifier[nYear] operator[%] Other[19] operator[SEP] Keyword[final] Keyword[int] identifier[d] operator[=] operator[SEP] Other[19] operator[*] identifier[c] operator[+] Other[15] operator[SEP] operator[%] Other[30] operator[SEP] Keyword[final] Keyword[int] identifier[e] operator[=] operator[SEP] Other[2] operator[*] identifier[a] operator[+] Other[4] operator[*] identifier[b] operator[-] identifier[d] operator[+] Other[34] operator[SEP] operator[%] Other[7] operator[SEP] Keyword[final] Keyword[int] identifier[x] operator[=] identifier[d] operator[+] identifier[e] operator[+] Other[114] operator[SEP] Keyword[final] Keyword[int] identifier[nMonth] operator[=] identifier[x] operator[/] Other[31] operator[SEP] Keyword[final] Keyword[int] identifier[nDay] operator[=] operator[SEP] identifier[x] operator[%] Other[31] operator[SEP] operator[+] Other[1] operator[SEP] Keyword[return] identifier[JulianDate] operator[SEP] identifier[of] operator[SEP] identifier[nYear] , operator[SEP] identifier[nMonth] operator[==] Other[3] operator[?] identifier[Month] operator[SEP] identifier[MARCH] operator[:] identifier[Month] operator[SEP] identifier[APRIL] operator[SEP] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] , identifier[nDay] operator[SEP] operator[SEP]
}
|
@Nonnull
public static AutoCloseable register(@Nonnull ServletInitializer servletInitializer,
@Nonnull PropertySource<?> source) {
final BigInteger bigInteger = new BigInteger(64, ThreadLocalRandom.current());
final String key = bigInteger.toString(16);
if (PROPERTIES.containsKey(key)) {
return register(servletInitializer, source); // shouldn't happen
}
// associate this key with the context parameter
servletInitializer.setInitParameter(PROPERTY_SOURCE_SERVLET_CONFIG_KEY, key);
// ... and put it to the globally visible properties map
PROPERTIES.put(key, source);
return new AutoCloseable() {
@Override
public void close() {
PROPERTIES.remove(key);
}
};
} | class class_name[name] begin[{]
method[register, return_type[type[AutoCloseable]], modifier[public static], parameter[servletInitializer, source]] begin[{]
local_variable[type[BigInteger], bigInteger]
local_variable[type[String], key]
if[call[PROPERTIES.containsKey, parameter[member[.key]]]] begin[{]
return[call[.register, parameter[member[.servletInitializer], member[.source]]]]
else begin[{]
None
end[}]
call[servletInitializer.setInitParameter, parameter[member[.PROPERTY_SOURCE_SERVLET_CONFIG_KEY], member[.key]]]
call[PROPERTIES.put, parameter[member[.key], member[.source]]]
return[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=PROPERTIES, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=close, 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=AutoCloseable, sub_type=None))]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] Keyword[static] identifier[AutoCloseable] identifier[register] operator[SEP] annotation[@] identifier[Nonnull] identifier[ServletInitializer] identifier[servletInitializer] , annotation[@] identifier[Nonnull] identifier[PropertySource] operator[<] operator[?] operator[>] identifier[source] operator[SEP] {
Keyword[final] identifier[BigInteger] identifier[bigInteger] operator[=] Keyword[new] identifier[BigInteger] operator[SEP] Other[64] , identifier[ThreadLocalRandom] operator[SEP] identifier[current] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[String] identifier[key] operator[=] identifier[bigInteger] operator[SEP] identifier[toString] operator[SEP] Other[16] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[PROPERTIES] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] {
Keyword[return] identifier[register] operator[SEP] identifier[servletInitializer] , identifier[source] operator[SEP] operator[SEP]
}
identifier[servletInitializer] operator[SEP] identifier[setInitParameter] operator[SEP] identifier[PROPERTY_SOURCE_SERVLET_CONFIG_KEY] , identifier[key] operator[SEP] operator[SEP] identifier[PROPERTIES] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[source] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[AutoCloseable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[close] operator[SEP] operator[SEP] {
identifier[PROPERTIES] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public static Map<String, Attribute> deepCopyAttributes(
EntityType entityType, EntityType entityTypeCopy, AttributeFactory attrFactory) {
Map<String, Attribute> copiedAttributes = new LinkedHashMap<>();
// step #1: deep copy attributes
Map<String, Attribute> ownAttrMap =
stream(entityType.getOwnAllAttributes())
.map(
attr -> {
Attribute attrCopy = Attribute.newInstance(attr, DEEP_COPY_ATTRS, attrFactory);
copiedAttributes.put(attr.getIdentifier(), attrCopy);
return attrCopy;
})
.map(attrCopy -> attrCopy.setEntity(entityTypeCopy))
.collect(toLinkedMap(Attribute::getName, Function.identity()));
// step #2: update attribute.parent relations
ownAttrMap.forEach(
(attrName, ownAttr) -> {
Attribute ownAttrParent = ownAttr.getParent();
if (ownAttrParent != null) {
ownAttr.setParent(ownAttrMap.get(ownAttrParent.getName()));
}
});
entityTypeCopy.setOwnAllAttributes(ownAttrMap.values());
return copiedAttributes;
} | class class_name[name] begin[{]
method[deepCopyAttributes, return_type[type[Map]], modifier[public static], parameter[entityType, entityTypeCopy, attrFactory]] begin[{]
local_variable[type[Map], copiedAttributes]
local_variable[type[Map], ownAttrMap]
call[ownAttrMap.forEach, parameter[LambdaExpression(body=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getParent, postfix_operators=[], prefix_operators=[], qualifier=ownAttr, selectors=[], type_arguments=None), name=ownAttrParent)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=ownAttrParent, 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=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=ownAttrParent, selectors=[], type_arguments=None)], member=get, postfix_operators=[], prefix_operators=[], qualifier=ownAttrMap, selectors=[], type_arguments=None)], member=setParent, postfix_operators=[], prefix_operators=[], qualifier=ownAttr, selectors=[], type_arguments=None), label=None)]))], parameters=[InferredFormalParameter(name=attrName), InferredFormalParameter(name=ownAttr)])]]
call[entityTypeCopy.setOwnAllAttributes, parameter[call[ownAttrMap.values, parameter[]]]]
return[member[.copiedAttributes]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Attribute] operator[>] identifier[deepCopyAttributes] operator[SEP] identifier[EntityType] identifier[entityType] , identifier[EntityType] identifier[entityTypeCopy] , identifier[AttributeFactory] identifier[attrFactory] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Attribute] operator[>] identifier[copiedAttributes] operator[=] Keyword[new] identifier[LinkedHashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Attribute] operator[>] identifier[ownAttrMap] operator[=] identifier[stream] operator[SEP] identifier[entityType] operator[SEP] identifier[getOwnAllAttributes] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[attr] operator[->] {
identifier[Attribute] identifier[attrCopy] operator[=] identifier[Attribute] operator[SEP] identifier[newInstance] operator[SEP] identifier[attr] , identifier[DEEP_COPY_ATTRS] , identifier[attrFactory] operator[SEP] operator[SEP] identifier[copiedAttributes] operator[SEP] identifier[put] operator[SEP] identifier[attr] operator[SEP] identifier[getIdentifier] operator[SEP] operator[SEP] , identifier[attrCopy] operator[SEP] operator[SEP] Keyword[return] identifier[attrCopy] operator[SEP]
} operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[attrCopy] operator[->] identifier[attrCopy] operator[SEP] identifier[setEntity] operator[SEP] identifier[entityTypeCopy] operator[SEP] operator[SEP] operator[SEP] identifier[collect] operator[SEP] identifier[toLinkedMap] operator[SEP] identifier[Attribute] operator[::] identifier[getName] , identifier[Function] operator[SEP] identifier[identity] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[ownAttrMap] operator[SEP] identifier[forEach] operator[SEP] operator[SEP] identifier[attrName] , identifier[ownAttr] operator[SEP] operator[->] {
identifier[Attribute] identifier[ownAttrParent] operator[=] identifier[ownAttr] operator[SEP] identifier[getParent] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ownAttrParent] operator[!=] Other[null] operator[SEP] {
identifier[ownAttr] operator[SEP] identifier[setParent] operator[SEP] identifier[ownAttrMap] operator[SEP] identifier[get] operator[SEP] identifier[ownAttrParent] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[entityTypeCopy] operator[SEP] identifier[setOwnAllAttributes] operator[SEP] identifier[ownAttrMap] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[copiedAttributes] operator[SEP]
}
|
public Query orderby(final Expression... orderbyColumns) {
if (orderbyColumns == null) {
return this;
}
return orderby(Arrays.asList(orderbyColumns));
} | class class_name[name] begin[{]
method[orderby, return_type[type[Query]], modifier[public], parameter[orderbyColumns]] begin[{]
if[binary_operation[member[.orderbyColumns], ==, literal[null]]] begin[{]
return[THIS[]]
else begin[{]
None
end[}]
return[call[.orderby, parameter[call[Arrays.asList, parameter[member[.orderbyColumns]]]]]]
end[}]
END[}] | Keyword[public] identifier[Query] identifier[orderby] operator[SEP] Keyword[final] identifier[Expression] operator[...] identifier[orderbyColumns] operator[SEP] {
Keyword[if] operator[SEP] identifier[orderbyColumns] operator[==] Other[null] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP]
}
Keyword[return] identifier[orderby] operator[SEP] identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[orderbyColumns] operator[SEP] operator[SEP] operator[SEP]
}
|
public ServiceFuture<List<JobExecutionInner>> listByJobAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final ListOperationCallback<JobExecutionInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listByJobSinglePageAsync(resourceGroupName, serverName, jobAgentName, jobName),
new Func1<String, Observable<ServiceResponse<Page<JobExecutionInner>>>>() {
@Override
public Observable<ServiceResponse<Page<JobExecutionInner>>> call(String nextPageLink) {
return listByJobNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
} | class class_name[name] begin[{]
method[listByJobAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, serverName, jobAgentName, jobName, serviceCallback]] begin[{]
return[call[AzureServiceFuture.fromPageResponse, parameter[call[.listByJobSinglePageAsync, parameter[member[.resourceGroupName], member[.serverName], member[.jobAgentName], member[.jobName]]], ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nextPageLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listByJobNextSinglePageAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=call, parameters=[FormalParameter(annotations=[], modifiers=set(), name=nextPageLink, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JobExecutionInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None), throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=JobExecutionInner, sub_type=None))], dimensions=[], name=Page, sub_type=None))], dimensions=[], name=ServiceResponse, sub_type=None))], dimensions=[], name=Observable, sub_type=None))], dimensions=None, name=Func1, sub_type=None)), member[.serviceCallback]]]]
end[}]
END[}] | Keyword[public] identifier[ServiceFuture] operator[<] identifier[List] operator[<] identifier[JobExecutionInner] operator[>] operator[>] identifier[listByJobAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[String] identifier[serverName] , Keyword[final] identifier[String] identifier[jobAgentName] , Keyword[final] identifier[String] identifier[jobName] , Keyword[final] identifier[ListOperationCallback] operator[<] identifier[JobExecutionInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[AzureServiceFuture] operator[SEP] identifier[fromPageResponse] operator[SEP] identifier[listByJobSinglePageAsync] operator[SEP] identifier[resourceGroupName] , identifier[serverName] , identifier[jobAgentName] , identifier[jobName] operator[SEP] , Keyword[new] identifier[Func1] operator[<] identifier[String] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[JobExecutionInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[JobExecutionInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[String] identifier[nextPageLink] operator[SEP] {
Keyword[return] identifier[listByJobNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP]
}
} , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
protected boolean needsTrailingSlashRedirect(HttpServletRequest request, String requestPath, ActionExecute execute) {
if (isOutOfTrailingSlashRedirect(request, requestPath, execute)) {
return false;
}
if (isSuppressTrailingSlashRedirect(request, requestPath, execute)) {
return false;
}
return isNonTrailingSlashRequest(request, requestPath, execute);
} | class class_name[name] begin[{]
method[needsTrailingSlashRedirect, return_type[type[boolean]], modifier[protected], parameter[request, requestPath, execute]] begin[{]
if[call[.isOutOfTrailingSlashRedirect, parameter[member[.request], member[.requestPath], member[.execute]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[call[.isSuppressTrailingSlashRedirect, parameter[member[.request], member[.requestPath], member[.execute]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[call[.isNonTrailingSlashRequest, parameter[member[.request], member[.requestPath], member[.execute]]]]
end[}]
END[}] | Keyword[protected] Keyword[boolean] identifier[needsTrailingSlashRedirect] operator[SEP] identifier[HttpServletRequest] identifier[request] , identifier[String] identifier[requestPath] , identifier[ActionExecute] identifier[execute] operator[SEP] {
Keyword[if] operator[SEP] identifier[isOutOfTrailingSlashRedirect] operator[SEP] identifier[request] , identifier[requestPath] , identifier[execute] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isSuppressTrailingSlashRedirect] operator[SEP] identifier[request] , identifier[requestPath] , identifier[execute] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] identifier[isNonTrailingSlashRequest] operator[SEP] identifier[request] , identifier[requestPath] , identifier[execute] operator[SEP] operator[SEP]
}
|
private static boolean looksLikeTLS(ChannelBuffer buffer) {
// TLS starts as
// 0: 0x16 - handshake protocol magic
// 1: 0x03 - SSL version major
// 2: 0x00 to 0x03 - SSL version minor (SSLv3 or TLS1.0 through TLS1.2)
// 3-4: length (2 bytes)
// 5: 0x01 - handshake type (ClientHello)
// 6-8: handshake len (3 bytes), equals value from offset 3-4 minus 4
// Framed binary starts as
// 0-3: frame len
// 4: 0x80 - binary magic
// 5: 0x01 - protocol version
// 6-7: various
// 8-11: method name len
// Other Thrift transports/protocols can't conflict because they don't have
// 16-03-01 at offsets 0-1-5.
// Definitely not TLS
if (buffer.getByte(0) != 0x16 || buffer.getByte(1) != 0x03 || buffer.getByte(5) != 0x01) {
return false;
}
// This is most likely TLS, but could be framed binary, which has 80-01
// at offsets 4-5.
if (buffer.getByte(4) == 0x80 && buffer.getByte(8) != 0x7c) {
// Binary will have the method name length at offsets 8-11, which must be
// smaller than the frame length at 0-3, so byte 8 is <= byte 0,
// which is 0x16.
// However, for TLS, bytes 6-8 (24 bits) are the length of the
// handshake protocol and this value is 4 less than the record-layer
// length at offset 3-4 (16 bits), so byte 8 equals 0x7c (0x80 - 4),
// which is not smaller than 0x16
return false;
}
return true;
} | class class_name[name] begin[{]
method[looksLikeTLS, return_type[type[boolean]], modifier[private static], parameter[buffer]] begin[{]
if[binary_operation[binary_operation[binary_operation[call[buffer.getByte, parameter[literal[0]]], !=, literal[0x16]], ||, binary_operation[call[buffer.getByte, parameter[literal[1]]], !=, literal[0x03]]], ||, binary_operation[call[buffer.getByte, parameter[literal[5]]], !=, literal[0x01]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[call[buffer.getByte, parameter[literal[4]]], ==, literal[0x80]], &&, binary_operation[call[buffer.getByte, parameter[literal[8]]], !=, literal[0x7c]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[boolean] identifier[looksLikeTLS] operator[SEP] identifier[ChannelBuffer] identifier[buffer] operator[SEP] {
Keyword[if] operator[SEP] identifier[buffer] operator[SEP] identifier[getByte] operator[SEP] Other[0] operator[SEP] operator[!=] literal[Integer] operator[||] identifier[buffer] operator[SEP] identifier[getByte] operator[SEP] Other[1] operator[SEP] operator[!=] literal[Integer] operator[||] identifier[buffer] operator[SEP] identifier[getByte] operator[SEP] Other[5] operator[SEP] operator[!=] literal[Integer] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[buffer] operator[SEP] identifier[getByte] operator[SEP] Other[4] operator[SEP] operator[==] literal[Integer] operator[&&] identifier[buffer] operator[SEP] identifier[getByte] operator[SEP] Other[8] operator[SEP] operator[!=] literal[Integer] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public String getTimexValueEB() {
if (Timex3Interval_Type.featOkTst && ((Timex3Interval_Type)jcasType).casFeat_TimexValueEB == null)
jcasType.jcas.throwFeatMissing("TimexValueEB", "de.unihd.dbs.uima.types.heideltime.Timex3Interval");
return jcasType.ll_cas.ll_getStringValue(addr, ((Timex3Interval_Type)jcasType).casFeatCode_TimexValueEB);} | class class_name[name] begin[{]
method[getTimexValueEB, return_type[type[String]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[Timex3Interval_Type.featOkTst], &&, binary_operation[Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Timex3Interval_Type, sub_type=None)), ==, literal[null]]]] begin[{]
call[jcasType.jcas.throwFeatMissing, parameter[literal["TimexValueEB"], literal["de.unihd.dbs.uima.types.heideltime.Timex3Interval"]]]
else begin[{]
None
end[}]
return[call[jcasType.ll_cas.ll_getStringValue, parameter[member[.addr], Cast(expression=MemberReference(member=jcasType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Timex3Interval_Type, sub_type=None))]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getTimexValueEB] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[Timex3Interval_Type] operator[SEP] identifier[featOkTst] operator[&&] operator[SEP] operator[SEP] identifier[Timex3Interval_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeat_TimexValueEB] operator[==] Other[null] operator[SEP] identifier[jcasType] operator[SEP] identifier[jcas] operator[SEP] identifier[throwFeatMissing] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[jcasType] operator[SEP] identifier[ll_cas] operator[SEP] identifier[ll_getStringValue] operator[SEP] identifier[addr] , operator[SEP] operator[SEP] identifier[Timex3Interval_Type] operator[SEP] identifier[jcasType] operator[SEP] operator[SEP] identifier[casFeatCode_TimexValueEB] operator[SEP] operator[SEP]
}
|
@Override
public SendAutomationSignalResult sendAutomationSignal(SendAutomationSignalRequest request) {
request = beforeClientExecution(request);
return executeSendAutomationSignal(request);
} | class class_name[name] begin[{]
method[sendAutomationSignal, return_type[type[SendAutomationSignalResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeSendAutomationSignal, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[SendAutomationSignalResult] identifier[sendAutomationSignal] operator[SEP] identifier[SendAutomationSignalRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeSendAutomationSignal] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public void marshall(UpdateServiceRequest updateServiceRequest, ProtocolMarshaller protocolMarshaller) {
if (updateServiceRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateServiceRequest.getCluster(), CLUSTER_BINDING);
protocolMarshaller.marshall(updateServiceRequest.getService(), SERVICE_BINDING);
protocolMarshaller.marshall(updateServiceRequest.getDesiredCount(), DESIREDCOUNT_BINDING);
protocolMarshaller.marshall(updateServiceRequest.getTaskDefinition(), TASKDEFINITION_BINDING);
protocolMarshaller.marshall(updateServiceRequest.getDeploymentConfiguration(), DEPLOYMENTCONFIGURATION_BINDING);
protocolMarshaller.marshall(updateServiceRequest.getNetworkConfiguration(), NETWORKCONFIGURATION_BINDING);
protocolMarshaller.marshall(updateServiceRequest.getPlatformVersion(), PLATFORMVERSION_BINDING);
protocolMarshaller.marshall(updateServiceRequest.getForceNewDeployment(), FORCENEWDEPLOYMENT_BINDING);
protocolMarshaller.marshall(updateServiceRequest.getHealthCheckGracePeriodSeconds(), HEALTHCHECKGRACEPERIODSECONDS_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[updateServiceRequest, protocolMarshaller]] begin[{]
if[binary_operation[member[.updateServiceRequest], ==, 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=getCluster, postfix_operators=[], prefix_operators=[], qualifier=updateServiceRequest, selectors=[], type_arguments=None), MemberReference(member=CLUSTER_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=getService, postfix_operators=[], prefix_operators=[], qualifier=updateServiceRequest, selectors=[], type_arguments=None), MemberReference(member=SERVICE_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=getDesiredCount, postfix_operators=[], prefix_operators=[], qualifier=updateServiceRequest, selectors=[], type_arguments=None), MemberReference(member=DESIREDCOUNT_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=getTaskDefinition, postfix_operators=[], prefix_operators=[], qualifier=updateServiceRequest, selectors=[], type_arguments=None), MemberReference(member=TASKDEFINITION_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=getDeploymentConfiguration, postfix_operators=[], prefix_operators=[], qualifier=updateServiceRequest, selectors=[], type_arguments=None), MemberReference(member=DEPLOYMENTCONFIGURATION_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=getNetworkConfiguration, postfix_operators=[], prefix_operators=[], qualifier=updateServiceRequest, selectors=[], type_arguments=None), MemberReference(member=NETWORKCONFIGURATION_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=getPlatformVersion, postfix_operators=[], prefix_operators=[], qualifier=updateServiceRequest, selectors=[], type_arguments=None), MemberReference(member=PLATFORMVERSION_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=getForceNewDeployment, postfix_operators=[], prefix_operators=[], qualifier=updateServiceRequest, selectors=[], type_arguments=None), MemberReference(member=FORCENEWDEPLOYMENT_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=getHealthCheckGracePeriodSeconds, postfix_operators=[], prefix_operators=[], qualifier=updateServiceRequest, selectors=[], type_arguments=None), MemberReference(member=HEALTHCHECKGRACEPERIODSECONDS_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[UpdateServiceRequest] identifier[updateServiceRequest] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[updateServiceRequest] 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[updateServiceRequest] operator[SEP] identifier[getCluster] operator[SEP] operator[SEP] , identifier[CLUSTER_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateServiceRequest] operator[SEP] identifier[getService] operator[SEP] operator[SEP] , identifier[SERVICE_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateServiceRequest] operator[SEP] identifier[getDesiredCount] operator[SEP] operator[SEP] , identifier[DESIREDCOUNT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateServiceRequest] operator[SEP] identifier[getTaskDefinition] operator[SEP] operator[SEP] , identifier[TASKDEFINITION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateServiceRequest] operator[SEP] identifier[getDeploymentConfiguration] operator[SEP] operator[SEP] , identifier[DEPLOYMENTCONFIGURATION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateServiceRequest] operator[SEP] identifier[getNetworkConfiguration] operator[SEP] operator[SEP] , identifier[NETWORKCONFIGURATION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateServiceRequest] operator[SEP] identifier[getPlatformVersion] operator[SEP] operator[SEP] , identifier[PLATFORMVERSION_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateServiceRequest] operator[SEP] identifier[getForceNewDeployment] operator[SEP] operator[SEP] , identifier[FORCENEWDEPLOYMENT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[updateServiceRequest] operator[SEP] identifier[getHealthCheckGracePeriodSeconds] operator[SEP] operator[SEP] , identifier[HEALTHCHECKGRACEPERIODSECONDS_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 boolean isProductive(Class<?> bundleClass) {
NlsBundleOptions options = bundleClass.getAnnotation(NlsBundleOptions.class);
if (options != null) {
return options.productive();
}
return true;
} | class class_name[name] begin[{]
method[isProductive, return_type[type[boolean]], modifier[private], parameter[bundleClass]] begin[{]
local_variable[type[NlsBundleOptions], options]
if[binary_operation[member[.options], !=, literal[null]]] begin[{]
return[call[options.productive, parameter[]]]
else begin[{]
None
end[}]
return[literal[true]]
end[}]
END[}] | Keyword[private] Keyword[boolean] identifier[isProductive] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[bundleClass] operator[SEP] {
identifier[NlsBundleOptions] identifier[options] operator[=] identifier[bundleClass] operator[SEP] identifier[getAnnotation] operator[SEP] identifier[NlsBundleOptions] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[options] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[options] operator[SEP] identifier[productive] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
public static base_response update(nitro_service client, nshostname resource) throws Exception {
nshostname updateresource = new nshostname();
updateresource.hostname = resource.hostname;
updateresource.ownernode = resource.ownernode;
return updateresource.update_resource(client);
} | class class_name[name] begin[{]
method[update, return_type[type[base_response]], modifier[public static], parameter[client, resource]] begin[{]
local_variable[type[nshostname], updateresource]
assign[member[updateresource.hostname], member[resource.hostname]]
assign[member[updateresource.ownernode], member[resource.ownernode]]
return[call[updateresource.update_resource, parameter[member[.client]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[base_response] identifier[update] operator[SEP] identifier[nitro_service] identifier[client] , identifier[nshostname] identifier[resource] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[nshostname] identifier[updateresource] operator[=] Keyword[new] identifier[nshostname] operator[SEP] operator[SEP] operator[SEP] identifier[updateresource] operator[SEP] identifier[hostname] operator[=] identifier[resource] operator[SEP] identifier[hostname] operator[SEP] identifier[updateresource] operator[SEP] identifier[ownernode] operator[=] identifier[resource] operator[SEP] identifier[ownernode] operator[SEP] Keyword[return] identifier[updateresource] operator[SEP] identifier[update_resource] operator[SEP] identifier[client] operator[SEP] operator[SEP]
}
|
protected void publishChangedFile(
CmsDbContext dbc,
CmsProject onlineProject,
CmsResource offlineResource,
Set<CmsUUID> publishedResourceIds,
CmsUUID publishHistoryId,
int publishTag)
throws CmsDataAccessException {
CmsResource onlineResource = null;
boolean needToUpdateContent = true;
boolean existsOnline = m_driverManager.getVfsDriver(dbc).validateStructureIdExists(
dbc,
CmsProject.ONLINE_PROJECT_ID,
offlineResource.getStructureId());
CmsResourceState resourceState = existsOnline
? fixMovedResource(dbc, onlineProject, offlineResource, publishHistoryId, publishTag)
: offlineResource.getState();
try {
// reset the labeled link flag before writing the online file
int flags = offlineResource.getFlags();
flags &= ~CmsResource.FLAG_LABELED;
offlineResource.setFlags(flags);
if (existsOnline) {
// read the file header online
onlineResource = m_driverManager.getVfsDriver(dbc).readResource(
dbc,
onlineProject.getUuid(),
offlineResource.getStructureId(),
false);
needToUpdateContent = (onlineResource.getDateContent() < offlineResource.getDateContent());
// delete the properties online
m_driverManager.getVfsDriver(dbc).deletePropertyObjects(
dbc,
onlineProject.getUuid(),
onlineResource,
CmsProperty.DELETE_OPTION_DELETE_STRUCTURE_AND_RESOURCE_VALUES);
// if the offline file has a resource ID different from the online file
// (probably because a deleted file was replaced by a new file with the
// same name), the properties mapped to the "old" resource ID have to be
// deleted also offline. if this is the case, the online and offline structure
// ID's do match, but the resource ID's are different. structure IDs are reused
// to prevent orphan structure records in the online project.
if (!onlineResource.getResourceId().equals(offlineResource.getResourceId())) {
List<CmsProperty> offlineProperties = m_driverManager.getVfsDriver(dbc).readPropertyObjects(
dbc,
dbc.currentProject(),
onlineResource);
if (offlineProperties.size() > 0) {
for (int i = 0; i < offlineProperties.size(); i++) {
CmsProperty property = offlineProperties.get(i);
property.setStructureValue(null);
property.setResourceValue(CmsProperty.DELETE_VALUE);
}
m_driverManager.getVfsDriver(dbc).writePropertyObjects(
dbc,
dbc.currentProject(),
onlineResource,
offlineProperties);
}
}
}
} catch (CmsDataAccessException e) {
if (LOG.isErrorEnabled()) {
LOG.error(
Messages.get().getBundle().key(Messages.LOG_DELETING_PROPERTIES_1, offlineResource.toString()),
e);
}
throw e;
}
CmsFile newFile;
try {
// publish the file content
newFile = m_driverManager.getProjectDriver(dbc).publishFileContent(
dbc,
dbc.currentProject(),
onlineProject,
offlineResource,
publishedResourceIds,
needToUpdateContent,
publishTag);
} catch (CmsDataAccessException e) {
if (LOG.isErrorEnabled()) {
LOG.error(
Messages.get().getBundle().key(Messages.LOG_PUBLISHING_RESOURCE_1, offlineResource.getRootPath()),
e);
}
throw e;
}
List<CmsProperty> offlineProperties;
try {
// write the properties online
offlineProperties = m_driverManager.getVfsDriver(dbc).readPropertyObjects(
dbc,
dbc.currentProject(),
offlineResource);
CmsProperty.setAutoCreatePropertyDefinitions(offlineProperties, true);
m_driverManager.getVfsDriver(dbc).writePropertyObjects(dbc, onlineProject, newFile, offlineProperties);
} catch (CmsDataAccessException e) {
if (LOG.isErrorEnabled()) {
LOG.error(
Messages.get().getBundle().key(Messages.LOG_PUBLISHING_PROPERTIES_1, newFile.getRootPath()),
e);
}
throw e;
}
try {
// write the ACL online
m_driverManager.getUserDriver(dbc).publishAccessControlEntries(
dbc,
dbc.currentProject(),
onlineProject,
newFile.getResourceId(),
offlineResource.getResourceId());
} catch (CmsDataAccessException e) {
if (LOG.isErrorEnabled()) {
LOG.error(Messages.get().getBundle().key(Messages.LOG_PUBLISHING_ACL_1, newFile.getRootPath()), e);
}
throw e;
}
CmsFile offlineFile = new CmsFile(offlineResource);
offlineFile.setContents(newFile.getContents());
internalWriteHistory(dbc, offlineFile, resourceState, offlineProperties, publishHistoryId, publishTag);
m_driverManager.getVfsDriver(dbc).updateRelations(dbc, onlineProject, offlineResource);
} | class class_name[name] begin[{]
method[publishChangedFile, return_type[void], modifier[protected], parameter[dbc, onlineProject, offlineResource, publishedResourceIds, publishHistoryId, publishTag]] begin[{]
local_variable[type[CmsResource], onlineResource]
local_variable[type[boolean], needToUpdateContent]
local_variable[type[boolean], existsOnline]
local_variable[type[CmsResourceState], resourceState]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFlags, postfix_operators=[], prefix_operators=[], qualifier=offlineResource, selectors=[], type_arguments=None), name=flags)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=&=, value=MemberReference(member=FLAG_LABELED, postfix_operators=[], prefix_operators=['~'], qualifier=CmsResource, selectors=[])), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=flags, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setFlags, postfix_operators=[], prefix_operators=[], qualifier=offlineResource, selectors=[], type_arguments=None), label=None), IfStatement(condition=MemberReference(member=existsOnline, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=onlineResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getVfsDriver, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getUuid, postfix_operators=[], prefix_operators=[], qualifier=onlineProject, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getStructureId, postfix_operators=[], prefix_operators=[], qualifier=offlineResource, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=readResource, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=needToUpdateContent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getDateContent, postfix_operators=[], prefix_operators=[], qualifier=onlineResource, selectors=[], type_arguments=None), operandr=MethodInvocation(arguments=[], member=getDateContent, postfix_operators=[], prefix_operators=[], qualifier=offlineResource, selectors=[], type_arguments=None), operator=<)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getVfsDriver, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getUuid, postfix_operators=[], prefix_operators=[], qualifier=onlineProject, selectors=[], type_arguments=None), MemberReference(member=onlineResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=DELETE_OPTION_DELETE_STRUCTURE_AND_RESOURCE_VALUES, postfix_operators=[], prefix_operators=[], qualifier=CmsProperty, selectors=[])], member=deletePropertyObjects, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), IfStatement(condition=MethodInvocation(arguments=[], member=getResourceId, postfix_operators=[], prefix_operators=['!'], qualifier=onlineResource, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getResourceId, postfix_operators=[], prefix_operators=[], qualifier=offlineResource, selectors=[], type_arguments=None)], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getVfsDriver, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=currentProject, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), MemberReference(member=onlineResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readPropertyObjects, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=offlineProperties)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=CmsProperty, sub_type=None))], dimensions=[], name=List, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=offlineProperties, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=offlineProperties, selectors=[], type_arguments=None), name=property)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=CmsProperty, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null)], member=setStructureValue, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=DELETE_VALUE, postfix_operators=[], prefix_operators=[], qualifier=CmsProperty, selectors=[])], member=setResourceValue, postfix_operators=[], prefix_operators=[], qualifier=property, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MethodInvocation(arguments=[], member=size, postfix_operators=[], prefix_operators=[], qualifier=offlineProperties, selectors=[], type_arguments=None), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getVfsDriver, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=currentProject, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), MemberReference(member=onlineResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offlineProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writePropertyObjects, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]))]))]))], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, 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=LOG_DELETING_PROPERTIES_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=offlineResource, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsDataAccessException']))], finally_block=None, label=None, resources=None)
local_variable[type[CmsFile], newFile]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=newFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getProjectDriver, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=currentProject, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), MemberReference(member=onlineProject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offlineResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=publishedResourceIds, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=needToUpdateContent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=publishTag, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=publishFileContent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, 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=LOG_PUBLISHING_RESOURCE_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=offlineResource, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsDataAccessException']))], finally_block=None, label=None, resources=None)
local_variable[type[List], offlineProperties]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=offlineProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getVfsDriver, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=currentProject, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), MemberReference(member=offlineResource, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readPropertyObjects, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=offlineProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=setAutoCreatePropertyDefinitions, postfix_operators=[], prefix_operators=[], qualifier=CmsProperty, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getVfsDriver, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=onlineProject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=offlineProperties, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=writePropertyObjects, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, 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=LOG_PUBLISHING_PROPERTIES_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=newFile, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsDataAccessException']))], finally_block=None, label=None, resources=None)
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getUserDriver, postfix_operators=[], prefix_operators=[], qualifier=m_driverManager, selectors=[MethodInvocation(arguments=[MemberReference(member=dbc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=currentProject, postfix_operators=[], prefix_operators=[], qualifier=dbc, selectors=[], type_arguments=None), MemberReference(member=onlineProject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getResourceId, postfix_operators=[], prefix_operators=[], qualifier=newFile, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getResourceId, postfix_operators=[], prefix_operators=[], qualifier=offlineResource, selectors=[], type_arguments=None)], member=publishAccessControlEntries, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=isErrorEnabled, 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=LOG_PUBLISHING_ACL_1, postfix_operators=[], prefix_operators=[], qualifier=Messages, selectors=[]), MethodInvocation(arguments=[], member=getRootPath, postfix_operators=[], prefix_operators=[], qualifier=newFile, selectors=[], type_arguments=None)], member=key, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)])), ThrowStatement(expression=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CmsDataAccessException']))], finally_block=None, label=None, resources=None)
local_variable[type[CmsFile], offlineFile]
call[offlineFile.setContents, parameter[call[newFile.getContents, parameter[]]]]
call[.internalWriteHistory, parameter[member[.dbc], member[.offlineFile], member[.resourceState], member[.offlineProperties], member[.publishHistoryId], member[.publishTag]]]
call[m_driverManager.getVfsDriver, parameter[member[.dbc]]]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[publishChangedFile] operator[SEP] identifier[CmsDbContext] identifier[dbc] , identifier[CmsProject] identifier[onlineProject] , identifier[CmsResource] identifier[offlineResource] , identifier[Set] operator[<] identifier[CmsUUID] operator[>] identifier[publishedResourceIds] , identifier[CmsUUID] identifier[publishHistoryId] , Keyword[int] identifier[publishTag] operator[SEP] Keyword[throws] identifier[CmsDataAccessException] {
identifier[CmsResource] identifier[onlineResource] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[needToUpdateContent] operator[=] literal[boolean] operator[SEP] Keyword[boolean] identifier[existsOnline] operator[=] identifier[m_driverManager] operator[SEP] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[validateStructureIdExists] operator[SEP] identifier[dbc] , identifier[CmsProject] operator[SEP] identifier[ONLINE_PROJECT_ID] , identifier[offlineResource] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[CmsResourceState] identifier[resourceState] operator[=] identifier[existsOnline] operator[?] identifier[fixMovedResource] operator[SEP] identifier[dbc] , identifier[onlineProject] , identifier[offlineResource] , identifier[publishHistoryId] , identifier[publishTag] operator[SEP] operator[:] identifier[offlineResource] operator[SEP] identifier[getState] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
Keyword[int] identifier[flags] operator[=] identifier[offlineResource] operator[SEP] identifier[getFlags] operator[SEP] operator[SEP] operator[SEP] identifier[flags] operator[&=] operator[~] identifier[CmsResource] operator[SEP] identifier[FLAG_LABELED] operator[SEP] identifier[offlineResource] operator[SEP] identifier[setFlags] operator[SEP] identifier[flags] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[existsOnline] operator[SEP] {
identifier[onlineResource] operator[=] identifier[m_driverManager] operator[SEP] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[readResource] operator[SEP] identifier[dbc] , identifier[onlineProject] operator[SEP] identifier[getUuid] operator[SEP] operator[SEP] , identifier[offlineResource] operator[SEP] identifier[getStructureId] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP] identifier[needToUpdateContent] operator[=] operator[SEP] identifier[onlineResource] operator[SEP] identifier[getDateContent] operator[SEP] operator[SEP] operator[<] identifier[offlineResource] operator[SEP] identifier[getDateContent] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[m_driverManager] operator[SEP] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[deletePropertyObjects] operator[SEP] identifier[dbc] , identifier[onlineProject] operator[SEP] identifier[getUuid] operator[SEP] operator[SEP] , identifier[onlineResource] , identifier[CmsProperty] operator[SEP] identifier[DELETE_OPTION_DELETE_STRUCTURE_AND_RESOURCE_VALUES] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[onlineResource] operator[SEP] identifier[getResourceId] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[offlineResource] operator[SEP] identifier[getResourceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[CmsProperty] operator[>] identifier[offlineProperties] operator[=] identifier[m_driverManager] operator[SEP] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[readPropertyObjects] operator[SEP] identifier[dbc] , identifier[dbc] operator[SEP] identifier[currentProject] operator[SEP] operator[SEP] , identifier[onlineResource] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[offlineProperties] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[offlineProperties] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[CmsProperty] identifier[property] operator[=] identifier[offlineProperties] operator[SEP] identifier[get] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[property] operator[SEP] identifier[setStructureValue] operator[SEP] Other[null] operator[SEP] operator[SEP] identifier[property] operator[SEP] identifier[setResourceValue] operator[SEP] identifier[CmsProperty] operator[SEP] identifier[DELETE_VALUE] operator[SEP] operator[SEP]
}
identifier[m_driverManager] operator[SEP] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[writePropertyObjects] operator[SEP] identifier[dbc] , identifier[dbc] operator[SEP] identifier[currentProject] operator[SEP] operator[SEP] , identifier[onlineResource] , identifier[offlineProperties] operator[SEP] operator[SEP]
}
}
}
}
Keyword[catch] operator[SEP] identifier[CmsDataAccessException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] 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[LOG_DELETING_PROPERTIES_1] , identifier[offlineResource] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[e] operator[SEP]
}
identifier[CmsFile] identifier[newFile] operator[SEP] Keyword[try] {
identifier[newFile] operator[=] identifier[m_driverManager] operator[SEP] identifier[getProjectDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[publishFileContent] operator[SEP] identifier[dbc] , identifier[dbc] operator[SEP] identifier[currentProject] operator[SEP] operator[SEP] , identifier[onlineProject] , identifier[offlineResource] , identifier[publishedResourceIds] , identifier[needToUpdateContent] , identifier[publishTag] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsDataAccessException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] 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[LOG_PUBLISHING_RESOURCE_1] , identifier[offlineResource] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[e] operator[SEP]
}
identifier[List] operator[<] identifier[CmsProperty] operator[>] identifier[offlineProperties] operator[SEP] Keyword[try] {
identifier[offlineProperties] operator[=] identifier[m_driverManager] operator[SEP] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[readPropertyObjects] operator[SEP] identifier[dbc] , identifier[dbc] operator[SEP] identifier[currentProject] operator[SEP] operator[SEP] , identifier[offlineResource] operator[SEP] operator[SEP] identifier[CmsProperty] operator[SEP] identifier[setAutoCreatePropertyDefinitions] operator[SEP] identifier[offlineProperties] , literal[boolean] operator[SEP] operator[SEP] identifier[m_driverManager] operator[SEP] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[writePropertyObjects] operator[SEP] identifier[dbc] , identifier[onlineProject] , identifier[newFile] , identifier[offlineProperties] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsDataAccessException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] 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[LOG_PUBLISHING_PROPERTIES_1] , identifier[newFile] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[e] operator[SEP]
}
Keyword[try] {
identifier[m_driverManager] operator[SEP] identifier[getUserDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[publishAccessControlEntries] operator[SEP] identifier[dbc] , identifier[dbc] operator[SEP] identifier[currentProject] operator[SEP] operator[SEP] , identifier[onlineProject] , identifier[newFile] operator[SEP] identifier[getResourceId] operator[SEP] operator[SEP] , identifier[offlineResource] operator[SEP] identifier[getResourceId] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CmsDataAccessException] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[LOG] operator[SEP] identifier[isErrorEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[LOG] operator[SEP] identifier[error] 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[LOG_PUBLISHING_ACL_1] , identifier[newFile] operator[SEP] identifier[getRootPath] operator[SEP] operator[SEP] operator[SEP] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[throw] identifier[e] operator[SEP]
}
identifier[CmsFile] identifier[offlineFile] operator[=] Keyword[new] identifier[CmsFile] operator[SEP] identifier[offlineResource] operator[SEP] operator[SEP] identifier[offlineFile] operator[SEP] identifier[setContents] operator[SEP] identifier[newFile] operator[SEP] identifier[getContents] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[internalWriteHistory] operator[SEP] identifier[dbc] , identifier[offlineFile] , identifier[resourceState] , identifier[offlineProperties] , identifier[publishHistoryId] , identifier[publishTag] operator[SEP] operator[SEP] identifier[m_driverManager] operator[SEP] identifier[getVfsDriver] operator[SEP] identifier[dbc] operator[SEP] operator[SEP] identifier[updateRelations] operator[SEP] identifier[dbc] , identifier[onlineProject] , identifier[offlineResource] operator[SEP] operator[SEP]
}
|
public static String uncompressString(byte[] input, String encoding)
throws IOException,
UnsupportedEncodingException
{
byte[] uncompressed = uncompress(input);
return new String(uncompressed, encoding);
} | class class_name[name] begin[{]
method[uncompressString, return_type[type[String]], modifier[public static], parameter[input, encoding]] begin[{]
local_variable[type[byte], uncompressed]
return[ClassCreator(arguments=[MemberReference(member=uncompressed, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=encoding, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[uncompressString] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[input] , identifier[String] identifier[encoding] operator[SEP] Keyword[throws] identifier[IOException] , identifier[UnsupportedEncodingException] {
Keyword[byte] operator[SEP] operator[SEP] identifier[uncompressed] operator[=] identifier[uncompress] operator[SEP] identifier[input] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[String] operator[SEP] identifier[uncompressed] , identifier[encoding] operator[SEP] operator[SEP]
}
|
@SuppressWarnings("rawtypes")
public static <E extends Exception> DataSet loadCSV(final InputStream csvInputStream, final long offset, final long count,
final Try.Predicate<String[], E> filter, final List<? extends Type> columnTypeList) throws E {
final Reader csvReader = new InputStreamReader(csvInputStream);
return loadCSV(csvReader, offset, count, filter, columnTypeList);
} | class class_name[name] begin[{]
method[loadCSV, return_type[type[DataSet]], modifier[public static], parameter[csvInputStream, offset, count, filter, columnTypeList]] begin[{]
local_variable[type[Reader], csvReader]
return[call[.loadCSV, parameter[member[.csvReader], member[.offset], member[.count], member[.filter], member[.columnTypeList]]]]
end[}]
END[}] | annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] Keyword[static] operator[<] identifier[E] Keyword[extends] identifier[Exception] operator[>] identifier[DataSet] identifier[loadCSV] operator[SEP] Keyword[final] identifier[InputStream] identifier[csvInputStream] , Keyword[final] Keyword[long] identifier[offset] , Keyword[final] Keyword[long] identifier[count] , Keyword[final] identifier[Try] operator[SEP] identifier[Predicate] operator[<] identifier[String] operator[SEP] operator[SEP] , identifier[E] operator[>] identifier[filter] , Keyword[final] identifier[List] operator[<] operator[?] Keyword[extends] identifier[Type] operator[>] identifier[columnTypeList] operator[SEP] Keyword[throws] identifier[E] {
Keyword[final] identifier[Reader] identifier[csvReader] operator[=] Keyword[new] identifier[InputStreamReader] operator[SEP] identifier[csvInputStream] operator[SEP] operator[SEP] Keyword[return] identifier[loadCSV] operator[SEP] identifier[csvReader] , identifier[offset] , identifier[count] , identifier[filter] , identifier[columnTypeList] operator[SEP] operator[SEP]
}
|
private void renderContent() {
JBakeConfiguration config = utensils.getConfiguration();
Renderer renderer = utensils.getRenderer();
ContentStore contentStore = utensils.getContentStore();
for (RenderingTool tool : ServiceLoader.load(RenderingTool.class)) {
try {
renderedCount += tool.render(renderer, contentStore, config);
} catch (RenderingException e) {
errors.add(e);
}
}
} | class class_name[name] begin[{]
method[renderContent, return_type[void], modifier[private], parameter[]] begin[{]
local_variable[type[JBakeConfiguration], config]
local_variable[type[Renderer], renderer]
local_variable[type[ContentStore], contentStore]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=renderedCount, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=MethodInvocation(arguments=[MemberReference(member=renderer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=contentStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=config, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=render, postfix_operators=[], prefix_operators=[], qualifier=tool, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=errors, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RenderingException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RenderingTool, sub_type=None))], member=load, postfix_operators=[], prefix_operators=[], qualifier=ServiceLoader, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=tool)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=RenderingTool, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[renderContent] operator[SEP] operator[SEP] {
identifier[JBakeConfiguration] identifier[config] operator[=] identifier[utensils] operator[SEP] identifier[getConfiguration] operator[SEP] operator[SEP] operator[SEP] identifier[Renderer] identifier[renderer] operator[=] identifier[utensils] operator[SEP] identifier[getRenderer] operator[SEP] operator[SEP] operator[SEP] identifier[ContentStore] identifier[contentStore] operator[=] identifier[utensils] operator[SEP] identifier[getContentStore] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[RenderingTool] identifier[tool] operator[:] identifier[ServiceLoader] operator[SEP] identifier[load] operator[SEP] identifier[RenderingTool] operator[SEP] Keyword[class] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[renderedCount] operator[+=] identifier[tool] operator[SEP] identifier[render] operator[SEP] identifier[renderer] , identifier[contentStore] , identifier[config] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RenderingException] identifier[e] operator[SEP] {
identifier[errors] operator[SEP] identifier[add] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
}
|
public Class loadClass(String name, boolean resolve)
throws ClassNotFoundException
{
if (name.startsWith("java.")) {
return super.loadClass(name, resolve); // prevent SecurityException
}
/*
Check first for classes loaded through this loader.
The VM will not allow a class to be loaded twice.
*/
Class c = findLoadedClass(name);
if ( c != null ) {
return c;
}
// This is copied from ClassManagerImpl
// We should refactor this somehow if it sticks around
if ( name.startsWith( ClassManagerImpl.BSH_PACKAGE ) ) {
final ClassLoader loader = bsh.Interpreter.class
.getClassLoader();
if ( null != loader ) try {
return loader.loadClass( name );
} catch ( ClassNotFoundException e ) { /* ignore */ }
}
/*
Try to find the class using our classloading mechanism.
*/
c = findClass( name );
if ( resolve ) {
resolveClass( c );
}
return c;
} | class class_name[name] begin[{]
method[loadClass, return_type[type[Class]], modifier[public], parameter[name, resolve]] begin[{]
if[call[name.startsWith, parameter[literal["java."]]]] begin[{]
return[SuperMethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
else begin[{]
None
end[}]
local_variable[type[Class], c]
if[binary_operation[member[.c], !=, literal[null]]] begin[{]
return[member[.c]]
else begin[{]
None
end[}]
if[call[name.startsWith, parameter[member[ClassManagerImpl.BSH_PACKAGE]]]] begin[{]
local_variable[type[ClassLoader], loader]
if[binary_operation[literal[null], !=, member[.loader]]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=loader, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ClassNotFoundException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
else begin[{]
None
end[}]
assign[member[.c], call[.findClass, parameter[member[.name]]]]
if[member[.resolve]] begin[{]
call[.resolveClass, parameter[member[.c]]]
else begin[{]
None
end[}]
return[member[.c]]
end[}]
END[}] | Keyword[public] identifier[Class] identifier[loadClass] operator[SEP] identifier[String] identifier[name] , Keyword[boolean] identifier[resolve] operator[SEP] Keyword[throws] identifier[ClassNotFoundException] {
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] Keyword[super] operator[SEP] identifier[loadClass] operator[SEP] identifier[name] , identifier[resolve] operator[SEP] operator[SEP]
}
identifier[Class] identifier[c] operator[=] identifier[findLoadedClass] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[c] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[c] operator[SEP]
}
Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[startsWith] operator[SEP] identifier[ClassManagerImpl] operator[SEP] identifier[BSH_PACKAGE] operator[SEP] operator[SEP] {
Keyword[final] identifier[ClassLoader] identifier[loader] operator[=] identifier[bsh] operator[SEP] identifier[Interpreter] operator[SEP] Keyword[class] operator[SEP] identifier[getClassLoader] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[loader] operator[SEP] Keyword[try] {
Keyword[return] identifier[loader] operator[SEP] identifier[loadClass] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[e] operator[SEP] {
}
}
identifier[c] operator[=] identifier[findClass] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resolve] operator[SEP] {
identifier[resolveClass] operator[SEP] identifier[c] operator[SEP] operator[SEP]
}
Keyword[return] identifier[c] operator[SEP]
}
|
public static Map<String, ? extends CacheConfig> fromYAML(InputStream inputStream) throws IOException {
return new CacheConfigSupport().fromYAML(inputStream);
} | class class_name[name] begin[{]
method[fromYAML, return_type[type[Map]], modifier[public static], parameter[inputStream]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=inputStream, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=fromYAML, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=CacheConfigSupport, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , operator[?] Keyword[extends] identifier[CacheConfig] operator[>] identifier[fromYAML] operator[SEP] identifier[InputStream] identifier[inputStream] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] Keyword[new] identifier[CacheConfigSupport] operator[SEP] operator[SEP] operator[SEP] identifier[fromYAML] operator[SEP] identifier[inputStream] operator[SEP] operator[SEP]
}
|
public static <T> T[] getBeans(Class<T> interfaceClass) {
Object object = serviceMap.get(interfaceClass.getName());
if(object == null) return null;
if(object instanceof Object[]) {
return (T[])object;
} else {
Object array = Array.newInstance(interfaceClass, 1);
Array.set(array, 0, object);
return (T[])array;
}
} | class class_name[name] begin[{]
method[getBeans, return_type[type[T]], modifier[public static], parameter[interfaceClass]] begin[{]
local_variable[type[Object], object]
if[binary_operation[member[.object], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[member[.object], instanceof, type[Object]]] begin[{]
return[Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=T, sub_type=None))]
else begin[{]
local_variable[type[Object], array]
call[Array.set, parameter[member[.array], literal[0], member[.object]]]
return[Cast(expression=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[None], name=T, sub_type=None))]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] operator[SEP] operator[SEP] identifier[getBeans] operator[SEP] identifier[Class] operator[<] identifier[T] operator[>] identifier[interfaceClass] operator[SEP] {
identifier[Object] identifier[object] operator[=] identifier[serviceMap] operator[SEP] identifier[get] operator[SEP] identifier[interfaceClass] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[object] operator[==] Other[null] operator[SEP] Keyword[return] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[object] Keyword[instanceof] identifier[Object] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] operator[SEP] identifier[T] operator[SEP] operator[SEP] operator[SEP] identifier[object] operator[SEP]
}
Keyword[else] {
identifier[Object] identifier[array] operator[=] identifier[Array] operator[SEP] identifier[newInstance] operator[SEP] identifier[interfaceClass] , Other[1] operator[SEP] operator[SEP] identifier[Array] operator[SEP] identifier[set] operator[SEP] identifier[array] , Other[0] , identifier[object] operator[SEP] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] operator[SEP] operator[SEP] identifier[array] operator[SEP]
}
}
|
public static ServiceAccount of(String email, String... scopes) {
return of(email, Arrays.asList(scopes));
} | class class_name[name] begin[{]
method[of, return_type[type[ServiceAccount]], modifier[public static], parameter[email, scopes]] begin[{]
return[call[.of, parameter[member[.email], call[Arrays.asList, parameter[member[.scopes]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[ServiceAccount] identifier[of] operator[SEP] identifier[String] identifier[email] , identifier[String] operator[...] identifier[scopes] operator[SEP] {
Keyword[return] identifier[of] operator[SEP] identifier[email] , identifier[Arrays] operator[SEP] identifier[asList] operator[SEP] identifier[scopes] operator[SEP] operator[SEP] operator[SEP]
}
|
public void setResourceShareAssociations(java.util.Collection<ResourceShareAssociation> resourceShareAssociations) {
if (resourceShareAssociations == null) {
this.resourceShareAssociations = null;
return;
}
this.resourceShareAssociations = new java.util.ArrayList<ResourceShareAssociation>(resourceShareAssociations);
} | class class_name[name] begin[{]
method[setResourceShareAssociations, return_type[void], modifier[public], parameter[resourceShareAssociations]] begin[{]
if[binary_operation[member[.resourceShareAssociations], ==, literal[null]]] begin[{]
assign[THIS[member[None.resourceShareAssociations]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.resourceShareAssociations]], ClassCreator(arguments=[MemberReference(member=resourceShareAssociations, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ResourceShareAssociation, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setResourceShareAssociations] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[ResourceShareAssociation] operator[>] identifier[resourceShareAssociations] operator[SEP] {
Keyword[if] operator[SEP] identifier[resourceShareAssociations] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[resourceShareAssociations] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[resourceShareAssociations] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[ResourceShareAssociation] operator[>] operator[SEP] identifier[resourceShareAssociations] operator[SEP] operator[SEP]
}
|
public void setButtons(java.util.Collection<Button> buttons) {
if (buttons == null) {
this.buttons = null;
return;
}
this.buttons = new java.util.ArrayList<Button>(buttons);
} | class class_name[name] begin[{]
method[setButtons, return_type[void], modifier[public], parameter[buttons]] begin[{]
if[binary_operation[member[.buttons], ==, literal[null]]] begin[{]
assign[THIS[member[None.buttons]], literal[null]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.buttons]], ClassCreator(arguments=[MemberReference(member=buttons, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=util, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Button, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))))]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setButtons] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Collection] operator[<] identifier[Button] operator[>] identifier[buttons] operator[SEP] {
Keyword[if] operator[SEP] identifier[buttons] operator[==] Other[null] operator[SEP] {
Keyword[this] operator[SEP] identifier[buttons] operator[=] Other[null] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[buttons] operator[=] Keyword[new] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[ArrayList] operator[<] identifier[Button] operator[>] operator[SEP] identifier[buttons] operator[SEP] operator[SEP]
}
|
public void dereferenceControllable()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "dereferenceControllable");
foreignDest = null;
messageProcessor = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "dereferenceControllable");
} | class class_name[name] begin[{]
method[dereferenceControllable, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.entry, parameter[member[.tc], literal["dereferenceControllable"]]]
else begin[{]
None
end[}]
assign[member[.foreignDest], literal[null]]
assign[member[.messageProcessor], literal[null]]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isEntryEnabled, parameter[]]]] begin[{]
call[SibTr.exit, parameter[member[.tc], literal["dereferenceControllable"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[dereferenceControllable] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[entry] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP] identifier[foreignDest] operator[=] Other[null] operator[SEP] identifier[messageProcessor] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[SibTr] operator[SEP] identifier[exit] operator[SEP] identifier[tc] , literal[String] operator[SEP] operator[SEP]
}
|
private FailedBatch doBatchWriteItemWithRetry(
Map<String, List<WriteRequest>> batch,
BatchWriteRetryStrategy batchWriteRetryStrategy) {
BatchWriteItemResult result = null;
int retries = 0;
int maxRetries = batchWriteRetryStrategy
.getMaxRetryOnUnprocessedItems(Collections
.unmodifiableMap(batch));
FailedBatch failedBatch = null;
Map<String, List<WriteRequest>> pendingItems = batch;
while (true) {
try {
result = db.batchWriteItem(applyBatchOperationUserAgent(
new BatchWriteItemRequest().withRequestItems(pendingItems)));
} catch (Exception e) {
failedBatch = new FailedBatch();
failedBatch.setUnprocessedItems(pendingItems);
failedBatch.setException(e);
return failedBatch;
}
pendingItems = result.getUnprocessedItems();
if (pendingItems.size() > 0) {
// return pendingItems as a FailedBatch if we have exceeded max retry
if (maxRetries >= 0 && retries >= maxRetries) {
failedBatch = new FailedBatch();
failedBatch.setUnprocessedItems(pendingItems);
failedBatch.setException(null);
return failedBatch;
}
pause(batchWriteRetryStrategy.getDelayBeforeRetryUnprocessedItems(
Collections.unmodifiableMap(pendingItems), retries));
retries++;
} else {
break;
}
}
return failedBatch;
} | class class_name[name] begin[{]
method[doBatchWriteItemWithRetry, return_type[type[FailedBatch]], modifier[private], parameter[batch, batchWriteRetryStrategy]] begin[{]
local_variable[type[BatchWriteItemResult], result]
local_variable[type[int], retries]
local_variable[type[int], maxRetries]
local_variable[type[FailedBatch], failedBatch]
local_variable[type[Map], pendingItems]
while[literal[true]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=pendingItems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=withRequestItems, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=BatchWriteItemRequest, sub_type=None))], member=applyBatchOperationUserAgent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=batchWriteItem, postfix_operators=[], prefix_operators=[], qualifier=db, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=failedBatch, 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=FailedBatch, sub_type=None))), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=pendingItems, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setUnprocessedItems, postfix_operators=[], prefix_operators=[], qualifier=failedBatch, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setException, postfix_operators=[], prefix_operators=[], qualifier=failedBatch, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MemberReference(member=failedBatch, 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)
assign[member[.pendingItems], call[result.getUnprocessedItems, parameter[]]]
if[binary_operation[call[pendingItems.size, parameter[]], >, literal[0]]] begin[{]
if[binary_operation[binary_operation[member[.maxRetries], >=, literal[0]], &&, binary_operation[member[.retries], >=, member[.maxRetries]]]] begin[{]
assign[member[.failedBatch], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=FailedBatch, sub_type=None))]
call[failedBatch.setUnprocessedItems, parameter[member[.pendingItems]]]
call[failedBatch.setException, parameter[literal[null]]]
return[member[.failedBatch]]
else begin[{]
None
end[}]
call[.pause, parameter[call[batchWriteRetryStrategy.getDelayBeforeRetryUnprocessedItems, parameter[call[Collections.unmodifiableMap, parameter[member[.pendingItems]]], member[.retries]]]]]
member[.retries]
else begin[{]
BreakStatement(goto=None, label=None)
end[}]
end[}]
return[member[.failedBatch]]
end[}]
END[}] | Keyword[private] identifier[FailedBatch] identifier[doBatchWriteItemWithRetry] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[WriteRequest] operator[>] operator[>] identifier[batch] , identifier[BatchWriteRetryStrategy] identifier[batchWriteRetryStrategy] operator[SEP] {
identifier[BatchWriteItemResult] identifier[result] operator[=] Other[null] operator[SEP] Keyword[int] identifier[retries] operator[=] Other[0] operator[SEP] Keyword[int] identifier[maxRetries] operator[=] identifier[batchWriteRetryStrategy] operator[SEP] identifier[getMaxRetryOnUnprocessedItems] operator[SEP] identifier[Collections] operator[SEP] identifier[unmodifiableMap] operator[SEP] identifier[batch] operator[SEP] operator[SEP] operator[SEP] identifier[FailedBatch] identifier[failedBatch] operator[=] Other[null] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[List] operator[<] identifier[WriteRequest] operator[>] operator[>] identifier[pendingItems] operator[=] identifier[batch] operator[SEP] Keyword[while] operator[SEP] literal[boolean] operator[SEP] {
Keyword[try] {
identifier[result] operator[=] identifier[db] operator[SEP] identifier[batchWriteItem] operator[SEP] identifier[applyBatchOperationUserAgent] operator[SEP] Keyword[new] identifier[BatchWriteItemRequest] operator[SEP] operator[SEP] operator[SEP] identifier[withRequestItems] operator[SEP] identifier[pendingItems] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
identifier[failedBatch] operator[=] Keyword[new] identifier[FailedBatch] operator[SEP] operator[SEP] operator[SEP] identifier[failedBatch] operator[SEP] identifier[setUnprocessedItems] operator[SEP] identifier[pendingItems] operator[SEP] operator[SEP] identifier[failedBatch] operator[SEP] identifier[setException] operator[SEP] identifier[e] operator[SEP] operator[SEP] Keyword[return] identifier[failedBatch] operator[SEP]
}
identifier[pendingItems] operator[=] identifier[result] operator[SEP] identifier[getUnprocessedItems] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[pendingItems] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
Keyword[if] operator[SEP] identifier[maxRetries] operator[>=] Other[0] operator[&&] identifier[retries] operator[>=] identifier[maxRetries] operator[SEP] {
identifier[failedBatch] operator[=] Keyword[new] identifier[FailedBatch] operator[SEP] operator[SEP] operator[SEP] identifier[failedBatch] operator[SEP] identifier[setUnprocessedItems] operator[SEP] identifier[pendingItems] operator[SEP] operator[SEP] identifier[failedBatch] operator[SEP] identifier[setException] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[return] identifier[failedBatch] operator[SEP]
}
identifier[pause] operator[SEP] identifier[batchWriteRetryStrategy] operator[SEP] identifier[getDelayBeforeRetryUnprocessedItems] operator[SEP] identifier[Collections] operator[SEP] identifier[unmodifiableMap] operator[SEP] identifier[pendingItems] operator[SEP] , identifier[retries] operator[SEP] operator[SEP] operator[SEP] identifier[retries] operator[++] operator[SEP]
}
Keyword[else] {
Keyword[break] operator[SEP]
}
}
Keyword[return] identifier[failedBatch] operator[SEP]
}
|
public final ListDeviceRegistriesPagedResponse listDeviceRegistries(LocationName parent) {
ListDeviceRegistriesRequest request =
ListDeviceRegistriesRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listDeviceRegistries(request);
} | class class_name[name] begin[{]
method[listDeviceRegistries, return_type[type[ListDeviceRegistriesPagedResponse]], modifier[final public], parameter[parent]] begin[{]
local_variable[type[ListDeviceRegistriesRequest], request]
return[call[.listDeviceRegistries, parameter[member[.request]]]]
end[}]
END[}] | Keyword[public] Keyword[final] identifier[ListDeviceRegistriesPagedResponse] identifier[listDeviceRegistries] operator[SEP] identifier[LocationName] identifier[parent] operator[SEP] {
identifier[ListDeviceRegistriesRequest] identifier[request] operator[=] identifier[ListDeviceRegistriesRequest] operator[SEP] identifier[newBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[setParent] operator[SEP] identifier[parent] operator[==] Other[null] operator[?] Other[null] operator[:] identifier[parent] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[listDeviceRegistries] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static String getHistoryResourceURI(String uri, ServletRequest req) {
String histUri = uri;
if (CmsHistoryResourceHandler.isHistoryRequest(req)) {
String version = req.getParameter(CmsHistoryResourceHandler.PARAM_VERSION);
histUri = CmsRequestUtil.appendParameter(uri, CmsHistoryResourceHandler.PARAM_VERSION, version);
}
return histUri;
} | class class_name[name] begin[{]
method[getHistoryResourceURI, return_type[type[String]], modifier[public static], parameter[uri, req]] begin[{]
local_variable[type[String], histUri]
if[call[CmsHistoryResourceHandler.isHistoryRequest, parameter[member[.req]]]] begin[{]
local_variable[type[String], version]
assign[member[.histUri], call[CmsRequestUtil.appendParameter, parameter[member[.uri], member[CmsHistoryResourceHandler.PARAM_VERSION], member[.version]]]]
else begin[{]
None
end[}]
return[member[.histUri]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getHistoryResourceURI] operator[SEP] identifier[String] identifier[uri] , identifier[ServletRequest] identifier[req] operator[SEP] {
identifier[String] identifier[histUri] operator[=] identifier[uri] operator[SEP] Keyword[if] operator[SEP] identifier[CmsHistoryResourceHandler] operator[SEP] identifier[isHistoryRequest] operator[SEP] identifier[req] operator[SEP] operator[SEP] {
identifier[String] identifier[version] operator[=] identifier[req] operator[SEP] identifier[getParameter] operator[SEP] identifier[CmsHistoryResourceHandler] operator[SEP] identifier[PARAM_VERSION] operator[SEP] operator[SEP] identifier[histUri] operator[=] identifier[CmsRequestUtil] operator[SEP] identifier[appendParameter] operator[SEP] identifier[uri] , identifier[CmsHistoryResourceHandler] operator[SEP] identifier[PARAM_VERSION] , identifier[version] operator[SEP] operator[SEP]
}
Keyword[return] identifier[histUri] operator[SEP]
}
|
@Override
public GetCompatibleElasticsearchVersionsResult getCompatibleElasticsearchVersions(GetCompatibleElasticsearchVersionsRequest request) {
request = beforeClientExecution(request);
return executeGetCompatibleElasticsearchVersions(request);
} | class class_name[name] begin[{]
method[getCompatibleElasticsearchVersions, return_type[type[GetCompatibleElasticsearchVersionsResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeGetCompatibleElasticsearchVersions, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[GetCompatibleElasticsearchVersionsResult] identifier[getCompatibleElasticsearchVersions] operator[SEP] identifier[GetCompatibleElasticsearchVersionsRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeGetCompatibleElasticsearchVersions] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static String applyFromPath(String path) throws ConverterException {
String xml = converters.get(0).convertFromPath(path, false);
xml = applyFromSecond(xml);
if (conversionDone()) {
return converters.get(converters.size()-1).changeVersion(xml);
} else {
return xml;
}
} | class class_name[name] begin[{]
method[applyFromPath, return_type[type[String]], modifier[public static], parameter[path]] begin[{]
local_variable[type[String], xml]
assign[member[.xml], call[.applyFromSecond, parameter[member[.xml]]]]
if[call[.conversionDone, parameter[]]] begin[{]
return[call[converters.get, parameter[binary_operation[call[converters.size, parameter[]], -, literal[1]]]]]
else begin[{]
return[member[.xml]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[applyFromPath] operator[SEP] identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[ConverterException] {
identifier[String] identifier[xml] operator[=] identifier[converters] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[convertFromPath] operator[SEP] identifier[path] , literal[boolean] operator[SEP] operator[SEP] identifier[xml] operator[=] identifier[applyFromSecond] operator[SEP] identifier[xml] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[conversionDone] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[converters] operator[SEP] identifier[get] operator[SEP] identifier[converters] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[-] Other[1] operator[SEP] operator[SEP] identifier[changeVersion] operator[SEP] identifier[xml] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[xml] operator[SEP]
}
}
|
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);
if (visible && invalidFieldEditor != null) {
invalidFieldEditor.setFocus();
}
} | class class_name[name] begin[{]
method[setVisible, return_type[void], modifier[public], parameter[visible]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=visible, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setVisible, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
if[binary_operation[member[.visible], &&, binary_operation[member[.invalidFieldEditor], !=, literal[null]]]] begin[{]
call[invalidFieldEditor.setFocus, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setVisible] operator[SEP] Keyword[boolean] identifier[visible] operator[SEP] {
Keyword[super] operator[SEP] identifier[setVisible] operator[SEP] identifier[visible] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[visible] operator[&&] identifier[invalidFieldEditor] operator[!=] Other[null] operator[SEP] {
identifier[invalidFieldEditor] operator[SEP] identifier[setFocus] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public JSONObject getJson(
String postfixUrlParam,
List<HeaderNameValue> headerNameValuesParam) {
return this.getJson(
false,
postfixUrlParam,
headerNameValuesParam);
} | class class_name[name] begin[{]
method[getJson, return_type[type[JSONObject]], modifier[public], parameter[postfixUrlParam, headerNameValuesParam]] begin[{]
return[THIS[call[None.getJson, parameter[literal[false], member[.postfixUrlParam], member[.headerNameValuesParam]]]]]
end[}]
END[}] | Keyword[public] identifier[JSONObject] identifier[getJson] operator[SEP] identifier[String] identifier[postfixUrlParam] , identifier[List] operator[<] identifier[HeaderNameValue] operator[>] identifier[headerNameValuesParam] operator[SEP] {
Keyword[return] Keyword[this] operator[SEP] identifier[getJson] operator[SEP] literal[boolean] , identifier[postfixUrlParam] , identifier[headerNameValuesParam] operator[SEP] operator[SEP]
}
|
public static short toShort(final String str, final short defaultValue) {
if(str == null) {
return defaultValue;
}
try {
return Short.parseShort(str);
} catch (final NumberFormatException nfe) {
return defaultValue;
}
} | class class_name[name] begin[{]
method[toShort, return_type[type[short]], modifier[public static], parameter[str, defaultValue]] begin[{]
if[binary_operation[member[.str], ==, literal[null]]] begin[{]
return[member[.defaultValue]]
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parseShort, postfix_operators=[], prefix_operators=[], qualifier=Short, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=MemberReference(member=defaultValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=nfe, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[short] identifier[toShort] operator[SEP] Keyword[final] identifier[String] identifier[str] , Keyword[final] Keyword[short] identifier[defaultValue] operator[SEP] {
Keyword[if] operator[SEP] identifier[str] operator[==] Other[null] operator[SEP] {
Keyword[return] identifier[defaultValue] operator[SEP]
}
Keyword[try] {
Keyword[return] identifier[Short] operator[SEP] identifier[parseShort] operator[SEP] identifier[str] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] Keyword[final] identifier[NumberFormatException] identifier[nfe] operator[SEP] {
Keyword[return] identifier[defaultValue] operator[SEP]
}
}
|
@Override
public RandomVariable pow(double exponent) {
return apply(OperatorType.POW, new RandomVariable[]{this, constructNewAADRandomVariable(exponent)});
} | class class_name[name] begin[{]
method[pow, return_type[type[RandomVariable]], modifier[public], parameter[exponent]] begin[{]
return[call[.apply, parameter[member[OperatorType.POW], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MethodInvocation(arguments=[MemberReference(member=exponent, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=constructNewAADRandomVariable, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RandomVariable, sub_type=None))]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[RandomVariable] identifier[pow] operator[SEP] Keyword[double] identifier[exponent] operator[SEP] {
Keyword[return] identifier[apply] operator[SEP] identifier[OperatorType] operator[SEP] identifier[POW] , Keyword[new] identifier[RandomVariable] operator[SEP] operator[SEP] {
Keyword[this] , identifier[constructNewAADRandomVariable] operator[SEP] identifier[exponent] operator[SEP]
} operator[SEP] operator[SEP]
}
|
private void initializeModuleScope(Node moduleBody, Module module, TypedScope moduleScope) {
if (module.metadata().isGoogModule()) {
declareExportsInModuleScope(module, moduleBody, moduleScope);
markGoogModuleExportsAsConst(module);
}
} | class class_name[name] begin[{]
method[initializeModuleScope, return_type[void], modifier[private], parameter[moduleBody, module, moduleScope]] begin[{]
if[call[module.metadata, parameter[]]] begin[{]
call[.declareExportsInModuleScope, parameter[member[.module], member[.moduleBody], member[.moduleScope]]]
call[.markGoogModuleExportsAsConst, parameter[member[.module]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[initializeModuleScope] operator[SEP] identifier[Node] identifier[moduleBody] , identifier[Module] identifier[module] , identifier[TypedScope] identifier[moduleScope] operator[SEP] {
Keyword[if] operator[SEP] identifier[module] operator[SEP] identifier[metadata] operator[SEP] operator[SEP] operator[SEP] identifier[isGoogModule] operator[SEP] operator[SEP] operator[SEP] {
identifier[declareExportsInModuleScope] operator[SEP] identifier[module] , identifier[moduleBody] , identifier[moduleScope] operator[SEP] operator[SEP] identifier[markGoogModuleExportsAsConst] operator[SEP] identifier[module] operator[SEP] operator[SEP]
}
}
|
public ContentPackageBuilder xmlNamespace(String prefix, String uri) {
metadata.addXmlNamespace(prefix, uri);
return this;
} | class class_name[name] begin[{]
method[xmlNamespace, return_type[type[ContentPackageBuilder]], modifier[public], parameter[prefix, uri]] begin[{]
call[metadata.addXmlNamespace, parameter[member[.prefix], member[.uri]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[ContentPackageBuilder] identifier[xmlNamespace] operator[SEP] identifier[String] identifier[prefix] , identifier[String] identifier[uri] operator[SEP] {
identifier[metadata] operator[SEP] identifier[addXmlNamespace] operator[SEP] identifier[prefix] , identifier[uri] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public Observable<List<VersionInfo>> listAsync(UUID appId, ListVersionsOptionalParameter listOptionalParameter) {
return listWithServiceResponseAsync(appId, listOptionalParameter).map(new Func1<ServiceResponse<List<VersionInfo>>, List<VersionInfo>>() {
@Override
public List<VersionInfo> call(ServiceResponse<List<VersionInfo>> response) {
return response.body();
}
});
} | class class_name[name] begin[{]
method[listAsync, return_type[type[Observable]], modifier[public], parameter[appId, listOptionalParameter]] begin[{]
return[call[.listWithServiceResponseAsync, parameter[member[.appId], member[.listOptionalParameter]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[List] operator[<] identifier[VersionInfo] operator[>] operator[>] identifier[listAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[ListVersionsOptionalParameter] identifier[listOptionalParameter] operator[SEP] {
Keyword[return] identifier[listWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[listOptionalParameter] operator[SEP] operator[SEP] identifier[map] operator[SEP] Keyword[new] identifier[Func1] operator[<] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[VersionInfo] operator[>] operator[>] , identifier[List] operator[<] identifier[VersionInfo] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[List] operator[<] identifier[VersionInfo] operator[>] identifier[call] operator[SEP] identifier[ServiceResponse] operator[<] identifier[List] operator[<] identifier[VersionInfo] 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 boolean isShift(double tol) {
Point2D pt = transformWithoutShift(Point2D.construct(0.0, 1.0));
pt.y -= 1.0;
if (pt.sqrLength() > tol * tol)
return false;
pt = transformWithoutShift(Point2D.construct(1.0, 0.0));
pt.x -= 1.0;
return pt.sqrLength() <= tol * tol;
} | class class_name[name] begin[{]
method[isShift, return_type[type[boolean]], modifier[public], parameter[tol]] begin[{]
local_variable[type[Point2D], pt]
assign[member[pt.y], literal[1.0]]
if[binary_operation[call[pt.sqrLength, parameter[]], >, binary_operation[member[.tol], *, member[.tol]]]] begin[{]
return[literal[false]]
else begin[{]
None
end[}]
assign[member[.pt], call[.transformWithoutShift, parameter[call[Point2D.construct, parameter[literal[1.0], literal[0.0]]]]]]
assign[member[pt.x], literal[1.0]]
return[binary_operation[call[pt.sqrLength, parameter[]], <=, binary_operation[member[.tol], *, member[.tol]]]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[isShift] operator[SEP] Keyword[double] identifier[tol] operator[SEP] {
identifier[Point2D] identifier[pt] operator[=] identifier[transformWithoutShift] operator[SEP] identifier[Point2D] operator[SEP] identifier[construct] operator[SEP] literal[Float] , literal[Float] operator[SEP] operator[SEP] operator[SEP] identifier[pt] operator[SEP] identifier[y] operator[-=] literal[Float] operator[SEP] Keyword[if] operator[SEP] identifier[pt] operator[SEP] identifier[sqrLength] operator[SEP] operator[SEP] operator[>] identifier[tol] operator[*] identifier[tol] operator[SEP] Keyword[return] literal[boolean] operator[SEP] identifier[pt] operator[=] identifier[transformWithoutShift] operator[SEP] identifier[Point2D] operator[SEP] identifier[construct] operator[SEP] literal[Float] , literal[Float] operator[SEP] operator[SEP] operator[SEP] identifier[pt] operator[SEP] identifier[x] operator[-=] literal[Float] operator[SEP] Keyword[return] identifier[pt] operator[SEP] identifier[sqrLength] operator[SEP] operator[SEP] operator[<=] identifier[tol] operator[*] identifier[tol] operator[SEP]
}
|
@Override
public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
return cpAttachmentFileEntryPersistence.findWithDynamicQuery(dynamicQuery);
} | class class_name[name] begin[{]
method[dynamicQuery, return_type[type[List]], modifier[public], parameter[dynamicQuery]] begin[{]
return[call[cpAttachmentFileEntryPersistence.findWithDynamicQuery, parameter[member[.dynamicQuery]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] operator[<] identifier[T] operator[>] identifier[List] operator[<] identifier[T] operator[>] identifier[dynamicQuery] operator[SEP] identifier[DynamicQuery] identifier[dynamicQuery] operator[SEP] {
Keyword[return] identifier[cpAttachmentFileEntryPersistence] operator[SEP] identifier[findWithDynamicQuery] operator[SEP] identifier[dynamicQuery] operator[SEP] operator[SEP]
}
|
@Override
public DisableAlarmActionsResult disableAlarmActions(DisableAlarmActionsRequest request) {
request = beforeClientExecution(request);
return executeDisableAlarmActions(request);
} | class class_name[name] begin[{]
method[disableAlarmActions, return_type[type[DisableAlarmActionsResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeDisableAlarmActions, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[DisableAlarmActionsResult] identifier[disableAlarmActions] operator[SEP] identifier[DisableAlarmActionsRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeDisableAlarmActions] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
private static Class loadImplementorClass( String className, Class interfaceType, ClassLoader classLoader )
{
try
{
if ( _log.isDebugEnabled() )
{
_log.debug( "Trying to load implementor class for interface " + interfaceType.getName()
+ ": " + className );
}
Class implementorClass = classLoader.loadClass( className );
if ( interfaceType.isAssignableFrom( implementorClass ) )
{
return implementorClass;
}
else
{
_log.error( "Implementor class " + className + " does not implement interface "
+ interfaceType.getName() );
}
}
catch ( ClassNotFoundException cnfe )
{
//
// This will happen when the user class was built against an out-of-date interface.
//
_log.error( "Could not find implementor class " + className + " for interface " + interfaceType.getName(),
cnfe );
}
catch ( LinkageError le )
{
_log.error( "Linkage error when loading implementor class " + className + " for interface "
+ interfaceType.getName(), le );
}
return null;
} | class class_name[name] begin[{]
method[loadImplementorClass, return_type[type[Class]], modifier[private static], parameter[className, interfaceType, classLoader]] begin[{]
TryStatement(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=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Trying to load implementor class for interface "), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=interfaceType, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=": "), operator=+), operandr=MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=loadClass, postfix_operators=[], prefix_operators=[], qualifier=classLoader, selectors=[], type_arguments=None), name=implementorClass)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Class, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=implementorClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=[], prefix_operators=[], qualifier=interfaceType, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Implementor class "), operandr=MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" does not implement interface "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=interfaceType, selectors=[], type_arguments=None), operator=+)], member=error, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MemberReference(member=implementorClass, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Could not find implementor class "), operandr=MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for interface "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=interfaceType, selectors=[], type_arguments=None), operator=+), MemberReference(member=cnfe, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=cnfe, types=['ClassNotFoundException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Linkage error when loading implementor class "), operandr=MemberReference(member=className, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" for interface "), operator=+), operandr=MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=interfaceType, selectors=[], type_arguments=None), operator=+), MemberReference(member=le, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=error, postfix_operators=[], prefix_operators=[], qualifier=_log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=le, types=['LinkageError']))], finally_block=None, label=None, resources=None)
return[literal[null]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Class] identifier[loadImplementorClass] operator[SEP] identifier[String] identifier[className] , identifier[Class] identifier[interfaceType] , identifier[ClassLoader] identifier[classLoader] operator[SEP] {
Keyword[try] {
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[interfaceType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[className] operator[SEP] operator[SEP]
}
identifier[Class] identifier[implementorClass] operator[=] identifier[classLoader] operator[SEP] identifier[loadClass] operator[SEP] identifier[className] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[interfaceType] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[implementorClass] operator[SEP] operator[SEP] {
Keyword[return] identifier[implementorClass] operator[SEP]
}
Keyword[else] {
identifier[_log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[className] operator[+] literal[String] operator[+] identifier[interfaceType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[ClassNotFoundException] identifier[cnfe] operator[SEP] {
identifier[_log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[className] operator[+] literal[String] operator[+] identifier[interfaceType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[cnfe] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[LinkageError] identifier[le] operator[SEP] {
identifier[_log] operator[SEP] identifier[error] operator[SEP] literal[String] operator[+] identifier[className] operator[+] literal[String] operator[+] identifier[interfaceType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[le] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
@Override
public void configurationEvent(ConfigurationEvent event) {
if (event.getType() == ConfigurationEvent.CM_UPDATED && event.getPid().equals(pid)) {
processProperties();
initializeInterceptor();
}
} | class class_name[name] begin[{]
method[configurationEvent, return_type[void], modifier[public], parameter[event]] begin[{]
if[binary_operation[binary_operation[call[event.getType, parameter[]], ==, member[ConfigurationEvent.CM_UPDATED]], &&, call[event.getPid, parameter[]]]] begin[{]
call[.processProperties, parameter[]]
call[.initializeInterceptor, parameter[]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[configurationEvent] operator[SEP] identifier[ConfigurationEvent] identifier[event] operator[SEP] {
Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[==] identifier[ConfigurationEvent] operator[SEP] identifier[CM_UPDATED] operator[&&] identifier[event] operator[SEP] identifier[getPid] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[pid] operator[SEP] operator[SEP] {
identifier[processProperties] operator[SEP] operator[SEP] operator[SEP] identifier[initializeInterceptor] operator[SEP] operator[SEP] operator[SEP]
}
}
|
protected ReadableLogRecord getReadableLogRecord(long expectedSequenceNumber)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "getReadableLogRecord", new java.lang.Object[] { this, new Long(expectedSequenceNumber) });
if (tc.isDebugEnabled())
Tr.debug(tc, "Creating readable log record to read from file " + _fileName);
final ReadableLogRecord readableLogRecord = ReadableLogRecord.read(_fileBuffer, expectedSequenceNumber, !_logFileHeader.wasShutdownClean());
if (tc.isEntryEnabled())
Tr.exit(tc, "getReadableLogRecord", readableLogRecord);
return readableLogRecord;
} | class class_name[name] begin[{]
method[getReadableLogRecord, return_type[type[ReadableLogRecord]], modifier[protected], parameter[expectedSequenceNumber]] begin[{]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.entry, parameter[member[.tc], literal["getReadableLogRecord"], ArrayCreator(dimensions=[None], initializer=ArrayInitializer(initializers=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), ClassCreator(arguments=[MemberReference(member=expectedSequenceNumber, 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))]), postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=java, sub_type=ReferenceType(arguments=None, dimensions=None, name=lang, sub_type=ReferenceType(arguments=None, dimensions=None, name=Object, sub_type=None))))]]
else begin[{]
None
end[}]
if[call[tc.isDebugEnabled, parameter[]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[literal["Creating readable log record to read from file "], +, member[._fileName]]]]
else begin[{]
None
end[}]
local_variable[type[ReadableLogRecord], readableLogRecord]
if[call[tc.isEntryEnabled, parameter[]]] begin[{]
call[Tr.exit, parameter[member[.tc], literal["getReadableLogRecord"], member[.readableLogRecord]]]
else begin[{]
None
end[}]
return[member[.readableLogRecord]]
end[}]
END[}] | Keyword[protected] identifier[ReadableLogRecord] identifier[getReadableLogRecord] operator[SEP] Keyword[long] identifier[expectedSequenceNumber] 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[java] operator[SEP] identifier[lang] operator[SEP] identifier[Object] operator[SEP] operator[SEP] {
Keyword[this] , Keyword[new] identifier[Long] operator[SEP] identifier[expectedSequenceNumber] operator[SEP]
} operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[_fileName] operator[SEP] operator[SEP] Keyword[final] identifier[ReadableLogRecord] identifier[readableLogRecord] operator[=] identifier[ReadableLogRecord] operator[SEP] identifier[read] operator[SEP] identifier[_fileBuffer] , identifier[expectedSequenceNumber] , operator[!] identifier[_logFileHeader] operator[SEP] identifier[wasShutdownClean] operator[SEP] 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[readableLogRecord] operator[SEP] operator[SEP] Keyword[return] identifier[readableLogRecord] operator[SEP]
}
|
public String walletToText(Wallet wallet) {
Protos.Wallet walletProto = walletToProto(wallet);
return TextFormat.printToString(walletProto);
} | class class_name[name] begin[{]
method[walletToText, return_type[type[String]], modifier[public], parameter[wallet]] begin[{]
local_variable[type[Protos], walletProto]
return[call[TextFormat.printToString, parameter[member[.walletProto]]]]
end[}]
END[}] | Keyword[public] identifier[String] identifier[walletToText] operator[SEP] identifier[Wallet] identifier[wallet] operator[SEP] {
identifier[Protos] operator[SEP] identifier[Wallet] identifier[walletProto] operator[=] identifier[walletToProto] operator[SEP] identifier[wallet] operator[SEP] operator[SEP] Keyword[return] identifier[TextFormat] operator[SEP] identifier[printToString] operator[SEP] identifier[walletProto] operator[SEP] operator[SEP]
}
|
private void obtainBreadCrumbTitle(@NonNull final TypedArray typedArray) {
setBreadCrumbTitle(
typedArray.getText(R.styleable.NavigationPreference_android_breadCrumbTitle));
} | class class_name[name] begin[{]
method[obtainBreadCrumbTitle, return_type[void], modifier[private], parameter[typedArray]] begin[{]
call[.setBreadCrumbTitle, parameter[call[typedArray.getText, parameter[member[R.styleable.NavigationPreference_android_breadCrumbTitle]]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[obtainBreadCrumbTitle] operator[SEP] annotation[@] identifier[NonNull] Keyword[final] identifier[TypedArray] identifier[typedArray] operator[SEP] {
identifier[setBreadCrumbTitle] operator[SEP] identifier[typedArray] operator[SEP] identifier[getText] operator[SEP] identifier[R] operator[SEP] identifier[styleable] operator[SEP] identifier[NavigationPreference_android_breadCrumbTitle] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <T> T invoke(Object obj, String methodName, Object[] arguments, Class<T> returnType) {
return invoke(obj, methodName, getArgumentTypes(arguments), arguments, returnType);
} | class class_name[name] begin[{]
method[invoke, return_type[type[T]], modifier[public static], parameter[obj, methodName, arguments, returnType]] begin[{]
return[call[.invoke, parameter[member[.obj], member[.methodName], call[.getArgumentTypes, parameter[member[.arguments]]], member[.arguments], member[.returnType]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[T] identifier[invoke] operator[SEP] identifier[Object] identifier[obj] , identifier[String] identifier[methodName] , identifier[Object] operator[SEP] operator[SEP] identifier[arguments] , identifier[Class] operator[<] identifier[T] operator[>] identifier[returnType] operator[SEP] {
Keyword[return] identifier[invoke] operator[SEP] identifier[obj] , identifier[methodName] , identifier[getArgumentTypes] operator[SEP] identifier[arguments] operator[SEP] , identifier[arguments] , identifier[returnType] operator[SEP] operator[SEP]
}
|
@Override
public UpdateCommentResult updateComment(UpdateCommentRequest request) {
request = beforeClientExecution(request);
return executeUpdateComment(request);
} | class class_name[name] begin[{]
method[updateComment, return_type[type[UpdateCommentResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeUpdateComment, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[UpdateCommentResult] identifier[updateComment] operator[SEP] identifier[UpdateCommentRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeUpdateComment] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public static base_responses enable(nitro_service client, String ip[]) throws Exception {
base_responses result = null;
if (ip != null && ip.length > 0) {
dnsnameserver enableresources[] = new dnsnameserver[ip.length];
for (int i=0;i<ip.length;i++){
enableresources[i] = new dnsnameserver();
enableresources[i].ip = ip[i];
}
result = perform_operation_bulk_request(client, enableresources,"enable");
}
return result;
} | class class_name[name] begin[{]
method[enable, return_type[type[base_responses]], modifier[public static], parameter[client, ip]] begin[{]
local_variable[type[base_responses], result]
if[binary_operation[binary_operation[member[.ip], !=, literal[null]], &&, binary_operation[member[ip.length], >, literal[0]]]] begin[{]
local_variable[type[dnsnameserver], enableresources]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=enableresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, 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=dnsnameserver, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=enableresources, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MemberReference(member=ip, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), type==, value=MemberReference(member=ip, postfix_operators=[], prefix_operators=[], qualifier=, 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=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=ip, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.result], call[.perform_operation_bulk_request, parameter[member[.client], member[.enableresources], literal["enable"]]]]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[base_responses] identifier[enable] operator[SEP] identifier[nitro_service] identifier[client] , identifier[String] identifier[ip] operator[SEP] operator[SEP] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[base_responses] identifier[result] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[ip] operator[!=] Other[null] operator[&&] identifier[ip] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[dnsnameserver] identifier[enableresources] operator[SEP] operator[SEP] operator[=] Keyword[new] identifier[dnsnameserver] operator[SEP] identifier[ip] operator[SEP] identifier[length] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[ip] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[enableresources] operator[SEP] identifier[i] operator[SEP] operator[=] Keyword[new] identifier[dnsnameserver] operator[SEP] operator[SEP] operator[SEP] identifier[enableresources] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[ip] operator[=] identifier[ip] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
identifier[result] operator[=] identifier[perform_operation_bulk_request] operator[SEP] identifier[client] , identifier[enableresources] , literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public List<ProtectionContainerResourceInner> list(String vaultName, String resourceGroupName, String filter) {
return listWithServiceResponseAsync(vaultName, resourceGroupName, filter).toBlocking().single().body();
} | class class_name[name] begin[{]
method[list, return_type[type[List]], modifier[public], parameter[vaultName, resourceGroupName, filter]] begin[{]
return[call[.listWithServiceResponseAsync, parameter[member[.vaultName], member[.resourceGroupName], member[.filter]]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[ProtectionContainerResourceInner] operator[>] identifier[list] operator[SEP] identifier[String] identifier[vaultName] , identifier[String] identifier[resourceGroupName] , identifier[String] identifier[filter] operator[SEP] {
Keyword[return] identifier[listWithServiceResponseAsync] operator[SEP] identifier[vaultName] , identifier[resourceGroupName] , identifier[filter] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public void reset() {
this.priorityElements = Lists.newArrayList(originalElements);
Collections.shuffle(priorityElements);
this.currentElements = Lists.newArrayListWithExpectedSize(2 * originalElements.size());
this.currentElements.addAll(originalElements);
} | class class_name[name] begin[{]
method[reset, return_type[void], modifier[public], parameter[]] begin[{]
assign[THIS[member[None.priorityElements]], call[Lists.newArrayList, parameter[member[.originalElements]]]]
call[Collections.shuffle, parameter[member[.priorityElements]]]
assign[THIS[member[None.currentElements]], call[Lists.newArrayListWithExpectedSize, parameter[binary_operation[literal[2], *, call[originalElements.size, parameter[]]]]]]
THIS[member[None.currentElements]call[None.addAll, parameter[member[.originalElements]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[reset] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[priorityElements] operator[=] identifier[Lists] operator[SEP] identifier[newArrayList] operator[SEP] identifier[originalElements] operator[SEP] operator[SEP] identifier[Collections] operator[SEP] identifier[shuffle] operator[SEP] identifier[priorityElements] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[currentElements] operator[=] identifier[Lists] operator[SEP] identifier[newArrayListWithExpectedSize] operator[SEP] Other[2] operator[*] identifier[originalElements] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[currentElements] operator[SEP] identifier[addAll] operator[SEP] identifier[originalElements] operator[SEP] operator[SEP]
}
|
public com.google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore getCommonCharactersToIgnore() {
if (charactersCase_ == 2) {
@SuppressWarnings("deprecation")
com.google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore result =
com.google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore.valueOf(
(java.lang.Integer) characters_);
return result == null
? com.google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore.UNRECOGNIZED
: result;
}
return com.google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore
.COMMON_CHARS_TO_IGNORE_UNSPECIFIED;
} | class class_name[name] begin[{]
method[getCommonCharactersToIgnore, return_type[type[com]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.charactersCase_], ==, literal[2]]] begin[{]
local_variable[type[com], result]
return[TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), if_true=MemberReference(member=UNRECOGNIZED, postfix_operators=[], prefix_operators=[], qualifier=com.google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore, selectors=[]))]
else begin[{]
None
end[}]
return[member[com.google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore.COMMON_CHARS_TO_IGNORE_UNSPECIFIED]]
end[}]
END[}] | Keyword[public] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[privacy] operator[SEP] identifier[dlp] operator[SEP] identifier[v2] operator[SEP] identifier[CharsToIgnore] operator[SEP] identifier[CommonCharsToIgnore] identifier[getCommonCharactersToIgnore] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[charactersCase_] operator[==] Other[2] operator[SEP] {
annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[privacy] operator[SEP] identifier[dlp] operator[SEP] identifier[v2] operator[SEP] identifier[CharsToIgnore] operator[SEP] identifier[CommonCharsToIgnore] identifier[result] operator[=] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[privacy] operator[SEP] identifier[dlp] operator[SEP] identifier[v2] operator[SEP] identifier[CharsToIgnore] operator[SEP] identifier[CommonCharsToIgnore] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] identifier[java] operator[SEP] identifier[lang] operator[SEP] identifier[Integer] operator[SEP] identifier[characters_] operator[SEP] operator[SEP] Keyword[return] identifier[result] operator[==] Other[null] operator[?] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[privacy] operator[SEP] identifier[dlp] operator[SEP] identifier[v2] operator[SEP] identifier[CharsToIgnore] operator[SEP] identifier[CommonCharsToIgnore] operator[SEP] identifier[UNRECOGNIZED] operator[:] identifier[result] operator[SEP]
}
Keyword[return] identifier[com] operator[SEP] identifier[google] operator[SEP] identifier[privacy] operator[SEP] identifier[dlp] operator[SEP] identifier[v2] operator[SEP] identifier[CharsToIgnore] operator[SEP] identifier[CommonCharsToIgnore] operator[SEP] identifier[COMMON_CHARS_TO_IGNORE_UNSPECIFIED] operator[SEP]
}
|
private String findBrace(char chLeft, char chRight) {
// 从当前位置查找查找匹配的 (...)
int left = findLeftBrace(chLeft, position);
if (left >= position) {
int start = left + 1;
int end = findRightBrace(chLeft, chRight, start);
if (end >= start) {
// 当前位置指向匹配的右括号后一个字符
position = end + 1;
// 返回匹配的括号内容
return pattern.substring(start, end);
}
}
return null; // 没有 (...) 匹配
} | class class_name[name] begin[{]
method[findBrace, return_type[type[String]], modifier[private], parameter[chLeft, chRight]] begin[{]
local_variable[type[int], left]
if[binary_operation[member[.left], >=, member[.position]]] begin[{]
local_variable[type[int], start]
local_variable[type[int], end]
if[binary_operation[member[.end], >=, member[.start]]] begin[{]
assign[member[.position], binary_operation[member[.end], +, literal[1]]]
return[call[pattern.substring, parameter[member[.start], member[.end]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[findBrace] operator[SEP] Keyword[char] identifier[chLeft] , Keyword[char] identifier[chRight] operator[SEP] {
Keyword[int] identifier[left] operator[=] identifier[findLeftBrace] operator[SEP] identifier[chLeft] , identifier[position] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[left] operator[>=] identifier[position] operator[SEP] {
Keyword[int] identifier[start] operator[=] identifier[left] operator[+] Other[1] operator[SEP] Keyword[int] identifier[end] operator[=] identifier[findRightBrace] operator[SEP] identifier[chLeft] , identifier[chRight] , identifier[start] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[end] operator[>=] identifier[start] operator[SEP] {
identifier[position] operator[=] identifier[end] operator[+] Other[1] operator[SEP] Keyword[return] identifier[pattern] operator[SEP] identifier[substring] operator[SEP] identifier[start] , identifier[end] operator[SEP] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public static PlotCanvas plot(String id, int[][] merge, double[] height) {
int n = merge.length + 1;
Dendrogram dendrogram = new Dendrogram(merge, height);
double[] lowerBound = {-n / 100, 0};
double[] upperBound = {n + n / 100, 1.01 * dendrogram.getHeight()};
PlotCanvas canvas = new PlotCanvas(lowerBound, upperBound, false);
canvas.getAxis(0).setGridVisible(false);
canvas.getAxis(0).setLabelVisible(false);
dendrogram.setID(id);
canvas.add(dendrogram);
return canvas;
} | class class_name[name] begin[{]
method[plot, return_type[type[PlotCanvas]], modifier[public static], parameter[id, merge, height]] begin[{]
local_variable[type[int], n]
local_variable[type[Dendrogram], dendrogram]
local_variable[type[double], lowerBound]
local_variable[type[double], upperBound]
local_variable[type[PlotCanvas], canvas]
call[canvas.getAxis, parameter[literal[0]]]
call[canvas.getAxis, parameter[literal[0]]]
call[dendrogram.setID, parameter[member[.id]]]
call[canvas.add, parameter[member[.dendrogram]]]
return[member[.canvas]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[PlotCanvas] identifier[plot] operator[SEP] identifier[String] identifier[id] , Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[merge] , Keyword[double] operator[SEP] operator[SEP] identifier[height] operator[SEP] {
Keyword[int] identifier[n] operator[=] identifier[merge] operator[SEP] identifier[length] operator[+] Other[1] operator[SEP] identifier[Dendrogram] identifier[dendrogram] operator[=] Keyword[new] identifier[Dendrogram] operator[SEP] identifier[merge] , identifier[height] operator[SEP] operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[lowerBound] operator[=] {
operator[-] identifier[n] operator[/] Other[100] , Other[0]
} operator[SEP] Keyword[double] operator[SEP] operator[SEP] identifier[upperBound] operator[=] {
identifier[n] operator[+] identifier[n] operator[/] Other[100] , literal[Float] operator[*] identifier[dendrogram] operator[SEP] identifier[getHeight] operator[SEP] operator[SEP]
} operator[SEP] identifier[PlotCanvas] identifier[canvas] operator[=] Keyword[new] identifier[PlotCanvas] operator[SEP] identifier[lowerBound] , identifier[upperBound] , literal[boolean] operator[SEP] operator[SEP] identifier[canvas] operator[SEP] identifier[getAxis] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[setGridVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[canvas] operator[SEP] identifier[getAxis] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[setLabelVisible] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[dendrogram] operator[SEP] identifier[setID] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[canvas] operator[SEP] identifier[add] operator[SEP] identifier[dendrogram] operator[SEP] operator[SEP] Keyword[return] identifier[canvas] operator[SEP]
}
|
public static String getMEName(Object o) {
String meName;
if (!threadLocalStack.isEmpty()) {
meName = threadLocalStack.peek();
} else {
meName = DEFAULT_ME_NAME;
}
String str = "";
if (o != null) {
str = "/" + Integer.toHexString(System.identityHashCode(o));
}
// Defect 91793 to avoid SIBMessage in Systemout.log starting with [:]
return "";
} | class class_name[name] begin[{]
method[getMEName, return_type[type[String]], modifier[public static], parameter[o]] begin[{]
local_variable[type[String], meName]
if[call[threadLocalStack.isEmpty, parameter[]]] begin[{]
assign[member[.meName], call[threadLocalStack.peek, parameter[]]]
else begin[{]
assign[member[.meName], member[.DEFAULT_ME_NAME]]
end[}]
local_variable[type[String], str]
if[binary_operation[member[.o], !=, literal[null]]] begin[{]
assign[member[.str], binary_operation[literal["/"], +, call[Integer.toHexString, parameter[call[System.identityHashCode, parameter[member[.o]]]]]]]
else begin[{]
None
end[}]
return[literal[""]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getMEName] operator[SEP] identifier[Object] identifier[o] operator[SEP] {
identifier[String] identifier[meName] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[threadLocalStack] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[meName] operator[=] identifier[threadLocalStack] operator[SEP] identifier[peek] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[meName] operator[=] identifier[DEFAULT_ME_NAME] operator[SEP]
}
identifier[String] identifier[str] operator[=] literal[String] operator[SEP] Keyword[if] operator[SEP] identifier[o] operator[!=] Other[null] operator[SEP] {
identifier[str] operator[=] literal[String] operator[+] identifier[Integer] operator[SEP] identifier[toHexString] operator[SEP] identifier[System] operator[SEP] identifier[identityHashCode] operator[SEP] identifier[o] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] literal[String] operator[SEP]
}
|
public static CustomSerializer getCustomSerializer(CommandCode code) {
if (!commandCustomSerializer.isEmpty()) {
return commandCustomSerializer.get(code);
}
return null;
} | class class_name[name] begin[{]
method[getCustomSerializer, return_type[type[CustomSerializer]], modifier[public static], parameter[code]] begin[{]
if[call[commandCustomSerializer.isEmpty, parameter[]]] begin[{]
return[call[commandCustomSerializer.get, parameter[member[.code]]]]
else begin[{]
None
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[CustomSerializer] identifier[getCustomSerializer] operator[SEP] identifier[CommandCode] identifier[code] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[commandCustomSerializer] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[commandCustomSerializer] operator[SEP] identifier[get] operator[SEP] identifier[code] operator[SEP] operator[SEP]
}
Keyword[return] Other[null] operator[SEP]
}
|
public static WritableRaster integerArray2WritableRaster( int[] array, double divide, int width, int height ) {
WritableRaster writableRaster = createWritableRaster(width, height, null, null, null);
int index = 0;;
for( int x = 0; x < width; x++ ) {
for( int y = 0; y < height; y++ ) {
double value = (double) array[index++] / divide;
writableRaster.setSample(x, y, 0, value);
}
}
return writableRaster;
} | class class_name[name] begin[{]
method[integerArray2WritableRaster, return_type[type[WritableRaster]], modifier[public static], parameter[array, divide, width, height]] begin[{]
local_variable[type[WritableRaster], writableRaster]
local_variable[type[int], index]
Statement(label=None)
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Cast(expression=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=index, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[]))]), type=BasicType(dimensions=[], name=double)), operandr=MemberReference(member=divide, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=/), name=value)], modifiers=set(), type=BasicType(dimensions=[], name=double)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=setSample, postfix_operators=[], prefix_operators=[], qualifier=writableRaster, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=y, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=height, 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=y)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=y, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=width, 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=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.writableRaster]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[WritableRaster] identifier[integerArray2WritableRaster] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[array] , Keyword[double] identifier[divide] , Keyword[int] identifier[width] , Keyword[int] identifier[height] operator[SEP] {
identifier[WritableRaster] identifier[writableRaster] operator[=] identifier[createWritableRaster] operator[SEP] identifier[width] , identifier[height] , Other[null] , Other[null] , Other[null] operator[SEP] operator[SEP] Keyword[int] identifier[index] operator[=] Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[width] operator[SEP] identifier[x] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[y] operator[=] Other[0] operator[SEP] identifier[y] operator[<] identifier[height] operator[SEP] identifier[y] operator[++] operator[SEP] {
Keyword[double] identifier[value] operator[=] operator[SEP] Keyword[double] operator[SEP] identifier[array] operator[SEP] identifier[index] operator[++] operator[SEP] operator[/] identifier[divide] operator[SEP] identifier[writableRaster] operator[SEP] identifier[setSample] operator[SEP] identifier[x] , identifier[y] , Other[0] , identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[writableRaster] operator[SEP]
}
|
@Override
public long getLongSizeInBytes() {
long size = 8;
for (int i = 0; i < this.highLowContainer.size(); i++) {
final Container c = this.highLowContainer.getContainerAtIndex(i);
size += 2 + c.getSizeInBytes();
}
return size;
} | class class_name[name] begin[{]
method[getLongSizeInBytes, return_type[type[long]], modifier[public], parameter[]] begin[{]
local_variable[type[long], size]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=highLowContainer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getContainerAtIndex, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=c)], modifiers={'final'}, type=ReferenceType(arguments=None, dimensions=[], name=Container, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=+=, value=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operandr=MethodInvocation(arguments=[], member=getSizeInBytes, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), operator=+)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=highLowContainer, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[], member=size, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.size]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[long] identifier[getLongSizeInBytes] operator[SEP] operator[SEP] {
Keyword[long] identifier[size] operator[=] Other[8] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Keyword[this] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[final] identifier[Container] identifier[c] operator[=] Keyword[this] operator[SEP] identifier[highLowContainer] operator[SEP] identifier[getContainerAtIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[size] operator[+=] Other[2] operator[+] identifier[c] operator[SEP] identifier[getSizeInBytes] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[size] operator[SEP]
}
|
protected final PrcPaymentToSave<RS> createPutPrcPaymentToSave(
final Map<String, Object> pAddParam) throws Exception {
PrcPaymentToSave<RS> proc = new PrcPaymentToSave<RS>();
proc.setSrvAccSettings(getSrvAccSettings());
proc.setSrvAccEntry(getSrvAccEntry());
proc.setSrvOrm(getSrvOrm());
proc.setSrvI18n(getSrvI18n());
proc.setPrcPurchaseInvoiceSave(lazyGetPrcPurchaseInvoiceSave(pAddParam));
//assigning fully initialized object:
this.processorsMap.put(PrcPaymentToSave.class.getSimpleName(), proc);
return proc;
} | class class_name[name] begin[{]
method[createPutPrcPaymentToSave, return_type[type[PrcPaymentToSave]], modifier[final protected], parameter[pAddParam]] begin[{]
local_variable[type[PrcPaymentToSave], proc]
call[proc.setSrvAccSettings, parameter[call[.getSrvAccSettings, parameter[]]]]
call[proc.setSrvAccEntry, parameter[call[.getSrvAccEntry, parameter[]]]]
call[proc.setSrvOrm, parameter[call[.getSrvOrm, parameter[]]]]
call[proc.setSrvI18n, parameter[call[.getSrvI18n, parameter[]]]]
call[proc.setPrcPurchaseInvoiceSave, parameter[call[.lazyGetPrcPurchaseInvoiceSave, parameter[member[.pAddParam]]]]]
THIS[member[None.processorsMap]call[None.put, parameter[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=PrcPaymentToSave, sub_type=None)), member[.proc]]]]
return[member[.proc]]
end[}]
END[}] | Keyword[protected] Keyword[final] identifier[PrcPaymentToSave] operator[<] identifier[RS] operator[>] identifier[createPutPrcPaymentToSave] operator[SEP] Keyword[final] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[pAddParam] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[PrcPaymentToSave] operator[<] identifier[RS] operator[>] identifier[proc] operator[=] Keyword[new] identifier[PrcPaymentToSave] operator[<] identifier[RS] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvAccSettings] operator[SEP] identifier[getSrvAccSettings] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvAccEntry] operator[SEP] identifier[getSrvAccEntry] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvOrm] operator[SEP] identifier[getSrvOrm] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setSrvI18n] operator[SEP] identifier[getSrvI18n] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[proc] operator[SEP] identifier[setPrcPurchaseInvoiceSave] operator[SEP] identifier[lazyGetPrcPurchaseInvoiceSave] operator[SEP] identifier[pAddParam] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[processorsMap] operator[SEP] identifier[put] operator[SEP] identifier[PrcPaymentToSave] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] , identifier[proc] operator[SEP] operator[SEP] Keyword[return] identifier[proc] operator[SEP]
}
|
public static sslservicegroup_sslcipher_binding[] get(nitro_service service, String servicegroupname) throws Exception{
sslservicegroup_sslcipher_binding obj = new sslservicegroup_sslcipher_binding();
obj.set_servicegroupname(servicegroupname);
sslservicegroup_sslcipher_binding response[] = (sslservicegroup_sslcipher_binding[]) obj.get_resources(service);
return response;
} | class class_name[name] begin[{]
method[get, return_type[type[sslservicegroup_sslcipher_binding]], modifier[public static], parameter[service, servicegroupname]] begin[{]
local_variable[type[sslservicegroup_sslcipher_binding], obj]
call[obj.set_servicegroupname, parameter[member[.servicegroupname]]]
local_variable[type[sslservicegroup_sslcipher_binding], response]
return[member[.response]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[sslservicegroup_sslcipher_binding] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[nitro_service] identifier[service] , identifier[String] identifier[servicegroupname] operator[SEP] Keyword[throws] identifier[Exception] {
identifier[sslservicegroup_sslcipher_binding] identifier[obj] operator[=] Keyword[new] identifier[sslservicegroup_sslcipher_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[set_servicegroupname] operator[SEP] identifier[servicegroupname] operator[SEP] operator[SEP] identifier[sslservicegroup_sslcipher_binding] identifier[response] operator[SEP] operator[SEP] operator[=] operator[SEP] identifier[sslservicegroup_sslcipher_binding] operator[SEP] operator[SEP] operator[SEP] identifier[obj] operator[SEP] identifier[get_resources] operator[SEP] identifier[service] operator[SEP] operator[SEP] Keyword[return] identifier[response] operator[SEP]
}
|
private ExpressionContext findAndRemoveValue(List<NamedValueContext> namedValues, String name) {
Iterator<NamedValueContext> namedValueIter = namedValues.iterator();
while (namedValueIter.hasNext()) {
NamedValueContext namedValue = namedValueIter.next();
if (name.equals(value(namedValue.name))) {
namedValueIter.remove();
return namedValue.expr;
}
}
return null;
} | class class_name[name] begin[{]
method[findAndRemoveValue, return_type[type[ExpressionContext]], modifier[private], parameter[namedValues, name]] begin[{]
local_variable[type[Iterator], namedValueIter]
while[call[namedValueIter.hasNext, parameter[]]] begin[{]
local_variable[type[NamedValueContext], namedValue]
if[call[name.equals, parameter[call[.value, parameter[member[namedValue.name]]]]]] begin[{]
call[namedValueIter.remove, parameter[]]
return[member[namedValue.expr]]
else begin[{]
None
end[}]
end[}]
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[ExpressionContext] identifier[findAndRemoveValue] operator[SEP] identifier[List] operator[<] identifier[NamedValueContext] operator[>] identifier[namedValues] , identifier[String] identifier[name] operator[SEP] {
identifier[Iterator] operator[<] identifier[NamedValueContext] operator[>] identifier[namedValueIter] operator[=] identifier[namedValues] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[namedValueIter] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[NamedValueContext] identifier[namedValue] operator[=] identifier[namedValueIter] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[name] operator[SEP] identifier[equals] operator[SEP] identifier[value] operator[SEP] identifier[namedValue] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[SEP] {
identifier[namedValueIter] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[namedValue] operator[SEP] identifier[expr] operator[SEP]
}
}
Keyword[return] Other[null] operator[SEP]
}
|
public <T> TypeAdapter<T> getDelegateAdapter(TypeAdapterFactory skipPast, TypeToken<T> type) {
// Hack. If the skipPast factory isn't registered, assume the factory is being requested via
// our @JsonAdapter annotation.
if (!factories.contains(skipPast)) {
skipPast = jsonAdapterFactory;
}
boolean skipPastFound = false;
for (TypeAdapterFactory factory : factories) {
if (!skipPastFound) {
if (factory == skipPast) {
skipPastFound = true;
}
continue;
}
TypeAdapter<T> candidate = factory.create(this, type);
if (candidate != null) {
return candidate;
}
}
throw new IllegalArgumentException("GSON cannot serialize " + type);
} | class class_name[name] begin[{]
method[getDelegateAdapter, return_type[type[TypeAdapter]], modifier[public], parameter[skipPast, type]] begin[{]
if[call[factories.contains, parameter[member[.skipPast]]]] begin[{]
assign[member[.skipPast], member[.jsonAdapterFactory]]
else begin[{]
None
end[}]
local_variable[type[boolean], skipPastFound]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MemberReference(member=skipPastFound, postfix_operators=[], prefix_operators=['!'], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=factory, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=skipPast, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=skipPastFound, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)])), ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=create, postfix_operators=[], prefix_operators=[], qualifier=factory, selectors=[], type_arguments=None), name=candidate)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=[], name=TypeAdapter, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=candidate, 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=[ReturnStatement(expression=MemberReference(member=candidate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=factories, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=factory)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TypeAdapterFactory, sub_type=None))), label=None)
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="GSON cannot serialize "), operandr=MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] operator[<] identifier[T] operator[>] identifier[TypeAdapter] operator[<] identifier[T] operator[>] identifier[getDelegateAdapter] operator[SEP] identifier[TypeAdapterFactory] identifier[skipPast] , identifier[TypeToken] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[factories] operator[SEP] identifier[contains] operator[SEP] identifier[skipPast] operator[SEP] operator[SEP] {
identifier[skipPast] operator[=] identifier[jsonAdapterFactory] operator[SEP]
}
Keyword[boolean] identifier[skipPastFound] operator[=] literal[boolean] operator[SEP] Keyword[for] operator[SEP] identifier[TypeAdapterFactory] identifier[factory] operator[:] identifier[factories] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[skipPastFound] operator[SEP] {
Keyword[if] operator[SEP] identifier[factory] operator[==] identifier[skipPast] operator[SEP] {
identifier[skipPastFound] operator[=] literal[boolean] operator[SEP]
}
Keyword[continue] operator[SEP]
}
identifier[TypeAdapter] operator[<] identifier[T] operator[>] identifier[candidate] operator[=] identifier[factory] operator[SEP] identifier[create] operator[SEP] Keyword[this] , identifier[type] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[candidate] operator[!=] Other[null] operator[SEP] {
Keyword[return] identifier[candidate] operator[SEP]
}
}
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[type] operator[SEP] operator[SEP]
}
|
public UpdateInputSecurityGroupRequest withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | class class_name[name] begin[{]
method[withTags, return_type[type[UpdateInputSecurityGroupRequest]], modifier[public], parameter[tags]] begin[{]
call[.setTags, parameter[member[.tags]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[UpdateInputSecurityGroupRequest] identifier[withTags] operator[SEP] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[tags] operator[SEP] {
identifier[setTags] operator[SEP] identifier[tags] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
@Deprecated
public int getTimezoneOffset() {
int zoneOffset;
if (cdate == null) {
// Android-changed: Android specific time zone logic
GregorianCalendar cal = new GregorianCalendar(fastTime);
zoneOffset = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET));
} else {
normalize();
zoneOffset = cdate.getZoneOffset();
}
return -zoneOffset/60000; // convert to minutes
} | class class_name[name] begin[{]
method[getTimezoneOffset, return_type[type[int]], modifier[public], parameter[]] begin[{]
local_variable[type[int], zoneOffset]
if[binary_operation[member[.cdate], ==, literal[null]]] begin[{]
local_variable[type[GregorianCalendar], cal]
assign[member[.zoneOffset], binary_operation[call[cal.get, parameter[member[Calendar.ZONE_OFFSET]]], +, call[cal.get, parameter[member[Calendar.DST_OFFSET]]]]]
else begin[{]
call[.normalize, parameter[]]
assign[member[.zoneOffset], call[cdate.getZoneOffset, parameter[]]]
end[}]
return[binary_operation[member[.zoneOffset], /, literal[60000]]]
end[}]
END[}] | annotation[@] identifier[Deprecated] Keyword[public] Keyword[int] identifier[getTimezoneOffset] operator[SEP] operator[SEP] {
Keyword[int] identifier[zoneOffset] operator[SEP] Keyword[if] operator[SEP] identifier[cdate] operator[==] Other[null] operator[SEP] {
identifier[GregorianCalendar] identifier[cal] operator[=] Keyword[new] identifier[GregorianCalendar] operator[SEP] identifier[fastTime] operator[SEP] operator[SEP] identifier[zoneOffset] operator[=] operator[SEP] identifier[cal] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[ZONE_OFFSET] operator[SEP] operator[+] identifier[cal] operator[SEP] identifier[get] operator[SEP] identifier[Calendar] operator[SEP] identifier[DST_OFFSET] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[normalize] operator[SEP] operator[SEP] operator[SEP] identifier[zoneOffset] operator[=] identifier[cdate] operator[SEP] identifier[getZoneOffset] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] operator[-] identifier[zoneOffset] operator[/] Other[60000] operator[SEP]
}
|
@Override
public CommercePriceList[] findByLtD_S_PrevAndNext(
long commercePriceListId, Date displayDate, int status,
OrderByComparator<CommercePriceList> orderByComparator)
throws NoSuchPriceListException {
CommercePriceList commercePriceList = findByPrimaryKey(commercePriceListId);
Session session = null;
try {
session = openSession();
CommercePriceList[] array = new CommercePriceListImpl[3];
array[0] = getByLtD_S_PrevAndNext(session, commercePriceList,
displayDate, status, orderByComparator, true);
array[1] = commercePriceList;
array[2] = getByLtD_S_PrevAndNext(session, commercePriceList,
displayDate, status, orderByComparator, false);
return array;
}
catch (Exception e) {
throw processException(e);
}
finally {
closeSession(session);
}
} | class class_name[name] begin[{]
method[findByLtD_S_PrevAndNext, return_type[type[CommercePriceList]], modifier[public], parameter[commercePriceListId, displayDate, status, orderByComparator]] begin[{]
local_variable[type[CommercePriceList], commercePriceList]
local_variable[type[Session], session]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=openSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ArrayCreator(dimensions=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CommercePriceListImpl, sub_type=None)), name=array)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[None], name=CommercePriceList, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]), type==, value=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=commercePriceList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=displayDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orderByComparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)], member=getByLtD_S_PrevAndNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1))]), type==, value=MemberReference(member=commercePriceList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), type==, value=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=commercePriceList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=displayDate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=status, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orderByComparator, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=getByLtD_S_PrevAndNext, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), ReturnStatement(expression=MemberReference(member=array, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=processException, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Exception']))], finally_block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=session, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=closeSession, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[CommercePriceList] operator[SEP] operator[SEP] identifier[findByLtD_S_PrevAndNext] operator[SEP] Keyword[long] identifier[commercePriceListId] , identifier[Date] identifier[displayDate] , Keyword[int] identifier[status] , identifier[OrderByComparator] operator[<] identifier[CommercePriceList] operator[>] identifier[orderByComparator] operator[SEP] Keyword[throws] identifier[NoSuchPriceListException] {
identifier[CommercePriceList] identifier[commercePriceList] operator[=] identifier[findByPrimaryKey] operator[SEP] identifier[commercePriceListId] operator[SEP] operator[SEP] identifier[Session] identifier[session] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[session] operator[=] identifier[openSession] operator[SEP] operator[SEP] operator[SEP] identifier[CommercePriceList] operator[SEP] operator[SEP] identifier[array] operator[=] Keyword[new] identifier[CommercePriceListImpl] operator[SEP] Other[3] operator[SEP] operator[SEP] identifier[array] operator[SEP] Other[0] operator[SEP] operator[=] identifier[getByLtD_S_PrevAndNext] operator[SEP] identifier[session] , identifier[commercePriceList] , identifier[displayDate] , identifier[status] , identifier[orderByComparator] , literal[boolean] operator[SEP] operator[SEP] identifier[array] operator[SEP] Other[1] operator[SEP] operator[=] identifier[commercePriceList] operator[SEP] identifier[array] operator[SEP] Other[2] operator[SEP] operator[=] identifier[getByLtD_S_PrevAndNext] operator[SEP] identifier[session] , identifier[commercePriceList] , identifier[displayDate] , identifier[status] , identifier[orderByComparator] , literal[boolean] operator[SEP] operator[SEP] Keyword[return] identifier[array] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[throw] identifier[processException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
Keyword[finally] {
identifier[closeSession] operator[SEP] identifier[session] operator[SEP] operator[SEP]
}
}
|
public static void send(int message, EntityPlayerMP player)
{
MalisisCore.network.sendTo(new Packet(message), player);
} | class class_name[name] begin[{]
method[send, return_type[void], modifier[public static], parameter[message, player]] begin[{]
call[MalisisCore.network.sendTo, parameter[ClassCreator(arguments=[MemberReference(member=message, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Packet, sub_type=None)), member[.player]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[send] operator[SEP] Keyword[int] identifier[message] , identifier[EntityPlayerMP] identifier[player] operator[SEP] {
identifier[MalisisCore] operator[SEP] identifier[network] operator[SEP] identifier[sendTo] operator[SEP] Keyword[new] identifier[Packet] operator[SEP] identifier[message] operator[SEP] , identifier[player] operator[SEP] operator[SEP]
}
|
@Override
protected void doPost(final HttpServletRequest req, final HttpServletResponse resp)
throws ServletException, IOException {
final boolean noCache = null != req && Boolean.valueOf(req.getParameter(noCacheParamName));
if (noCache || System.currentTimeMillis() - lastRefreshedTime > cacheTimeInMilliseconds) {
this.populateStatistics(noCache);
}
JSONUtils.toJSON(cachedstats, resp.getOutputStream(), true);
} | class class_name[name] begin[{]
method[doPost, return_type[void], modifier[protected], parameter[req, resp]] begin[{]
local_variable[type[boolean], noCache]
if[binary_operation[member[.noCache], ||, binary_operation[binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.lastRefreshedTime]], >, member[.cacheTimeInMilliseconds]]]] begin[{]
THIS[call[None.populateStatistics, parameter[member[.noCache]]]]
else begin[{]
None
end[}]
call[JSONUtils.toJSON, parameter[member[.cachedstats], call[resp.getOutputStream, parameter[]], literal[true]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[doPost] operator[SEP] Keyword[final] identifier[HttpServletRequest] identifier[req] , Keyword[final] identifier[HttpServletResponse] identifier[resp] operator[SEP] Keyword[throws] identifier[ServletException] , identifier[IOException] {
Keyword[final] Keyword[boolean] identifier[noCache] operator[=] Other[null] operator[!=] identifier[req] operator[&&] identifier[Boolean] operator[SEP] identifier[valueOf] operator[SEP] identifier[req] operator[SEP] identifier[getParameter] operator[SEP] identifier[noCacheParamName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[noCache] operator[||] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[lastRefreshedTime] operator[>] identifier[cacheTimeInMilliseconds] operator[SEP] {
Keyword[this] operator[SEP] identifier[populateStatistics] operator[SEP] identifier[noCache] operator[SEP] operator[SEP]
}
identifier[JSONUtils] operator[SEP] identifier[toJSON] operator[SEP] identifier[cachedstats] , identifier[resp] operator[SEP] identifier[getOutputStream] operator[SEP] operator[SEP] , literal[boolean] operator[SEP] operator[SEP]
}
|
@Override
public EClass getFormatSerializerMap() {
if (formatSerializerMapEClass == null) {
formatSerializerMapEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(StorePackage.eNS_URI).getEClassifiers().get(113);
}
return formatSerializerMapEClass;
} | class class_name[name] begin[{]
method[getFormatSerializerMap, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.formatSerializerMapEClass], ==, literal[null]]] begin[{]
assign[member[.formatSerializerMapEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=StorePackage, selectors=[])], member=getEPackage, postfix_operators=[], prefix_operators=[], qualifier=EPackage.Registry.INSTANCE, selectors=[MethodInvocation(arguments=[], member=getEClassifiers, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=113)], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=EClass, sub_type=None))]
else begin[{]
None
end[}]
return[member[.formatSerializerMapEClass]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[EClass] identifier[getFormatSerializerMap] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[formatSerializerMapEClass] operator[==] Other[null] operator[SEP] {
identifier[formatSerializerMapEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[StorePackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[113] operator[SEP] operator[SEP]
}
Keyword[return] identifier[formatSerializerMapEClass] operator[SEP]
}
|
public void setDataSource(DataSource dataSource) {
mDataSource = dataSource;
mDriverClassName = null;
mURL = null;
mUsername = null;
mPassword = null;
} | class class_name[name] begin[{]
method[setDataSource, return_type[void], modifier[public], parameter[dataSource]] begin[{]
assign[member[.mDataSource], member[.dataSource]]
assign[member[.mDriverClassName], literal[null]]
assign[member[.mURL], literal[null]]
assign[member[.mUsername], literal[null]]
assign[member[.mPassword], literal[null]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setDataSource] operator[SEP] identifier[DataSource] identifier[dataSource] operator[SEP] {
identifier[mDataSource] operator[=] identifier[dataSource] operator[SEP] identifier[mDriverClassName] operator[=] Other[null] operator[SEP] identifier[mURL] operator[=] Other[null] operator[SEP] identifier[mUsername] operator[=] Other[null] operator[SEP] identifier[mPassword] operator[=] Other[null] operator[SEP]
}
|
private MyWrapper asMyWrapper(StringWrapper w)
{
if (w instanceof MyWrapper) return (MyWrapper)w;
else return new MyWrapper(w.unwrap());
} | class class_name[name] begin[{]
method[asMyWrapper, return_type[type[MyWrapper]], modifier[private], parameter[w]] begin[{]
if[binary_operation[member[.w], instanceof, type[MyWrapper]]] begin[{]
return[Cast(expression=MemberReference(member=w, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MyWrapper, sub_type=None))]
else begin[{]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=unwrap, postfix_operators=[], prefix_operators=[], qualifier=w, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MyWrapper, sub_type=None))]
end[}]
end[}]
END[}] | Keyword[private] identifier[MyWrapper] identifier[asMyWrapper] operator[SEP] identifier[StringWrapper] identifier[w] operator[SEP] {
Keyword[if] operator[SEP] identifier[w] Keyword[instanceof] identifier[MyWrapper] operator[SEP] Keyword[return] operator[SEP] identifier[MyWrapper] operator[SEP] identifier[w] operator[SEP] Keyword[else] Keyword[return] Keyword[new] identifier[MyWrapper] operator[SEP] identifier[w] operator[SEP] identifier[unwrap] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
public List<MessageLine> getLines(boolean includeAllPrecedingComments) {
List<MessageLine> lines = new ArrayList<>();
MessageLine l = firstLine;
if (includeAllPrecedingComments) {
// scan back to find end of prev message
while (l.prev != null && l.prev.isEmptyOrComment())
l = l.prev;
// skip leading blank lines
while (l.text.isEmpty())
l = l.next;
} else {
if (l.prev != null && l.prev.isInfo())
l = l.prev;
}
// include any preceding lines
for ( ; l != firstLine; l = l.next)
lines.add(l);
// include message lines
for (l = firstLine; l != null && l.hasContinuation(); l = l.next)
lines.add(l);
lines.add(l);
// include trailing blank line if present
l = l.next;
if (l != null && l.text.isEmpty())
lines.add(l);
return lines;
} | class class_name[name] begin[{]
method[getLines, return_type[type[List]], modifier[public], parameter[includeAllPrecedingComments]] begin[{]
local_variable[type[List], lines]
local_variable[type[MessageLine], l]
if[member[.includeAllPrecedingComments]] begin[{]
while[binary_operation[binary_operation[member[l.prev], !=, literal[null]], &&, call[l.prev.isEmptyOrComment, parameter[]]]] begin[{]
assign[member[.l], member[l.prev]]
end[}]
while[call[l.text.isEmpty, parameter[]]] begin[{]
assign[member[.l], member[l.next]]
end[}]
else begin[{]
if[binary_operation[binary_operation[member[l.prev], !=, literal[null]], &&, call[l.prev.isInfo, parameter[]]]] begin[{]
assign[member[.l], member[l.prev]]
else begin[{]
None
end[}]
end[}]
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=lines, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=firstLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), init=None, update=[Assignment(expressionl=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[]))]), label=None)
ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=lines, selectors=[], type_arguments=None), label=None), control=ForControl(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=hasContinuation, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[], type_arguments=None), operator=&&), init=[Assignment(expressionl=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=firstLine, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))], update=[Assignment(expressionl=MemberReference(member=l, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=next, postfix_operators=[], prefix_operators=[], qualifier=l, selectors=[]))]), label=None)
call[lines.add, parameter[member[.l]]]
assign[member[.l], member[l.next]]
if[binary_operation[binary_operation[member[.l], !=, literal[null]], &&, call[l.text.isEmpty, parameter[]]]] begin[{]
call[lines.add, parameter[member[.l]]]
else begin[{]
None
end[}]
return[member[.lines]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[MessageLine] operator[>] identifier[getLines] operator[SEP] Keyword[boolean] identifier[includeAllPrecedingComments] operator[SEP] {
identifier[List] operator[<] identifier[MessageLine] operator[>] identifier[lines] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[MessageLine] identifier[l] operator[=] identifier[firstLine] operator[SEP] Keyword[if] operator[SEP] identifier[includeAllPrecedingComments] operator[SEP] {
Keyword[while] operator[SEP] identifier[l] operator[SEP] identifier[prev] operator[!=] Other[null] operator[&&] identifier[l] operator[SEP] identifier[prev] operator[SEP] identifier[isEmptyOrComment] operator[SEP] operator[SEP] operator[SEP] identifier[l] operator[=] identifier[l] operator[SEP] identifier[prev] operator[SEP] Keyword[while] operator[SEP] identifier[l] operator[SEP] identifier[text] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[l] operator[=] identifier[l] operator[SEP] identifier[next] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[l] operator[SEP] identifier[prev] operator[!=] Other[null] operator[&&] identifier[l] operator[SEP] identifier[prev] operator[SEP] identifier[isInfo] operator[SEP] operator[SEP] operator[SEP] identifier[l] operator[=] identifier[l] operator[SEP] identifier[prev] operator[SEP]
}
Keyword[for] operator[SEP] operator[SEP] identifier[l] operator[!=] identifier[firstLine] operator[SEP] identifier[l] operator[=] identifier[l] operator[SEP] identifier[next] operator[SEP] identifier[lines] operator[SEP] identifier[add] operator[SEP] identifier[l] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[l] operator[=] identifier[firstLine] operator[SEP] identifier[l] operator[!=] Other[null] operator[&&] identifier[l] operator[SEP] identifier[hasContinuation] operator[SEP] operator[SEP] operator[SEP] identifier[l] operator[=] identifier[l] operator[SEP] identifier[next] operator[SEP] identifier[lines] operator[SEP] identifier[add] operator[SEP] identifier[l] operator[SEP] operator[SEP] identifier[lines] operator[SEP] identifier[add] operator[SEP] identifier[l] operator[SEP] operator[SEP] identifier[l] operator[=] identifier[l] operator[SEP] identifier[next] operator[SEP] Keyword[if] operator[SEP] identifier[l] operator[!=] Other[null] operator[&&] identifier[l] operator[SEP] identifier[text] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] identifier[lines] operator[SEP] identifier[add] operator[SEP] identifier[l] operator[SEP] operator[SEP] Keyword[return] identifier[lines] operator[SEP]
}
|
@Internal
public <R> SingleOutputStreamOperator<R> process(
CoProcessFunction<IN1, IN2, R> coProcessFunction,
TypeInformation<R> outputType) {
TwoInputStreamOperator<IN1, IN2, R> operator;
if ((inputStream1 instanceof KeyedStream) && (inputStream2 instanceof KeyedStream)) {
operator = new KeyedCoProcessOperator<>(inputStream1.clean(coProcessFunction));
} else {
operator = new CoProcessOperator<>(inputStream1.clean(coProcessFunction));
}
return transform("Co-Process", outputType, operator);
} | class class_name[name] begin[{]
method[process, return_type[type[SingleOutputStreamOperator]], modifier[public], parameter[coProcessFunction, outputType]] begin[{]
local_variable[type[TwoInputStreamOperator], operator]
if[binary_operation[binary_operation[member[.inputStream1], instanceof, type[KeyedStream]], &&, binary_operation[member[.inputStream2], instanceof, type[KeyedStream]]]] begin[{]
assign[member[.operator], ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=coProcessFunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=clean, postfix_operators=[], prefix_operators=[], qualifier=inputStream1, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=KeyedCoProcessOperator, sub_type=None))]
else begin[{]
assign[member[.operator], ClassCreator(arguments=[MethodInvocation(arguments=[MemberReference(member=coProcessFunction, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=clean, postfix_operators=[], prefix_operators=[], qualifier=inputStream1, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=CoProcessOperator, sub_type=None))]
end[}]
return[call[.transform, parameter[literal["Co-Process"], member[.outputType], member[.operator]]]]
end[}]
END[}] | annotation[@] identifier[Internal] Keyword[public] operator[<] identifier[R] operator[>] identifier[SingleOutputStreamOperator] operator[<] identifier[R] operator[>] identifier[process] operator[SEP] identifier[CoProcessFunction] operator[<] identifier[IN1] , identifier[IN2] , identifier[R] operator[>] identifier[coProcessFunction] , identifier[TypeInformation] operator[<] identifier[R] operator[>] identifier[outputType] operator[SEP] {
identifier[TwoInputStreamOperator] operator[<] identifier[IN1] , identifier[IN2] , identifier[R] operator[>] identifier[operator] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[inputStream1] Keyword[instanceof] identifier[KeyedStream] operator[SEP] operator[&&] operator[SEP] identifier[inputStream2] Keyword[instanceof] identifier[KeyedStream] operator[SEP] operator[SEP] {
identifier[operator] operator[=] Keyword[new] identifier[KeyedCoProcessOperator] operator[<] operator[>] operator[SEP] identifier[inputStream1] operator[SEP] identifier[clean] operator[SEP] identifier[coProcessFunction] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[operator] operator[=] Keyword[new] identifier[CoProcessOperator] operator[<] operator[>] operator[SEP] identifier[inputStream1] operator[SEP] identifier[clean] operator[SEP] identifier[coProcessFunction] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[transform] operator[SEP] literal[String] , identifier[outputType] , identifier[operator] operator[SEP] operator[SEP]
}
|
public SelectBuilder format(final String _pattern)
{
addPoint();
this.bldr.append("format[").append(_pattern).append("]");
return this;
} | class class_name[name] begin[{]
method[format, return_type[type[SelectBuilder]], modifier[public], parameter[_pattern]] begin[{]
call[.addPoint, parameter[]]
THIS[member[None.bldr]call[None.append, parameter[literal["format["]]]call[None.append, parameter[member[._pattern]]]call[None.append, parameter[literal["]"]]]]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[SelectBuilder] identifier[format] operator[SEP] Keyword[final] identifier[String] identifier[_pattern] operator[SEP] {
identifier[addPoint] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[bldr] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[_pattern] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
private float getFloatInternal(String key, float defaultValue) {
float retVal = defaultValue;
try {
synchronized (this.confData) {
if (this.confData.containsKey(key)) {
retVal = Float.parseFloat(this.confData.get(key));
}
}
} catch (NumberFormatException e) {
if (LOG.isDebugEnabled()) {
LOG.debug(StringUtils.stringifyException(e));
}
}
return retVal;
} | class class_name[name] begin[{]
method[getFloatInternal, return_type[type[float]], modifier[private], parameter[key, defaultValue]] begin[{]
local_variable[type[float], retVal]
TryStatement(block=[SynchronizedStatement(block=[IfStatement(condition=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=confData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=retVal, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=confData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])], member=parseFloat, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None)), label=None)]))], label=None, lock=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=confData, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=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=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=stringifyException, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None)], member=debug, postfix_operators=[], prefix_operators=[], qualifier=LOG, selectors=[], type_arguments=None), label=None)]))], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)
return[member[.retVal]]
end[}]
END[}] | Keyword[private] Keyword[float] identifier[getFloatInternal] operator[SEP] identifier[String] identifier[key] , Keyword[float] identifier[defaultValue] operator[SEP] {
Keyword[float] identifier[retVal] operator[=] identifier[defaultValue] operator[SEP] Keyword[try] {
Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] identifier[confData] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[confData] operator[SEP] identifier[containsKey] operator[SEP] identifier[key] operator[SEP] operator[SEP] {
identifier[retVal] operator[=] identifier[Float] operator[SEP] identifier[parseFloat] operator[SEP] Keyword[this] operator[SEP] identifier[confData] operator[SEP] identifier[get] operator[SEP] identifier[key] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] 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[StringUtils] operator[SEP] identifier[stringifyException] operator[SEP] identifier[e] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[retVal] operator[SEP]
}
|
private String expandTemplates(String message, JsonNode entityJson) throws IOException, TemplateException {
// Read entityJSON data
Map<String, Object> data = new HashMap<>();
data.put("data", MAPPER.convertValue(entityJson, Map.class));
data.put("entity", MAPPER.convertValue(entityJson, Map.class));
// Read MessageMLV2 template
StringWriter sw = new StringWriter();
Template template = new Template("messageML", message, FREEMARKER);
// Expand the template
template.process(data, sw);
return sw.toString();
} | class class_name[name] begin[{]
method[expandTemplates, return_type[type[String]], modifier[private], parameter[message, entityJson]] begin[{]
local_variable[type[Map], data]
call[data.put, parameter[literal["data"], call[MAPPER.convertValue, parameter[member[.entityJson], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None))]]]]
call[data.put, parameter[literal["entity"], call[MAPPER.convertValue, parameter[member[.entityJson], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Map, sub_type=None))]]]]
local_variable[type[StringWriter], sw]
local_variable[type[Template], template]
call[template.process, parameter[member[.data], member[.sw]]]
return[call[sw.toString, parameter[]]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[expandTemplates] operator[SEP] identifier[String] identifier[message] , identifier[JsonNode] identifier[entityJson] operator[SEP] Keyword[throws] identifier[IOException] , identifier[TemplateException] {
identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[data] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[MAPPER] operator[SEP] identifier[convertValue] operator[SEP] identifier[entityJson] , identifier[Map] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[data] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[MAPPER] operator[SEP] identifier[convertValue] operator[SEP] identifier[entityJson] , identifier[Map] operator[SEP] Keyword[class] operator[SEP] operator[SEP] operator[SEP] identifier[StringWriter] identifier[sw] operator[=] Keyword[new] identifier[StringWriter] operator[SEP] operator[SEP] operator[SEP] identifier[Template] identifier[template] operator[=] Keyword[new] identifier[Template] operator[SEP] literal[String] , identifier[message] , identifier[FREEMARKER] operator[SEP] operator[SEP] identifier[template] operator[SEP] identifier[process] operator[SEP] identifier[data] , identifier[sw] operator[SEP] operator[SEP] Keyword[return] identifier[sw] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
protected void serializeObject(final DataOutputStream dos, final Object value) throws IOException {
if (value != null) {
final Integer typeKey = TypeMap.get(value.getClass());
if (typeKey != null) {
dos.writeInt(typeKey);
switch (typeKey) {
case 1:
dos.writeUTF((String)value);
break;
case 2:
dos.writeInt((Integer)value);
break;
case 3:
dos.writeLong((Long)value);
break;
case 4:
dos.writeBoolean((Boolean)value);
break;
case 5:
dos.writeDouble((Double)value);
break;
case 6:
dos.writeFloat((Float)value);
break;
case 100:
serializeList(dos, (List<Object>)value);
break;
}
} else {
System.out.println("Unknown type " + value.getClass() + ", cannot serialize!");
}
} else {
dos.writeInt(0);
}
} | class class_name[name] begin[{]
method[serializeObject, return_type[void], modifier[protected], parameter[dos, value]] begin[{]
if[binary_operation[member[.value], !=, literal[null]]] begin[{]
local_variable[type[Integer], typeKey]
if[binary_operation[member[.typeKey], !=, literal[null]]] begin[{]
call[dos.writeInt, parameter[member[.typeKey]]]
SwitchStatement(cases=[SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], member=writeUTF, postfix_operators=[], prefix_operators=[], qualifier=dos, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Integer, sub_type=None))], member=writeInt, postfix_operators=[], prefix_operators=[], qualifier=dos, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=3)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None))], member=writeLong, postfix_operators=[], prefix_operators=[], qualifier=dos, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=4)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Boolean, sub_type=None))], member=writeBoolean, postfix_operators=[], prefix_operators=[], qualifier=dos, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Double, sub_type=None))], member=writeDouble, postfix_operators=[], prefix_operators=[], qualifier=dos, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=6)], statements=[StatementExpression(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Float, sub_type=None))], member=writeFloat, postfix_operators=[], prefix_operators=[], qualifier=dos, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)]), SwitchStatementCase(case=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=100)], statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=dos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=List, sub_type=None))], member=serializeList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), BreakStatement(goto=None, label=None)])], expression=MemberReference(member=typeKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
else begin[{]
call[System.out.println, parameter[binary_operation[binary_operation[literal["Unknown type "], +, call[value.getClass, parameter[]]], +, literal[", cannot serialize!"]]]]
end[}]
else begin[{]
call[dos.writeInt, parameter[literal[0]]]
end[}]
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[serializeObject] operator[SEP] Keyword[final] identifier[DataOutputStream] identifier[dos] , Keyword[final] identifier[Object] identifier[value] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[SEP] {
Keyword[final] identifier[Integer] identifier[typeKey] operator[=] identifier[TypeMap] operator[SEP] identifier[get] operator[SEP] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[typeKey] operator[!=] Other[null] operator[SEP] {
identifier[dos] operator[SEP] identifier[writeInt] operator[SEP] identifier[typeKey] operator[SEP] operator[SEP] Keyword[switch] operator[SEP] identifier[typeKey] operator[SEP] {
Keyword[case] Other[1] operator[:] identifier[dos] operator[SEP] identifier[writeUTF] operator[SEP] operator[SEP] identifier[String] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[2] operator[:] identifier[dos] operator[SEP] identifier[writeInt] operator[SEP] operator[SEP] identifier[Integer] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[3] operator[:] identifier[dos] operator[SEP] identifier[writeLong] operator[SEP] operator[SEP] identifier[Long] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[4] operator[:] identifier[dos] operator[SEP] identifier[writeBoolean] operator[SEP] operator[SEP] identifier[Boolean] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[5] operator[:] identifier[dos] operator[SEP] identifier[writeDouble] operator[SEP] operator[SEP] identifier[Double] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[6] operator[:] identifier[dos] operator[SEP] identifier[writeFloat] operator[SEP] operator[SEP] identifier[Float] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[break] operator[SEP] Keyword[case] Other[100] operator[:] identifier[serializeList] operator[SEP] identifier[dos] , operator[SEP] identifier[List] operator[<] identifier[Object] operator[>] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
Keyword[else] {
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] identifier[value] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] {
identifier[dos] operator[SEP] identifier[writeInt] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
}
|
public void normalizePercentEncoding() {
try {
uri = new URI(uri.getScheme(),
uri.getSchemeSpecificPart(),
uri.getFragment());
} catch (URISyntaxException e) {
// This should never be reached
e.printStackTrace();
}
} | class class_name[name] begin[{]
method[normalizePercentEncoding, return_type[void], modifier[public], parameter[]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=uri, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getScheme, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getSchemeSpecificPart, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getFragment, postfix_operators=[], prefix_operators=[], qualifier=uri, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URI, sub_type=None))), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=printStackTrace, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['URISyntaxException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[normalizePercentEncoding] operator[SEP] operator[SEP] {
Keyword[try] {
identifier[uri] operator[=] Keyword[new] identifier[URI] operator[SEP] identifier[uri] operator[SEP] identifier[getScheme] operator[SEP] operator[SEP] , identifier[uri] operator[SEP] identifier[getSchemeSpecificPart] operator[SEP] operator[SEP] , identifier[uri] operator[SEP] identifier[getFragment] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[URISyntaxException] identifier[e] operator[SEP] {
identifier[e] operator[SEP] identifier[printStackTrace] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void write(io.netty.buffer.ByteBuf buf) throws IOException {
write(buf, 0, buf.readableBytes());
} | class class_name[name] begin[{]
method[write, return_type[void], modifier[public], parameter[buf]] begin[{]
call[.write, parameter[member[.buf], literal[0], call[buf.readableBytes, parameter[]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[write] operator[SEP] identifier[io] operator[SEP] identifier[netty] operator[SEP] identifier[buffer] operator[SEP] identifier[ByteBuf] identifier[buf] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[write] operator[SEP] identifier[buf] , Other[0] , identifier[buf] operator[SEP] identifier[readableBytes] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public StopCrawlerResult stopCrawler(StopCrawlerRequest request) {
request = beforeClientExecution(request);
return executeStopCrawler(request);
} | class class_name[name] begin[{]
method[stopCrawler, return_type[type[StopCrawlerResult]], modifier[public], parameter[request]] begin[{]
assign[member[.request], call[.beforeClientExecution, parameter[member[.request]]]]
return[call[.executeStopCrawler, parameter[member[.request]]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[StopCrawlerResult] identifier[stopCrawler] operator[SEP] identifier[StopCrawlerRequest] identifier[request] operator[SEP] {
identifier[request] operator[=] identifier[beforeClientExecution] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[return] identifier[executeStopCrawler] operator[SEP] identifier[request] operator[SEP] operator[SEP]
}
|
public void setAll(String attributeName, String busClassNameWithDots, String busClassName, boolean isNullable, RelatedFinder relatedFinder, Map properties, boolean transactional)
{
timestampAttribute.setAll(attributeName, busClassNameWithDots, busClassName, isNullable, relatedFinder, properties, transactional);
} | class class_name[name] begin[{]
method[setAll, return_type[void], modifier[public], parameter[attributeName, busClassNameWithDots, busClassName, isNullable, relatedFinder, properties, transactional]] begin[{]
call[timestampAttribute.setAll, parameter[member[.attributeName], member[.busClassNameWithDots], member[.busClassName], member[.isNullable], member[.relatedFinder], member[.properties], member[.transactional]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setAll] operator[SEP] identifier[String] identifier[attributeName] , identifier[String] identifier[busClassNameWithDots] , identifier[String] identifier[busClassName] , Keyword[boolean] identifier[isNullable] , identifier[RelatedFinder] identifier[relatedFinder] , identifier[Map] identifier[properties] , Keyword[boolean] identifier[transactional] operator[SEP] {
identifier[timestampAttribute] operator[SEP] identifier[setAll] operator[SEP] identifier[attributeName] , identifier[busClassNameWithDots] , identifier[busClassName] , identifier[isNullable] , identifier[relatedFinder] , identifier[properties] , identifier[transactional] operator[SEP] operator[SEP]
}
|
public static void main(final String... args) throws Exception {
if (args.length < 2 || args.length > 3) {
System.out.println("Usage: XMLSerializer input-TT output.xml");
System.exit(1);
}
System.out.print("Serializing '" + args[0] + "' to '" + args[1] + "' ... ");
final long time = System.currentTimeMillis();
Injector injector =
Guice.createInjector(new ModuleSetter().setDataFacClass(TreeNodeFactory.class).setMetaFacClass(
NodeMetaPageFactory.class).createModule());
IBackendFactory storage = injector.getInstance(IBackendFactory.class);
IRevisioning revision = injector.getInstance(IRevisioning.class);
final File target = new File(args[1]);
target.delete();
final FileOutputStream outputStream = new FileOutputStream(target);
final StorageConfiguration config = new StorageConfiguration(new File(args[0]));
Storage.createStorage(config);
final IStorage db = Storage.openStorage(new File(args[0]));
Properties props = new Properties();
props.setProperty(ConstructorProps.STORAGEPATH, target.getAbsolutePath());
props.setProperty(ConstructorProps.RESOURCE, "shredded");
db.createResource(new ResourceConfiguration(props, storage, revision, new TreeNodeFactory(),
new NodeMetaPageFactory()));
final ISession session = db.getSession(new SessionConfiguration("shredded", StandardSettings.KEY));
final XMLSerializer serializer = new XMLSerializerBuilder(session, outputStream).build();
serializer.call();
session.close();
outputStream.close();
db.close();
System.out.println(" done [" + (System.currentTimeMillis() - time) + "ms].");
} | class class_name[name] begin[{]
method[main, return_type[void], modifier[public static], parameter[args]] begin[{]
if[binary_operation[binary_operation[member[args.length], <, literal[2]], ||, binary_operation[member[args.length], >, literal[3]]]] begin[{]
call[System.out.println, parameter[literal["Usage: XMLSerializer input-TT output.xml"]]]
call[System.exit, parameter[literal[1]]]
else begin[{]
None
end[}]
call[System.out.print, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["Serializing '"], +, member[.args]], +, literal["' to '"]], +, member[.args]], +, literal["' ... "]]]]
local_variable[type[long], time]
local_variable[type[Injector], injector]
local_variable[type[IBackendFactory], storage]
local_variable[type[IRevisioning], revision]
local_variable[type[File], target]
call[target.delete, parameter[]]
local_variable[type[FileOutputStream], outputStream]
local_variable[type[StorageConfiguration], config]
call[Storage.createStorage, parameter[member[.config]]]
local_variable[type[IStorage], db]
local_variable[type[Properties], props]
call[props.setProperty, parameter[member[ConstructorProps.STORAGEPATH], call[target.getAbsolutePath, parameter[]]]]
call[props.setProperty, parameter[member[ConstructorProps.RESOURCE], literal["shredded"]]]
call[db.createResource, parameter[ClassCreator(arguments=[MemberReference(member=props, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=storage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=revision, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=TreeNodeFactory, sub_type=None)), ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NodeMetaPageFactory, sub_type=None))], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ResourceConfiguration, sub_type=None))]]
local_variable[type[ISession], session]
local_variable[type[XMLSerializer], serializer]
call[serializer.call, parameter[]]
call[session.close, parameter[]]
call[outputStream.close, parameter[]]
call[db.close, parameter[]]
call[System.out.println, parameter[binary_operation[binary_operation[literal[" done ["], +, binary_operation[call[System.currentTimeMillis, parameter[]], -, member[.time]]], +, literal["ms]."]]]]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[void] identifier[main] operator[SEP] Keyword[final] identifier[String] operator[...] identifier[args] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[if] operator[SEP] identifier[args] operator[SEP] identifier[length] operator[<] Other[2] operator[||] identifier[args] operator[SEP] identifier[length] operator[>] Other[3] 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[exit] operator[SEP] Other[1] operator[SEP] operator[SEP]
}
identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[print] operator[SEP] literal[String] operator[+] identifier[args] operator[SEP] Other[0] operator[SEP] operator[+] literal[String] operator[+] identifier[args] operator[SEP] Other[1] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP] Keyword[final] Keyword[long] identifier[time] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[Injector] identifier[injector] operator[=] identifier[Guice] operator[SEP] identifier[createInjector] operator[SEP] Keyword[new] identifier[ModuleSetter] operator[SEP] operator[SEP] operator[SEP] identifier[setDataFacClass] operator[SEP] identifier[TreeNodeFactory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[setMetaFacClass] operator[SEP] identifier[NodeMetaPageFactory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[createModule] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[IBackendFactory] identifier[storage] operator[=] identifier[injector] operator[SEP] identifier[getInstance] operator[SEP] identifier[IBackendFactory] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[IRevisioning] identifier[revision] operator[=] identifier[injector] operator[SEP] identifier[getInstance] operator[SEP] identifier[IRevisioning] operator[SEP] Keyword[class] operator[SEP] operator[SEP] Keyword[final] identifier[File] identifier[target] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[args] operator[SEP] Other[1] operator[SEP] operator[SEP] operator[SEP] identifier[target] operator[SEP] identifier[delete] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[FileOutputStream] identifier[outputStream] operator[=] Keyword[new] identifier[FileOutputStream] operator[SEP] identifier[target] operator[SEP] operator[SEP] Keyword[final] identifier[StorageConfiguration] identifier[config] operator[=] Keyword[new] identifier[StorageConfiguration] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Storage] operator[SEP] identifier[createStorage] operator[SEP] identifier[config] operator[SEP] operator[SEP] Keyword[final] identifier[IStorage] identifier[db] operator[=] identifier[Storage] operator[SEP] identifier[openStorage] operator[SEP] Keyword[new] identifier[File] operator[SEP] identifier[args] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Properties] identifier[props] operator[=] Keyword[new] identifier[Properties] operator[SEP] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[setProperty] operator[SEP] identifier[ConstructorProps] operator[SEP] identifier[STORAGEPATH] , identifier[target] operator[SEP] identifier[getAbsolutePath] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[props] operator[SEP] identifier[setProperty] operator[SEP] identifier[ConstructorProps] operator[SEP] identifier[RESOURCE] , literal[String] operator[SEP] operator[SEP] identifier[db] operator[SEP] identifier[createResource] operator[SEP] Keyword[new] identifier[ResourceConfiguration] operator[SEP] identifier[props] , identifier[storage] , identifier[revision] , Keyword[new] identifier[TreeNodeFactory] operator[SEP] operator[SEP] , Keyword[new] identifier[NodeMetaPageFactory] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[ISession] identifier[session] operator[=] identifier[db] operator[SEP] identifier[getSession] operator[SEP] Keyword[new] identifier[SessionConfiguration] operator[SEP] literal[String] , identifier[StandardSettings] operator[SEP] identifier[KEY] operator[SEP] operator[SEP] operator[SEP] Keyword[final] identifier[XMLSerializer] identifier[serializer] operator[=] Keyword[new] identifier[XMLSerializerBuilder] operator[SEP] identifier[session] , identifier[outputStream] operator[SEP] operator[SEP] identifier[build] operator[SEP] operator[SEP] operator[SEP] identifier[serializer] operator[SEP] identifier[call] operator[SEP] operator[SEP] operator[SEP] identifier[session] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[outputStream] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[db] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[System] operator[SEP] identifier[out] operator[SEP] identifier[println] operator[SEP] literal[String] operator[+] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[-] identifier[time] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
|
@Override
protected void preparePaintComponent(final Request request) {
super.preparePaintComponent(request);
if (!isInitialised()) {
// This model holds the data so would be included on the user session.
ExampleExpandableModel data = new ExampleExpandableModel(ExampleDataUtil.
createExampleData(),
TravelDocPanel.class);
table.setTableModel(data);
setInitialised(true);
}
} | class class_name[name] begin[{]
method[preparePaintComponent, return_type[void], modifier[protected], parameter[request]] begin[{]
SuperMethodInvocation(arguments=[MemberReference(member=request, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=preparePaintComponent, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
if[call[.isInitialised, parameter[]]] begin[{]
local_variable[type[ExampleExpandableModel], data]
call[table.setTableModel, parameter[member[.data]]]
call[.setInitialised, parameter[literal[true]]]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[preparePaintComponent] operator[SEP] Keyword[final] identifier[Request] identifier[request] operator[SEP] {
Keyword[super] operator[SEP] identifier[preparePaintComponent] operator[SEP] identifier[request] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[isInitialised] operator[SEP] operator[SEP] operator[SEP] {
identifier[ExampleExpandableModel] identifier[data] operator[=] Keyword[new] identifier[ExampleExpandableModel] operator[SEP] identifier[ExampleDataUtil] operator[SEP] identifier[createExampleData] operator[SEP] operator[SEP] , identifier[TravelDocPanel] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[table] operator[SEP] identifier[setTableModel] operator[SEP] identifier[data] operator[SEP] operator[SEP] identifier[setInitialised] operator[SEP] literal[boolean] operator[SEP] operator[SEP]
}
}
|
public LockEntry getWriter(Object obj)
{
PersistenceBroker broker = getBroker();
Identity oid = new Identity(obj, broker);
return getWriter(oid);
} | class class_name[name] begin[{]
method[getWriter, return_type[type[LockEntry]], modifier[public], parameter[obj]] begin[{]
local_variable[type[PersistenceBroker], broker]
local_variable[type[Identity], oid]
return[call[.getWriter, parameter[member[.oid]]]]
end[}]
END[}] | Keyword[public] identifier[LockEntry] identifier[getWriter] operator[SEP] identifier[Object] identifier[obj] operator[SEP] {
identifier[PersistenceBroker] identifier[broker] operator[=] identifier[getBroker] operator[SEP] operator[SEP] operator[SEP] identifier[Identity] identifier[oid] operator[=] Keyword[new] identifier[Identity] operator[SEP] identifier[obj] , identifier[broker] operator[SEP] operator[SEP] Keyword[return] identifier[getWriter] operator[SEP] identifier[oid] operator[SEP] operator[SEP]
}
|
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AfplibPackage.GCPARC__XCENT:
return getXCENT();
case AfplibPackage.GCPARC__YCENT:
return getYCENT();
case AfplibPackage.GCPARC__MH:
return getMH();
case AfplibPackage.GCPARC__MFR:
return getMFR();
case AfplibPackage.GCPARC__START:
return getSTART();
case AfplibPackage.GCPARC__SWEEP:
return getSWEEP();
}
return super.eGet(featureID, resolve, coreType);
} | class class_name[name] begin[{]
method[eGet, return_type[type[Object]], modifier[public], parameter[featureID, resolve, coreType]] begin[{]
SwitchStatement(cases=[SwitchStatementCase(case=[MemberReference(member=GCPARC__XCENT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getXCENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=GCPARC__YCENT, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getYCENT, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=GCPARC__MH, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getMH, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=GCPARC__MFR, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getMFR, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=GCPARC__START, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getSTART, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), SwitchStatementCase(case=[MemberReference(member=GCPARC__SWEEP, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, selectors=[])], statements=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getSWEEP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)])], expression=MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)
return[SuperMethodInvocation(arguments=[MemberReference(member=featureID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resolve, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=coreType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=eGet, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[Object] identifier[eGet] operator[SEP] Keyword[int] identifier[featureID] , Keyword[boolean] identifier[resolve] , Keyword[boolean] identifier[coreType] operator[SEP] {
Keyword[switch] operator[SEP] identifier[featureID] operator[SEP] {
Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GCPARC__XCENT] operator[:] Keyword[return] identifier[getXCENT] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GCPARC__YCENT] operator[:] Keyword[return] identifier[getYCENT] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GCPARC__MH] operator[:] Keyword[return] identifier[getMH] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GCPARC__MFR] operator[:] Keyword[return] identifier[getMFR] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GCPARC__START] operator[:] Keyword[return] identifier[getSTART] operator[SEP] operator[SEP] operator[SEP] Keyword[case] identifier[AfplibPackage] operator[SEP] identifier[GCPARC__SWEEP] operator[:] Keyword[return] identifier[getSWEEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[super] operator[SEP] identifier[eGet] operator[SEP] identifier[featureID] , identifier[resolve] , identifier[coreType] operator[SEP] operator[SEP]
}
|
public Element insertByKey(Object key, Object object)
{
EJSWrapperCommon element = (EJSWrapperCommon) object;
if (ivWrappers == null)
{
ivWrappers = new HashMap<Object, EJSWrapperCommon>(DEFAULT_BUCKET_SIZE);
}
Object duplicate = ivWrappers.put(key, element);
if (duplicate != null)
{
// The wrapper cache does not support duplicates.... however, the
// first time a home is looked up, and keyToObject faults it in,
// deferred init will initialize it and insert it into the cache
// before returning to faultOnKey where it will be done AGAIN!
// In the future, it would be nice if deferred init would NOT
// add the home to the cache, but until then, it is fine to just
// ignore this and go on.... at least this code will only allow
// it in the cache once. d535968
if (duplicate == element)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "insertByKey : same object again : " + object);
}
else
{
// It is totally unacceptable to have more than one
// EJSWrapperCommon instance per key. d535968
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "insertByKey : attempt to insert duplicate : " + key +
" : " + object + " : " + duplicate);
throw new IllegalArgumentException("Attempt to insert duplicate element into EJB Wrapper Cache");
}
}
// Give the element (EJSWrapperCommon) access to the bucket, so it
// may syncronize on it, and also reset the pin count to 0,
// a non-negative, to indiate the element is now in the cache.
element.ivBucket = this;
element.pinned = 0;
return element;
} | class class_name[name] begin[{]
method[insertByKey, return_type[type[Element]], modifier[public], parameter[key, object]] begin[{]
local_variable[type[EJSWrapperCommon], element]
if[binary_operation[member[.ivWrappers], ==, literal[null]]] begin[{]
assign[member[.ivWrappers], ClassCreator(arguments=[MemberReference(member=DEFAULT_BUCKET_SIZE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=EJSWrapperCommon, sub_type=None))], dimensions=None, name=HashMap, sub_type=None))]
else begin[{]
None
end[}]
local_variable[type[Object], duplicate]
if[binary_operation[member[.duplicate], !=, literal[null]]] begin[{]
if[binary_operation[member[.duplicate], ==, member[.element]]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[literal["insertByKey : same object again : "], +, member[.object]]]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[tc.isDebugEnabled, parameter[]]]] begin[{]
call[Tr.debug, parameter[member[.tc], binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[literal["insertByKey : attempt to insert duplicate : "], +, member[.key]], +, literal[" : "]], +, member[.object]], +, literal[" : "]], +, member[.duplicate]]]]
else begin[{]
None
end[}]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Attempt to insert duplicate element into EJB Wrapper Cache")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
else begin[{]
None
end[}]
assign[member[element.ivBucket], THIS[]]
assign[member[element.pinned], literal[0]]
return[member[.element]]
end[}]
END[}] | Keyword[public] identifier[Element] identifier[insertByKey] operator[SEP] identifier[Object] identifier[key] , identifier[Object] identifier[object] operator[SEP] {
identifier[EJSWrapperCommon] identifier[element] operator[=] operator[SEP] identifier[EJSWrapperCommon] operator[SEP] identifier[object] operator[SEP] Keyword[if] operator[SEP] identifier[ivWrappers] operator[==] Other[null] operator[SEP] {
identifier[ivWrappers] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[Object] , identifier[EJSWrapperCommon] operator[>] operator[SEP] identifier[DEFAULT_BUCKET_SIZE] operator[SEP] operator[SEP]
}
identifier[Object] identifier[duplicate] operator[=] identifier[ivWrappers] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[element] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[duplicate] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[duplicate] operator[==] identifier[element] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[object] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[Tr] operator[SEP] identifier[debug] operator[SEP] identifier[tc] , literal[String] operator[+] identifier[key] operator[+] literal[String] operator[+] identifier[object] operator[+] literal[String] operator[+] identifier[duplicate] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
identifier[element] operator[SEP] identifier[ivBucket] operator[=] Keyword[this] operator[SEP] identifier[element] operator[SEP] identifier[pinned] operator[=] Other[0] operator[SEP] Keyword[return] identifier[element] operator[SEP]
}
|
public AuthorizationRequestUrl setScopes(Collection<String> scopes) {
this.scopes =
scopes == null || !scopes.iterator().hasNext() ? null : Joiner.on(' ').join(scopes);
return this;
} | class class_name[name] begin[{]
method[setScopes, return_type[type[AuthorizationRequestUrl]], modifier[public], parameter[scopes]] begin[{]
assign[THIS[member[None.scopes]], TernaryExpression(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=scopes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), operandr=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=['!'], qualifier=scopes, selectors=[MethodInvocation(arguments=[], member=hasNext, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=||), if_false=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=' ')], member=on, postfix_operators=[], prefix_operators=[], qualifier=Joiner, selectors=[MethodInvocation(arguments=[MemberReference(member=scopes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null))]
return[THIS[]]
end[}]
END[}] | Keyword[public] identifier[AuthorizationRequestUrl] identifier[setScopes] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[scopes] operator[SEP] {
Keyword[this] operator[SEP] identifier[scopes] operator[=] identifier[scopes] operator[==] Other[null] operator[||] operator[!] identifier[scopes] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[?] Other[null] operator[:] identifier[Joiner] operator[SEP] identifier[on] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[join] operator[SEP] identifier[scopes] operator[SEP] operator[SEP] Keyword[return] Keyword[this] operator[SEP]
}
|
public void removeByValue(Object value)
{
Object key = valueTable.remove(value);
if (key != null)
{
keyTable.remove(key);
}
} | class class_name[name] begin[{]
method[removeByValue, return_type[void], modifier[public], parameter[value]] begin[{]
local_variable[type[Object], key]
if[binary_operation[member[.key], !=, literal[null]]] begin[{]
call[keyTable.remove, parameter[member[.key]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[removeByValue] operator[SEP] identifier[Object] identifier[value] operator[SEP] {
identifier[Object] identifier[key] operator[=] identifier[valueTable] operator[SEP] identifier[remove] operator[SEP] identifier[value] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[key] operator[!=] Other[null] operator[SEP] {
identifier[keyTable] operator[SEP] identifier[remove] operator[SEP] identifier[key] operator[SEP] operator[SEP]
}
}
|
public Iterator<Operator<Tree<E>>> validOperators(boolean reverse)
{
/*log.fine("public Iterator<Operator> validOperators(): called");*/
// Check if the tree is a leaf and return an empty iterator if so.
if (tree.isLeaf())
{
/*log.fine("is leaf");*/
return new ArrayList<Operator<Tree<E>>>().iterator();
}
// Generate an iterator over the child trees of the current node, encapsulating them as operators.
else
{
/*log.fine("is node");*/
Tree.Node<E> node = tree.getAsNode();
return new TreeSearchOperatorIterator<E>(node.getChildIterator());
}
} | class class_name[name] begin[{]
method[validOperators, return_type[type[Iterator]], modifier[public], parameter[reverse]] begin[{]
if[call[tree.isLeaf, parameter[]]] begin[{]
return[ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=iterator, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=[], name=Tree, sub_type=None))], dimensions=[], name=Operator, sub_type=None))], dimensions=None, name=ArrayList, sub_type=None))]
else begin[{]
local_variable[type[Tree], node]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=getChildIterator, postfix_operators=[], prefix_operators=[], qualifier=node, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=E, sub_type=None))], dimensions=None, name=TreeSearchOperatorIterator, sub_type=None))]
end[}]
end[}]
END[}] | Keyword[public] identifier[Iterator] operator[<] identifier[Operator] operator[<] identifier[Tree] operator[<] identifier[E] operator[>] operator[>] operator[>] identifier[validOperators] operator[SEP] Keyword[boolean] identifier[reverse] operator[SEP] {
Keyword[if] operator[SEP] identifier[tree] operator[SEP] identifier[isLeaf] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] Keyword[new] identifier[ArrayList] operator[<] identifier[Operator] operator[<] identifier[Tree] operator[<] identifier[E] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Tree] operator[SEP] identifier[Node] operator[<] identifier[E] operator[>] identifier[node] operator[=] identifier[tree] operator[SEP] identifier[getAsNode] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[TreeSearchOperatorIterator] operator[<] identifier[E] operator[>] operator[SEP] identifier[node] operator[SEP] identifier[getChildIterator] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private static final String encode(String s) {
try {
return URLEncoder.encode(s, UTF_8);
} catch (UnsupportedEncodingException e) {
throw new Error("JVM unable to handle UTF-8");
}
} | class class_name[name] begin[{]
method[encode, return_type[type[String]], modifier[final private static], parameter[s]] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=encode, postfix_operators=[], prefix_operators=[], qualifier=URLEncoder, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="JVM unable to handle UTF-8")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Error, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['UnsupportedEncodingException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[final] identifier[String] identifier[encode] operator[SEP] identifier[String] identifier[s] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[URLEncoder] operator[SEP] identifier[encode] operator[SEP] identifier[s] , identifier[UTF_8] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[UnsupportedEncodingException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[Error] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
|
public static String getPlatform(RemoteProxy proxy) {
if (proxy.getTestSlots().size() == 0) {
return "Unknown";
}
Platform res = getPlatform(proxy.getTestSlots().get(0));
for (TestSlot slot : proxy.getTestSlots()) {
Platform tmp = getPlatform(slot);
if (tmp != res) {
return "mixed OS";
}
res = tmp;
}
if (res == null) {
return "not specified";
}
return res.toString();
} | class class_name[name] begin[{]
method[getPlatform, return_type[type[String]], modifier[public static], parameter[proxy]] begin[{]
if[binary_operation[call[proxy.getTestSlots, parameter[]], ==, literal[0]]] begin[{]
return[literal["Unknown"]]
else begin[{]
None
end[}]
local_variable[type[Platform], res]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=slot, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPlatform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=tmp)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Platform, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="mixed OS"), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=res, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=tmp, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=getTestSlots, postfix_operators=[], prefix_operators=[], qualifier=proxy, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=slot)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=TestSlot, sub_type=None))), label=None)
if[binary_operation[member[.res], ==, literal[null]]] begin[{]
return[literal["not specified"]]
else begin[{]
None
end[}]
return[call[res.toString, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getPlatform] operator[SEP] identifier[RemoteProxy] identifier[proxy] operator[SEP] {
Keyword[if] operator[SEP] identifier[proxy] operator[SEP] identifier[getTestSlots] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[==] Other[0] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
identifier[Platform] identifier[res] operator[=] identifier[getPlatform] operator[SEP] identifier[proxy] operator[SEP] identifier[getTestSlots] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[0] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[TestSlot] identifier[slot] operator[:] identifier[proxy] operator[SEP] identifier[getTestSlots] operator[SEP] operator[SEP] operator[SEP] {
identifier[Platform] identifier[tmp] operator[=] identifier[getPlatform] operator[SEP] identifier[slot] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[tmp] operator[!=] identifier[res] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
identifier[res] operator[=] identifier[tmp] operator[SEP]
}
Keyword[if] operator[SEP] identifier[res] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[String] operator[SEP]
}
Keyword[return] identifier[res] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public List<DetailInfo> getDetailInfo(CmsObject cms) {
return getCacheState(isOnline(cms)).getDetailInfosForSubsites(cms);
} | class class_name[name] begin[{]
method[getDetailInfo, return_type[type[List]], modifier[public], parameter[cms]] begin[{]
return[call[.getCacheState, parameter[call[.isOnline, parameter[member[.cms]]]]]]
end[}]
END[}] | Keyword[public] identifier[List] operator[<] identifier[DetailInfo] operator[>] identifier[getDetailInfo] operator[SEP] identifier[CmsObject] identifier[cms] operator[SEP] {
Keyword[return] identifier[getCacheState] operator[SEP] identifier[isOnline] operator[SEP] identifier[cms] operator[SEP] operator[SEP] operator[SEP] identifier[getDetailInfosForSubsites] operator[SEP] identifier[cms] operator[SEP] operator[SEP]
}
|
public static String getNewSaveFileLocation(boolean isTemporary) {
File dst;
File savesDir = FMLClientHandler.instance().getSavesDir();
do {
// We used to create filenames based on the current date/time, but this can cause problems when
// multiple clients might be writing to the same save location. Instead, use a GUID:
String s = UUID.randomUUID().toString();
// Add our port number, to help with file management:
s = AddressHelper.getMissionControlPort() + "_" + s;
// If this is a temp file, mark it as such:
if (isTemporary) {
s = tempMark + s;
}
dst = new File(savesDir, s);
} while (dst.exists());
return dst.getName();
} | class class_name[name] begin[{]
method[getNewSaveFileLocation, return_type[type[String]], modifier[public static], parameter[isTemporary]] begin[{]
local_variable[type[File], dst]
local_variable[type[File], savesDir]
do[call[dst.exists, parameter[]]] begin[{]
local_variable[type[String], s]
assign[member[.s], binary_operation[binary_operation[call[AddressHelper.getMissionControlPort, parameter[]], +, literal["_"]], +, member[.s]]]
if[member[.isTemporary]] begin[{]
assign[member[.s], binary_operation[member[.tempMark], +, member[.s]]]
else begin[{]
None
end[}]
assign[member[.dst], ClassCreator(arguments=[MemberReference(member=savesDir, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=s, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=File, sub_type=None))]
end[}]
return[call[dst.getName, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getNewSaveFileLocation] operator[SEP] Keyword[boolean] identifier[isTemporary] operator[SEP] {
identifier[File] identifier[dst] operator[SEP] identifier[File] identifier[savesDir] operator[=] identifier[FMLClientHandler] operator[SEP] identifier[instance] operator[SEP] operator[SEP] operator[SEP] identifier[getSavesDir] operator[SEP] operator[SEP] operator[SEP] Keyword[do] {
identifier[String] identifier[s] operator[=] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[=] identifier[AddressHelper] operator[SEP] identifier[getMissionControlPort] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[s] operator[SEP] Keyword[if] operator[SEP] identifier[isTemporary] operator[SEP] {
identifier[s] operator[=] identifier[tempMark] operator[+] identifier[s] operator[SEP]
}
identifier[dst] operator[=] Keyword[new] identifier[File] operator[SEP] identifier[savesDir] , identifier[s] operator[SEP] operator[SEP]
}
Keyword[while] operator[SEP] identifier[dst] operator[SEP] identifier[exists] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dst] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP]
}
|
public void marshall(RouteSettings routeSettings, ProtocolMarshaller protocolMarshaller) {
if (routeSettings == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(routeSettings.getDataTraceEnabled(), DATATRACEENABLED_BINDING);
protocolMarshaller.marshall(routeSettings.getDetailedMetricsEnabled(), DETAILEDMETRICSENABLED_BINDING);
protocolMarshaller.marshall(routeSettings.getLoggingLevel(), LOGGINGLEVEL_BINDING);
protocolMarshaller.marshall(routeSettings.getThrottlingBurstLimit(), THROTTLINGBURSTLIMIT_BINDING);
protocolMarshaller.marshall(routeSettings.getThrottlingRateLimit(), THROTTLINGRATELIMIT_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[routeSettings, protocolMarshaller]] begin[{]
if[binary_operation[member[.routeSettings], ==, 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=getDataTraceEnabled, postfix_operators=[], prefix_operators=[], qualifier=routeSettings, selectors=[], type_arguments=None), MemberReference(member=DATATRACEENABLED_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=getDetailedMetricsEnabled, postfix_operators=[], prefix_operators=[], qualifier=routeSettings, selectors=[], type_arguments=None), MemberReference(member=DETAILEDMETRICSENABLED_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=getLoggingLevel, postfix_operators=[], prefix_operators=[], qualifier=routeSettings, selectors=[], type_arguments=None), MemberReference(member=LOGGINGLEVEL_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=getThrottlingBurstLimit, postfix_operators=[], prefix_operators=[], qualifier=routeSettings, selectors=[], type_arguments=None), MemberReference(member=THROTTLINGBURSTLIMIT_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=getThrottlingRateLimit, postfix_operators=[], prefix_operators=[], qualifier=routeSettings, selectors=[], type_arguments=None), MemberReference(member=THROTTLINGRATELIMIT_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[RouteSettings] identifier[routeSettings] , identifier[ProtocolMarshaller] identifier[protocolMarshaller] operator[SEP] {
Keyword[if] operator[SEP] identifier[routeSettings] 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[routeSettings] operator[SEP] identifier[getDataTraceEnabled] operator[SEP] operator[SEP] , identifier[DATATRACEENABLED_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[routeSettings] operator[SEP] identifier[getDetailedMetricsEnabled] operator[SEP] operator[SEP] , identifier[DETAILEDMETRICSENABLED_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[routeSettings] operator[SEP] identifier[getLoggingLevel] operator[SEP] operator[SEP] , identifier[LOGGINGLEVEL_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[routeSettings] operator[SEP] identifier[getThrottlingBurstLimit] operator[SEP] operator[SEP] , identifier[THROTTLINGBURSTLIMIT_BINDING] operator[SEP] operator[SEP] identifier[protocolMarshaller] operator[SEP] identifier[marshall] operator[SEP] identifier[routeSettings] operator[SEP] identifier[getThrottlingRateLimit] operator[SEP] operator[SEP] , identifier[THROTTLINGRATELIMIT_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]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.