code
stringlengths 63
466k
| code_sememe
stringlengths 141
3.79M
| token_type
stringlengths 274
1.23M
|
---|---|---|
@Override
public void run() {
if (this.state != null && this.state.cancel) {
// we were already cancelled, don't run, but still post completion
this.state.documentCounter = 0;
this.state.batchCounter = 0;
runComplete(null);
return;
}
// reset internal state
this.state = new State();
Throwable errorInfo = null;
try {
replicate();
} catch (Throwable e) {
logger.log(Level.SEVERE,String.format("Batch %s ended with error:", this.state.batchCounter),e);
errorInfo = e;
}
runComplete(errorInfo);
} | class class_name[name] begin[{]
method[run, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[binary_operation[THIS[member[None.state]], !=, literal[null]], &&, THIS[member[None.state]member[None.cancel]]]] begin[{]
assign[THIS[member[None.state]member[None.documentCounter]], literal[0]]
assign[THIS[member[None.state]member[None.batchCounter]], literal[0]]
call[.runComplete, parameter[literal[null]]]
return[None]
else begin[{]
None
end[}]
assign[THIS[member[None.state]], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=State, sub_type=None))]
local_variable[type[Throwable], errorInfo]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=replicate, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SEVERE, postfix_operators=[], prefix_operators=[], qualifier=Level, selectors=[]), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Batch %s ended with error:"), This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=state, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MemberReference(member=batchCounter, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)])], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=log, postfix_operators=[], prefix_operators=[], qualifier=logger, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=errorInfo, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['Throwable']))], finally_block=None, label=None, resources=None)
call[.runComplete, parameter[member[.errorInfo]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[state] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[cancel] operator[SEP] {
Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[documentCounter] operator[=] Other[0] operator[SEP] Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[batchCounter] operator[=] Other[0] operator[SEP] identifier[runComplete] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
Keyword[this] operator[SEP] identifier[state] operator[=] Keyword[new] identifier[State] operator[SEP] operator[SEP] operator[SEP] identifier[Throwable] identifier[errorInfo] operator[=] Other[null] operator[SEP] Keyword[try] {
identifier[replicate] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Throwable] identifier[e] operator[SEP] {
identifier[logger] operator[SEP] identifier[log] operator[SEP] identifier[Level] operator[SEP] identifier[SEVERE] , identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[state] operator[SEP] identifier[batchCounter] operator[SEP] , identifier[e] operator[SEP] operator[SEP] identifier[errorInfo] operator[=] identifier[e] operator[SEP]
}
identifier[runComplete] operator[SEP] identifier[errorInfo] operator[SEP] operator[SEP]
}
|
public void readState(DataInputStream stream) throws IOException
{
int len = mt.length;
for(int x=0;x<len;x++) mt[x] = stream.readInt();
len = mag01.length;
for(int x=0;x<len;x++) mag01[x] = stream.readInt();
mti = stream.readInt();
__nextNextGaussian = stream.readDouble();
__haveNextNextGaussian = stream.readBoolean();
} | class class_name[name] begin[{]
method[readState, return_type[void], modifier[public], parameter[stream]] begin[{]
local_variable[type[int], len]
ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=mt, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.len], member[mag01.length]]
ForStatement(body=StatementExpression(expression=Assignment(expressionl=MemberReference(member=mag01, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MethodInvocation(arguments=[], member=readInt, postfix_operators=[], prefix_operators=[], qualifier=stream, selectors=[], type_arguments=None)), label=None), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=x, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=x)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=x, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
assign[member[.mti], call[stream.readInt, parameter[]]]
assign[member[.__nextNextGaussian], call[stream.readDouble, parameter[]]]
assign[member[.__haveNextNextGaussian], call[stream.readBoolean, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[readState] operator[SEP] identifier[DataInputStream] identifier[stream] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[int] identifier[len] operator[=] identifier[mt] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[len] operator[SEP] identifier[x] operator[++] operator[SEP] identifier[mt] operator[SEP] identifier[x] operator[SEP] operator[=] identifier[stream] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] identifier[len] operator[=] identifier[mag01] operator[SEP] identifier[length] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[x] operator[=] Other[0] operator[SEP] identifier[x] operator[<] identifier[len] operator[SEP] identifier[x] operator[++] operator[SEP] identifier[mag01] operator[SEP] identifier[x] operator[SEP] operator[=] identifier[stream] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] identifier[mti] operator[=] identifier[stream] operator[SEP] identifier[readInt] operator[SEP] operator[SEP] operator[SEP] identifier[__nextNextGaussian] operator[=] identifier[stream] operator[SEP] identifier[readDouble] operator[SEP] operator[SEP] operator[SEP] identifier[__haveNextNextGaussian] operator[=] identifier[stream] operator[SEP] identifier[readBoolean] operator[SEP] operator[SEP] operator[SEP]
}
|
public static UpdateResult update(String accessToken, UpdateGift updateGift) {
return update(accessToken, JsonUtil.toJSONString(updateGift));
} | class class_name[name] begin[{]
method[update, return_type[type[UpdateResult]], modifier[public static], parameter[accessToken, updateGift]] begin[{]
return[call[.update, parameter[member[.accessToken], call[JsonUtil.toJSONString, parameter[member[.updateGift]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[UpdateResult] identifier[update] operator[SEP] identifier[String] identifier[accessToken] , identifier[UpdateGift] identifier[updateGift] operator[SEP] {
Keyword[return] identifier[update] operator[SEP] identifier[accessToken] , identifier[JsonUtil] operator[SEP] identifier[toJSONString] operator[SEP] identifier[updateGift] operator[SEP] operator[SEP] operator[SEP]
}
|
@Override
public boolean onTouchEvent(@NonNull MotionEvent event) {
final MentionSpan touchedSpan = getTouchedSpan(event);
// Android 6 occasionally throws a NullPointerException inside Editor.onTouchEvent()
// for ACTION_UP when attempting to display (uninitialised) text handles.
boolean superResult;
if (android.os.Build.VERSION.SDK_INT == Build.VERSION_CODES.M &&
event.getActionMasked() == MotionEvent.ACTION_UP) {
try {
superResult = super.onTouchEvent(event);
} catch (NullPointerException ignored) {
// Ignore this (see above) - since we're now in an unknown state let's clear all
// selection (which is still better than an arbitrary crash that we can't control):
clearFocus();
superResult = true;
}
} else {
superResult = super.onTouchEvent(event);
}
if (event.getAction() == MotionEvent.ACTION_UP) {
// Don't call the onclick on mention if MotionEvent.ACTION_UP is for long click action,
if (!isLongPressed && touchedSpan != null) {
// Manually click span and show soft keyboard
touchedSpan.onClick(this);
Context context = getContext();
if (context != null) {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(this, 0);
}
return true;
}
} else if (event.getAction() == MotionEvent.ACTION_DOWN) {
isLongPressed = false;
if (isLongClickable() && touchedSpan != null) {
if (longClickRunnable == null) {
longClickRunnable = new CheckLongClickRunnable();
}
longClickRunnable.touchedSpan = touchedSpan;
removeCallbacks(longClickRunnable);
postDelayed(longClickRunnable, ViewConfiguration.getLongPressTimeout());
}
} else if (event.getAction() == MotionEvent.ACTION_CANCEL) {
isLongPressed = false;
}
// Check if user clicked on the EditText while showing the suggestions list
// If so, avoid the current prefix
if (mAvoidPrefixOnTap
&& mSuggestionsVisibilityManager != null
&& mSuggestionsVisibilityManager.isDisplayingSuggestions()) {
mSuggestionsVisibilityManager.displaySuggestions(false);
String keywords = getCurrentKeywordsString();
String[] words = keywords.split(" ");
if (words.length > 0) {
String prefix = words[words.length - 1];
// Note that prefix == "" when user types an explicit character and taps the EditText
// We must not allow the user to avoid suggestions for the empty string prefix
// Otherwise, explicit mentions would be broken, see MOB-38080
if (prefix.length() > 0) {
setAvoidedPrefix(prefix);
}
}
}
return superResult;
} | class class_name[name] begin[{]
method[onTouchEvent, return_type[type[boolean]], modifier[public], parameter[event]] begin[{]
local_variable[type[MentionSpan], touchedSpan]
local_variable[type[boolean], superResult]
if[binary_operation[binary_operation[member[android.os.Build.VERSION.SDK_INT], ==, member[Build.VERSION_CODES.M]], &&, binary_operation[call[event.getActionMasked, parameter[]], ==, member[MotionEvent.ACTION_UP]]]] begin[{]
TryStatement(block=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=superResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=SuperMethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onTouchEvent, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=clearFocus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=superResult, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignored, types=['NullPointerException']))], finally_block=None, label=None, resources=None)
else begin[{]
assign[member[.superResult], SuperMethodInvocation(arguments=[MemberReference(member=event, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=onTouchEvent, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)]
end[}]
if[binary_operation[call[event.getAction, parameter[]], ==, member[MotionEvent.ACTION_UP]]] begin[{]
if[binary_operation[member[.isLongPressed], &&, binary_operation[member[.touchedSpan], !=, literal[null]]]] begin[{]
call[touchedSpan.onClick, parameter[THIS[]]]
local_variable[type[Context], context]
if[binary_operation[member[.context], !=, literal[null]]] begin[{]
local_variable[type[InputMethodManager], imm]
call[imm.showSoftInput, parameter[THIS[], literal[0]]]
else begin[{]
None
end[}]
return[literal[true]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[call[event.getAction, parameter[]], ==, member[MotionEvent.ACTION_DOWN]]] begin[{]
assign[member[.isLongPressed], literal[false]]
if[binary_operation[call[.isLongClickable, parameter[]], &&, binary_operation[member[.touchedSpan], !=, literal[null]]]] begin[{]
if[binary_operation[member[.longClickRunnable], ==, literal[null]]] begin[{]
assign[member[.longClickRunnable], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=CheckLongClickRunnable, sub_type=None))]
else begin[{]
None
end[}]
assign[member[longClickRunnable.touchedSpan], member[.touchedSpan]]
call[.removeCallbacks, parameter[member[.longClickRunnable]]]
call[.postDelayed, parameter[member[.longClickRunnable], call[ViewConfiguration.getLongPressTimeout, parameter[]]]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[call[event.getAction, parameter[]], ==, member[MotionEvent.ACTION_CANCEL]]] begin[{]
assign[member[.isLongPressed], literal[false]]
else begin[{]
None
end[}]
end[}]
end[}]
if[binary_operation[binary_operation[member[.mAvoidPrefixOnTap], &&, binary_operation[member[.mSuggestionsVisibilityManager], !=, literal[null]]], &&, call[mSuggestionsVisibilityManager.isDisplayingSuggestions, parameter[]]]] begin[{]
call[mSuggestionsVisibilityManager.displaySuggestions, parameter[literal[false]]]
local_variable[type[String], keywords]
local_variable[type[String], words]
if[binary_operation[member[words.length], >, literal[0]]] begin[{]
local_variable[type[String], prefix]
if[binary_operation[call[prefix.length, parameter[]], >, literal[0]]] begin[{]
call[.setAvoidedPrefix, parameter[member[.prefix]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.superResult]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[onTouchEvent] operator[SEP] annotation[@] identifier[NonNull] identifier[MotionEvent] identifier[event] operator[SEP] {
Keyword[final] identifier[MentionSpan] identifier[touchedSpan] operator[=] identifier[getTouchedSpan] operator[SEP] identifier[event] operator[SEP] operator[SEP] Keyword[boolean] identifier[superResult] operator[SEP] Keyword[if] operator[SEP] identifier[android] operator[SEP] identifier[os] operator[SEP] identifier[Build] operator[SEP] identifier[VERSION] operator[SEP] identifier[SDK_INT] operator[==] identifier[Build] operator[SEP] identifier[VERSION_CODES] operator[SEP] identifier[M] operator[&&] identifier[event] operator[SEP] identifier[getActionMasked] operator[SEP] operator[SEP] operator[==] identifier[MotionEvent] operator[SEP] identifier[ACTION_UP] operator[SEP] {
Keyword[try] {
identifier[superResult] operator[=] Keyword[super] operator[SEP] identifier[onTouchEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NullPointerException] identifier[ignored] operator[SEP] {
identifier[clearFocus] operator[SEP] operator[SEP] operator[SEP] identifier[superResult] operator[=] literal[boolean] operator[SEP]
}
}
Keyword[else] {
identifier[superResult] operator[=] Keyword[super] operator[SEP] identifier[onTouchEvent] operator[SEP] identifier[event] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[getAction] operator[SEP] operator[SEP] operator[==] identifier[MotionEvent] operator[SEP] identifier[ACTION_UP] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isLongPressed] operator[&&] identifier[touchedSpan] operator[!=] Other[null] operator[SEP] {
identifier[touchedSpan] operator[SEP] identifier[onClick] operator[SEP] Keyword[this] operator[SEP] operator[SEP] identifier[Context] identifier[context] operator[=] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[!=] Other[null] operator[SEP] {
identifier[InputMethodManager] identifier[imm] operator[=] operator[SEP] identifier[InputMethodManager] operator[SEP] identifier[context] operator[SEP] identifier[getSystemService] operator[SEP] identifier[Context] operator[SEP] identifier[INPUT_METHOD_SERVICE] operator[SEP] operator[SEP] identifier[imm] operator[SEP] identifier[showSoftInput] operator[SEP] Keyword[this] , Other[0] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[getAction] operator[SEP] operator[SEP] operator[==] identifier[MotionEvent] operator[SEP] identifier[ACTION_DOWN] operator[SEP] {
identifier[isLongPressed] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[isLongClickable] operator[SEP] operator[SEP] operator[&&] identifier[touchedSpan] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[longClickRunnable] operator[==] Other[null] operator[SEP] {
identifier[longClickRunnable] operator[=] Keyword[new] identifier[CheckLongClickRunnable] operator[SEP] operator[SEP] operator[SEP]
}
identifier[longClickRunnable] operator[SEP] identifier[touchedSpan] operator[=] identifier[touchedSpan] operator[SEP] identifier[removeCallbacks] operator[SEP] identifier[longClickRunnable] operator[SEP] operator[SEP] identifier[postDelayed] operator[SEP] identifier[longClickRunnable] , identifier[ViewConfiguration] operator[SEP] identifier[getLongPressTimeout] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[event] operator[SEP] identifier[getAction] operator[SEP] operator[SEP] operator[==] identifier[MotionEvent] operator[SEP] identifier[ACTION_CANCEL] operator[SEP] {
identifier[isLongPressed] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[mAvoidPrefixOnTap] operator[&&] identifier[mSuggestionsVisibilityManager] operator[!=] Other[null] operator[&&] identifier[mSuggestionsVisibilityManager] operator[SEP] identifier[isDisplayingSuggestions] operator[SEP] operator[SEP] operator[SEP] {
identifier[mSuggestionsVisibilityManager] operator[SEP] identifier[displaySuggestions] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[String] identifier[keywords] operator[=] identifier[getCurrentKeywordsString] operator[SEP] operator[SEP] operator[SEP] identifier[String] operator[SEP] operator[SEP] identifier[words] operator[=] identifier[keywords] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[words] operator[SEP] identifier[length] operator[>] Other[0] operator[SEP] {
identifier[String] identifier[prefix] operator[=] identifier[words] operator[SEP] identifier[words] operator[SEP] identifier[length] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prefix] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[setAvoidedPrefix] operator[SEP] identifier[prefix] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[superResult] operator[SEP]
}
|
public void forEachBeanType(final Class type, final Consumer<String> beanNameConsumer) {
forEachBean(bd -> {
if (ClassUtil.isTypeOf(bd.type, type)) {
beanNameConsumer.accept(bd.name);
}
});
} | class class_name[name] begin[{]
method[forEachBeanType, return_type[void], modifier[public], parameter[type, beanNameConsumer]] begin[{]
call[.forEachBean, parameter[LambdaExpression(body=[IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=bd, selectors=[]), MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isTypeOf, postfix_operators=[], prefix_operators=[], qualifier=ClassUtil, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=bd, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=beanNameConsumer, selectors=[], type_arguments=None), label=None)]))], parameters=[MemberReference(member=bd, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])])]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[forEachBeanType] operator[SEP] Keyword[final] identifier[Class] identifier[type] , Keyword[final] identifier[Consumer] operator[<] identifier[String] operator[>] identifier[beanNameConsumer] operator[SEP] {
identifier[forEachBean] operator[SEP] identifier[bd] operator[->] {
Keyword[if] operator[SEP] identifier[ClassUtil] operator[SEP] identifier[isTypeOf] operator[SEP] identifier[bd] operator[SEP] identifier[type] , identifier[type] operator[SEP] operator[SEP] {
identifier[beanNameConsumer] operator[SEP] identifier[accept] operator[SEP] identifier[bd] operator[SEP] identifier[name] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP]
}
|
@Override
public T copy(T from) {
if (CONCURRENT_ACCESS_CHECK) {
enterExclusiveThread();
}
try {
checkAvroInitialized();
return avroData.deepCopy(runtimeSchema, from);
}
finally {
if (CONCURRENT_ACCESS_CHECK) {
exitExclusiveThread();
}
}
} | class class_name[name] begin[{]
method[copy, return_type[type[T]], modifier[public], parameter[from]] begin[{]
if[member[.CONCURRENT_ACCESS_CHECK]] begin[{]
call[.enterExclusiveThread, parameter[]]
else begin[{]
None
end[}]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=checkAvroInitialized, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=runtimeSchema, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=from, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deepCopy, postfix_operators=[], prefix_operators=[], qualifier=avroData, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=[IfStatement(condition=MemberReference(member=CONCURRENT_ACCESS_CHECK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=exitExclusiveThread, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))], label=None, resources=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[T] identifier[copy] operator[SEP] identifier[T] identifier[from] operator[SEP] {
Keyword[if] operator[SEP] identifier[CONCURRENT_ACCESS_CHECK] operator[SEP] {
identifier[enterExclusiveThread] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[try] {
identifier[checkAvroInitialized] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[avroData] operator[SEP] identifier[deepCopy] operator[SEP] identifier[runtimeSchema] , identifier[from] operator[SEP] operator[SEP]
}
Keyword[finally] {
Keyword[if] operator[SEP] identifier[CONCURRENT_ACCESS_CHECK] operator[SEP] {
identifier[exitExclusiveThread] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
@Override
public void beginDocument(MetaData metadata)
{
for (Listener listener : this.listeners) {
listener.beginDocument(metadata);
}
} | class class_name[name] begin[{]
method[beginDocument, return_type[void], modifier[public], parameter[metadata]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=metadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=beginDocument, postfix_operators=[], prefix_operators=[], qualifier=listener, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MemberReference(member=listeners, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listener)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Listener, sub_type=None))), label=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[beginDocument] operator[SEP] identifier[MetaData] identifier[metadata] operator[SEP] {
Keyword[for] operator[SEP] identifier[Listener] identifier[listener] operator[:] Keyword[this] operator[SEP] identifier[listeners] operator[SEP] {
identifier[listener] operator[SEP] identifier[beginDocument] operator[SEP] identifier[metadata] operator[SEP] operator[SEP]
}
}
|
public PackageInfo getPackageInfo(final String packageName) {
if (closed.get()) {
throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
}
if (!scanSpec.enableClassInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableClassInfo() before #scan()");
}
return packageNameToPackageInfo.get(packageName);
} | class class_name[name] begin[{]
method[getPackageInfo, return_type[type[PackageInfo]], modifier[public], parameter[packageName]] begin[{]
if[call[closed.get, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Cannot use a ScanResult after it has been closed")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[member[scanSpec.enableClassInfo]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Please call ClassGraph#enableClassInfo() before #scan()")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[call[packageNameToPackageInfo.get, parameter[member[.packageName]]]]
end[}]
END[}] | Keyword[public] identifier[PackageInfo] identifier[getPackageInfo] operator[SEP] Keyword[final] identifier[String] identifier[packageName] operator[SEP] {
Keyword[if] operator[SEP] identifier[closed] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[scanSpec] operator[SEP] identifier[enableClassInfo] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] identifier[packageNameToPackageInfo] operator[SEP] identifier[get] operator[SEP] identifier[packageName] operator[SEP] operator[SEP]
}
|
public java.awt.Graphics2D createGraphicsShapes(float width, float height) {
return new PdfGraphics2D(this, width, height, null, true, false, 0);
} | class class_name[name] begin[{]
method[createGraphicsShapes, return_type[type[java]], modifier[public], parameter[width, height]] begin[{]
return[ClassCreator(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[]), MemberReference(member=width, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=height, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=PdfGraphics2D, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[Graphics2D] identifier[createGraphicsShapes] operator[SEP] Keyword[float] identifier[width] , Keyword[float] identifier[height] operator[SEP] {
Keyword[return] Keyword[new] identifier[PdfGraphics2D] operator[SEP] Keyword[this] , identifier[width] , identifier[height] , Other[null] , literal[boolean] , literal[boolean] , Other[0] operator[SEP] operator[SEP]
}
|
protected final void adjust_code_for_locals_change(
MethodGen mgen, int index_first_moved_local, int size) {
InstructionList il = mgen.getInstructionList();
for (InstructionHandle ih = il.getStart(); ih != null; ih = ih.getNext()) {
Instruction inst = ih.getInstruction();
int orig_length = inst.getLength();
int operand;
if ((inst instanceof RET) || (inst instanceof IINC)) {
IndexedInstruction index_inst = (IndexedInstruction) inst;
if (index_inst.getIndex() >= index_first_moved_local) {
index_inst.setIndex(index_inst.getIndex() + size);
}
} else if (inst instanceof LocalVariableInstruction) {
// BCEL handles all the details of which opcode and if index
// is implicit or explicit; also, and if needs to be WIDE.
operand = ((LocalVariableInstruction) inst).getIndex();
if (operand >= index_first_moved_local) {
((LocalVariableInstruction) inst).setIndex(operand + size);
}
}
// Unfortunately, BCEL doesn't take care of incrementing the
// offset within StackMapEntrys.
int delta = inst.getLength() - orig_length;
if (delta > 0) {
il.setPositions();
update_stack_map_offset(ih.getPosition(), delta);
modify_stack_maps_for_switches(ih, il);
}
}
} | class class_name[name] begin[{]
method[adjust_code_for_locals_change, return_type[void], modifier[final protected], parameter[mgen, index_first_moved_local, size]] begin[{]
local_variable[type[InstructionList], il]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getInstruction, postfix_operators=[], prefix_operators=[], qualifier=ih, selectors=[], type_arguments=None), name=inst)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Instruction, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=inst, selectors=[], type_arguments=None), name=orig_length)], modifiers=set(), type=BasicType(dimensions=[], name=int)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=operand)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=inst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=RET, sub_type=None), operator=instanceof), operandr=BinaryOperation(operandl=MemberReference(member=inst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=IINC, sub_type=None), operator=instanceof), operator=||), else_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=inst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=LocalVariableInstruction, sub_type=None), operator=instanceof), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=operand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=inst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LocalVariableInstruction, sub_type=None))), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=operand, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=index_first_moved_local, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Cast(expression=MemberReference(member=inst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=LocalVariableInstruction, sub_type=None)), label=None)]))])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=inst, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IndexedInstruction, sub_type=None)), name=index_inst)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=IndexedInstruction, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=index_inst, selectors=[], type_arguments=None), operandr=MemberReference(member=index_first_moved_local, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=>=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[], member=getIndex, postfix_operators=[], prefix_operators=[], qualifier=index_inst, selectors=[], type_arguments=None), operandr=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+)], member=setIndex, postfix_operators=[], prefix_operators=[], qualifier=index_inst, selectors=[], type_arguments=None), label=None)]))])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=MethodInvocation(arguments=[], member=getLength, postfix_operators=[], prefix_operators=[], qualifier=inst, selectors=[], type_arguments=None), operandr=MemberReference(member=orig_length, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=-), name=delta)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[], member=setPositions, postfix_operators=[], prefix_operators=[], qualifier=il, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPosition, postfix_operators=[], prefix_operators=[], qualifier=ih, selectors=[], type_arguments=None), MemberReference(member=delta, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=update_stack_map_offset, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ih, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=il, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=modify_stack_maps_for_switches, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=ih, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MethodInvocation(arguments=[], member=getStart, postfix_operators=[], prefix_operators=[], qualifier=il, selectors=[], type_arguments=None), name=ih)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=InstructionHandle, sub_type=None)), update=[Assignment(expressionl=MemberReference(member=ih, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getNext, postfix_operators=[], prefix_operators=[], qualifier=ih, selectors=[], type_arguments=None))]), label=None)
end[}]
END[}] | Keyword[protected] Keyword[final] Keyword[void] identifier[adjust_code_for_locals_change] operator[SEP] identifier[MethodGen] identifier[mgen] , Keyword[int] identifier[index_first_moved_local] , Keyword[int] identifier[size] operator[SEP] {
identifier[InstructionList] identifier[il] operator[=] identifier[mgen] operator[SEP] identifier[getInstructionList] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[InstructionHandle] identifier[ih] operator[=] identifier[il] operator[SEP] identifier[getStart] operator[SEP] operator[SEP] operator[SEP] identifier[ih] operator[!=] Other[null] operator[SEP] identifier[ih] operator[=] identifier[ih] operator[SEP] identifier[getNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[Instruction] identifier[inst] operator[=] identifier[ih] operator[SEP] identifier[getInstruction] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[orig_length] operator[=] identifier[inst] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[operand] operator[SEP] Keyword[if] operator[SEP] operator[SEP] identifier[inst] Keyword[instanceof] identifier[RET] operator[SEP] operator[||] operator[SEP] identifier[inst] Keyword[instanceof] identifier[IINC] operator[SEP] operator[SEP] {
identifier[IndexedInstruction] identifier[index_inst] operator[=] operator[SEP] identifier[IndexedInstruction] operator[SEP] identifier[inst] operator[SEP] Keyword[if] operator[SEP] identifier[index_inst] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[>=] identifier[index_first_moved_local] operator[SEP] {
identifier[index_inst] operator[SEP] identifier[setIndex] operator[SEP] identifier[index_inst] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[+] identifier[size] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[inst] Keyword[instanceof] identifier[LocalVariableInstruction] operator[SEP] {
identifier[operand] operator[=] operator[SEP] operator[SEP] identifier[LocalVariableInstruction] operator[SEP] identifier[inst] operator[SEP] operator[SEP] identifier[getIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[operand] operator[>=] identifier[index_first_moved_local] operator[SEP] {
operator[SEP] operator[SEP] identifier[LocalVariableInstruction] operator[SEP] identifier[inst] operator[SEP] operator[SEP] identifier[setIndex] operator[SEP] identifier[operand] operator[+] identifier[size] operator[SEP] operator[SEP]
}
}
Keyword[int] identifier[delta] operator[=] identifier[inst] operator[SEP] identifier[getLength] operator[SEP] operator[SEP] operator[-] identifier[orig_length] operator[SEP] Keyword[if] operator[SEP] identifier[delta] operator[>] Other[0] operator[SEP] {
identifier[il] operator[SEP] identifier[setPositions] operator[SEP] operator[SEP] operator[SEP] identifier[update_stack_map_offset] operator[SEP] identifier[ih] operator[SEP] identifier[getPosition] operator[SEP] operator[SEP] , identifier[delta] operator[SEP] operator[SEP] identifier[modify_stack_maps_for_switches] operator[SEP] identifier[ih] , identifier[il] operator[SEP] operator[SEP]
}
}
}
|
static JbcSrcJavaValue ofConstantNull(JbcSrcValueErrorReporter reporter) {
return new JbcSrcJavaValue(
SoyExpression.NULL,
/* method= */ null,
/* allowedType= */ null,
/* constantNull= */ true,
/* error= */ false,
reporter);
} | class class_name[name] begin[{]
method[ofConstantNull, return_type[type[JbcSrcJavaValue]], modifier[static], parameter[reporter]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=NULL, postfix_operators=[], prefix_operators=[], qualifier=SoyExpression, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false), MemberReference(member=reporter, 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=JbcSrcJavaValue, sub_type=None))]
end[}]
END[}] | Keyword[static] identifier[JbcSrcJavaValue] identifier[ofConstantNull] operator[SEP] identifier[JbcSrcValueErrorReporter] identifier[reporter] operator[SEP] {
Keyword[return] Keyword[new] identifier[JbcSrcJavaValue] operator[SEP] identifier[SoyExpression] operator[SEP] identifier[NULL] , Other[null] , Other[null] , literal[boolean] , literal[boolean] , identifier[reporter] operator[SEP] operator[SEP]
}
|
public static final void sortAfps(AFPChain afpChain, Atom[] ca1, Atom[] ca2)
{
List<AFP> afpSet = afpChain.getAfpSet();
if ( debug)
System.err.println("entering sortAfps");
int pro1Len = ca1.length;
int pro2Len = ca2.length;
afpChain.setAfpIndex( new int[pro1Len][pro2Len]); //the index of (i,j) pair in AFP list, otherwise -1
afpChain.setAfpAftIndex( new int[pro1Len][pro2Len]); //the index of AFP (i,j*) nearest to (i,j), j*<j. if a AFP exits for (i,j), it equals to afpIndex
afpChain.setAfpBefIndex( new int[pro1Len][pro2Len]); //the index of AFP (i,j*) nearest to (i,j), j*>j. if a AFP exits for (i,j), it equals to afpIndex
int[][] afpIndex = afpChain.getAfpIndex();
int[][] afpAftIndex = afpChain.getAfpAftIndex();
int[][] afpBefIndex = afpChain.getAfpBefIndex();
for(int i = 0; i < pro1Len; i ++) {
for(int j = 0; j < pro2Len; j ++) {
afpIndex[i][j] = afpAftIndex[i][j] = afpBefIndex[i][j] = -1;
}
}
//index the AFP for easy extraction of compatible AFPs
int afpNum = afpSet.size();
int b0 = 0;
for(int a = 0; a < afpNum; a ++) {
if(a == afpNum - 1 || afpSet.get(a).getP1() != afpSet.get(a+1).getP1()) {
int i = afpSet.get(a).getP1();
for(int b = b0; b <= a; b ++) {
int j = afpSet.get(b).getP2();
afpIndex[i][j]=b ;
afpBefIndex[i][j]=b;
afpAftIndex[i][j]=b;
if(afpSet.get(b).getP1() != i) {
System.err.println(String.format("Warning: wrong afp index %d %d\n", i, afpSet.get(b).getP1()));
return;
}
}
for(int k = 1; k < pro2Len; k ++) {
if( afpBefIndex[i][k] == -1){
afpBefIndex[i][k] = afpBefIndex[i][k-1];
}
}
for(int k = pro2Len - 2; k >= 0; k --) {
if(afpAftIndex[i][k] == -1) {
afpAftIndex[i][k] = afpAftIndex[i][k+1];
}
}
b0 = a + 1;
}
}
if ( debug)
System.err.println("done sortAfps");
} | class class_name[name] begin[{]
method[sortAfps, return_type[void], modifier[final public static], parameter[afpChain, ca1, ca2]] begin[{]
local_variable[type[List], afpSet]
if[member[.debug]] begin[{]
call[System.err.println, parameter[literal["entering sortAfps"]]]
else begin[{]
None
end[}]
local_variable[type[int], pro1Len]
local_variable[type[int], pro2Len]
call[afpChain.setAfpIndex, parameter[ArrayCreator(dimensions=[MemberReference(member=pro1Len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pro2Len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]]
call[afpChain.setAfpAftIndex, parameter[ArrayCreator(dimensions=[MemberReference(member=pro1Len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pro2Len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]]
call[afpChain.setAfpBefIndex, parameter[ArrayCreator(dimensions=[MemberReference(member=pro1Len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=pro2Len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], initializer=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=None, name=int))]]
local_variable[type[int], afpIndex]
local_variable[type[int], afpAftIndex]
local_variable[type[int], afpBefIndex]
ForStatement(body=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=afpIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Assignment(expressionl=MemberReference(member=afpAftIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Assignment(expressionl=MemberReference(member=afpBefIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1)))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=pro2Len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=pro1Len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
local_variable[type[int], afpNum]
local_variable[type[int], b0]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=afpNum, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator===), operandr=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=afpSet, selectors=[MethodInvocation(arguments=[], member=getP1, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=get, postfix_operators=[], prefix_operators=[], qualifier=afpSet, selectors=[MethodInvocation(arguments=[], member=getP1, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=!=), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=afpSet, selectors=[MethodInvocation(arguments=[], member=getP1, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=afpSet, selectors=[MethodInvocation(arguments=[], member=getP2, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=afpIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=afpBefIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=afpAftIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=afpSet, selectors=[MethodInvocation(arguments=[], member=getP1, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operandr=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Warning: wrong afp index %d %d\n"), MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=afpSet, selectors=[MethodInvocation(arguments=[], member=getP1, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=format, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None)], member=println, postfix_operators=[], prefix_operators=[], qualifier=System.err, selectors=[], type_arguments=None), label=None), ReturnStatement(expression=None, label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=b, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=MemberReference(member=b0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), name=b)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=b, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=afpBefIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=afpBefIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=afpBefIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-))])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=pro2Len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=afpAftIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=Literal(postfix_operators=[], prefix_operators=['-'], qualifier=None, selectors=[], value=1), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=afpAftIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=MemberReference(member=afpAftIndex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+))])), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>=), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=BinaryOperation(operandl=MemberReference(member=pro2Len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2), operator=-), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['--'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=b0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)), label=None)]))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=a, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=afpNum, 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=a)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=a, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
if[member[.debug]] begin[{]
call[System.err.println, parameter[literal["done sortAfps"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] Keyword[final] Keyword[void] identifier[sortAfps] operator[SEP] identifier[AFPChain] identifier[afpChain] , identifier[Atom] operator[SEP] operator[SEP] identifier[ca1] , identifier[Atom] operator[SEP] operator[SEP] identifier[ca2] operator[SEP] {
identifier[List] operator[<] identifier[AFP] operator[>] identifier[afpSet] operator[=] identifier[afpChain] operator[SEP] identifier[getAfpSet] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[debug] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[int] identifier[pro1Len] operator[=] identifier[ca1] operator[SEP] identifier[length] operator[SEP] Keyword[int] identifier[pro2Len] operator[=] identifier[ca2] operator[SEP] identifier[length] operator[SEP] identifier[afpChain] operator[SEP] identifier[setAfpIndex] operator[SEP] Keyword[new] Keyword[int] operator[SEP] identifier[pro1Len] operator[SEP] operator[SEP] identifier[pro2Len] operator[SEP] operator[SEP] operator[SEP] identifier[afpChain] operator[SEP] identifier[setAfpAftIndex] operator[SEP] Keyword[new] Keyword[int] operator[SEP] identifier[pro1Len] operator[SEP] operator[SEP] identifier[pro2Len] operator[SEP] operator[SEP] operator[SEP] identifier[afpChain] operator[SEP] identifier[setAfpBefIndex] operator[SEP] Keyword[new] Keyword[int] operator[SEP] identifier[pro1Len] operator[SEP] operator[SEP] identifier[pro2Len] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[afpIndex] operator[=] identifier[afpChain] operator[SEP] identifier[getAfpIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[afpAftIndex] operator[=] identifier[afpChain] operator[SEP] identifier[getAfpAftIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[afpBefIndex] operator[=] identifier[afpChain] operator[SEP] identifier[getAfpBefIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[pro1Len] operator[SEP] identifier[i] operator[++] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[pro2Len] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[afpIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[afpAftIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[afpBefIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] operator[-] Other[1] operator[SEP]
}
}
Keyword[int] identifier[afpNum] operator[=] identifier[afpSet] operator[SEP] identifier[size] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[b0] operator[=] Other[0] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[a] operator[=] Other[0] operator[SEP] identifier[a] operator[<] identifier[afpNum] operator[SEP] identifier[a] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[a] operator[==] identifier[afpNum] operator[-] Other[1] operator[||] identifier[afpSet] operator[SEP] identifier[get] operator[SEP] identifier[a] operator[SEP] operator[SEP] identifier[getP1] operator[SEP] operator[SEP] operator[!=] identifier[afpSet] operator[SEP] identifier[get] operator[SEP] identifier[a] operator[+] Other[1] operator[SEP] operator[SEP] identifier[getP1] operator[SEP] operator[SEP] operator[SEP] {
Keyword[int] identifier[i] operator[=] identifier[afpSet] operator[SEP] identifier[get] operator[SEP] identifier[a] operator[SEP] operator[SEP] identifier[getP1] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[b] operator[=] identifier[b0] operator[SEP] identifier[b] operator[<=] identifier[a] operator[SEP] identifier[b] operator[++] operator[SEP] {
Keyword[int] identifier[j] operator[=] identifier[afpSet] operator[SEP] identifier[get] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[getP2] operator[SEP] operator[SEP] operator[SEP] identifier[afpIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[b] operator[SEP] identifier[afpBefIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[b] operator[SEP] identifier[afpAftIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[b] operator[SEP] Keyword[if] operator[SEP] identifier[afpSet] operator[SEP] identifier[get] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[getP1] operator[SEP] operator[SEP] operator[!=] identifier[i] operator[SEP] {
identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] identifier[String] operator[SEP] identifier[format] operator[SEP] literal[String] , identifier[i] , identifier[afpSet] operator[SEP] identifier[get] operator[SEP] identifier[b] operator[SEP] operator[SEP] identifier[getP1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] operator[SEP]
}
}
Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[1] operator[SEP] identifier[k] operator[<] identifier[pro2Len] operator[SEP] identifier[k] operator[++] operator[SEP] {
Keyword[if] operator[SEP] identifier[afpBefIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] {
identifier[afpBefIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[=] identifier[afpBefIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[k] operator[-] Other[1] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] identifier[pro2Len] operator[-] Other[2] operator[SEP] identifier[k] operator[>=] Other[0] operator[SEP] identifier[k] operator[--] operator[SEP] {
Keyword[if] operator[SEP] identifier[afpAftIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] {
identifier[afpAftIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[k] operator[SEP] operator[=] identifier[afpAftIndex] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[k] operator[+] Other[1] operator[SEP] operator[SEP]
}
}
identifier[b0] operator[=] identifier[a] operator[+] Other[1] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[debug] operator[SEP] identifier[System] operator[SEP] identifier[err] operator[SEP] identifier[println] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
public ResultList<Artwork> getSeasonImages(int tvID, int seasonNumber, String language, String... includeImageLanguage) throws MovieDbException {
return tmdbSeasons.getSeasonImages(tvID, seasonNumber, language, includeImageLanguage);
} | class class_name[name] begin[{]
method[getSeasonImages, return_type[type[ResultList]], modifier[public], parameter[tvID, seasonNumber, language, includeImageLanguage]] begin[{]
return[call[tmdbSeasons.getSeasonImages, parameter[member[.tvID], member[.seasonNumber], member[.language], member[.includeImageLanguage]]]]
end[}]
END[}] | Keyword[public] identifier[ResultList] operator[<] identifier[Artwork] operator[>] identifier[getSeasonImages] operator[SEP] Keyword[int] identifier[tvID] , Keyword[int] identifier[seasonNumber] , identifier[String] identifier[language] , identifier[String] operator[...] identifier[includeImageLanguage] operator[SEP] Keyword[throws] identifier[MovieDbException] {
Keyword[return] identifier[tmdbSeasons] operator[SEP] identifier[getSeasonImages] operator[SEP] identifier[tvID] , identifier[seasonNumber] , identifier[language] , identifier[includeImageLanguage] operator[SEP] operator[SEP]
}
|
public Matrix4x3f reflect(Vector3fc normal, Vector3fc point, Matrix4x3f dest) {
return reflect(normal.x(), normal.y(), normal.z(), point.x(), point.y(), point.z(), dest);
} | class class_name[name] begin[{]
method[reflect, return_type[type[Matrix4x3f]], modifier[public], parameter[normal, point, dest]] begin[{]
return[call[.reflect, parameter[call[normal.x, parameter[]], call[normal.y, parameter[]], call[normal.z, parameter[]], call[point.x, parameter[]], call[point.y, parameter[]], call[point.z, parameter[]], member[.dest]]]]
end[}]
END[}] | Keyword[public] identifier[Matrix4x3f] identifier[reflect] operator[SEP] identifier[Vector3fc] identifier[normal] , identifier[Vector3fc] identifier[point] , identifier[Matrix4x3f] identifier[dest] operator[SEP] {
Keyword[return] identifier[reflect] operator[SEP] identifier[normal] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[normal] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[normal] operator[SEP] identifier[z] operator[SEP] operator[SEP] , identifier[point] operator[SEP] identifier[x] operator[SEP] operator[SEP] , identifier[point] operator[SEP] identifier[y] operator[SEP] operator[SEP] , identifier[point] operator[SEP] identifier[z] operator[SEP] operator[SEP] , identifier[dest] operator[SEP] operator[SEP]
}
|
@Override
public void setValueAt(final Object aValue, final int row, final int column) {
final Vector rowVector = (Vector) this.dataVector.elementAt(row);
rowVector.setElementAt(aValue, column);
fireTableCellUpdated(row, column);
} | class class_name[name] begin[{]
method[setValueAt, return_type[void], modifier[public], parameter[aValue, row, column]] begin[{]
local_variable[type[Vector], rowVector]
call[rowVector.setElementAt, parameter[member[.aValue], member[.column]]]
call[.fireTableCellUpdated, parameter[member[.row], member[.column]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[setValueAt] operator[SEP] Keyword[final] identifier[Object] identifier[aValue] , Keyword[final] Keyword[int] identifier[row] , Keyword[final] Keyword[int] identifier[column] operator[SEP] {
Keyword[final] identifier[Vector] identifier[rowVector] operator[=] operator[SEP] identifier[Vector] operator[SEP] Keyword[this] operator[SEP] identifier[dataVector] operator[SEP] identifier[elementAt] operator[SEP] identifier[row] operator[SEP] operator[SEP] identifier[rowVector] operator[SEP] identifier[setElementAt] operator[SEP] identifier[aValue] , identifier[column] operator[SEP] operator[SEP] identifier[fireTableCellUpdated] operator[SEP] identifier[row] , identifier[column] operator[SEP] operator[SEP]
}
|
public <T extends Assignable> T create(final Class<T> type) throws IllegalArgumentException,
UnknownExtensionTypeException {
// Precondition checks
if (type == null) {
throw new IllegalArgumentException("Type must be specified");
}
// Get the extensionType type
final String extension = configuration.getExtensionLoader().getExtensionFromExtensionMapping(type);
// Generate a random name
String archiveName = UUID.randomUUID().toString();
// Delegate
return create(type, archiveName += extension);
} | class class_name[name] begin[{]
method[create, return_type[type[T]], modifier[public], parameter[type]] begin[{]
if[binary_operation[member[.type], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Type must be specified")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], extension]
local_variable[type[String], archiveName]
return[call[.create, parameter[member[.type], assign[member[.archiveName], member[.extension]]]]]
end[}]
END[}] | Keyword[public] operator[<] identifier[T] Keyword[extends] identifier[Assignable] operator[>] identifier[T] identifier[create] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[T] operator[>] identifier[type] operator[SEP] Keyword[throws] identifier[IllegalArgumentException] , identifier[UnknownExtensionTypeException] {
Keyword[if] operator[SEP] identifier[type] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] identifier[String] identifier[extension] operator[=] identifier[configuration] operator[SEP] identifier[getExtensionLoader] operator[SEP] operator[SEP] operator[SEP] identifier[getExtensionFromExtensionMapping] operator[SEP] identifier[type] operator[SEP] operator[SEP] identifier[String] identifier[archiveName] operator[=] identifier[UUID] operator[SEP] identifier[randomUUID] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[create] operator[SEP] identifier[type] , identifier[archiveName] operator[+=] identifier[extension] operator[SEP] operator[SEP]
}
|
private static void appendAltIDs(StringBuilder logMsg, String[] altIDs) {
logMsg.append(", altIDs: ");
if (altIDs == null) {
logMsg.append("null");
} else {
for (String altID : altIDs) {
logMsg.append("'").append(altID).append("'");
}
}
} | class class_name[name] begin[{]
method[appendAltIDs, return_type[void], modifier[private static], parameter[logMsg, altIDs]] begin[{]
call[logMsg.append, parameter[literal[", altIDs: "]]]
if[binary_operation[member[.altIDs], ==, literal[null]]] begin[{]
call[logMsg.append, parameter[literal["null"]]]
else begin[{]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'")], member=append, postfix_operators=[], prefix_operators=[], qualifier=logMsg, selectors=[MethodInvocation(arguments=[MemberReference(member=altID, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'")], member=append, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=altIDs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=altID)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[appendAltIDs] operator[SEP] identifier[StringBuilder] identifier[logMsg] , identifier[String] operator[SEP] operator[SEP] identifier[altIDs] operator[SEP] {
identifier[logMsg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[altIDs] operator[==] Other[null] operator[SEP] {
identifier[logMsg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[for] operator[SEP] identifier[String] identifier[altID] operator[:] identifier[altIDs] operator[SEP] {
identifier[logMsg] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[append] operator[SEP] identifier[altID] operator[SEP] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
}
}
|
private void updateBugCollection(Project findBugsProject, Reporter bugReporter, boolean incremental) {
SortedBugCollection newBugCollection = bugReporter.getBugCollection();
try {
st.newPoint("getBugCollection");
SortedBugCollection oldBugCollection = FindbugsPlugin.getBugCollection(project, monitor);
st.newPoint("mergeBugCollections");
SortedBugCollection resultCollection = mergeBugCollections(oldBugCollection, newBugCollection, incremental);
resultCollection.getProject().setGuiCallback(new EclipseGuiCallback(project));
resultCollection.setTimestamp(System.currentTimeMillis());
// will store bugs in the default FB file + Eclipse project session
// props
st.newPoint("storeBugCollection");
FindbugsPlugin.storeBugCollection(project, resultCollection, monitor);
} catch (IOException e) {
FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
} catch (CoreException e) {
FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
}
// will store bugs as markers in Eclipse workspace
st.newPoint("createMarkers");
MarkerUtil.createMarkers(javaProject, newBugCollection, resource, monitor);
} | class class_name[name] begin[{]
method[updateBugCollection, return_type[void], modifier[private], parameter[findBugsProject, bugReporter, incremental]] begin[{]
local_variable[type[SortedBugCollection], newBugCollection]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="getBugCollection")], member=newPoint, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=project, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=monitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getBugCollection, postfix_operators=[], prefix_operators=[], qualifier=FindbugsPlugin, selectors=[], type_arguments=None), name=oldBugCollection)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SortedBugCollection, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="mergeBugCollections")], member=newPoint, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=oldBugCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=newBugCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=incremental, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=mergeBugCollections, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=resultCollection)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SortedBugCollection, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=getProject, postfix_operators=[], prefix_operators=[], qualifier=resultCollection, selectors=[MethodInvocation(arguments=[ClassCreator(arguments=[MemberReference(member=project, 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=EclipseGuiCallback, sub_type=None))], member=setGuiCallback, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=currentTimeMillis, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)], member=setTimestamp, postfix_operators=[], prefix_operators=[], qualifier=resultCollection, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="storeBugCollection")], member=newPoint, postfix_operators=[], prefix_operators=[], qualifier=st, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=project, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=resultCollection, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=monitor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=storeBugCollection, postfix_operators=[], prefix_operators=[], qualifier=FindbugsPlugin, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=FindbugsPlugin, selectors=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error performing SpotBugs results update")], member=logException, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException'])), CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=getDefault, postfix_operators=[], prefix_operators=[], qualifier=FindbugsPlugin, selectors=[MethodInvocation(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error performing SpotBugs results update")], member=logException, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['CoreException']))], finally_block=None, label=None, resources=None)
call[st.newPoint, parameter[literal["createMarkers"]]]
call[MarkerUtil.createMarkers, parameter[member[.javaProject], member[.newBugCollection], member[.resource], member[.monitor]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[updateBugCollection] operator[SEP] identifier[Project] identifier[findBugsProject] , identifier[Reporter] identifier[bugReporter] , Keyword[boolean] identifier[incremental] operator[SEP] {
identifier[SortedBugCollection] identifier[newBugCollection] operator[=] identifier[bugReporter] operator[SEP] identifier[getBugCollection] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[st] operator[SEP] identifier[newPoint] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[SortedBugCollection] identifier[oldBugCollection] operator[=] identifier[FindbugsPlugin] operator[SEP] identifier[getBugCollection] operator[SEP] identifier[project] , identifier[monitor] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[newPoint] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[SortedBugCollection] identifier[resultCollection] operator[=] identifier[mergeBugCollections] operator[SEP] identifier[oldBugCollection] , identifier[newBugCollection] , identifier[incremental] operator[SEP] operator[SEP] identifier[resultCollection] operator[SEP] identifier[getProject] operator[SEP] operator[SEP] operator[SEP] identifier[setGuiCallback] operator[SEP] Keyword[new] identifier[EclipseGuiCallback] operator[SEP] identifier[project] operator[SEP] operator[SEP] operator[SEP] identifier[resultCollection] operator[SEP] identifier[setTimestamp] operator[SEP] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[st] operator[SEP] identifier[newPoint] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[FindbugsPlugin] operator[SEP] identifier[storeBugCollection] operator[SEP] identifier[project] , identifier[resultCollection] , identifier[monitor] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
identifier[FindbugsPlugin] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[logException] operator[SEP] identifier[e] , literal[String] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[CoreException] identifier[e] operator[SEP] {
identifier[FindbugsPlugin] operator[SEP] identifier[getDefault] operator[SEP] operator[SEP] operator[SEP] identifier[logException] operator[SEP] identifier[e] , literal[String] operator[SEP] operator[SEP]
}
identifier[st] operator[SEP] identifier[newPoint] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[MarkerUtil] operator[SEP] identifier[createMarkers] operator[SEP] identifier[javaProject] , identifier[newBugCollection] , identifier[resource] , identifier[monitor] operator[SEP] operator[SEP]
}
|
protected WebDriver getDefaultDriver(DesiredCapabilities caps) {
String hubUrl = getHubUrl();
if (hubUrl == null) {
return new FirefoxDriver(caps);
}
try {
return new RemoteWebDriver(new URL(hubUrl), caps);
} catch (MalformedURLException e) {
throw new SebException("Unable to construct remote webdriver.", e);
}
} | class class_name[name] begin[{]
method[getDefaultDriver, return_type[type[WebDriver]], modifier[protected], parameter[caps]] begin[{]
local_variable[type[String], hubUrl]
if[binary_operation[member[.hubUrl], ==, literal[null]]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=caps, 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=FirefoxDriver, sub_type=None))]
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=ClassCreator(arguments=[ClassCreator(arguments=[MemberReference(member=hubUrl, 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=URL, sub_type=None)), MemberReference(member=caps, 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=RemoteWebDriver, sub_type=None)), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to construct remote webdriver."), 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=SebException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['MalformedURLException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[protected] identifier[WebDriver] identifier[getDefaultDriver] operator[SEP] identifier[DesiredCapabilities] identifier[caps] operator[SEP] {
identifier[String] identifier[hubUrl] operator[=] identifier[getHubUrl] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[hubUrl] operator[==] Other[null] operator[SEP] {
Keyword[return] Keyword[new] identifier[FirefoxDriver] operator[SEP] identifier[caps] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[return] Keyword[new] identifier[RemoteWebDriver] operator[SEP] Keyword[new] identifier[URL] operator[SEP] identifier[hubUrl] operator[SEP] , identifier[caps] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[MalformedURLException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SebException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void addListeners()
{
super.addListeners();
Record record = this.getMainRecord();
Record recClassInfo = this.getRecord(ClassInfo.CLASS_INFO_FILE);
if (recClassInfo != null)
{
record.setKeyArea(FieldData.FIELD_FILE_NAME_KEY);
SubFileFilter listener = new SubFileFilter(recClassInfo.getField(ClassInfo.CLASS_NAME), FieldData.FIELD_FILE_NAME, null, null, null, null, true);
record.addListener(listener);
recClassInfo.getField(ClassInfo.CLASS_NAME).addListener(new FieldReSelectHandler(this));
}
} | class class_name[name] begin[{]
method[addListeners, return_type[void], modifier[public], parameter[]] begin[{]
SuperMethodInvocation(arguments=[], member=addListeners, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
local_variable[type[Record], record]
local_variable[type[Record], recClassInfo]
if[binary_operation[member[.recClassInfo], !=, literal[null]]] begin[{]
call[record.setKeyArea, parameter[member[FieldData.FIELD_FILE_NAME_KEY]]]
local_variable[type[SubFileFilter], listener]
call[record.addListener, parameter[member[.listener]]]
call[recClassInfo.getField, parameter[member[ClassInfo.CLASS_NAME]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[addListeners] operator[SEP] operator[SEP] {
Keyword[super] operator[SEP] identifier[addListeners] operator[SEP] operator[SEP] operator[SEP] identifier[Record] identifier[record] operator[=] Keyword[this] operator[SEP] identifier[getMainRecord] operator[SEP] operator[SEP] operator[SEP] identifier[Record] identifier[recClassInfo] operator[=] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[CLASS_INFO_FILE] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[recClassInfo] operator[!=] Other[null] operator[SEP] {
identifier[record] operator[SEP] identifier[setKeyArea] operator[SEP] identifier[FieldData] operator[SEP] identifier[FIELD_FILE_NAME_KEY] operator[SEP] operator[SEP] identifier[SubFileFilter] identifier[listener] operator[=] Keyword[new] identifier[SubFileFilter] operator[SEP] identifier[recClassInfo] operator[SEP] identifier[getField] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[CLASS_NAME] operator[SEP] , identifier[FieldData] operator[SEP] identifier[FIELD_FILE_NAME] , Other[null] , Other[null] , Other[null] , Other[null] , literal[boolean] operator[SEP] operator[SEP] identifier[record] operator[SEP] identifier[addListener] operator[SEP] identifier[listener] operator[SEP] operator[SEP] identifier[recClassInfo] operator[SEP] identifier[getField] operator[SEP] identifier[ClassInfo] operator[SEP] identifier[CLASS_NAME] operator[SEP] operator[SEP] identifier[addListener] operator[SEP] Keyword[new] identifier[FieldReSelectHandler] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public void dequeue(final int executionId) {
if (this.queuedFlowMap.containsKey(executionId)) {
this.queuedFlowList.remove(this.queuedFlowMap.get(executionId));
this.queuedFlowMap.remove(executionId);
}
} | class class_name[name] begin[{]
method[dequeue, return_type[void], modifier[public], parameter[executionId]] begin[{]
if[THIS[member[None.queuedFlowMap]call[None.containsKey, parameter[member[.executionId]]]]] begin[{]
THIS[member[None.queuedFlowList]call[None.remove, parameter[THIS[member[None.queuedFlowMap]call[None.get, parameter[member[.executionId]]]]]]]
THIS[member[None.queuedFlowMap]call[None.remove, parameter[member[.executionId]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[dequeue] operator[SEP] Keyword[final] Keyword[int] identifier[executionId] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[queuedFlowMap] operator[SEP] identifier[containsKey] operator[SEP] identifier[executionId] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[queuedFlowList] operator[SEP] identifier[remove] operator[SEP] Keyword[this] operator[SEP] identifier[queuedFlowMap] operator[SEP] identifier[get] operator[SEP] identifier[executionId] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[queuedFlowMap] operator[SEP] identifier[remove] operator[SEP] identifier[executionId] operator[SEP] operator[SEP]
}
}
|
public static String cleanPath(String path) throws InvalidPathException {
validatePath(path);
return FilenameUtils.separatorsToUnix(FilenameUtils.normalizeNoEndSeparator(path));
} | class class_name[name] begin[{]
method[cleanPath, return_type[type[String]], modifier[public static], parameter[path]] begin[{]
call[.validatePath, parameter[member[.path]]]
return[call[FilenameUtils.separatorsToUnix, parameter[call[FilenameUtils.normalizeNoEndSeparator, parameter[member[.path]]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[cleanPath] operator[SEP] identifier[String] identifier[path] operator[SEP] Keyword[throws] identifier[InvalidPathException] {
identifier[validatePath] operator[SEP] identifier[path] operator[SEP] operator[SEP] Keyword[return] identifier[FilenameUtils] operator[SEP] identifier[separatorsToUnix] operator[SEP] identifier[FilenameUtils] operator[SEP] identifier[normalizeNoEndSeparator] operator[SEP] identifier[path] operator[SEP] operator[SEP] operator[SEP]
}
|
public Object convertToPropertyType(TypeMetadata entityType, String[] propertyPath, String value) {
final Class<?> propertyType = getPrimitivePropertyType(entityType, propertyPath);
if (propertyType == null) {
// not a primitive, then it is an embedded entity, need to signal an invalid query
throw log.getPredicatesOnCompleteEmbeddedEntitiesNotAllowedException(StringHelper.join(propertyPath));
}
if (Date.class.isAssignableFrom(propertyType)) {
try {
return DateHelper.getJpaDateFormat().parse(value);
} catch (ParseException e) {
throw log.getInvalidDateLiteralException(value);
}
}
if (Instant.class.isAssignableFrom(propertyType)) {
return Instant.parse(value);
}
if (Enum.class.isAssignableFrom(propertyType)) {
try {
return Enum.valueOf((Class<Enum>) propertyType, value);
} catch (IllegalArgumentException e) {
throw log.getInvalidEnumLiteralException(value, propertyType.getName());
}
}
if (propertyType == String.class) {
return value;
}
if (propertyType == Character.class || propertyType == char.class) {
return value.charAt(0);
}
try {
if (propertyType == Double.class || propertyType == double.class) {
return Double.valueOf(value);
}
if (propertyType == Float.class || propertyType == float.class) {
return Float.valueOf(value);
}
if (propertyType == Long.class || propertyType == long.class) {
return Long.valueOf(value);
}
if (propertyType == Integer.class || propertyType == int.class) {
return Integer.valueOf(value);
}
if (propertyType == Short.class || propertyType == short.class) {
return Short.valueOf(value);
}
if (propertyType == Byte.class || propertyType == byte.class) {
return Byte.valueOf(value);
}
} catch (NumberFormatException ex) {
throw log.getInvalidNumericLiteralException(value);
}
if (propertyType == Boolean.class || propertyType == boolean.class) {
if ("true".equalsIgnoreCase(value)) {
return true;
} else if ("false".equalsIgnoreCase(value)) {
return false;
} else {
throw log.getInvalidBooleanLiteralException(value);
}
}
return value;
} | class class_name[name] begin[{]
method[convertToPropertyType, return_type[type[Object]], modifier[public], parameter[entityType, propertyPath, value]] begin[{]
local_variable[type[Class], propertyType]
if[binary_operation[member[.propertyType], ==, literal[null]]] begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=propertyPath, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=StringHelper, selectors=[], type_arguments=None)], member=getPredicatesOnCompleteEmbeddedEntitiesNotAllowedException, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Date, sub_type=None))] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getJpaDateFormat, postfix_operators=[], prefix_operators=[], qualifier=DateHelper, selectors=[MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=parse, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInvalidDateLiteralException, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['ParseException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Instant, sub_type=None))] begin[{]
return[call[Instant.parse, parameter[member[.value]]]]
else begin[{]
None
end[}]
if[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Enum, sub_type=None))] begin[{]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[Cast(expression=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Enum, sub_type=None))], dimensions=[], name=Class, sub_type=None)), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Enum, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=propertyType, selectors=[], type_arguments=None)], member=getInvalidEnumLiteralException, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IllegalArgumentException']))], finally_block=None, label=None, resources=None)
else begin[{]
None
end[}]
if[binary_operation[member[.propertyType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=String, sub_type=None))]] begin[{]
return[member[.value]]
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.propertyType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Character, sub_type=None))], ||, binary_operation[member[.propertyType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=char))]]] begin[{]
return[call[value.charAt, parameter[literal[0]]]]
else begin[{]
None
end[}]
TryStatement(block=[IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Double, sub_type=None)), operator===), operandr=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=double)), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Double, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Float, sub_type=None)), operator===), operandr=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=float)), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Float, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Long, sub_type=None)), operator===), operandr=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=long)), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Long, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Integer, sub_type=None)), operator===), operandr=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=int)), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Integer, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Short, sub_type=None)), operator===), operandr=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=short)), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Short, selectors=[], type_arguments=None), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Byte, sub_type=None)), operator===), operandr=BinaryOperation(operandl=MemberReference(member=propertyType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=byte)), operator===), operator=||), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=valueOf, postfix_operators=[], prefix_operators=[], qualifier=Byte, selectors=[], type_arguments=None), label=None)]))], catches=[CatchClause(block=[ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInvalidNumericLiteralException, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NumberFormatException']))], finally_block=None, label=None, resources=None)
if[binary_operation[binary_operation[member[.propertyType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Boolean, sub_type=None))], ||, binary_operation[member[.propertyType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=BasicType(dimensions=[], name=boolean))]]] begin[{]
if[literal["true"]] begin[{]
return[literal[true]]
else begin[{]
if[literal["false"]] begin[{]
return[literal[false]]
else begin[{]
ThrowStatement(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInvalidBooleanLiteralException, postfix_operators=[], prefix_operators=[], qualifier=log, selectors=[], type_arguments=None), label=None)
end[}]
end[}]
else begin[{]
None
end[}]
return[member[.value]]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[convertToPropertyType] operator[SEP] identifier[TypeMetadata] identifier[entityType] , identifier[String] operator[SEP] operator[SEP] identifier[propertyPath] , identifier[String] identifier[value] operator[SEP] {
Keyword[final] identifier[Class] operator[<] operator[?] operator[>] identifier[propertyType] operator[=] identifier[getPrimitivePropertyType] operator[SEP] identifier[entityType] , identifier[propertyPath] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[propertyType] operator[==] Other[null] operator[SEP] {
Keyword[throw] identifier[log] operator[SEP] identifier[getPredicatesOnCompleteEmbeddedEntitiesNotAllowedException] operator[SEP] identifier[StringHelper] operator[SEP] identifier[join] operator[SEP] identifier[propertyPath] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Date] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[propertyType] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[DateHelper] operator[SEP] identifier[getJpaDateFormat] operator[SEP] operator[SEP] operator[SEP] identifier[parse] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[ParseException] identifier[e] operator[SEP] {
Keyword[throw] identifier[log] operator[SEP] identifier[getInvalidDateLiteralException] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[Instant] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[propertyType] operator[SEP] operator[SEP] {
Keyword[return] identifier[Instant] operator[SEP] identifier[parse] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[Enum] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[propertyType] operator[SEP] operator[SEP] {
Keyword[try] {
Keyword[return] identifier[Enum] operator[SEP] identifier[valueOf] operator[SEP] operator[SEP] identifier[Class] operator[<] identifier[Enum] operator[>] operator[SEP] identifier[propertyType] , identifier[value] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[IllegalArgumentException] identifier[e] operator[SEP] {
Keyword[throw] identifier[log] operator[SEP] identifier[getInvalidEnumLiteralException] operator[SEP] identifier[value] , identifier[propertyType] operator[SEP] identifier[getName] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[propertyType] operator[==] identifier[String] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[value] operator[SEP]
}
Keyword[if] operator[SEP] identifier[propertyType] operator[==] identifier[Character] operator[SEP] Keyword[class] operator[||] identifier[propertyType] operator[==] Keyword[char] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[value] operator[SEP] identifier[charAt] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[if] operator[SEP] identifier[propertyType] operator[==] identifier[Double] operator[SEP] Keyword[class] operator[||] identifier[propertyType] operator[==] Keyword[double] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[Double] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[propertyType] operator[==] identifier[Float] operator[SEP] Keyword[class] operator[||] identifier[propertyType] operator[==] Keyword[float] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[Float] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[propertyType] operator[==] identifier[Long] operator[SEP] Keyword[class] operator[||] identifier[propertyType] operator[==] Keyword[long] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[Long] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[propertyType] operator[==] identifier[Integer] operator[SEP] Keyword[class] operator[||] identifier[propertyType] operator[==] Keyword[int] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[Integer] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[propertyType] operator[==] identifier[Short] operator[SEP] Keyword[class] operator[||] identifier[propertyType] operator[==] Keyword[short] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[Short] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[propertyType] operator[==] identifier[Byte] operator[SEP] Keyword[class] operator[||] identifier[propertyType] operator[==] Keyword[byte] operator[SEP] Keyword[class] operator[SEP] {
Keyword[return] identifier[Byte] operator[SEP] identifier[valueOf] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[NumberFormatException] identifier[ex] operator[SEP] {
Keyword[throw] identifier[log] operator[SEP] identifier[getInvalidNumericLiteralException] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[propertyType] operator[==] identifier[Boolean] operator[SEP] Keyword[class] operator[||] identifier[propertyType] operator[==] Keyword[boolean] operator[SEP] Keyword[class] operator[SEP] {
Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] literal[String] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[value] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[throw] identifier[log] operator[SEP] identifier[getInvalidBooleanLiteralException] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[value] operator[SEP]
}
|
void evictAll(EntityType entityType) {
CombinedEntityCache entityCache = caches.get();
if (entityCache != null) {
LOG.trace("Removing all entities from L1 cache that belong to {}", entityType.getId());
entityCache.evictAll(entityType);
}
} | class class_name[name] begin[{]
method[evictAll, return_type[void], modifier[default], parameter[entityType]] begin[{]
local_variable[type[CombinedEntityCache], entityCache]
if[binary_operation[member[.entityCache], !=, literal[null]]] begin[{]
call[LOG.trace, parameter[literal["Removing all entities from L1 cache that belong to {}"], call[entityType.getId, parameter[]]]]
call[entityCache.evictAll, parameter[member[.entityType]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[void] identifier[evictAll] operator[SEP] identifier[EntityType] identifier[entityType] operator[SEP] {
identifier[CombinedEntityCache] identifier[entityCache] operator[=] identifier[caches] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[entityCache] operator[!=] Other[null] operator[SEP] {
identifier[LOG] operator[SEP] identifier[trace] operator[SEP] literal[String] , identifier[entityType] operator[SEP] identifier[getId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[entityCache] operator[SEP] identifier[evictAll] operator[SEP] identifier[entityType] operator[SEP] operator[SEP]
}
}
|
public String getValue() {
String value = getText().toString();
return isEmpty(value_verify_regex) ? value : (verifyValue() ? value : "");
} | class class_name[name] begin[{]
method[getValue, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[String], value]
return[TernaryExpression(condition=MethodInvocation(arguments=[MemberReference(member=value_verify_regex, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isEmpty, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=TernaryExpression(condition=MethodInvocation(arguments=[], member=verifyValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=""), if_true=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), if_true=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]
end[}]
END[}] | Keyword[public] identifier[String] identifier[getValue] operator[SEP] operator[SEP] {
identifier[String] identifier[value] operator[=] identifier[getText] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[isEmpty] operator[SEP] identifier[value_verify_regex] operator[SEP] operator[?] identifier[value] operator[:] operator[SEP] identifier[verifyValue] operator[SEP] operator[SEP] operator[?] identifier[value] operator[:] literal[String] operator[SEP] operator[SEP]
}
|
private void translateConstantDeclaration(WyilFile.Decl.StaticVariable decl) {
if (decl.hasInitialiser()) {
// The environments are needed to prevent clashes between variable
// versions across verification conditions, and also to type variables
// used in verification conditions.
GlobalEnvironment globalEnvironment = new GlobalEnvironment(decl);
LocalEnvironment localEnvironment = new LocalEnvironment(globalEnvironment);
List<VerificationCondition> vcs = new ArrayList<>();
Context context = new Context(wyalFile, AssumptionSet.ROOT, localEnvironment, localEnvironment, null, vcs);
//
Pair<Expr, Context> rp = translateExpressionWithChecks(decl.getInitialiser(), null, context);
generateTypeInvariantCheck(decl.getType(), rp.first(), context);
// Translate each generated verification condition into an assertion in
// the underlying WyalFile.
createAssertions(decl, vcs, globalEnvironment);
}
} | class class_name[name] begin[{]
method[translateConstantDeclaration, return_type[void], modifier[private], parameter[decl]] begin[{]
if[call[decl.hasInitialiser, parameter[]]] begin[{]
local_variable[type[GlobalEnvironment], globalEnvironment]
local_variable[type[LocalEnvironment], localEnvironment]
local_variable[type[List], vcs]
local_variable[type[Context], context]
local_variable[type[Pair], rp]
call[.generateTypeInvariantCheck, parameter[call[decl.getType, parameter[]], call[rp.first, parameter[]], member[.context]]]
call[.createAssertions, parameter[member[.decl], member[.vcs], member[.globalEnvironment]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[translateConstantDeclaration] operator[SEP] identifier[WyilFile] operator[SEP] identifier[Decl] operator[SEP] identifier[StaticVariable] identifier[decl] operator[SEP] {
Keyword[if] operator[SEP] identifier[decl] operator[SEP] identifier[hasInitialiser] operator[SEP] operator[SEP] operator[SEP] {
identifier[GlobalEnvironment] identifier[globalEnvironment] operator[=] Keyword[new] identifier[GlobalEnvironment] operator[SEP] identifier[decl] operator[SEP] operator[SEP] identifier[LocalEnvironment] identifier[localEnvironment] operator[=] Keyword[new] identifier[LocalEnvironment] operator[SEP] identifier[globalEnvironment] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[VerificationCondition] operator[>] identifier[vcs] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[Context] identifier[context] operator[=] Keyword[new] identifier[Context] operator[SEP] identifier[wyalFile] , identifier[AssumptionSet] operator[SEP] identifier[ROOT] , identifier[localEnvironment] , identifier[localEnvironment] , Other[null] , identifier[vcs] operator[SEP] operator[SEP] identifier[Pair] operator[<] identifier[Expr] , identifier[Context] operator[>] identifier[rp] operator[=] identifier[translateExpressionWithChecks] operator[SEP] identifier[decl] operator[SEP] identifier[getInitialiser] operator[SEP] operator[SEP] , Other[null] , identifier[context] operator[SEP] operator[SEP] identifier[generateTypeInvariantCheck] operator[SEP] identifier[decl] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[rp] operator[SEP] identifier[first] operator[SEP] operator[SEP] , identifier[context] operator[SEP] operator[SEP] identifier[createAssertions] operator[SEP] identifier[decl] , identifier[vcs] , identifier[globalEnvironment] operator[SEP] operator[SEP]
}
}
|
private void failHeartbeat() {
raft.checkThread();
// Iterate through pending timestamped heartbeat futures and fail futures that have been pending longer
// than an election timeout.
long currentTimestamp = System.currentTimeMillis();
Iterator<TimestampedFuture<Long>> iterator = heartbeatFutures.iterator();
while (iterator.hasNext()) {
TimestampedFuture<Long> future = iterator.next();
if (currentTimestamp - future.timestamp > electionTimeout) {
future.completeExceptionally(new RaftException.ProtocolException("Failed to reach consensus"));
iterator.remove();
}
}
} | class class_name[name] begin[{]
method[failHeartbeat, return_type[void], modifier[private], parameter[]] begin[{]
call[raft.checkThread, parameter[]]
local_variable[type[long], currentTimestamp]
local_variable[type[Iterator], iterator]
while[call[iterator.hasNext, parameter[]]] begin[{]
local_variable[type[TimestampedFuture], future]
if[binary_operation[binary_operation[member[.currentTimestamp], -, member[future.timestamp]], >, member[.electionTimeout]]] begin[{]
call[future.completeExceptionally, parameter[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Failed to reach consensus")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RaftException, sub_type=ReferenceType(arguments=None, dimensions=None, name=ProtocolException, sub_type=None)))]]
call[iterator.remove, parameter[]]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[failHeartbeat] operator[SEP] operator[SEP] {
identifier[raft] operator[SEP] identifier[checkThread] operator[SEP] operator[SEP] operator[SEP] Keyword[long] identifier[currentTimestamp] operator[=] identifier[System] operator[SEP] identifier[currentTimeMillis] operator[SEP] operator[SEP] operator[SEP] identifier[Iterator] operator[<] identifier[TimestampedFuture] operator[<] identifier[Long] operator[>] operator[>] identifier[iterator] operator[=] identifier[heartbeatFutures] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[TimestampedFuture] operator[<] identifier[Long] operator[>] identifier[future] operator[=] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[currentTimestamp] operator[-] identifier[future] operator[SEP] identifier[timestamp] operator[>] identifier[electionTimeout] operator[SEP] {
identifier[future] operator[SEP] identifier[completeExceptionally] operator[SEP] Keyword[new] identifier[RaftException] operator[SEP] identifier[ProtocolException] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[iterator] operator[SEP] identifier[remove] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public int getFieldsSendTotalByteSize(Object bean, Charset charset) {
if (!hasDynamicField()) {
return fieldsTotalSize;
} else {
return getDynamicTotalFieldSize(bean, charset);
}
} | class class_name[name] begin[{]
method[getFieldsSendTotalByteSize, return_type[type[int]], modifier[public], parameter[bean, charset]] begin[{]
if[call[.hasDynamicField, parameter[]]] begin[{]
return[member[.fieldsTotalSize]]
else begin[{]
return[call[.getDynamicTotalFieldSize, parameter[member[.bean], member[.charset]]]]
end[}]
end[}]
END[}] | Keyword[public] Keyword[int] identifier[getFieldsSendTotalByteSize] operator[SEP] identifier[Object] identifier[bean] , identifier[Charset] identifier[charset] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[hasDynamicField] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[fieldsTotalSize] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[getDynamicTotalFieldSize] operator[SEP] identifier[bean] , identifier[charset] operator[SEP] operator[SEP]
}
}
|
@Override
public void cancelFlow(final ExecutableFlow exFlow, final String userId)
throws ExecutorManagerException {
synchronized (exFlow) {
if (this.runningExecutions.get().containsKey(exFlow.getExecutionId())) {
final Pair<ExecutionReference, ExecutableFlow> pair =
this.runningExecutions.get().get(exFlow.getExecutionId());
this.apiGateway.callWithReferenceByUser(pair.getFirst(), ConnectorParams.CANCEL_ACTION,
userId);
} else if (this.queuedFlows.hasExecution(exFlow.getExecutionId())) {
this.queuedFlows.dequeue(exFlow.getExecutionId());
this.executionFinalizer
.finalizeFlow(exFlow, "Cancelled before dispatching to executor", null);
} else {
throw new ExecutorManagerException("Execution "
+ exFlow.getExecutionId() + " of flow " + exFlow.getFlowId()
+ " isn't running.");
}
}
} | class class_name[name] begin[{]
method[cancelFlow, return_type[void], modifier[public], parameter[exFlow, userId]] begin[{]
SYNCHRONIZED[member[.exFlow]] BEGIN[{]
if[THIS[member[None.runningExecutions]call[None.get, parameter[]]call[None.containsKey, parameter[call[exFlow.getExecutionId, parameter[]]]]]] begin[{]
local_variable[type[Pair], pair]
THIS[member[None.apiGateway]call[None.callWithReferenceByUser, parameter[call[pair.getFirst, parameter[]], member[ConnectorParams.CANCEL_ACTION], member[.userId]]]]
else begin[{]
if[THIS[member[None.queuedFlows]call[None.hasExecution, parameter[call[exFlow.getExecutionId, parameter[]]]]]] begin[{]
THIS[member[None.queuedFlows]call[None.dequeue, parameter[call[exFlow.getExecutionId, parameter[]]]]]
THIS[member[None.executionFinalizer]call[None.finalizeFlow, parameter[member[.exFlow], literal["Cancelled before dispatching to executor"], literal[null]]]]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Execution "), operandr=MethodInvocation(arguments=[], member=getExecutionId, postfix_operators=[], prefix_operators=[], qualifier=exFlow, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" of flow "), operator=+), operandr=MethodInvocation(arguments=[], member=getFlowId, postfix_operators=[], prefix_operators=[], qualifier=exFlow, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" isn't running."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExecutorManagerException, sub_type=None)), label=None)
end[}]
end[}]
END[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[cancelFlow] operator[SEP] Keyword[final] identifier[ExecutableFlow] identifier[exFlow] , Keyword[final] identifier[String] identifier[userId] operator[SEP] Keyword[throws] identifier[ExecutorManagerException] {
Keyword[synchronized] operator[SEP] identifier[exFlow] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[runningExecutions] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[containsKey] operator[SEP] identifier[exFlow] operator[SEP] identifier[getExecutionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[final] identifier[Pair] operator[<] identifier[ExecutionReference] , identifier[ExecutableFlow] operator[>] identifier[pair] operator[=] Keyword[this] operator[SEP] identifier[runningExecutions] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[exFlow] operator[SEP] identifier[getExecutionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[apiGateway] operator[SEP] identifier[callWithReferenceByUser] operator[SEP] identifier[pair] operator[SEP] identifier[getFirst] operator[SEP] operator[SEP] , identifier[ConnectorParams] operator[SEP] identifier[CANCEL_ACTION] , identifier[userId] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[queuedFlows] operator[SEP] identifier[hasExecution] operator[SEP] identifier[exFlow] operator[SEP] identifier[getExecutionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[queuedFlows] operator[SEP] identifier[dequeue] operator[SEP] identifier[exFlow] operator[SEP] identifier[getExecutionId] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[executionFinalizer] operator[SEP] identifier[finalizeFlow] operator[SEP] identifier[exFlow] , literal[String] , Other[null] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[ExecutorManagerException] operator[SEP] literal[String] operator[+] identifier[exFlow] operator[SEP] identifier[getExecutionId] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[exFlow] operator[SEP] identifier[getFlowId] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
}
}
|
public Inventory queryInventory(boolean querySkuDetails, List<String> moreItemSkus,
List<String> moreSubsSkus) throws IabException {
checkSetupDone("queryInventory");
try {
Inventory inv = new Inventory();
int r = queryPurchases(inv, ITEM_TYPE_INAPP);
if (r != BILLING_RESPONSE_RESULT_OK) {
throw new IabException(r, "Error refreshing inventory (querying owned items).");
}
if (querySkuDetails) {
r = querySkuDetails(ITEM_TYPE_INAPP, inv, moreItemSkus);
if (r != BILLING_RESPONSE_RESULT_OK) {
throw new IabException(r, "Error refreshing inventory (querying prices of items).");
}
}
// if subscriptions are supported, then also query for subscriptions
if (mSubscriptionsSupported) {
r = queryPurchases(inv, ITEM_TYPE_SUBS);
if (r != BILLING_RESPONSE_RESULT_OK) {
throw new IabException(r, "Error refreshing inventory (querying owned subscriptions).");
}
if (querySkuDetails) {
r = querySkuDetails(ITEM_TYPE_SUBS, inv, moreSubsSkus);
if (r != BILLING_RESPONSE_RESULT_OK) {
throw new IabException(r, "Error refreshing inventory (querying prices of subscriptions).");
}
}
}
return inv;
} catch (RemoteException e) {
throw new IabException(IABHELPER_REMOTE_EXCEPTION, "Remote exception while refreshing inventory.", e);
} catch (JSONException e) {
throw new IabException(IABHELPER_BAD_RESPONSE, "Error parsing JSON response while refreshing inventory.", e);
}
} | class class_name[name] begin[{]
method[queryInventory, return_type[type[Inventory]], modifier[public], parameter[querySkuDetails, moreItemSkus, moreSubsSkus]] begin[{]
call[.checkSetupDone, parameter[literal["queryInventory"]]]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Inventory, sub_type=None)), name=inv)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Inventory, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=inv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ITEM_TYPE_INAPP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=queryPurchases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), name=r)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BILLING_RESPONSE_RESULT_OK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error refreshing inventory (querying owned items).")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IabException, sub_type=None)), label=None)])), IfStatement(condition=MemberReference(member=querySkuDetails, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ITEM_TYPE_INAPP, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=moreItemSkus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=querySkuDetails, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BILLING_RESPONSE_RESULT_OK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error refreshing inventory (querying prices of items).")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IabException, sub_type=None)), label=None)]))])), IfStatement(condition=MemberReference(member=mSubscriptionsSupported, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=inv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=ITEM_TYPE_SUBS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=queryPurchases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BILLING_RESPONSE_RESULT_OK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error refreshing inventory (querying owned subscriptions).")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IabException, sub_type=None)), label=None)])), IfStatement(condition=MemberReference(member=querySkuDetails, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=ITEM_TYPE_SUBS, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=inv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=moreSubsSkus, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=querySkuDetails, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=BILLING_RESPONSE_RESULT_OK, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=r, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error refreshing inventory (querying prices of subscriptions).")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IabException, sub_type=None)), label=None)]))]))])), ReturnStatement(expression=MemberReference(member=inv, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=IABHELPER_REMOTE_EXCEPTION, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Remote exception while refreshing inventory."), 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=IabException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RemoteException'])), CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=IABHELPER_BAD_RESPONSE, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Error parsing JSON response while refreshing inventory."), 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=IabException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['JSONException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] identifier[Inventory] identifier[queryInventory] operator[SEP] Keyword[boolean] identifier[querySkuDetails] , identifier[List] operator[<] identifier[String] operator[>] identifier[moreItemSkus] , identifier[List] operator[<] identifier[String] operator[>] identifier[moreSubsSkus] operator[SEP] Keyword[throws] identifier[IabException] {
identifier[checkSetupDone] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] {
identifier[Inventory] identifier[inv] operator[=] Keyword[new] identifier[Inventory] operator[SEP] operator[SEP] operator[SEP] Keyword[int] identifier[r] operator[=] identifier[queryPurchases] operator[SEP] identifier[inv] , identifier[ITEM_TYPE_INAPP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[!=] identifier[BILLING_RESPONSE_RESULT_OK] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IabException] operator[SEP] identifier[r] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[querySkuDetails] operator[SEP] {
identifier[r] operator[=] identifier[querySkuDetails] operator[SEP] identifier[ITEM_TYPE_INAPP] , identifier[inv] , identifier[moreItemSkus] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[!=] identifier[BILLING_RESPONSE_RESULT_OK] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IabException] operator[SEP] identifier[r] , literal[String] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[mSubscriptionsSupported] operator[SEP] {
identifier[r] operator[=] identifier[queryPurchases] operator[SEP] identifier[inv] , identifier[ITEM_TYPE_SUBS] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[!=] identifier[BILLING_RESPONSE_RESULT_OK] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IabException] operator[SEP] identifier[r] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[querySkuDetails] operator[SEP] {
identifier[r] operator[=] identifier[querySkuDetails] operator[SEP] identifier[ITEM_TYPE_SUBS] , identifier[inv] , identifier[moreSubsSkus] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[r] operator[!=] identifier[BILLING_RESPONSE_RESULT_OK] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IabException] operator[SEP] identifier[r] , literal[String] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[inv] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RemoteException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IabException] operator[SEP] identifier[IABHELPER_REMOTE_EXCEPTION] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[JSONException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IabException] operator[SEP] identifier[IABHELPER_BAD_RESPONSE] , literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
private StringBuilder appendOrderByClause(MetamodelImpl metaModel, EntityMetadata m, EmbeddableType keyObj,
StringBuilder builder, CQLTranslator translator) {
List<SortOrdering> orders = getKunderaQuery().getOrdering();
if (orders != null) {
builder.append(CQLTranslator.SPACE_STRING);
builder.append(CQLTranslator.SORT_CLAUSE);
for (SortOrdering order : orders) {
String orderColumnName = order.getColumnName();
orderColumnName = orderColumnName.substring(orderColumnName.indexOf(".") + 1, orderColumnName.length());
String orderByColumnName;
if (StringUtils.contains(orderColumnName, '.')) {
String propertyName = orderColumnName.substring(0, orderColumnName.indexOf("."));
Attribute embeddableAttribute = metaModel.getEntityAttribute(m.getEntityClazz(), propertyName);
EmbeddableType embeddableType =
metaModel.embeddable(((AbstractAttribute) embeddableAttribute).getBindableJavaType());
orderColumnName = orderColumnName.substring(orderColumnName.indexOf(".") + 1);
AbstractAttribute attribute = (AbstractAttribute) embeddableType.getAttribute(orderColumnName);
orderByColumnName = attribute.getJPAColumnName();
} else {
Attribute attribute = metaModel.getEntityAttribute(m.getEntityClazz(), orderColumnName);
orderByColumnName = ((AbstractAttribute) attribute).getJPAColumnName();
}
builder = translator.ensureCase(builder, orderByColumnName, false);
builder.append(CQLTranslator.SPACE_STRING);
builder.append(order.getOrder());
builder.append(CQLTranslator.COMMA_STR);
}
if (!orders.isEmpty()) {
builder.deleteCharAt(builder.lastIndexOf(CQLTranslator.COMMA_STR));
}
}
return builder;
} | class class_name[name] begin[{]
method[appendOrderByClause, return_type[type[StringBuilder]], modifier[private], parameter[metaModel, m, keyObj, builder, translator]] begin[{]
local_variable[type[List], orders]
if[binary_operation[member[.orders], !=, literal[null]]] begin[{]
call[builder.append, parameter[member[CQLTranslator.SPACE_STRING]]]
call[builder.append, parameter[member[CQLTranslator.SORT_CLAUSE]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getColumnName, postfix_operators=[], prefix_operators=[], qualifier=order, selectors=[], type_arguments=None), name=orderColumnName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=orderColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=orderColumnName, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), MethodInvocation(arguments=[], member=length, postfix_operators=[], prefix_operators=[], qualifier=orderColumnName, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=orderColumnName, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=orderByColumnName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=orderColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=contains, postfix_operators=[], prefix_operators=[], qualifier=StringUtils, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEntityClazz, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), MemberReference(member=orderColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEntityAttribute, postfix_operators=[], prefix_operators=[], qualifier=metaModel, selectors=[], type_arguments=None), name=attribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=orderByColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=Cast(expression=MemberReference(member=attribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None))), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=orderColumnName, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=orderColumnName, selectors=[], type_arguments=None), name=propertyName)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEntityClazz, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), MemberReference(member=propertyName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getEntityAttribute, postfix_operators=[], prefix_operators=[], qualifier=metaModel, selectors=[], type_arguments=None), name=embeddableAttribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Attribute, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Cast(expression=MemberReference(member=embeddableAttribute, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None))], member=embeddable, postfix_operators=[], prefix_operators=[], qualifier=metaModel, selectors=[], type_arguments=None), name=embeddableType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EmbeddableType, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=orderColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".")], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=orderColumnName, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=orderColumnName, selectors=[], type_arguments=None)), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[MemberReference(member=orderColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getAttribute, postfix_operators=[], prefix_operators=[], qualifier=embeddableType, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None)), name=attribute)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractAttribute, sub_type=None)), StatementExpression(expression=Assignment(expressionl=MemberReference(member=orderByColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[], member=getJPAColumnName, postfix_operators=[], prefix_operators=[], qualifier=attribute, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=Assignment(expressionl=MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=builder, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=orderByColumnName, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=false)], member=ensureCase, postfix_operators=[], prefix_operators=[], qualifier=translator, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=SPACE_STRING, postfix_operators=[], prefix_operators=[], qualifier=CQLTranslator, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getOrder, postfix_operators=[], prefix_operators=[], qualifier=order, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=COMMA_STR, postfix_operators=[], prefix_operators=[], qualifier=CQLTranslator, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=builder, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=orders, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=order)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=SortOrdering, sub_type=None))), label=None)
if[call[orders.isEmpty, parameter[]]] begin[{]
call[builder.deleteCharAt, parameter[call[builder.lastIndexOf, parameter[member[CQLTranslator.COMMA_STR]]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.builder]]
end[}]
END[}] | Keyword[private] identifier[StringBuilder] identifier[appendOrderByClause] operator[SEP] identifier[MetamodelImpl] identifier[metaModel] , identifier[EntityMetadata] identifier[m] , identifier[EmbeddableType] identifier[keyObj] , identifier[StringBuilder] identifier[builder] , identifier[CQLTranslator] identifier[translator] operator[SEP] {
identifier[List] operator[<] identifier[SortOrdering] operator[>] identifier[orders] operator[=] identifier[getKunderaQuery] operator[SEP] operator[SEP] operator[SEP] identifier[getOrdering] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[orders] operator[!=] Other[null] operator[SEP] {
identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[CQLTranslator] operator[SEP] identifier[SPACE_STRING] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[CQLTranslator] operator[SEP] identifier[SORT_CLAUSE] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[SortOrdering] identifier[order] operator[:] identifier[orders] operator[SEP] {
identifier[String] identifier[orderColumnName] operator[=] identifier[order] operator[SEP] identifier[getColumnName] operator[SEP] operator[SEP] operator[SEP] identifier[orderColumnName] operator[=] identifier[orderColumnName] operator[SEP] identifier[substring] operator[SEP] identifier[orderColumnName] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] , identifier[orderColumnName] operator[SEP] identifier[length] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[orderByColumnName] operator[SEP] Keyword[if] operator[SEP] identifier[StringUtils] operator[SEP] identifier[contains] operator[SEP] identifier[orderColumnName] , literal[String] operator[SEP] operator[SEP] {
identifier[String] identifier[propertyName] operator[=] identifier[orderColumnName] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[orderColumnName] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[Attribute] identifier[embeddableAttribute] operator[=] identifier[metaModel] operator[SEP] identifier[getEntityAttribute] operator[SEP] identifier[m] operator[SEP] identifier[getEntityClazz] operator[SEP] operator[SEP] , identifier[propertyName] operator[SEP] operator[SEP] identifier[EmbeddableType] identifier[embeddableType] operator[=] identifier[metaModel] operator[SEP] identifier[embeddable] operator[SEP] operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[embeddableAttribute] operator[SEP] operator[SEP] identifier[getBindableJavaType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[orderColumnName] operator[=] identifier[orderColumnName] operator[SEP] identifier[substring] operator[SEP] identifier[orderColumnName] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[+] Other[1] operator[SEP] operator[SEP] identifier[AbstractAttribute] identifier[attribute] operator[=] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[embeddableType] operator[SEP] identifier[getAttribute] operator[SEP] identifier[orderColumnName] operator[SEP] operator[SEP] identifier[orderByColumnName] operator[=] identifier[attribute] operator[SEP] identifier[getJPAColumnName] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[Attribute] identifier[attribute] operator[=] identifier[metaModel] operator[SEP] identifier[getEntityAttribute] operator[SEP] identifier[m] operator[SEP] identifier[getEntityClazz] operator[SEP] operator[SEP] , identifier[orderColumnName] operator[SEP] operator[SEP] identifier[orderByColumnName] operator[=] operator[SEP] operator[SEP] identifier[AbstractAttribute] operator[SEP] identifier[attribute] operator[SEP] operator[SEP] identifier[getJPAColumnName] operator[SEP] operator[SEP] operator[SEP]
}
identifier[builder] operator[=] identifier[translator] operator[SEP] identifier[ensureCase] operator[SEP] identifier[builder] , identifier[orderByColumnName] , literal[boolean] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[CQLTranslator] operator[SEP] identifier[SPACE_STRING] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[order] operator[SEP] identifier[getOrder] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[builder] operator[SEP] identifier[append] operator[SEP] identifier[CQLTranslator] operator[SEP] identifier[COMMA_STR] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[!] identifier[orders] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[builder] operator[SEP] identifier[deleteCharAt] operator[SEP] identifier[builder] operator[SEP] identifier[lastIndexOf] operator[SEP] identifier[CQLTranslator] operator[SEP] identifier[COMMA_STR] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[builder] operator[SEP]
}
|
@Override
public void initializeContext(ProfileRequestContext<?, ?> context) throws ExternalAutenticationErrorCodeException {
final String logId = this.getLogString(context);
AuthnRequest authnRequest = this.getAuthnRequest(context);
if (authnRequest == null) {
log.error("No AuthnRequest available [{}]", logId);
throw new ExternalAutenticationErrorCodeException(AuthnEventIds.INVALID_AUTHN_CTX, "Missing AuthnRequest");
}
if (authnRequest.getExtensions() != null) {
SignMessage signMessage = authnRequest.getExtensions()
.getUnknownXMLObjects()
.stream()
.filter(SignMessage.class::isInstance)
.map(SignMessage.class::cast)
.findFirst()
.orElse(null);
if (signMessage != null) {
log.debug("AuthnContext contains SignMessage extension, creating SignMessageContext ... [{}]", logId);
AuthenticationContext authnContext = authenticationContextLookupStrategy.apply(context);
if (authnContext == null) {
log.error("No AuthenticationContext available [{}]", this.getLogString(context));
throw new ExternalAutenticationErrorCodeException(AuthnEventIds.INVALID_AUTHN_CTX, "Missing AuthenticationContext");
}
authnContext.addSubcontext(new SignMessageContext(signMessage), true);
}
}
} | class class_name[name] begin[{]
method[initializeContext, return_type[void], modifier[public], parameter[context]] begin[{]
local_variable[type[String], logId]
local_variable[type[AuthnRequest], authnRequest]
if[binary_operation[member[.authnRequest], ==, literal[null]]] begin[{]
call[log.error, parameter[literal["No AuthnRequest available [{}]"], member[.logId]]]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INVALID_AUTHN_CTX, postfix_operators=[], prefix_operators=[], qualifier=AuthnEventIds, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing AuthnRequest")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExternalAutenticationErrorCodeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[call[authnRequest.getExtensions, parameter[]], !=, literal[null]]] begin[{]
local_variable[type[SignMessage], signMessage]
if[binary_operation[member[.signMessage], !=, literal[null]]] begin[{]
call[log.debug, parameter[literal["AuthnContext contains SignMessage extension, creating SignMessageContext ... [{}]"], member[.logId]]]
local_variable[type[AuthenticationContext], authnContext]
if[binary_operation[member[.authnContext], ==, literal[null]]] begin[{]
call[log.error, parameter[literal["No AuthenticationContext available [{}]"], THIS[call[None.getLogString, parameter[member[.context]]]]]]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=INVALID_AUTHN_CTX, postfix_operators=[], prefix_operators=[], qualifier=AuthnEventIds, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Missing AuthenticationContext")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ExternalAutenticationErrorCodeException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[authnContext.addSubcontext, parameter[ClassCreator(arguments=[MemberReference(member=signMessage, 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=SignMessageContext, sub_type=None)), literal[true]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[initializeContext] operator[SEP] identifier[ProfileRequestContext] operator[<] operator[?] , operator[?] operator[>] identifier[context] operator[SEP] Keyword[throws] identifier[ExternalAutenticationErrorCodeException] {
Keyword[final] identifier[String] identifier[logId] operator[=] Keyword[this] operator[SEP] identifier[getLogString] operator[SEP] identifier[context] operator[SEP] operator[SEP] identifier[AuthnRequest] identifier[authnRequest] operator[=] Keyword[this] operator[SEP] identifier[getAuthnRequest] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[authnRequest] operator[==] Other[null] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , identifier[logId] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ExternalAutenticationErrorCodeException] operator[SEP] identifier[AuthnEventIds] operator[SEP] identifier[INVALID_AUTHN_CTX] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[authnRequest] operator[SEP] identifier[getExtensions] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[SignMessage] identifier[signMessage] operator[=] identifier[authnRequest] operator[SEP] identifier[getExtensions] operator[SEP] operator[SEP] operator[SEP] identifier[getUnknownXMLObjects] operator[SEP] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[filter] operator[SEP] identifier[SignMessage] operator[SEP] Keyword[class] operator[::] identifier[isInstance] operator[SEP] operator[SEP] identifier[map] operator[SEP] identifier[SignMessage] operator[SEP] Keyword[class] operator[::] identifier[cast] operator[SEP] operator[SEP] identifier[findFirst] operator[SEP] operator[SEP] operator[SEP] identifier[orElse] operator[SEP] Other[null] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[signMessage] operator[!=] Other[null] operator[SEP] {
identifier[log] operator[SEP] identifier[debug] operator[SEP] literal[String] , identifier[logId] operator[SEP] operator[SEP] identifier[AuthenticationContext] identifier[authnContext] operator[=] identifier[authenticationContextLookupStrategy] operator[SEP] identifier[apply] operator[SEP] identifier[context] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[authnContext] operator[==] Other[null] operator[SEP] {
identifier[log] operator[SEP] identifier[error] operator[SEP] literal[String] , Keyword[this] operator[SEP] identifier[getLogString] operator[SEP] identifier[context] operator[SEP] operator[SEP] operator[SEP] Keyword[throw] Keyword[new] identifier[ExternalAutenticationErrorCodeException] operator[SEP] identifier[AuthnEventIds] operator[SEP] identifier[INVALID_AUTHN_CTX] , literal[String] operator[SEP] operator[SEP]
}
identifier[authnContext] operator[SEP] identifier[addSubcontext] operator[SEP] Keyword[new] identifier[SignMessageContext] operator[SEP] identifier[signMessage] operator[SEP] , literal[boolean] operator[SEP] operator[SEP]
}
}
}
|
public static Analysis readAnalysis(final URL url) throws IOException {
checkNotNull(url);
try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) {
return readAnalysis(reader);
}
} | class class_name[name] begin[{]
method[readAnalysis, return_type[type[Analysis]], modifier[public static], parameter[url]] begin[{]
call[.checkNotNull, parameter[member[.url]]]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=reader, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=readAnalysis, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=reader, type=ReferenceType(arguments=None, dimensions=[], name=BufferedReader, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=url, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=UTF_8, postfix_operators=[], prefix_operators=[], qualifier=Charsets, selectors=[])], member=asCharSource, postfix_operators=[], prefix_operators=[], qualifier=Resources, selectors=[MethodInvocation(arguments=[], member=openBufferedStream, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None))])
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Analysis] identifier[readAnalysis] operator[SEP] Keyword[final] identifier[URL] identifier[url] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[checkNotNull] operator[SEP] identifier[url] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[BufferedReader] identifier[reader] operator[=] identifier[Resources] operator[SEP] identifier[asCharSource] operator[SEP] identifier[url] , identifier[Charsets] operator[SEP] identifier[UTF_8] operator[SEP] operator[SEP] identifier[openBufferedStream] operator[SEP] operator[SEP] operator[SEP] {
Keyword[return] identifier[readAnalysis] operator[SEP] identifier[reader] operator[SEP] operator[SEP]
}
}
|
public static Object[] consumeVia(final Buffer buffer) throws SipParseException, IOException {
final Object[] result = new Object[4];
// start off by just finding the ';'. A Via-header MUST have a branch
// parameter and as such
// there must be a ';' present. If there isn't one, then bail out and
// complain.
int count = 0;
int indexOfSemi = 0;
int countOfColons = 0;
int indexOfLastColon = 0;
int readerIndexOfLastColon = 0; // for reporting
consumeSWS(buffer);
result[0] = consumeSentProtocol(buffer);
consumeLWS(buffer);
final int index = buffer.getReaderIndex();
while (indexOfSemi == 0 && buffer.hasReadableBytes() && ++count < MAX_LOOK_AHEAD) {
final byte b = buffer.readByte();
if (b == SipParser.SEMI) {
indexOfSemi = count;
} else if (b == SipParser.COLON) {
++countOfColons;
indexOfLastColon = count;
readerIndexOfLastColon = buffer.getReaderIndex();
}
}
if (count == 0) {
return null;
}
if (count == MAX_LOOK_AHEAD) {
throw new SipParseException(buffer.getReaderIndex(),
"Unable to find the parameters part of the Via-header "
+ "even after searching for " + MAX_LOOK_AHEAD + " bytes.");
}
if (indexOfSemi == 0) {
// well, we don't check if the branch parameter is there but
// if there are no parameters present at all then there
// is no chance of it being present.
throw new SipParseException(buffer.getReaderIndex(),
"No via-parameters found. The Via-header MUST contain at least the branch parameter.");
}
buffer.setReaderIndex(index);
if (countOfColons == 0 || countOfColons == 7) {
// no port, just host
result[1] = buffer.readBytes(indexOfSemi - 1);
} else if (indexOfLastColon != 0 && (countOfColons == 1 || countOfColons == 8)) {
// found either a single colon or 8 colons where 8 colons indicates
// that we have an ipv6 address in front of us.
result[1] = buffer.readBytes(indexOfLastColon - 1);
buffer.readByte(); // consume ':'
result[2] = buffer.readBytes(indexOfSemi - indexOfLastColon - 1); // consume
// port
if (result[2] == null || ((Buffer) result[2]).isEmpty()) {
throw new SipParseException(readerIndexOfLastColon + 1, "Expected port after colon");
}
} else {
// indication an strange number of colons. May be the strange
// ipv4 address after ipv6 thing which we currently dont handle
throw new SipParseException(indexOfLastColon, "Found " + countOfColons + " which seems odd."
+ " Expecting 0, 1, 7 or 8 colons in the Via-host:port portion. Please check your traffic");
}
final List<Buffer[]> params = consumeGenericParams(buffer);
result[3] = params;
return result;
} | class class_name[name] begin[{]
method[consumeVia, return_type[type[Object]], modifier[public static], parameter[buffer]] begin[{]
local_variable[type[Object], result]
local_variable[type[int], count]
local_variable[type[int], indexOfSemi]
local_variable[type[int], countOfColons]
local_variable[type[int], indexOfLastColon]
local_variable[type[int], readerIndexOfLastColon]
call[.consumeSWS, parameter[member[.buffer]]]
assign[member[.result], call[.consumeSentProtocol, parameter[member[.buffer]]]]
call[.consumeLWS, parameter[member[.buffer]]]
local_variable[type[int], index]
while[binary_operation[binary_operation[binary_operation[member[.indexOfSemi], ==, literal[0]], &&, call[buffer.hasReadableBytes, parameter[]]], &&, binary_operation[member[.count], <, member[.MAX_LOOK_AHEAD]]]] begin[{]
local_variable[type[byte], b]
if[binary_operation[member[.b], ==, member[SipParser.SEMI]]] begin[{]
assign[member[.indexOfSemi], member[.count]]
else begin[{]
if[binary_operation[member[.b], ==, member[SipParser.COLON]]] begin[{]
member[.countOfColons]
assign[member[.indexOfLastColon], member[.count]]
assign[member[.readerIndexOfLastColon], call[buffer.getReaderIndex, parameter[]]]
else begin[{]
None
end[}]
end[}]
end[}]
if[binary_operation[member[.count], ==, literal[0]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
if[binary_operation[member[.count], ==, member[.MAX_LOOK_AHEAD]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getReaderIndex, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to find the parameters part of the Via-header "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="even after searching for "), operator=+), operandr=MemberReference(member=MAX_LOOK_AHEAD, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" bytes."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SipParseException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.indexOfSemi], ==, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MethodInvocation(arguments=[], member=getReaderIndex, postfix_operators=[], prefix_operators=[], qualifier=buffer, selectors=[], type_arguments=None), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="No via-parameters found. The Via-header MUST contain at least the branch parameter.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SipParseException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[buffer.setReaderIndex, parameter[member[.index]]]
if[binary_operation[binary_operation[member[.countOfColons], ==, literal[0]], ||, binary_operation[member[.countOfColons], ==, literal[7]]]] begin[{]
assign[member[.result], call[buffer.readBytes, parameter[binary_operation[member[.indexOfSemi], -, literal[1]]]]]
else begin[{]
if[binary_operation[binary_operation[member[.indexOfLastColon], !=, literal[0]], &&, binary_operation[binary_operation[member[.countOfColons], ==, literal[1]], ||, binary_operation[member[.countOfColons], ==, literal[8]]]]] begin[{]
assign[member[.result], call[buffer.readBytes, parameter[binary_operation[member[.indexOfLastColon], -, literal[1]]]]]
call[buffer.readByte, parameter[]]
assign[member[.result], call[buffer.readBytes, parameter[binary_operation[binary_operation[member[.indexOfSemi], -, member[.indexOfLastColon]], -, literal[1]]]]]
if[binary_operation[binary_operation[member[.result], ==, literal[null]], ||, Cast(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=2))]), type=ReferenceType(arguments=None, dimensions=[], name=Buffer, sub_type=None))]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=MemberReference(member=readerIndexOfLastColon, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Expected port after colon")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SipParseException, sub_type=None)), label=None)
else begin[{]
None
end[}]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=indexOfLastColon, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Found "), operandr=MemberReference(member=countOfColons, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" which seems odd."), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" Expecting 0, 1, 7 or 8 colons in the Via-host:port portion. Please check your traffic"), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=SipParseException, sub_type=None)), label=None)
end[}]
end[}]
local_variable[type[List], params]
assign[member[.result], member[.params]]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] operator[SEP] operator[SEP] identifier[consumeVia] operator[SEP] Keyword[final] identifier[Buffer] identifier[buffer] operator[SEP] Keyword[throws] identifier[SipParseException] , identifier[IOException] {
Keyword[final] identifier[Object] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] identifier[Object] operator[SEP] Other[4] operator[SEP] operator[SEP] Keyword[int] identifier[count] operator[=] Other[0] operator[SEP] Keyword[int] identifier[indexOfSemi] operator[=] Other[0] operator[SEP] Keyword[int] identifier[countOfColons] operator[=] Other[0] operator[SEP] Keyword[int] identifier[indexOfLastColon] operator[=] Other[0] operator[SEP] Keyword[int] identifier[readerIndexOfLastColon] operator[=] Other[0] operator[SEP] identifier[consumeSWS] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] identifier[result] operator[SEP] Other[0] operator[SEP] operator[=] identifier[consumeSentProtocol] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] identifier[consumeLWS] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] Keyword[final] Keyword[int] identifier[index] operator[=] identifier[buffer] operator[SEP] identifier[getReaderIndex] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[indexOfSemi] operator[==] Other[0] operator[&&] identifier[buffer] operator[SEP] identifier[hasReadableBytes] operator[SEP] operator[SEP] operator[&&] operator[++] identifier[count] operator[<] identifier[MAX_LOOK_AHEAD] operator[SEP] {
Keyword[final] Keyword[byte] identifier[b] operator[=] identifier[buffer] operator[SEP] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[b] operator[==] identifier[SipParser] operator[SEP] identifier[SEMI] operator[SEP] {
identifier[indexOfSemi] operator[=] identifier[count] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[b] operator[==] identifier[SipParser] operator[SEP] identifier[COLON] operator[SEP] {
operator[++] identifier[countOfColons] operator[SEP] identifier[indexOfLastColon] operator[=] identifier[count] operator[SEP] identifier[readerIndexOfLastColon] operator[=] identifier[buffer] operator[SEP] identifier[getReaderIndex] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[if] operator[SEP] identifier[count] operator[==] Other[0] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[if] operator[SEP] identifier[count] operator[==] identifier[MAX_LOOK_AHEAD] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SipParseException] operator[SEP] identifier[buffer] operator[SEP] identifier[getReaderIndex] operator[SEP] operator[SEP] , literal[String] operator[+] literal[String] operator[+] identifier[MAX_LOOK_AHEAD] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[indexOfSemi] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SipParseException] operator[SEP] identifier[buffer] operator[SEP] identifier[getReaderIndex] operator[SEP] operator[SEP] , literal[String] operator[SEP] operator[SEP]
}
identifier[buffer] operator[SEP] identifier[setReaderIndex] operator[SEP] identifier[index] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[countOfColons] operator[==] Other[0] operator[||] identifier[countOfColons] operator[==] Other[7] operator[SEP] {
identifier[result] operator[SEP] Other[1] operator[SEP] operator[=] identifier[buffer] operator[SEP] identifier[readBytes] operator[SEP] identifier[indexOfSemi] operator[-] Other[1] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[indexOfLastColon] operator[!=] Other[0] operator[&&] operator[SEP] identifier[countOfColons] operator[==] Other[1] operator[||] identifier[countOfColons] operator[==] Other[8] operator[SEP] operator[SEP] {
identifier[result] operator[SEP] Other[1] operator[SEP] operator[=] identifier[buffer] operator[SEP] identifier[readBytes] operator[SEP] identifier[indexOfLastColon] operator[-] Other[1] operator[SEP] operator[SEP] identifier[buffer] operator[SEP] identifier[readByte] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] Other[2] operator[SEP] operator[=] identifier[buffer] operator[SEP] identifier[readBytes] operator[SEP] identifier[indexOfSemi] operator[-] identifier[indexOfLastColon] operator[-] Other[1] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[result] operator[SEP] Other[2] operator[SEP] operator[==] Other[null] operator[||] operator[SEP] operator[SEP] identifier[Buffer] operator[SEP] identifier[result] operator[SEP] Other[2] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[SipParseException] operator[SEP] identifier[readerIndexOfLastColon] operator[+] Other[1] , literal[String] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[throw] Keyword[new] identifier[SipParseException] operator[SEP] identifier[indexOfLastColon] , literal[String] operator[+] identifier[countOfColons] operator[+] literal[String] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] identifier[List] operator[<] identifier[Buffer] operator[SEP] operator[SEP] operator[>] identifier[params] operator[=] identifier[consumeGenericParams] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] identifier[result] operator[SEP] Other[3] operator[SEP] operator[=] identifier[params] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public void taintPackagesDependingOnChangedClasspathPackages() throws IOException {
// 1. Collect fully qualified names of all interesting classpath dependencies
Set<String> fqDependencies = new HashSet<>();
for (Package pkg : prev.packages().values()) {
// Check if this package was compiled. If it's presence is recorded
// because it was on the class path and we needed to save it's
// public api, it's not a candidate for tainting.
if (pkg.sources().isEmpty())
continue;
pkg.typeClasspathDependencies().values().forEach(fqDependencies::addAll);
}
// 2. Extract the public APIs from the on disk .class files
// (Reason for doing step 1 in a separate phase is to avoid extracting
// public APIs of the same class twice.)
PubApiExtractor pubApiExtractor = new PubApiExtractor(options);
Map<String, PubApi> onDiskPubApi = new HashMap<>();
for (String cpDep : fqDependencies) {
onDiskPubApi.put(cpDep, pubApiExtractor.getPubApi(cpDep));
}
pubApiExtractor.close();
// 3. Compare them with the public APIs as of last compilation (loaded from javac_state)
nextPkg:
for (Package pkg : prev.packages().values()) {
// Check if this package was compiled. If it's presence is recorded
// because it was on the class path and we needed to save it's
// public api, it's not a candidate for tainting.
if (pkg.sources().isEmpty())
continue;
Set<String> cpDepsOfThisPkg = new HashSet<>();
for (Set<String> cpDeps : pkg.typeClasspathDependencies().values())
cpDepsOfThisPkg.addAll(cpDeps);
for (String fqDep : cpDepsOfThisPkg) {
String depPkg = ":" + fqDep.substring(0, fqDep.lastIndexOf('.'));
PubApi prevPkgApi = prev.packages().get(depPkg).getPubApi();
// This PubApi directly lists the members of the class,
// i.e. [ MEMBER1, MEMBER2, ... ]
PubApi prevDepApi = prevPkgApi.types.get(fqDep).pubApi;
// In order to dive *into* the class, we need to add
// .types.get(fqDep).pubApi below.
PubApi currentDepApi = onDiskPubApi.get(fqDep).types.get(fqDep).pubApi;
if (!currentDepApi.isBackwardCompatibleWith(prevDepApi)) {
List<String> apiDiff = currentDepApi.diff(prevDepApi);
taintPackage(pkg.name(), "depends on classpath "
+ "package which has an updated package api: "
+ String.join("\n", apiDiff));
//Log.debug("========================================");
//Log.debug("------ PREV API ------------------------");
//prevDepApi.asListOfStrings().forEach(Log::debug);
//Log.debug("------ CURRENT API ---------------------");
//currentDepApi.asListOfStrings().forEach(Log::debug);
//Log.debug("========================================");
continue nextPkg;
}
}
}
} | class class_name[name] begin[{]
method[taintPackagesDependingOnChangedClasspathPackages, return_type[void], modifier[public], parameter[]] begin[{]
local_variable[type[Set], fqDependencies]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=sources, postfix_operators=[], prefix_operators=[], qualifier=pkg, selectors=[MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), StatementExpression(expression=MethodInvocation(arguments=[], member=typeClasspathDependencies, postfix_operators=[], prefix_operators=[], qualifier=pkg, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MethodReference(expression=MemberReference(member=fqDependencies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), method=MemberReference(member=addAll, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type_arguments=[])], member=forEach, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=packages, postfix_operators=[], prefix_operators=[], qualifier=prev, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pkg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Package, sub_type=None))), label=None)
local_variable[type[PubApiExtractor], pubApiExtractor]
local_variable[type[Map], onDiskPubApi]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cpDep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=cpDep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getPubApi, postfix_operators=[], prefix_operators=[], qualifier=pubApiExtractor, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=onDiskPubApi, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=fqDependencies, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cpDep)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
call[pubApiExtractor.close, parameter[]]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=sources, postfix_operators=[], prefix_operators=[], qualifier=pkg, selectors=[MethodInvocation(arguments=[], member=isEmpty, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=ContinueStatement(goto=None, label=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=HashSet, sub_type=None)), name=cpDepsOfThisPkg)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None)), ForStatement(body=StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=cpDeps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=cpDepsOfThisPkg, selectors=[], type_arguments=None), label=None), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=typeClasspathDependencies, postfix_operators=[], prefix_operators=[], qualifier=pkg, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=cpDeps)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=Set, sub_type=None))), label=None), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=":"), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='.')], member=lastIndexOf, postfix_operators=[], prefix_operators=[], qualifier=fqDep, selectors=[], type_arguments=None)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=fqDep, selectors=[], type_arguments=None), operator=+), name=depPkg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=packages, postfix_operators=[], prefix_operators=[], qualifier=prev, selectors=[MethodInvocation(arguments=[MemberReference(member=depPkg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getPubApi, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=prevPkgApi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PubApi, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=fqDep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=prevPkgApi.types, selectors=[MemberReference(member=pubApi, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), name=prevDepApi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PubApi, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=fqDep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=onDiskPubApi, selectors=[MemberReference(member=types, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None), MethodInvocation(arguments=[MemberReference(member=fqDep, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MemberReference(member=pubApi, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None)], type_arguments=None), name=currentDepApi)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=PubApi, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=prevDepApi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=isBackwardCompatibleWith, postfix_operators=[], prefix_operators=['!'], qualifier=currentDepApi, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=prevDepApi, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=diff, postfix_operators=[], prefix_operators=[], qualifier=currentDepApi, selectors=[], type_arguments=None), name=apiDiff)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))], dimensions=[], name=List, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=name, postfix_operators=[], prefix_operators=[], qualifier=pkg, selectors=[], type_arguments=None), BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="depends on classpath "), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="package which has an updated package api: "), operator=+), operandr=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\n"), MemberReference(member=apiDiff, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=join, postfix_operators=[], prefix_operators=[], qualifier=String, selectors=[], type_arguments=None), operator=+)], member=taintPackage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None), ContinueStatement(goto=nextPkg, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=cpDepsOfThisPkg, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=fqDep)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=packages, postfix_operators=[], prefix_operators=[], qualifier=prev, selectors=[MethodInvocation(arguments=[], member=values, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=pkg)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Package, sub_type=None))), label=nextPkg)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[taintPackagesDependingOnChangedClasspathPackages] operator[SEP] operator[SEP] Keyword[throws] identifier[IOException] {
identifier[Set] operator[<] identifier[String] operator[>] identifier[fqDependencies] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Package] identifier[pkg] operator[:] identifier[prev] operator[SEP] identifier[packages] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[pkg] operator[SEP] identifier[sources] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[pkg] operator[SEP] identifier[typeClasspathDependencies] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[forEach] operator[SEP] identifier[fqDependencies] operator[::] identifier[addAll] operator[SEP] operator[SEP]
}
identifier[PubApiExtractor] identifier[pubApiExtractor] operator[=] Keyword[new] identifier[PubApiExtractor] operator[SEP] identifier[options] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[PubApi] operator[>] identifier[onDiskPubApi] operator[=] Keyword[new] identifier[HashMap] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[cpDep] operator[:] identifier[fqDependencies] operator[SEP] {
identifier[onDiskPubApi] operator[SEP] identifier[put] operator[SEP] identifier[cpDep] , identifier[pubApiExtractor] operator[SEP] identifier[getPubApi] operator[SEP] identifier[cpDep] operator[SEP] operator[SEP] operator[SEP]
}
identifier[pubApiExtractor] operator[SEP] identifier[close] operator[SEP] operator[SEP] operator[SEP] identifier[nextPkg] operator[:] Keyword[for] operator[SEP] identifier[Package] identifier[pkg] operator[:] identifier[prev] operator[SEP] identifier[packages] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[pkg] operator[SEP] identifier[sources] operator[SEP] operator[SEP] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[cpDepsOfThisPkg] operator[=] Keyword[new] identifier[HashSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Set] operator[<] identifier[String] operator[>] identifier[cpDeps] operator[:] identifier[pkg] operator[SEP] identifier[typeClasspathDependencies] operator[SEP] operator[SEP] operator[SEP] identifier[values] operator[SEP] operator[SEP] operator[SEP] identifier[cpDepsOfThisPkg] operator[SEP] identifier[addAll] operator[SEP] identifier[cpDeps] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[fqDep] operator[:] identifier[cpDepsOfThisPkg] operator[SEP] {
identifier[String] identifier[depPkg] operator[=] literal[String] operator[+] identifier[fqDep] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[fqDep] operator[SEP] identifier[lastIndexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] identifier[PubApi] identifier[prevPkgApi] operator[=] identifier[prev] operator[SEP] identifier[packages] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[depPkg] operator[SEP] operator[SEP] identifier[getPubApi] operator[SEP] operator[SEP] operator[SEP] identifier[PubApi] identifier[prevDepApi] operator[=] identifier[prevPkgApi] operator[SEP] identifier[types] operator[SEP] identifier[get] operator[SEP] identifier[fqDep] operator[SEP] operator[SEP] identifier[pubApi] operator[SEP] identifier[PubApi] identifier[currentDepApi] operator[=] identifier[onDiskPubApi] operator[SEP] identifier[get] operator[SEP] identifier[fqDep] operator[SEP] operator[SEP] identifier[types] operator[SEP] identifier[get] operator[SEP] identifier[fqDep] operator[SEP] operator[SEP] identifier[pubApi] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[currentDepApi] operator[SEP] identifier[isBackwardCompatibleWith] operator[SEP] identifier[prevDepApi] operator[SEP] operator[SEP] {
identifier[List] operator[<] identifier[String] operator[>] identifier[apiDiff] operator[=] identifier[currentDepApi] operator[SEP] identifier[diff] operator[SEP] identifier[prevDepApi] operator[SEP] operator[SEP] identifier[taintPackage] operator[SEP] identifier[pkg] operator[SEP] identifier[name] operator[SEP] operator[SEP] , literal[String] operator[+] literal[String] operator[+] identifier[String] operator[SEP] identifier[join] operator[SEP] literal[String] , identifier[apiDiff] operator[SEP] operator[SEP] operator[SEP] Keyword[continue] identifier[nextPkg] operator[SEP]
}
}
}
}
|
protected DataView<T> newDataView(final String id, final IDataProvider<T> dataProvider)
{
final DataView<T> dataView = new DataView<T>(id, dataProvider)
{
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
protected void populateItem(final Item<T> item)
{
item.add(newListComponent("item", item));
}
};
dataView.setItemsPerPage(newItemsPerPage());
dataView.setItemReuseStrategy(ReuseIfModelsEqualStrategy.getInstance());
return dataView;
} | class class_name[name] begin[{]
method[newDataView, return_type[type[DataView]], modifier[protected], parameter[id, dataProvider]] begin[{]
local_variable[type[DataView], dataView]
call[dataView.setItemsPerPage, parameter[call[.newItemsPerPage, parameter[]]]]
call[dataView.setItemReuseStrategy, parameter[call[ReuseIfModelsEqualStrategy.getInstance, parameter[]]]]
return[member[.dataView]]
end[}]
END[}] | Keyword[protected] identifier[DataView] operator[<] identifier[T] operator[>] identifier[newDataView] operator[SEP] Keyword[final] identifier[String] identifier[id] , Keyword[final] identifier[IDataProvider] operator[<] identifier[T] operator[>] identifier[dataProvider] operator[SEP] {
Keyword[final] identifier[DataView] operator[<] identifier[T] operator[>] identifier[dataView] operator[=] Keyword[new] identifier[DataView] operator[<] identifier[T] operator[>] operator[SEP] identifier[id] , identifier[dataProvider] operator[SEP] {
Keyword[private] Keyword[static] Keyword[final] Keyword[long] identifier[serialVersionUID] operator[=] Other[1L] operator[SEP] annotation[@] identifier[Override] Keyword[protected] Keyword[void] identifier[populateItem] operator[SEP] Keyword[final] identifier[Item] operator[<] identifier[T] operator[>] identifier[item] operator[SEP] {
identifier[item] operator[SEP] identifier[add] operator[SEP] identifier[newListComponent] operator[SEP] literal[String] , identifier[item] operator[SEP] operator[SEP] operator[SEP]
}
} operator[SEP] identifier[dataView] operator[SEP] identifier[setItemsPerPage] operator[SEP] identifier[newItemsPerPage] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[dataView] operator[SEP] identifier[setItemReuseStrategy] operator[SEP] identifier[ReuseIfModelsEqualStrategy] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[dataView] operator[SEP]
}
|
private String listToString(List<String> stringList){
StringBuilder concat = new StringBuilder();
for(String str:stringList){
concat.append(str);
concat.append(System.getProperty("line.separator"));
}
return concat.toString();
} | class class_name[name] begin[{]
method[listToString, return_type[type[String]], modifier[private], parameter[stringList]] begin[{]
local_variable[type[StringBuilder], concat]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=str, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=append, postfix_operators=[], prefix_operators=[], qualifier=concat, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="line.separator")], member=getProperty, postfix_operators=[], prefix_operators=[], qualifier=System, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=concat, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=stringList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=str)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[call[concat.toString, parameter[]]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[listToString] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[stringList] operator[SEP] {
identifier[StringBuilder] identifier[concat] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[str] operator[:] identifier[stringList] operator[SEP] {
identifier[concat] operator[SEP] identifier[append] operator[SEP] identifier[str] operator[SEP] operator[SEP] identifier[concat] operator[SEP] identifier[append] operator[SEP] identifier[System] operator[SEP] identifier[getProperty] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[concat] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static Expression power(Expression expression1, Expression expression2) {
return x("POWER(" + expression1.toString() + ", " + expression2.toString() + ")");
} | class class_name[name] begin[{]
method[power, return_type[type[Expression]], modifier[public static], parameter[expression1, expression2]] begin[{]
return[call[.x, parameter[binary_operation[binary_operation[binary_operation[binary_operation[literal["POWER("], +, call[expression1.toString, parameter[]]], +, literal[", "]], +, call[expression2.toString, parameter[]]], +, literal[")"]]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Expression] identifier[power] operator[SEP] identifier[Expression] identifier[expression1] , identifier[Expression] identifier[expression2] operator[SEP] {
Keyword[return] identifier[x] operator[SEP] literal[String] operator[+] identifier[expression1] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[expression2] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
|
public JavaWriter emitField(String type, String name) throws IOException {
return emitField(type, name, EnumSet.noneOf(Modifier.class), null);
} | class class_name[name] begin[{]
method[emitField, return_type[type[JavaWriter]], modifier[public], parameter[type, name]] begin[{]
return[call[.emitField, parameter[member[.type], member[.name], call[EnumSet.noneOf, parameter[ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Modifier, sub_type=None))]], literal[null]]]]
end[}]
END[}] | Keyword[public] identifier[JavaWriter] identifier[emitField] operator[SEP] identifier[String] identifier[type] , identifier[String] identifier[name] operator[SEP] Keyword[throws] identifier[IOException] {
Keyword[return] identifier[emitField] operator[SEP] identifier[type] , identifier[name] , identifier[EnumSet] operator[SEP] identifier[noneOf] operator[SEP] identifier[Modifier] operator[SEP] Keyword[class] operator[SEP] , Other[null] operator[SEP] operator[SEP]
}
|
public Formula getFormula() {
Reagent[] reagents = new Reagent[] {RESOURCE, SOURCE};
final Formula rslt = new SimpleFormula(ServletRedirectTask.class, reagents);
return rslt;
} | class class_name[name] begin[{]
method[getFormula, return_type[type[Formula]], modifier[public], parameter[]] begin[{]
local_variable[type[Reagent], reagents]
local_variable[type[Formula], rslt]
return[member[.rslt]]
end[}]
END[}] | Keyword[public] identifier[Formula] identifier[getFormula] operator[SEP] operator[SEP] {
identifier[Reagent] operator[SEP] operator[SEP] identifier[reagents] operator[=] Keyword[new] identifier[Reagent] operator[SEP] operator[SEP] {
identifier[RESOURCE] , identifier[SOURCE]
} operator[SEP] Keyword[final] identifier[Formula] identifier[rslt] operator[=] Keyword[new] identifier[SimpleFormula] operator[SEP] identifier[ServletRedirectTask] operator[SEP] Keyword[class] , identifier[reagents] operator[SEP] operator[SEP] Keyword[return] identifier[rslt] operator[SEP]
}
|
private Expression compileUnary(UnaryOperation unary, int opPos)
throws TransformerException
{
int rightPos = getFirstChildPos(opPos);
unary.setRight(compile(rightPos));
return unary;
} | class class_name[name] begin[{]
method[compileUnary, return_type[type[Expression]], modifier[private], parameter[unary, opPos]] begin[{]
local_variable[type[int], rightPos]
call[unary.setRight, parameter[call[.compile, parameter[member[.rightPos]]]]]
return[member[.unary]]
end[}]
END[}] | Keyword[private] identifier[Expression] identifier[compileUnary] operator[SEP] identifier[UnaryOperation] identifier[unary] , Keyword[int] identifier[opPos] operator[SEP] Keyword[throws] identifier[TransformerException] {
Keyword[int] identifier[rightPos] operator[=] identifier[getFirstChildPos] operator[SEP] identifier[opPos] operator[SEP] operator[SEP] identifier[unary] operator[SEP] identifier[setRight] operator[SEP] identifier[compile] operator[SEP] identifier[rightPos] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[unary] operator[SEP]
}
|
public EClass getCPD() {
if (cpdEClass == null) {
cpdEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(229);
}
return cpdEClass;
} | class class_name[name] begin[{]
method[getCPD, return_type[type[EClass]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.cpdEClass], ==, literal[null]]] begin[{]
assign[member[.cpdEClass], Cast(expression=MethodInvocation(arguments=[MemberReference(member=eNS_URI, postfix_operators=[], prefix_operators=[], qualifier=AfplibPackage, 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=229)], 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[.cpdEClass]]
end[}]
END[}] | Keyword[public] identifier[EClass] identifier[getCPD] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[cpdEClass] operator[==] Other[null] operator[SEP] {
identifier[cpdEClass] operator[=] operator[SEP] identifier[EClass] operator[SEP] identifier[EPackage] operator[SEP] identifier[Registry] operator[SEP] identifier[INSTANCE] operator[SEP] identifier[getEPackage] operator[SEP] identifier[AfplibPackage] operator[SEP] identifier[eNS_URI] operator[SEP] operator[SEP] identifier[getEClassifiers] operator[SEP] operator[SEP] operator[SEP] identifier[get] operator[SEP] Other[229] operator[SEP] operator[SEP]
}
Keyword[return] identifier[cpdEClass] operator[SEP]
}
|
private void doInterceptBeforeInsert(Object t) {
List<Object> list = new ArrayList<Object>();
list.add(t);
doInterceptBeforeInsertList(list);
} | class class_name[name] begin[{]
method[doInterceptBeforeInsert, return_type[void], modifier[private], parameter[t]] begin[{]
local_variable[type[List], list]
call[list.add, parameter[member[.t]]]
call[.doInterceptBeforeInsertList, parameter[member[.list]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[doInterceptBeforeInsert] operator[SEP] identifier[Object] identifier[t] operator[SEP] {
identifier[List] operator[<] identifier[Object] operator[>] identifier[list] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[list] operator[SEP] identifier[add] operator[SEP] identifier[t] operator[SEP] operator[SEP] identifier[doInterceptBeforeInsertList] operator[SEP] identifier[list] operator[SEP] operator[SEP]
}
|
@Override
@SuppressWarnings("unchecked")
public <BD extends BehaviorData, B extends Behavior<BD, ?>> B getBehavior(final Class<B> behaviorClass) {
B behavior = null;
if (this.behaviors != null && this.behaviors.get(behaviorClass) instanceof List) {
final Optional<B> oBehavior = (Optional<B>) this.behaviors.get(behaviorClass).stream().findFirst();
if (oBehavior.isPresent()) {
behavior = oBehavior.orElse(null);
}
}
return behavior;
} | class class_name[name] begin[{]
method[getBehavior, return_type[type[B]], modifier[public], parameter[behaviorClass]] begin[{]
local_variable[type[B], behavior]
if[binary_operation[binary_operation[THIS[member[None.behaviors]], !=, literal[null]], &&, binary_operation[THIS[member[None.behaviors]call[None.get, parameter[member[.behaviorClass]]]], instanceof, type[List]]]] begin[{]
local_variable[type[Optional], oBehavior]
if[call[oBehavior.isPresent, parameter[]]] begin[{]
assign[member[.behavior], call[oBehavior.orElse, parameter[literal[null]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
return[member[.behavior]]
end[}]
END[}] | annotation[@] identifier[Override] annotation[@] identifier[SuppressWarnings] operator[SEP] literal[String] operator[SEP] Keyword[public] operator[<] identifier[BD] Keyword[extends] identifier[BehaviorData] , identifier[B] Keyword[extends] identifier[Behavior] operator[<] identifier[BD] , operator[?] operator[>] operator[>] identifier[B] identifier[getBehavior] operator[SEP] Keyword[final] identifier[Class] operator[<] identifier[B] operator[>] identifier[behaviorClass] operator[SEP] {
identifier[B] identifier[behavior] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[behaviors] operator[!=] Other[null] operator[&&] Keyword[this] operator[SEP] identifier[behaviors] operator[SEP] identifier[get] operator[SEP] identifier[behaviorClass] operator[SEP] Keyword[instanceof] identifier[List] operator[SEP] {
Keyword[final] identifier[Optional] operator[<] identifier[B] operator[>] identifier[oBehavior] operator[=] operator[SEP] identifier[Optional] operator[<] identifier[B] operator[>] operator[SEP] Keyword[this] operator[SEP] identifier[behaviors] operator[SEP] identifier[get] operator[SEP] identifier[behaviorClass] operator[SEP] operator[SEP] identifier[stream] operator[SEP] operator[SEP] operator[SEP] identifier[findFirst] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[oBehavior] operator[SEP] identifier[isPresent] operator[SEP] operator[SEP] operator[SEP] {
identifier[behavior] operator[=] identifier[oBehavior] operator[SEP] identifier[orElse] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[behavior] operator[SEP]
}
|
public Request partialUpdateObjectAsync(final @NonNull JSONObject partialObject, final @NonNull String objectID, final boolean createIfNotExists, @Nullable final RequestOptions requestOptions, @Nullable CompletionHandler completionHandler) {
return getClient().new AsyncTaskRequest(completionHandler) {
@NonNull
@Override protected JSONObject run() throws AlgoliaException {
return partialUpdateObject(partialObject, objectID, createIfNotExists, requestOptions);
}
}.start();
} | class class_name[name] begin[{]
method[partialUpdateObjectAsync, return_type[type[Request]], modifier[public], parameter[partialObject, objectID, createIfNotExists, requestOptions, completionHandler]] begin[{]
return[call[.getClient, parameter[]]]
end[}]
END[}] | Keyword[public] identifier[Request] identifier[partialUpdateObjectAsync] operator[SEP] Keyword[final] annotation[@] identifier[NonNull] identifier[JSONObject] identifier[partialObject] , Keyword[final] annotation[@] identifier[NonNull] identifier[String] identifier[objectID] , Keyword[final] Keyword[boolean] identifier[createIfNotExists] , annotation[@] identifier[Nullable] Keyword[final] identifier[RequestOptions] identifier[requestOptions] , annotation[@] identifier[Nullable] identifier[CompletionHandler] identifier[completionHandler] operator[SEP] {
Keyword[return] identifier[getClient] operator[SEP] operator[SEP] operator[SEP] Keyword[new] identifier[AsyncTaskRequest] operator[SEP] identifier[completionHandler] operator[SEP] {
annotation[@] identifier[NonNull] annotation[@] identifier[Override] Keyword[protected] identifier[JSONObject] identifier[run] operator[SEP] operator[SEP] Keyword[throws] identifier[AlgoliaException] {
Keyword[return] identifier[partialUpdateObject] operator[SEP] identifier[partialObject] , identifier[objectID] , identifier[createIfNotExists] , identifier[requestOptions] operator[SEP] operator[SEP]
}
} operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP]
}
|
public boolean checkIndexField(BaseField field)
{
for (int iKeySeq = 0; iKeySeq < this.getRecord().getKeyAreaCount(); iKeySeq++)
{
KeyArea keyArea = this.getRecord().getKeyArea(iKeySeq);
if (keyArea.getField(0) == field)
if (field != this.getRecord().getCounterField())
return true;
}
return false;
} | class class_name[name] begin[{]
method[checkIndexField, return_type[type[boolean]], modifier[public], parameter[field]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[MemberReference(member=iKeySeq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getKeyArea, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), name=keyArea)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=KeyArea, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], member=getField, postfix_operators=[], prefix_operators=[], qualifier=keyArea, selectors=[], type_arguments=None), operandr=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator===), else_statement=None, label=None, then_statement=IfStatement(condition=BinaryOperation(operandl=MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getCounterField, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), operator=!=), else_statement=None, label=None, then_statement=ReturnStatement(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=true), label=None)))]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=iKeySeq, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[], member=getRecord, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=getKeyAreaCount, 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=iKeySeq)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=iKeySeq, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[false]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[checkIndexField] operator[SEP] identifier[BaseField] identifier[field] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[iKeySeq] operator[=] Other[0] operator[SEP] identifier[iKeySeq] operator[<] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getKeyAreaCount] operator[SEP] operator[SEP] operator[SEP] identifier[iKeySeq] operator[++] operator[SEP] {
identifier[KeyArea] identifier[keyArea] operator[=] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getKeyArea] operator[SEP] identifier[iKeySeq] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[keyArea] operator[SEP] identifier[getField] operator[SEP] Other[0] operator[SEP] operator[==] identifier[field] operator[SEP] Keyword[if] operator[SEP] identifier[field] operator[!=] Keyword[this] operator[SEP] identifier[getRecord] operator[SEP] operator[SEP] operator[SEP] identifier[getCounterField] operator[SEP] operator[SEP] operator[SEP] Keyword[return] literal[boolean] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private String fontAvailable(String family, String[] avail)
{
for (int i = 0; i < avail.length; i++)
if (avail[i].equalsIgnoreCase(family)) return avail[i];
return null;
} | class class_name[name] begin[{]
method[fontAvailable, return_type[type[String]], modifier[private], parameter[family, avail]] begin[{]
ForStatement(body=IfStatement(condition=MemberReference(member=avail, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), MethodInvocation(arguments=[MemberReference(member=family, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equalsIgnoreCase, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), else_statement=None, label=None, then_statement=ReturnStatement(expression=MemberReference(member=avail, 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=avail, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[null]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[fontAvailable] operator[SEP] identifier[String] identifier[family] , identifier[String] operator[SEP] operator[SEP] identifier[avail] operator[SEP] {
Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[avail] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] Keyword[if] operator[SEP] identifier[avail] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[equalsIgnoreCase] operator[SEP] identifier[family] operator[SEP] operator[SEP] Keyword[return] identifier[avail] operator[SEP] identifier[i] operator[SEP] operator[SEP] Keyword[return] Other[null] operator[SEP]
}
|
public static <T> DBObject getBsonFromObject(T t)
throws IllegalAccessException, InstantiationException, InvocationTargetException {
Field[] fields = AnnotationUtils.filterDeepFields(t.getClass());
DBObject bson = new BasicDBObject();
for (Field field : fields) {
Method method = Utils.findGetter(field.getName(), t.getClass());
Object object = method.invoke(t);
if (object != null) {
if (Collection.class.isAssignableFrom(field.getType())) {
Collection c = (Collection) object;
Iterator iterator = c.iterator();
List innerBsonList = new ArrayList<>();
while (iterator.hasNext()) {
innerBsonList.add(getBsonFromObject(iterator.next()));
}
bson.put(AnnotationUtils.deepFieldName(field), innerBsonList);
} else if (IDeepType.class.isAssignableFrom(field.getType())) {
bson.put(AnnotationUtils.deepFieldName(field), getBsonFromObject((IDeepType) object));
} else {
bson.put(AnnotationUtils.deepFieldName(field), object);
}
}
}
return bson;
} | class class_name[name] begin[{]
method[getBsonFromObject, return_type[type[DBObject]], modifier[public static], parameter[t]] begin[{]
local_variable[type[Field], fields]
local_variable[type[DBObject], bson]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getName, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None), MethodInvocation(arguments=[], member=getClass, postfix_operators=[], prefix_operators=[], qualifier=t, selectors=[], type_arguments=None)], member=findGetter, postfix_operators=[], prefix_operators=[], qualifier=Utils, selectors=[], type_arguments=None), name=method)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Method, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=t, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=invoke, postfix_operators=[], prefix_operators=[], qualifier=method, selectors=[], type_arguments=None), name=object)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Collection, sub_type=None)), else_statement=IfStatement(condition=ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=field, selectors=[], type_arguments=None)], member=isAssignableFrom, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=IDeepType, sub_type=None)), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deepFieldName, postfix_operators=[], prefix_operators=[], qualifier=AnnotationUtils, selectors=[], type_arguments=None), MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=bson, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deepFieldName, postfix_operators=[], prefix_operators=[], qualifier=AnnotationUtils, selectors=[], type_arguments=None), MethodInvocation(arguments=[Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=IDeepType, sub_type=None))], member=getBsonFromObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=put, postfix_operators=[], prefix_operators=[], qualifier=bson, selectors=[], type_arguments=None), label=None)])), label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=object, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=Collection, sub_type=None)), name=c)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Collection, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=iterator, postfix_operators=[], prefix_operators=[], qualifier=c, selectors=[], type_arguments=None), name=iterator)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Iterator, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=innerBsonList)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=List, sub_type=None)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=next, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None)], member=getBsonFromObject, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=innerBsonList, selectors=[], type_arguments=None), label=None)]), condition=MethodInvocation(arguments=[], member=hasNext, postfix_operators=[], prefix_operators=[], qualifier=iterator, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=field, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=deepFieldName, postfix_operators=[], prefix_operators=[], qualifier=AnnotationUtils, selectors=[], type_arguments=None), MemberReference(member=innerBsonList, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=bson, selectors=[], type_arguments=None), label=None)]))]))]), control=EnhancedForControl(iterable=MemberReference(member=fields, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=field)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Field, sub_type=None))), label=None)
return[member[.bson]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[DBObject] identifier[getBsonFromObject] operator[SEP] identifier[T] identifier[t] operator[SEP] Keyword[throws] identifier[IllegalAccessException] , identifier[InstantiationException] , identifier[InvocationTargetException] {
identifier[Field] operator[SEP] operator[SEP] identifier[fields] operator[=] identifier[AnnotationUtils] operator[SEP] identifier[filterDeepFields] operator[SEP] identifier[t] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[DBObject] identifier[bson] operator[=] Keyword[new] identifier[BasicDBObject] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Field] identifier[field] operator[:] identifier[fields] operator[SEP] {
identifier[Method] identifier[method] operator[=] identifier[Utils] operator[SEP] identifier[findGetter] operator[SEP] identifier[field] operator[SEP] identifier[getName] operator[SEP] operator[SEP] , identifier[t] operator[SEP] identifier[getClass] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[object] operator[=] identifier[method] operator[SEP] identifier[invoke] operator[SEP] identifier[t] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[object] operator[!=] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[Collection] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[Collection] identifier[c] operator[=] operator[SEP] identifier[Collection] operator[SEP] identifier[object] operator[SEP] identifier[Iterator] identifier[iterator] operator[=] identifier[c] operator[SEP] identifier[iterator] operator[SEP] operator[SEP] operator[SEP] identifier[List] identifier[innerBsonList] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[while] operator[SEP] identifier[iterator] operator[SEP] identifier[hasNext] operator[SEP] operator[SEP] operator[SEP] {
identifier[innerBsonList] operator[SEP] identifier[add] operator[SEP] identifier[getBsonFromObject] operator[SEP] identifier[iterator] operator[SEP] identifier[next] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[bson] operator[SEP] identifier[put] operator[SEP] identifier[AnnotationUtils] operator[SEP] identifier[deepFieldName] operator[SEP] identifier[field] operator[SEP] , identifier[innerBsonList] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[IDeepType] operator[SEP] Keyword[class] operator[SEP] identifier[isAssignableFrom] operator[SEP] identifier[field] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[bson] operator[SEP] identifier[put] operator[SEP] identifier[AnnotationUtils] operator[SEP] identifier[deepFieldName] operator[SEP] identifier[field] operator[SEP] , identifier[getBsonFromObject] operator[SEP] operator[SEP] identifier[IDeepType] operator[SEP] identifier[object] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[bson] operator[SEP] identifier[put] operator[SEP] identifier[AnnotationUtils] operator[SEP] identifier[deepFieldName] operator[SEP] identifier[field] operator[SEP] , identifier[object] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[bson] operator[SEP]
}
|
@Override
public String getZipCode() {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < 5; i++) {
sb.append(random.nextInt(10));
}
return sb.toString();
} | class class_name[name] begin[{]
method[getZipCode, return_type[type[String]], modifier[public], parameter[]] begin[{]
local_variable[type[StringBuilder], sb]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10)], member=nextInt, postfix_operators=[], prefix_operators=[], qualifier=random, selectors=[], type_arguments=None)], member=append, postfix_operators=[], prefix_operators=[], qualifier=sb, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=5), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[call[sb.toString, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] identifier[String] identifier[getZipCode] operator[SEP] operator[SEP] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] Other[5] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[random] operator[SEP] identifier[nextInt] operator[SEP] Other[10] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
public static List<Dashboard> findSharedDashboards(EntityManager em, PrincipalUser owner, Integer limit, String version) {
requireArgument(em != null, "Entity manager can not be null.");
TypedQuery<Dashboard> query;
if(owner == null){
if (version==null) {
query = em.createNamedQuery("Dashboard.getSharedDashboards", Dashboard.class);
}
else {
query = em.createNamedQuery("Dashboard.getSharedDashboardsByVersion", Dashboard.class);
query.setParameter("version",version);
}
} else {
if(version==null) {
query = em.createNamedQuery("Dashboard.getSharedDashboardsByOwner", Dashboard.class);
query.setParameter("owner", owner);
}
else {
query = em.createNamedQuery("Dashboard.getSharedDashboardsByOwnerAndByVersion", Dashboard.class);
query.setParameter("owner", owner);
query.setParameter("version",version);
}
}
query.setHint("javax.persistence.cache.storeMode", "REFRESH");
if(limit!= null){
query.setMaxResults(limit);
}
try {
return query.getResultList();
} catch (NoResultException ex) {
return new ArrayList<>(0);
}
} | class class_name[name] begin[{]
method[findSharedDashboards, return_type[type[List]], modifier[public static], parameter[em, owner, limit, version]] begin[{]
call[.requireArgument, parameter[binary_operation[member[.em], !=, literal[null]], literal["Entity manager can not be null."]]]
local_variable[type[TypedQuery], query]
if[binary_operation[member[.owner], ==, literal[null]]] begin[{]
if[binary_operation[member[.version], ==, literal[null]]] begin[{]
assign[member[.query], call[em.createNamedQuery, parameter[literal["Dashboard.getSharedDashboards"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dashboard, sub_type=None))]]]
else begin[{]
assign[member[.query], call[em.createNamedQuery, parameter[literal["Dashboard.getSharedDashboardsByVersion"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dashboard, sub_type=None))]]]
call[query.setParameter, parameter[literal["version"], member[.version]]]
end[}]
else begin[{]
if[binary_operation[member[.version], ==, literal[null]]] begin[{]
assign[member[.query], call[em.createNamedQuery, parameter[literal["Dashboard.getSharedDashboardsByOwner"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dashboard, sub_type=None))]]]
call[query.setParameter, parameter[literal["owner"], member[.owner]]]
else begin[{]
assign[member[.query], call[em.createNamedQuery, parameter[literal["Dashboard.getSharedDashboardsByOwnerAndByVersion"], ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Dashboard, sub_type=None))]]]
call[query.setParameter, parameter[literal["owner"], member[.owner]]]
call[query.setParameter, parameter[literal["version"], member[.version]]]
end[}]
end[}]
call[query.setHint, parameter[literal["javax.persistence.cache.storeMode"], literal["REFRESH"]]]
if[binary_operation[member[.limit], !=, literal[null]]] begin[{]
call[query.setMaxResults, parameter[member[.limit]]]
else begin[{]
None
end[}]
TryStatement(block=[ReturnStatement(expression=MethodInvocation(arguments=[], member=getResultList, postfix_operators=[], prefix_operators=[], qualifier=query, selectors=[], type_arguments=None), label=None)], catches=[CatchClause(block=[ReturnStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ex, types=['NoResultException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Dashboard] operator[>] identifier[findSharedDashboards] operator[SEP] identifier[EntityManager] identifier[em] , identifier[PrincipalUser] identifier[owner] , identifier[Integer] identifier[limit] , identifier[String] identifier[version] operator[SEP] {
identifier[requireArgument] operator[SEP] identifier[em] operator[!=] Other[null] , literal[String] operator[SEP] operator[SEP] identifier[TypedQuery] operator[<] identifier[Dashboard] operator[>] identifier[query] operator[SEP] Keyword[if] operator[SEP] identifier[owner] operator[==] Other[null] operator[SEP] {
Keyword[if] operator[SEP] identifier[version] operator[==] Other[null] operator[SEP] {
identifier[query] operator[=] identifier[em] operator[SEP] identifier[createNamedQuery] operator[SEP] literal[String] , identifier[Dashboard] operator[SEP] Keyword[class] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[query] operator[=] identifier[em] operator[SEP] identifier[createNamedQuery] operator[SEP] literal[String] , identifier[Dashboard] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setParameter] operator[SEP] literal[String] , identifier[version] operator[SEP] operator[SEP]
}
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[version] operator[==] Other[null] operator[SEP] {
identifier[query] operator[=] identifier[em] operator[SEP] identifier[createNamedQuery] operator[SEP] literal[String] , identifier[Dashboard] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setParameter] operator[SEP] literal[String] , identifier[owner] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[query] operator[=] identifier[em] operator[SEP] identifier[createNamedQuery] operator[SEP] literal[String] , identifier[Dashboard] operator[SEP] Keyword[class] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setParameter] operator[SEP] literal[String] , identifier[owner] operator[SEP] operator[SEP] identifier[query] operator[SEP] identifier[setParameter] operator[SEP] literal[String] , identifier[version] operator[SEP] operator[SEP]
}
}
identifier[query] operator[SEP] identifier[setHint] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[limit] operator[!=] Other[null] operator[SEP] {
identifier[query] operator[SEP] identifier[setMaxResults] operator[SEP] identifier[limit] operator[SEP] operator[SEP]
}
Keyword[try] {
Keyword[return] identifier[query] operator[SEP] identifier[getResultList] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[NoResultException] identifier[ex] operator[SEP] {
Keyword[return] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
}
|
private SortedSet<String> mergeSets(SortedSet<String> primary, Set<String> secondary) {
SortedSet<String> result = primary;
if (!secondary.isEmpty()) {
result = new TreeSet<>();
result.addAll(primary);
result.addAll(secondary);
}
return result;
} | class class_name[name] begin[{]
method[mergeSets, return_type[type[SortedSet]], modifier[private], parameter[primary, secondary]] begin[{]
local_variable[type[SortedSet], result]
if[call[secondary.isEmpty, parameter[]]] begin[{]
assign[member[.result], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=TreeSet, sub_type=None))]
call[result.addAll, parameter[member[.primary]]]
call[result.addAll, parameter[member[.secondary]]]
else begin[{]
None
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[private] identifier[SortedSet] operator[<] identifier[String] operator[>] identifier[mergeSets] operator[SEP] identifier[SortedSet] operator[<] identifier[String] operator[>] identifier[primary] , identifier[Set] operator[<] identifier[String] operator[>] identifier[secondary] operator[SEP] {
identifier[SortedSet] operator[<] identifier[String] operator[>] identifier[result] operator[=] identifier[primary] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[secondary] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[result] operator[=] Keyword[new] identifier[TreeSet] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[primary] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[addAll] operator[SEP] identifier[secondary] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public Observable<ServiceResponse<UUID>> createPrebuiltEntityRoleWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, CreatePrebuiltEntityRoleOptionalParameter createPrebuiltEntityRoleOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
}
if (appId == null) {
throw new IllegalArgumentException("Parameter appId is required and cannot be null.");
}
if (versionId == null) {
throw new IllegalArgumentException("Parameter versionId is required and cannot be null.");
}
if (entityId == null) {
throw new IllegalArgumentException("Parameter entityId is required and cannot be null.");
}
final String name = createPrebuiltEntityRoleOptionalParameter != null ? createPrebuiltEntityRoleOptionalParameter.name() : null;
return createPrebuiltEntityRoleWithServiceResponseAsync(appId, versionId, entityId, name);
} | class class_name[name] begin[{]
method[createPrebuiltEntityRoleWithServiceResponseAsync, return_type[type[Observable]], modifier[public], parameter[appId, versionId, entityId, createPrebuiltEntityRoleOptionalParameter]] begin[{]
if[binary_operation[THIS[member[None.client]call[None.endpoint, parameter[]]], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter this.client.endpoint() is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.appId], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter appId is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.versionId], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter versionId is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.entityId], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Parameter entityId is required and cannot be null.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
local_variable[type[String], name]
return[call[.createPrebuiltEntityRoleWithServiceResponseAsync, parameter[member[.appId], member[.versionId], member[.entityId], member[.name]]]]
end[}]
END[}] | Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[UUID] operator[>] operator[>] identifier[createPrebuiltEntityRoleWithServiceResponseAsync] operator[SEP] identifier[UUID] identifier[appId] , identifier[String] identifier[versionId] , identifier[UUID] identifier[entityId] , identifier[CreatePrebuiltEntityRoleOptionalParameter] identifier[createPrebuiltEntityRoleOptionalParameter] operator[SEP] {
Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[client] operator[SEP] identifier[endpoint] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[appId] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[versionId] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[entityId] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[final] identifier[String] identifier[name] operator[=] identifier[createPrebuiltEntityRoleOptionalParameter] operator[!=] Other[null] operator[?] identifier[createPrebuiltEntityRoleOptionalParameter] operator[SEP] identifier[name] operator[SEP] operator[SEP] operator[:] Other[null] operator[SEP] Keyword[return] identifier[createPrebuiltEntityRoleWithServiceResponseAsync] operator[SEP] identifier[appId] , identifier[versionId] , identifier[entityId] , identifier[name] operator[SEP] operator[SEP]
}
|
public ServiceFuture<List<UsageInner>> listWebWorkerUsagesAsync(final String resourceGroupName, final String name, final String workerPoolName, final ListOperationCallback<UsageInner> serviceCallback) {
return AzureServiceFuture.fromPageResponse(
listWebWorkerUsagesSinglePageAsync(resourceGroupName, name, workerPoolName),
new Func1<String, Observable<ServiceResponse<Page<UsageInner>>>>() {
@Override
public Observable<ServiceResponse<Page<UsageInner>>> call(String nextPageLink) {
return listWebWorkerUsagesNextSinglePageAsync(nextPageLink);
}
},
serviceCallback);
} | class class_name[name] begin[{]
method[listWebWorkerUsagesAsync, return_type[type[ServiceFuture]], modifier[public], parameter[resourceGroupName, name, workerPoolName, serviceCallback]] begin[{]
return[call[AzureServiceFuture.fromPageResponse, parameter[call[.listWebWorkerUsagesSinglePageAsync, parameter[member[.resourceGroupName], member[.name], member[.workerPoolName]]], 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=listWebWorkerUsagesNextSinglePageAsync, 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=UsageInner, 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=UsageInner, 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[UsageInner] operator[>] operator[>] identifier[listWebWorkerUsagesAsync] operator[SEP] Keyword[final] identifier[String] identifier[resourceGroupName] , Keyword[final] identifier[String] identifier[name] , Keyword[final] identifier[String] identifier[workerPoolName] , Keyword[final] identifier[ListOperationCallback] operator[<] identifier[UsageInner] operator[>] identifier[serviceCallback] operator[SEP] {
Keyword[return] identifier[AzureServiceFuture] operator[SEP] identifier[fromPageResponse] operator[SEP] identifier[listWebWorkerUsagesSinglePageAsync] operator[SEP] identifier[resourceGroupName] , identifier[name] , identifier[workerPoolName] operator[SEP] , Keyword[new] identifier[Func1] operator[<] identifier[String] , identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[UsageInner] operator[>] operator[>] operator[>] operator[>] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Observable] operator[<] identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[UsageInner] operator[>] operator[>] operator[>] identifier[call] operator[SEP] identifier[String] identifier[nextPageLink] operator[SEP] {
Keyword[return] identifier[listWebWorkerUsagesNextSinglePageAsync] operator[SEP] identifier[nextPageLink] operator[SEP] operator[SEP]
}
} , identifier[serviceCallback] operator[SEP] operator[SEP]
}
|
public static String getProperty(Class<?> aClass, String key)
{
return getSettings().getProperty(aClass, key);
} | class class_name[name] begin[{]
method[getProperty, return_type[type[String]], modifier[public static], parameter[aClass, key]] begin[{]
return[call[.getSettings, parameter[]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[String] identifier[getProperty] operator[SEP] identifier[Class] operator[<] operator[?] operator[>] identifier[aClass] , identifier[String] identifier[key] operator[SEP] {
Keyword[return] identifier[getSettings] operator[SEP] operator[SEP] operator[SEP] identifier[getProperty] operator[SEP] identifier[aClass] , identifier[key] operator[SEP] operator[SEP]
}
|
private Icon getPressedIcon(AbstractButton b, Icon defaultIcon) {
return getIcon(b, b.getPressedIcon(), defaultIcon, SynthConstants.PRESSED);
} | class class_name[name] begin[{]
method[getPressedIcon, return_type[type[Icon]], modifier[private], parameter[b, defaultIcon]] begin[{]
return[call[.getIcon, parameter[member[.b], call[b.getPressedIcon, parameter[]], member[.defaultIcon], member[SynthConstants.PRESSED]]]]
end[}]
END[}] | Keyword[private] identifier[Icon] identifier[getPressedIcon] operator[SEP] identifier[AbstractButton] identifier[b] , identifier[Icon] identifier[defaultIcon] operator[SEP] {
Keyword[return] identifier[getIcon] operator[SEP] identifier[b] , identifier[b] operator[SEP] identifier[getPressedIcon] operator[SEP] operator[SEP] , identifier[defaultIcon] , identifier[SynthConstants] operator[SEP] identifier[PRESSED] operator[SEP] operator[SEP]
}
|
private void addExportMethod(Map<String, Node> exports, String export, Node context) {
// We can export as a property if any of the following conditions holds:
// a) ES6 class members, which the above `addExportForEs6Method` handles
// b) this is a property on a name which is also being exported
// c) this is a prototype property
String methodOwnerName = null; // the object this method is on, null for exported names.
boolean isEs5StylePrototypeAssignment = false; // If this is a prototype property
String propertyName = null;
if (context.getFirstChild().isGetProp()) { // e.g. `/** @export */ a.prototype.b = obj;`
Node node = context.getFirstChild(); // e.g. get `a.prototype.b`
Node ownerNode = node.getFirstChild(); // e.g. get `a.prototype`
methodOwnerName = ownerNode.getQualifiedName(); // e.g. get the string "a.prototype"
if (ownerNode.isGetProp()
&& ownerNode.getLastChild().getString().equals(PROTOTYPE_PROPERTY)) {
// e.g. true if ownerNode is `a.prototype`
// false if this export were `/** @export */ a.b = obj;` instead
isEs5StylePrototypeAssignment = true;
}
propertyName = node.getSecondChild().getString();
}
boolean useExportSymbol = true;
if (isEs5StylePrototypeAssignment) {
useExportSymbol = false;
} else if (methodOwnerName != null && exports.containsKey(methodOwnerName)) {
useExportSymbol = false;
}
if (useExportSymbol) {
addExportSymbolCall(export, context);
} else {
addExportPropertyCall(methodOwnerName, context, export, propertyName);
}
} | class class_name[name] begin[{]
method[addExportMethod, return_type[void], modifier[private], parameter[exports, export, context]] begin[{]
local_variable[type[String], methodOwnerName]
local_variable[type[boolean], isEs5StylePrototypeAssignment]
local_variable[type[String], propertyName]
if[call[context.getFirstChild, parameter[]]] begin[{]
local_variable[type[Node], node]
local_variable[type[Node], ownerNode]
assign[member[.methodOwnerName], call[ownerNode.getQualifiedName, parameter[]]]
if[binary_operation[call[ownerNode.isGetProp, parameter[]], &&, call[ownerNode.getLastChild, parameter[]]]] begin[{]
assign[member[.isEs5StylePrototypeAssignment], literal[true]]
else begin[{]
None
end[}]
assign[member[.propertyName], call[node.getSecondChild, parameter[]]]
else begin[{]
None
end[}]
local_variable[type[boolean], useExportSymbol]
if[member[.isEs5StylePrototypeAssignment]] begin[{]
assign[member[.useExportSymbol], literal[false]]
else begin[{]
if[binary_operation[binary_operation[member[.methodOwnerName], !=, literal[null]], &&, call[exports.containsKey, parameter[member[.methodOwnerName]]]]] begin[{]
assign[member[.useExportSymbol], literal[false]]
else begin[{]
None
end[}]
end[}]
if[member[.useExportSymbol]] begin[{]
call[.addExportSymbolCall, parameter[member[.export], member[.context]]]
else begin[{]
call[.addExportPropertyCall, parameter[member[.methodOwnerName], member[.context], member[.export], member[.propertyName]]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[addExportMethod] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Node] operator[>] identifier[exports] , identifier[String] identifier[export] , identifier[Node] identifier[context] operator[SEP] {
identifier[String] identifier[methodOwnerName] operator[=] Other[null] operator[SEP] Keyword[boolean] identifier[isEs5StylePrototypeAssignment] operator[=] literal[boolean] operator[SEP] identifier[String] identifier[propertyName] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] identifier[context] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[isGetProp] operator[SEP] operator[SEP] operator[SEP] {
identifier[Node] identifier[node] operator[=] identifier[context] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[Node] identifier[ownerNode] operator[=] identifier[node] operator[SEP] identifier[getFirstChild] operator[SEP] operator[SEP] operator[SEP] identifier[methodOwnerName] operator[=] identifier[ownerNode] operator[SEP] identifier[getQualifiedName] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[ownerNode] operator[SEP] identifier[isGetProp] operator[SEP] operator[SEP] operator[&&] identifier[ownerNode] operator[SEP] identifier[getLastChild] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[PROTOTYPE_PROPERTY] operator[SEP] operator[SEP] {
identifier[isEs5StylePrototypeAssignment] operator[=] literal[boolean] operator[SEP]
}
identifier[propertyName] operator[=] identifier[node] operator[SEP] identifier[getSecondChild] operator[SEP] operator[SEP] operator[SEP] identifier[getString] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[boolean] identifier[useExportSymbol] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[isEs5StylePrototypeAssignment] operator[SEP] {
identifier[useExportSymbol] operator[=] literal[boolean] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[methodOwnerName] operator[!=] Other[null] operator[&&] identifier[exports] operator[SEP] identifier[containsKey] operator[SEP] identifier[methodOwnerName] operator[SEP] operator[SEP] {
identifier[useExportSymbol] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[useExportSymbol] operator[SEP] {
identifier[addExportSymbolCall] operator[SEP] identifier[export] , identifier[context] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[addExportPropertyCall] operator[SEP] identifier[methodOwnerName] , identifier[context] , identifier[export] , identifier[propertyName] operator[SEP] operator[SEP]
}
}
|
protected void setHostKeyType(OpenSshConfig.Host host, Session session) {
HostKey[] hostKeys = session.getHostKeyRepository().getHostKey();
for(HostKey hostKey : hostKeys) {
if(hostKey.getHost().contains(host.getHostName())) {
session.setConfig(KEY_TYPE_CONFIG, hostKey.getType());
}
}
} | class class_name[name] begin[{]
method[setHostKeyType, return_type[void], modifier[protected], parameter[host, session]] begin[{]
local_variable[type[HostKey], hostKeys]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=MethodInvocation(arguments=[], member=getHost, postfix_operators=[], prefix_operators=[], qualifier=hostKey, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getHostName, postfix_operators=[], prefix_operators=[], qualifier=host, selectors=[], type_arguments=None)], member=contains, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=KEY_TYPE_CONFIG, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=hostKey, selectors=[], type_arguments=None)], member=setConfig, postfix_operators=[], prefix_operators=[], qualifier=session, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=hostKeys, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=hostKey)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=HostKey, sub_type=None))), label=None)
end[}]
END[}] | Keyword[protected] Keyword[void] identifier[setHostKeyType] operator[SEP] identifier[OpenSshConfig] operator[SEP] identifier[Host] identifier[host] , identifier[Session] identifier[session] operator[SEP] {
identifier[HostKey] operator[SEP] operator[SEP] identifier[hostKeys] operator[=] identifier[session] operator[SEP] identifier[getHostKeyRepository] operator[SEP] operator[SEP] operator[SEP] identifier[getHostKey] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[HostKey] identifier[hostKey] operator[:] identifier[hostKeys] operator[SEP] {
Keyword[if] operator[SEP] identifier[hostKey] operator[SEP] identifier[getHost] operator[SEP] operator[SEP] operator[SEP] identifier[contains] operator[SEP] identifier[host] operator[SEP] identifier[getHostName] operator[SEP] operator[SEP] operator[SEP] operator[SEP] {
identifier[session] operator[SEP] identifier[setConfig] operator[SEP] identifier[KEY_TYPE_CONFIG] , identifier[hostKey] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
public void setActiveButton(I_CmsToolbarButton button) {
m_activeButton = button;
setEditButtonsVisible((button == null) || m_editor.getSelection().equals(button));
} | class class_name[name] begin[{]
method[setActiveButton, return_type[void], modifier[public], parameter[button]] begin[{]
assign[member[.m_activeButton], member[.button]]
call[.setEditButtonsVisible, parameter[binary_operation[binary_operation[member[.button], ==, literal[null]], ||, call[m_editor.getSelection, parameter[]]]]]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[setActiveButton] operator[SEP] identifier[I_CmsToolbarButton] identifier[button] operator[SEP] {
identifier[m_activeButton] operator[=] identifier[button] operator[SEP] identifier[setEditButtonsVisible] operator[SEP] operator[SEP] identifier[button] operator[==] Other[null] operator[SEP] operator[||] identifier[m_editor] operator[SEP] identifier[getSelection] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[button] operator[SEP] operator[SEP] operator[SEP]
}
|
@Nonnull
public <V extends T> LObjIntLongFunctionBuilder<T, R> aCase(Class<V> argC1, LObjIntLongFunction<V, R> function) {
PartialCaseWithProduct.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)));
pc.evaluate(function);
return self();
} | class class_name[name] begin[{]
method[aCase, return_type[type[LObjIntLongFunctionBuilder]], modifier[public], parameter[argC1, function]] begin[{]
local_variable[type[PartialCaseWithProduct], pc]
call[pc.evaluate, parameter[member[.function]]]
return[call[.self, parameter[]]]
end[}]
END[}] | annotation[@] identifier[Nonnull] Keyword[public] operator[<] identifier[V] Keyword[extends] identifier[T] operator[>] identifier[LObjIntLongFunctionBuilder] operator[<] identifier[T] , identifier[R] operator[>] identifier[aCase] operator[SEP] identifier[Class] operator[<] identifier[V] operator[>] identifier[argC1] , identifier[LObjIntLongFunction] operator[<] identifier[V] , identifier[R] operator[>] identifier[function] operator[SEP] {
identifier[PartialCaseWithProduct] operator[SEP] identifier[The] identifier[pc] operator[=] identifier[partialCaseFactoryMethod] operator[SEP] operator[SEP] identifier[a1] , identifier[a2] , identifier[a3] operator[SEP] operator[->] operator[SEP] identifier[argC1] operator[==] Other[null] operator[||] identifier[argC1] operator[SEP] identifier[isInstance] operator[SEP] identifier[a1] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[pc] operator[SEP] identifier[evaluate] operator[SEP] identifier[function] operator[SEP] operator[SEP] Keyword[return] identifier[self] operator[SEP] operator[SEP] operator[SEP]
}
|
public static <T> Set<T> newLinkedHashSet(Iterable<? extends T> elements) {
return Sets.newLinkedHashSet(elements);
} | class class_name[name] begin[{]
method[newLinkedHashSet, return_type[type[Set]], modifier[public static], parameter[elements]] begin[{]
return[call[Sets.newLinkedHashSet, parameter[member[.elements]]]]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[Set] operator[<] identifier[T] operator[>] identifier[newLinkedHashSet] operator[SEP] identifier[Iterable] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[elements] operator[SEP] {
Keyword[return] identifier[Sets] operator[SEP] identifier[newLinkedHashSet] operator[SEP] identifier[elements] operator[SEP] operator[SEP]
}
|
@Override
public void infoSeeFromWest(ControllerPlayer c, double distance, double direction, double distChange,
double dirChange, double bodyFacingDirection, double headFacingDirection) {
c.infoSeePlayerOther(number, goalie, distance, direction, distChange, dirChange, bodyFacingDirection,
headFacingDirection);
} | class class_name[name] begin[{]
method[infoSeeFromWest, return_type[void], modifier[public], parameter[c, distance, direction, distChange, dirChange, bodyFacingDirection, headFacingDirection]] begin[{]
call[c.infoSeePlayerOther, parameter[member[.number], member[.goalie], member[.distance], member[.direction], member[.distChange], member[.dirChange], member[.bodyFacingDirection], member[.headFacingDirection]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[infoSeeFromWest] operator[SEP] identifier[ControllerPlayer] identifier[c] , Keyword[double] identifier[distance] , Keyword[double] identifier[direction] , Keyword[double] identifier[distChange] , Keyword[double] identifier[dirChange] , Keyword[double] identifier[bodyFacingDirection] , Keyword[double] identifier[headFacingDirection] operator[SEP] {
identifier[c] operator[SEP] identifier[infoSeePlayerOther] operator[SEP] identifier[number] , identifier[goalie] , identifier[distance] , identifier[direction] , identifier[distChange] , identifier[dirChange] , identifier[bodyFacingDirection] , identifier[headFacingDirection] operator[SEP] operator[SEP]
}
|
public static <K, V> CacheEvent<K, V> removal(K removedKey, V removedValue, Cache<K, V> source) {
return new RemovalEvent<>(removedKey, removedValue, source);
} | class class_name[name] begin[{]
method[removal, return_type[type[CacheEvent]], modifier[public static], parameter[removedKey, removedValue, source]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=removedKey, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=removedValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=source, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=RemovalEvent, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[K] , identifier[V] operator[>] identifier[CacheEvent] operator[<] identifier[K] , identifier[V] operator[>] identifier[removal] operator[SEP] identifier[K] identifier[removedKey] , identifier[V] identifier[removedValue] , identifier[Cache] operator[<] identifier[K] , identifier[V] operator[>] identifier[source] operator[SEP] {
Keyword[return] Keyword[new] identifier[RemovalEvent] operator[<] operator[>] operator[SEP] identifier[removedKey] , identifier[removedValue] , identifier[source] operator[SEP] operator[SEP]
}
|
protected PListAccessor getInfoPListAccessor(XCodeContext.SourceCodeLocation location, String configuration,
String sdk)
throws MojoExecutionException, XCodeException
{
File plistFile = getPListFile(location, configuration, sdk);
if (!plistFile.isFile()) {
throw new MojoExecutionException("The Xcode project refers to the Info.plist file '" + plistFile
+ "' that does not exist.");
}
return new PListAccessor(plistFile);
} | class class_name[name] begin[{]
method[getInfoPListAccessor, return_type[type[PListAccessor]], modifier[protected], parameter[location, configuration, sdk]] begin[{]
local_variable[type[File], plistFile]
if[call[plistFile.isFile, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The Xcode project refers to the Info.plist file '"), operandr=MemberReference(member=plistFile, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="' that does not exist."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=MojoExecutionException, sub_type=None)), label=None)
else begin[{]
None
end[}]
return[ClassCreator(arguments=[MemberReference(member=plistFile, 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=PListAccessor, sub_type=None))]
end[}]
END[}] | Keyword[protected] identifier[PListAccessor] identifier[getInfoPListAccessor] operator[SEP] identifier[XCodeContext] operator[SEP] identifier[SourceCodeLocation] identifier[location] , identifier[String] identifier[configuration] , identifier[String] identifier[sdk] operator[SEP] Keyword[throws] identifier[MojoExecutionException] , identifier[XCodeException] {
identifier[File] identifier[plistFile] operator[=] identifier[getPListFile] operator[SEP] identifier[location] , identifier[configuration] , identifier[sdk] operator[SEP] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[plistFile] operator[SEP] identifier[isFile] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[MojoExecutionException] operator[SEP] literal[String] operator[+] identifier[plistFile] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[return] Keyword[new] identifier[PListAccessor] operator[SEP] identifier[plistFile] operator[SEP] operator[SEP]
}
|
@Override
public boolean decompose( ZMatrixRMaj A ) {
init(A);
for( int k = 0; k < N-1; k++ ) {
similarTransform(k);
}
return true;
} | class class_name[name] begin[{]
method[decompose, return_type[type[boolean]], modifier[public], parameter[A]] begin[{]
call[.init, parameter[member[.A]]]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=similarTransform, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=MemberReference(member=N, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=-), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[literal[true]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[decompose] operator[SEP] identifier[ZMatrixRMaj] identifier[A] operator[SEP] {
identifier[init] operator[SEP] identifier[A] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[0] operator[SEP] identifier[k] operator[<] identifier[N] operator[-] Other[1] operator[SEP] identifier[k] operator[++] operator[SEP] {
identifier[similarTransform] operator[SEP] identifier[k] operator[SEP] operator[SEP]
}
Keyword[return] literal[boolean] operator[SEP]
}
|
private String getResizeJavaScript() {
StringBuilder sb = new StringBuilder();
sb.append("$(window).bind(\'resizeEnd\',function(){");
sb.append(getDisplayCall());
sb.append("});");
return sb.toString();
} | class class_name[name] begin[{]
method[getResizeJavaScript, return_type[type[String]], modifier[private], parameter[]] begin[{]
local_variable[type[StringBuilder], sb]
call[sb.append, parameter[literal["$(window).bind(\'resizeEnd\',function(){"]]]
call[sb.append, parameter[call[.getDisplayCall, parameter[]]]]
call[sb.append, parameter[literal["});"]]]
return[call[sb.toString, parameter[]]]
end[}]
END[}] | Keyword[private] identifier[String] identifier[getResizeJavaScript] operator[SEP] operator[SEP] {
identifier[StringBuilder] identifier[sb] operator[=] Keyword[new] identifier[StringBuilder] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] identifier[getDisplayCall] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sb] operator[SEP] identifier[append] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[sb] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP]
}
|
protected Component newListPanel(final String id, final IModel<ContentListModelBean> model)
{
return new ResourceBundleKeysPanel(id, model.getObject().getContentResourceKeys())
{
private static final long serialVersionUID = 1L;
@Override
protected Component newListComponent(final String id,
final ListItem<ResourceBundleKey> item)
{
return HeaderContentListPanel.this.newListComponent(id, item);
}
};
} | class class_name[name] begin[{]
method[newListPanel, return_type[type[Component]], modifier[protected], parameter[id, model]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getObject, postfix_operators=[], prefix_operators=[], qualifier=model, selectors=[MethodInvocation(arguments=[], member=getContentResourceKeys, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=[FieldDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1L), name=serialVersionUID)], documentation=None, modifiers={'final', 'private', 'static'}, type=BasicType(dimensions=[], name=long)), MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=This(postfix_operators=[], prefix_operators=[], qualifier=HeaderContentListPanel, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=item, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newListComponent, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)]), label=None)], documentation=None, modifiers={'protected'}, name=newListComponent, parameters=[FormalParameter(annotations=[], modifiers={'final'}, name=id, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None), varargs=False), FormalParameter(annotations=[], modifiers={'final'}, name=item, type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ResourceBundleKey, sub_type=None))], dimensions=[], name=ListItem, sub_type=None), varargs=False)], return_type=ReferenceType(arguments=None, dimensions=[], name=Component, sub_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=ResourceBundleKeysPanel, sub_type=None))]
end[}]
END[}] | Keyword[protected] identifier[Component] identifier[newListPanel] operator[SEP] Keyword[final] identifier[String] identifier[id] , Keyword[final] identifier[IModel] operator[<] identifier[ContentListModelBean] operator[>] identifier[model] operator[SEP] {
Keyword[return] Keyword[new] identifier[ResourceBundleKeysPanel] operator[SEP] identifier[id] , identifier[model] operator[SEP] identifier[getObject] operator[SEP] operator[SEP] operator[SEP] identifier[getContentResourceKeys] operator[SEP] operator[SEP] operator[SEP] {
Keyword[private] Keyword[static] Keyword[final] Keyword[long] identifier[serialVersionUID] operator[=] Other[1L] operator[SEP] annotation[@] identifier[Override] Keyword[protected] identifier[Component] identifier[newListComponent] operator[SEP] Keyword[final] identifier[String] identifier[id] , Keyword[final] identifier[ListItem] operator[<] identifier[ResourceBundleKey] operator[>] identifier[item] operator[SEP] {
Keyword[return] identifier[HeaderContentListPanel] operator[SEP] Keyword[this] operator[SEP] identifier[newListComponent] operator[SEP] identifier[id] , identifier[item] operator[SEP] operator[SEP]
}
} operator[SEP]
}
|
public void pushParameterStack()
{
if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){ //306998.15
logger.logp(Level.FINE, CLASS_NAME,"pushParameterStack", "entry");
}
if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){
checkRequestObjectInUse();
}
SRTServletRequestThreadData reqData = SRTServletRequestThreadData.getInstance();
if (reqData.getParameters() == null)
{
reqData.pushParameterStack(null);
} else
{
_paramStack.push(((Hashtable) reqData.getParameters()).clone());
}
if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE) && reqData.getParameters() !=null) //306998.15
{
debugParams(reqData.getParameters());
}
} | class class_name[name] begin[{]
method[pushParameterStack, return_type[void], modifier[public], parameter[]] begin[{]
if[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[logger.isLoggable, parameter[member[Level.FINE]]]]] begin[{]
call[logger.logp, parameter[member[Level.FINE], member[.CLASS_NAME], literal["pushParameterStack"], literal["entry"]]]
else begin[{]
None
end[}]
if[member[WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE]] begin[{]
call[.checkRequestObjectInUse, parameter[]]
else begin[{]
None
end[}]
local_variable[type[SRTServletRequestThreadData], reqData]
if[binary_operation[call[reqData.getParameters, parameter[]], ==, literal[null]]] begin[{]
call[reqData.pushParameterStack, parameter[literal[null]]]
else begin[{]
call[_paramStack.push, parameter[Cast(expression=MethodInvocation(arguments=[], member=getParameters, postfix_operators=[], prefix_operators=[], qualifier=reqData, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=Hashtable, sub_type=None))]]
end[}]
if[binary_operation[binary_operation[call[TraceComponent.isAnyTracingEnabled, parameter[]], &&, call[logger.isLoggable, parameter[member[Level.FINE]]]], &&, binary_operation[call[reqData.getParameters, parameter[]], !=, literal[null]]]] begin[{]
call[.debugParams, parameter[call[reqData.getParameters, parameter[]]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[pushParameterStack] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[SEP] {
identifier[logger] operator[SEP] identifier[logp] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] , identifier[CLASS_NAME] , literal[String] , literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[WCCustomProperties] operator[SEP] identifier[CHECK_REQUEST_OBJECT_IN_USE] operator[SEP] {
identifier[checkRequestObjectInUse] operator[SEP] operator[SEP] operator[SEP]
}
identifier[SRTServletRequestThreadData] identifier[reqData] operator[=] identifier[SRTServletRequestThreadData] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[reqData] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[reqData] operator[SEP] identifier[pushParameterStack] operator[SEP] Other[null] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[_paramStack] operator[SEP] identifier[push] operator[SEP] operator[SEP] operator[SEP] identifier[Hashtable] operator[SEP] identifier[reqData] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[clone] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[TraceComponent] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[logger] operator[SEP] identifier[isLoggable] operator[SEP] identifier[Level] operator[SEP] identifier[FINE] operator[SEP] operator[&&] identifier[reqData] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[!=] Other[null] operator[SEP] {
identifier[debugParams] operator[SEP] identifier[reqData] operator[SEP] identifier[getParameters] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
private static Path getFileFromZip(Path path) {
byte[] buffer = new byte[1024];
try {
Path outputDir = new TempDirectory("robolectric_assets").create("fromzip");
try (InputStream zis = Fs.getInputStream(path)) {
Path fileFromZip = outputDir.resolve(path.getFileName().toString());
try (OutputStream fos = Files.newOutputStream(fileFromZip)) {
int len;
while ((len = zis.read(buffer)) > 0) {
fos.write(buffer, 0, len);
}
}
return fileFromZip;
}
} catch (IOException e) {
throw new RuntimeException(e);
}
} | class class_name[name] begin[{]
method[getFileFromZip, return_type[type[Path]], modifier[private static], parameter[path]] begin[{]
local_variable[type[byte], buffer]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="robolectric_assets")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="fromzip")], member=create, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=TempDirectory, sub_type=None)), name=outputDir)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getFileName, postfix_operators=[], prefix_operators=[], qualifier=path, selectors=[MethodInvocation(arguments=[], member=toString, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], member=resolve, postfix_operators=[], prefix_operators=[], qualifier=outputDir, selectors=[], type_arguments=None), name=fileFromZip)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Path, sub_type=None)), TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=None, name=len)], modifiers=set(), type=BasicType(dimensions=[], name=int)), WhileStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=write, postfix_operators=[], prefix_operators=[], qualifier=fos, selectors=[], type_arguments=None), label=None)]), condition=BinaryOperation(operandl=Assignment(expressionl=MemberReference(member=len, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=buffer, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=read, postfix_operators=[], prefix_operators=[], qualifier=zis, selectors=[], type_arguments=None)), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=fos, type=ReferenceType(arguments=None, dimensions=[], name=OutputStream, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=fileFromZip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=newOutputStream, postfix_operators=[], prefix_operators=[], qualifier=Files, selectors=[], type_arguments=None))]), ReturnStatement(expression=MemberReference(member=fileFromZip, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=None, finally_block=None, label=None, resources=[TryResource(annotations=[], modifiers=set(), name=zis, type=ReferenceType(arguments=None, dimensions=[], name=InputStream, sub_type=None), value=MethodInvocation(arguments=[MemberReference(member=path, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getInputStream, postfix_operators=[], prefix_operators=[], qualifier=Fs, selectors=[], type_arguments=None))])], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=RuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['IOException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Path] identifier[getFileFromZip] operator[SEP] identifier[Path] identifier[path] operator[SEP] {
Keyword[byte] operator[SEP] operator[SEP] identifier[buffer] operator[=] Keyword[new] Keyword[byte] operator[SEP] Other[1024] operator[SEP] operator[SEP] Keyword[try] {
identifier[Path] identifier[outputDir] operator[=] Keyword[new] identifier[TempDirectory] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[create] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[InputStream] identifier[zis] operator[=] identifier[Fs] operator[SEP] identifier[getInputStream] operator[SEP] identifier[path] operator[SEP] operator[SEP] {
identifier[Path] identifier[fileFromZip] operator[=] identifier[outputDir] operator[SEP] identifier[resolve] operator[SEP] identifier[path] operator[SEP] identifier[getFileName] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[try] operator[SEP] identifier[OutputStream] identifier[fos] operator[=] identifier[Files] operator[SEP] identifier[newOutputStream] operator[SEP] identifier[fileFromZip] operator[SEP] operator[SEP] {
Keyword[int] identifier[len] operator[SEP] Keyword[while] operator[SEP] operator[SEP] identifier[len] operator[=] identifier[zis] operator[SEP] identifier[read] operator[SEP] identifier[buffer] operator[SEP] operator[SEP] operator[>] Other[0] operator[SEP] {
identifier[fos] operator[SEP] identifier[write] operator[SEP] identifier[buffer] , Other[0] , identifier[len] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[fileFromZip] operator[SEP]
}
}
Keyword[catch] operator[SEP] identifier[IOException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[RuntimeException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public void performRecovery(ObjectManagerState objectManagerState)
throws ObjectManagerException
{
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.entry(this,
cclass,
"performRecovery",
objectManagerState);
// Recover the ObjectManagerState from its serialized bytes.
ObjectManagerState recoveredObjectManagerState = (ObjectManagerState) ManagedObject.restoreFromSerializedBytes(objectManagerStateBytes,
objectManagerState);
if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
trace.debug(this, cclass
, "recoveredObjectManagerState=" + recoveredObjectManagerState + "(ObjectManagerState)"
);
// Make ObjectManagerState the recovered version.
objectManagerStateToken.setManagedObject(recoveredObjectManagerState);
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
trace.exit(this,
cclass,
"performRecovery");
} | class class_name[name] begin[{]
method[performRecovery, return_type[void], modifier[public], parameter[objectManagerState]] begin[{]
if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{]
call[trace.entry, parameter[THIS[], member[.cclass], literal["performRecovery"], member[.objectManagerState]]]
else begin[{]
None
end[}]
local_variable[type[ObjectManagerState], recoveredObjectManagerState]
if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isDebugEnabled, parameter[]]]] begin[{]
call[trace.debug, parameter[THIS[], member[.cclass], binary_operation[binary_operation[literal["recoveredObjectManagerState="], +, member[.recoveredObjectManagerState]], +, literal["(ObjectManagerState)"]]]]
else begin[{]
None
end[}]
call[objectManagerStateToken.setManagedObject, parameter[member[.recoveredObjectManagerState]]]
if[binary_operation[call[Tracing.isAnyTracingEnabled, parameter[]], &&, call[trace.isEntryEnabled, parameter[]]]] begin[{]
call[trace.exit, parameter[THIS[], member[.cclass], literal["performRecovery"]]]
else begin[{]
None
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[performRecovery] operator[SEP] identifier[ObjectManagerState] identifier[objectManagerState] operator[SEP] Keyword[throws] identifier[ObjectManagerException] {
Keyword[if] operator[SEP] identifier[Tracing] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[entry] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] , identifier[objectManagerState] operator[SEP] operator[SEP] identifier[ObjectManagerState] identifier[recoveredObjectManagerState] operator[=] operator[SEP] identifier[ObjectManagerState] operator[SEP] identifier[ManagedObject] operator[SEP] identifier[restoreFromSerializedBytes] operator[SEP] identifier[objectManagerStateBytes] , identifier[objectManagerState] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Tracing] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[debug] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] operator[+] identifier[recoveredObjectManagerState] operator[+] literal[String] operator[SEP] operator[SEP] identifier[objectManagerStateToken] operator[SEP] identifier[setManagedObject] operator[SEP] identifier[recoveredObjectManagerState] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[Tracing] operator[SEP] identifier[isAnyTracingEnabled] operator[SEP] operator[SEP] operator[&&] identifier[trace] operator[SEP] identifier[isEntryEnabled] operator[SEP] operator[SEP] operator[SEP] identifier[trace] operator[SEP] identifier[exit] operator[SEP] Keyword[this] , identifier[cclass] , literal[String] operator[SEP] operator[SEP]
}
|
public boolean handleControlWord(RtfCtrlWordData ctrlWordData) {
boolean result = true;
// just let fonttbl fall through and set last ctrl word object.
if(ctrlWordData.ctrlWord.equals("f")) { this.setFontNumber(ctrlWordData.param); result=true;}
if(ctrlWordData.ctrlWord.equals("fcharset")) { this.setCharset(ctrlWordData.param); result=true; }
// font families
if(ctrlWordData.ctrlWord.equals("fnil")) { this.setFontFamily("roman"); result=true; }
if(ctrlWordData.ctrlWord.equals("froman")) { this.setFontFamily("roman"); result=true; }
if(ctrlWordData.ctrlWord.equals("fswiss")) { this.setFontFamily("swiss"); result=true; }
if(ctrlWordData.ctrlWord.equals("fmodern")) { this.setFontFamily("modern"); result=true; }
if(ctrlWordData.ctrlWord.equals("fscript")) { this.setFontFamily("script"); result=true; }
if(ctrlWordData.ctrlWord.equals("fdecor")) { this.setFontFamily("decor"); result=true; }
if(ctrlWordData.ctrlWord.equals("ftech")) { this.setFontFamily("tech"); result=true; }
if(ctrlWordData.ctrlWord.equals("fbidi")) { this.setFontFamily("bidi"); result=true; }
// pitch
if(ctrlWordData.ctrlWord.equals("fprq")) { this.setPitch(ctrlWordData.param); result=true; }
// bias
if(ctrlWordData.ctrlWord.equals("fbias")) { this.setBias(ctrlWordData.param); result=true; }
// theme font information
if(ctrlWordData.ctrlWord.equals("flomajor")) { this.setThemeFont("flomajor"); result= true; }
if(ctrlWordData.ctrlWord.equals("fhimajor")) { this.setThemeFont("fhimajor"); result= true; }
if(ctrlWordData.ctrlWord.equals("fdbmajor")) { this.setThemeFont("fdbmajor"); result= true; }
if(ctrlWordData.ctrlWord.equals("fbimajor")) { this.setThemeFont("fbimajor"); result= true; }
if(ctrlWordData.ctrlWord.equals("flominor")) { this.setThemeFont("flominor"); result= true; }
if(ctrlWordData.ctrlWord.equals("fhiminor")) { this.setThemeFont("fhiminor"); result= true; }
if(ctrlWordData.ctrlWord.equals("fdbminor")) { this.setThemeFont("fdbminor"); result= true; }
if(ctrlWordData.ctrlWord.equals("fbiminor")) { this.setThemeFont("fbiminor"); result= true; }
// panose
if(ctrlWordData.ctrlWord.equals("panose")) {state = SETTING_PANOSE; result = true; }
// \*\fname
// <font name> #PCDATA
if(ctrlWordData.ctrlWord.equals("fname")) {state = SETTING_FONTNAME; result = true; }
// \*\falt
if(ctrlWordData.ctrlWord.equals("falt")) { state = SETTING_ALTERNATE; result = true; }
// \*\fontemb
if(ctrlWordData.ctrlWord.equals("fontemb")) { state = SETTING_FONT_EMBED; result = true; }
// font type
if(ctrlWordData.ctrlWord.equals("ftnil")) { this.setTrueType("ftnil"); result= true; }
if(ctrlWordData.ctrlWord.equals("fttruetype")) { this.setTrueType("fttruetype"); result= true; }
// \*\fontfile
if(ctrlWordData.ctrlWord.equals("fontemb")) { state = SETTING_FONT_FILE; result = true; }
// codepage
if(ctrlWordData.ctrlWord.equals("cpg")) { this.setCodePage(ctrlWordData.param); result= true; }
this.lastCtrlWord = ctrlWordData;
return result;
} | class class_name[name] begin[{]
method[handleControlWord, return_type[type[boolean]], modifier[public], parameter[ctrlWordData]] begin[{]
local_variable[type[boolean], result]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["f"]]]] begin[{]
THIS[call[None.setFontNumber, parameter[member[ctrlWordData.param]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fcharset"]]]] begin[{]
THIS[call[None.setCharset, parameter[member[ctrlWordData.param]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fnil"]]]] begin[{]
THIS[call[None.setFontFamily, parameter[literal["roman"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["froman"]]]] begin[{]
THIS[call[None.setFontFamily, parameter[literal["roman"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fswiss"]]]] begin[{]
THIS[call[None.setFontFamily, parameter[literal["swiss"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fmodern"]]]] begin[{]
THIS[call[None.setFontFamily, parameter[literal["modern"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fscript"]]]] begin[{]
THIS[call[None.setFontFamily, parameter[literal["script"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fdecor"]]]] begin[{]
THIS[call[None.setFontFamily, parameter[literal["decor"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["ftech"]]]] begin[{]
THIS[call[None.setFontFamily, parameter[literal["tech"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fbidi"]]]] begin[{]
THIS[call[None.setFontFamily, parameter[literal["bidi"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fprq"]]]] begin[{]
THIS[call[None.setPitch, parameter[member[ctrlWordData.param]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fbias"]]]] begin[{]
THIS[call[None.setBias, parameter[member[ctrlWordData.param]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["flomajor"]]]] begin[{]
THIS[call[None.setThemeFont, parameter[literal["flomajor"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fhimajor"]]]] begin[{]
THIS[call[None.setThemeFont, parameter[literal["fhimajor"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fdbmajor"]]]] begin[{]
THIS[call[None.setThemeFont, parameter[literal["fdbmajor"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fbimajor"]]]] begin[{]
THIS[call[None.setThemeFont, parameter[literal["fbimajor"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["flominor"]]]] begin[{]
THIS[call[None.setThemeFont, parameter[literal["flominor"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fhiminor"]]]] begin[{]
THIS[call[None.setThemeFont, parameter[literal["fhiminor"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fdbminor"]]]] begin[{]
THIS[call[None.setThemeFont, parameter[literal["fdbminor"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fbiminor"]]]] begin[{]
THIS[call[None.setThemeFont, parameter[literal["fbiminor"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["panose"]]]] begin[{]
assign[member[.state], member[.SETTING_PANOSE]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fname"]]]] begin[{]
assign[member[.state], member[.SETTING_FONTNAME]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["falt"]]]] begin[{]
assign[member[.state], member[.SETTING_ALTERNATE]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fontemb"]]]] begin[{]
assign[member[.state], member[.SETTING_FONT_EMBED]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["ftnil"]]]] begin[{]
THIS[call[None.setTrueType, parameter[literal["ftnil"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fttruetype"]]]] begin[{]
THIS[call[None.setTrueType, parameter[literal["fttruetype"]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["fontemb"]]]] begin[{]
assign[member[.state], member[.SETTING_FONT_FILE]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
if[call[ctrlWordData.ctrlWord.equals, parameter[literal["cpg"]]]] begin[{]
THIS[call[None.setCodePage, parameter[member[ctrlWordData.param]]]]
assign[member[.result], literal[true]]
else begin[{]
None
end[}]
assign[THIS[member[None.lastCtrlWord]], member[.ctrlWordData]]
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[boolean] identifier[handleControlWord] operator[SEP] identifier[RtfCtrlWordData] identifier[ctrlWordData] operator[SEP] {
Keyword[boolean] identifier[result] operator[=] literal[boolean] operator[SEP] Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setFontNumber] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[param] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setCharset] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[param] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setFontFamily] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setFontFamily] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setFontFamily] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setFontFamily] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setFontFamily] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setFontFamily] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setFontFamily] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setFontFamily] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setPitch] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[param] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setBias] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[param] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setThemeFont] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setThemeFont] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setThemeFont] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setThemeFont] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setThemeFont] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setThemeFont] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setThemeFont] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setThemeFont] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[state] operator[=] identifier[SETTING_PANOSE] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[state] operator[=] identifier[SETTING_FONTNAME] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[state] operator[=] identifier[SETTING_ALTERNATE] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[state] operator[=] identifier[SETTING_FONT_EMBED] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setTrueType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setTrueType] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
identifier[state] operator[=] identifier[SETTING_FONT_FILE] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[if] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[ctrlWord] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[setCodePage] operator[SEP] identifier[ctrlWordData] operator[SEP] identifier[param] operator[SEP] operator[SEP] identifier[result] operator[=] literal[boolean] operator[SEP]
}
Keyword[this] operator[SEP] identifier[lastCtrlWord] operator[=] identifier[ctrlWordData] operator[SEP] Keyword[return] identifier[result] operator[SEP]
}
|
public float[] t1(float[] z, int k) {
float[] result = new float[z.length];
for (int i = 0; i < z.length; i++) {
result[i] = (new Transformations()).sMulti(z[i], 30, 10, (float) 0.35);
}
return result;
} | class class_name[name] begin[{]
method[t1, return_type[type[float]], modifier[public], parameter[z, k]] begin[{]
local_variable[type[float], result]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=z, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=30), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=10), Cast(expression=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0.35), type=BasicType(dimensions=[], name=float))], member=sMulti, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type=ReferenceType(arguments=None, dimensions=None, name=Transformations, sub_type=None))), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=length, postfix_operators=[], prefix_operators=[], qualifier=z, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[float] operator[SEP] operator[SEP] identifier[t1] operator[SEP] Keyword[float] operator[SEP] operator[SEP] identifier[z] , Keyword[int] identifier[k] operator[SEP] {
Keyword[float] operator[SEP] operator[SEP] identifier[result] operator[=] Keyword[new] Keyword[float] operator[SEP] identifier[z] 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[z] operator[SEP] identifier[length] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[result] operator[SEP] identifier[i] operator[SEP] operator[=] operator[SEP] Keyword[new] identifier[Transformations] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[sMulti] operator[SEP] identifier[z] operator[SEP] identifier[i] operator[SEP] , Other[30] , Other[10] , operator[SEP] Keyword[float] operator[SEP] literal[Float] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public static <T> ConstructorExpression<T> constructor(Class<? extends T> type, Class<?>[] paramTypes, Expression<?>... exprs) {
return new ConstructorExpression<T>(type, paramTypes, exprs);
} | class class_name[name] begin[{]
method[constructor, return_type[type[ConstructorExpression]], modifier[public static], parameter[type, paramTypes, exprs]] begin[{]
return[ClassCreator(arguments=[MemberReference(member=type, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=paramTypes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=exprs, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))], dimensions=None, name=ConstructorExpression, sub_type=None))]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] operator[>] identifier[ConstructorExpression] operator[<] identifier[T] operator[>] identifier[constructor] operator[SEP] identifier[Class] operator[<] operator[?] Keyword[extends] identifier[T] operator[>] identifier[type] , identifier[Class] operator[<] operator[?] operator[>] operator[SEP] operator[SEP] identifier[paramTypes] , identifier[Expression] operator[<] operator[?] operator[>] operator[...] identifier[exprs] operator[SEP] {
Keyword[return] Keyword[new] identifier[ConstructorExpression] operator[<] identifier[T] operator[>] operator[SEP] identifier[type] , identifier[paramTypes] , identifier[exprs] operator[SEP] operator[SEP]
}
|
public ISynchronizationPoint<IOException> start(byte priority, WorkProgress progress, long work) {
JoinPoint<IOException> jp = new JoinPoint<>();
jp.addToJoin(1);
processDirectory("", root, rootObject, jp, priority, progress, work);
jp.start();
return jp;
} | class class_name[name] begin[{]
method[start, return_type[type[ISynchronizationPoint]], modifier[public], parameter[priority, progress, work]] begin[{]
local_variable[type[JoinPoint], jp]
call[jp.addToJoin, parameter[literal[1]]]
call[.processDirectory, parameter[literal[""], member[.root], member[.rootObject], member[.jp], member[.priority], member[.progress], member[.work]]]
call[jp.start, parameter[]]
return[member[.jp]]
end[}]
END[}] | Keyword[public] identifier[ISynchronizationPoint] operator[<] identifier[IOException] operator[>] identifier[start] operator[SEP] Keyword[byte] identifier[priority] , identifier[WorkProgress] identifier[progress] , Keyword[long] identifier[work] operator[SEP] {
identifier[JoinPoint] operator[<] identifier[IOException] operator[>] identifier[jp] operator[=] Keyword[new] identifier[JoinPoint] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[jp] operator[SEP] identifier[addToJoin] operator[SEP] Other[1] operator[SEP] operator[SEP] identifier[processDirectory] operator[SEP] literal[String] , identifier[root] , identifier[rootObject] , identifier[jp] , identifier[priority] , identifier[progress] , identifier[work] operator[SEP] operator[SEP] identifier[jp] operator[SEP] identifier[start] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[jp] operator[SEP]
}
|
private void gatherInfoFromURL(URL url) throws MalformedURLException {
// Weird VFS behavior... returns jar:file:...jar!/
if(url.getProtocol().equals("jar")) {
this.url = new URL(url.getFile().replaceFirst("!/", "/"));
}
else {
this.url = url;
}
this.fullPath = this.url.getFile();
this.fileName = getFileNameInternal(fullPath);
} | class class_name[name] begin[{]
method[gatherInfoFromURL, return_type[void], modifier[private], parameter[url]] begin[{]
if[call[url.getProtocol, parameter[]]] begin[{]
assign[THIS[member[None.url]], ClassCreator(arguments=[MethodInvocation(arguments=[], member=getFile, postfix_operators=[], prefix_operators=[], qualifier=url, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="!/"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="/")], member=replaceFirst, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=URL, sub_type=None))]
else begin[{]
assign[THIS[member[None.url]], member[.url]]
end[}]
assign[THIS[member[None.fullPath]], THIS[member[None.url]call[None.getFile, parameter[]]]]
assign[THIS[member[None.fileName]], call[.getFileNameInternal, parameter[member[.fullPath]]]]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[gatherInfoFromURL] operator[SEP] identifier[URL] identifier[url] operator[SEP] Keyword[throws] identifier[MalformedURLException] {
Keyword[if] operator[SEP] identifier[url] operator[SEP] identifier[getProtocol] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[this] operator[SEP] identifier[url] operator[=] Keyword[new] identifier[URL] operator[SEP] identifier[url] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[this] operator[SEP] identifier[url] operator[=] identifier[url] operator[SEP]
}
Keyword[this] operator[SEP] identifier[fullPath] operator[=] Keyword[this] operator[SEP] identifier[url] operator[SEP] identifier[getFile] operator[SEP] operator[SEP] operator[SEP] Keyword[this] operator[SEP] identifier[fileName] operator[=] identifier[getFileNameInternal] operator[SEP] identifier[fullPath] operator[SEP] operator[SEP]
}
|
@Override
public boolean route(String msg, LogRecord logRecord) {
if (!isValidMessage(msg)) {
return true;
}
Set<String> logHandlerIdSet = getLogHandlersForMessage(msg);
if (logHandlerIdSet == null) {
// There are no routing requirements for this msgId.
// Return true to tell the caller to log the msg normally.
return true;
} else {
// Route to all LogHandlers in the list.
return routeToAll(msg, logRecord, logHandlerIdSet);
}
} | class class_name[name] begin[{]
method[route, return_type[type[boolean]], modifier[public], parameter[msg, logRecord]] begin[{]
if[call[.isValidMessage, parameter[member[.msg]]]] begin[{]
return[literal[true]]
else begin[{]
None
end[}]
local_variable[type[Set], logHandlerIdSet]
if[binary_operation[member[.logHandlerIdSet], ==, literal[null]]] begin[{]
return[literal[true]]
else begin[{]
return[call[.routeToAll, parameter[member[.msg], member[.logRecord], member[.logHandlerIdSet]]]]
end[}]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[boolean] identifier[route] operator[SEP] identifier[String] identifier[msg] , identifier[LogRecord] identifier[logRecord] operator[SEP] {
Keyword[if] operator[SEP] operator[!] identifier[isValidMessage] operator[SEP] identifier[msg] operator[SEP] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
identifier[Set] operator[<] identifier[String] operator[>] identifier[logHandlerIdSet] operator[=] identifier[getLogHandlersForMessage] operator[SEP] identifier[msg] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[logHandlerIdSet] operator[==] Other[null] operator[SEP] {
Keyword[return] literal[boolean] operator[SEP]
}
Keyword[else] {
Keyword[return] identifier[routeToAll] operator[SEP] identifier[msg] , identifier[logRecord] , identifier[logHandlerIdSet] operator[SEP] operator[SEP]
}
}
|
@Override
public void afterProblemFactRemoved(Object problemFact) {
FactHandle factHandle = kieSession.getFactHandle(problemFact);
if (factHandle == null) {
throw new IllegalArgumentException("The problemFact (" + problemFact
+ ") was never added to this ScoreDirector.\n"
+ "Maybe that specific instance is not in the "
+ PlanningSolution.class.getSimpleName() + "'s problem fact members ("
+ getSolutionDescriptor().getProblemFactMemberAndProblemFactCollectionMemberNames() + ").\n"
+ "Maybe first translate that external instance to the workingSolution's instance"
+ " with " + ScoreDirector.class.getSimpleName() + ".lookUpWorkingObject().");
}
kieSession.delete(factHandle);
super.afterProblemFactRemoved(problemFact);
} | class class_name[name] begin[{]
method[afterProblemFactRemoved, return_type[void], modifier[public], parameter[problemFact]] begin[{]
local_variable[type[FactHandle], factHandle]
if[binary_operation[member[.factHandle], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="The problemFact ("), operandr=MemberReference(member=problemFact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=") was never added to this ScoreDirector.\n"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Maybe that specific instance is not in the "), operator=+), operandr=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=PlanningSolution, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="'s problem fact members ("), operator=+), operandr=MethodInvocation(arguments=[], member=getSolutionDescriptor, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=getProblemFactMemberAndProblemFactCollectionMemberNames, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=").\n"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Maybe first translate that external instance to the workingSolution's instance"), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=" with "), operator=+), operandr=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=ScoreDirector, sub_type=None)), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=".lookUpWorkingObject()."), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
call[kieSession.delete, parameter[member[.factHandle]]]
SuperMethodInvocation(arguments=[MemberReference(member=problemFact, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=afterProblemFactRemoved, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type_arguments=None)
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[afterProblemFactRemoved] operator[SEP] identifier[Object] identifier[problemFact] operator[SEP] {
identifier[FactHandle] identifier[factHandle] operator[=] identifier[kieSession] operator[SEP] identifier[getFactHandle] operator[SEP] identifier[problemFact] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[factHandle] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[problemFact] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[PlanningSolution] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] identifier[getSolutionDescriptor] operator[SEP] operator[SEP] operator[SEP] identifier[getProblemFactMemberAndProblemFactCollectionMemberNames] operator[SEP] operator[SEP] operator[+] literal[String] operator[+] literal[String] operator[+] literal[String] operator[+] identifier[ScoreDirector] operator[SEP] Keyword[class] operator[SEP] identifier[getSimpleName] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
identifier[kieSession] operator[SEP] identifier[delete] operator[SEP] identifier[factHandle] operator[SEP] operator[SEP] Keyword[super] operator[SEP] identifier[afterProblemFactRemoved] operator[SEP] identifier[problemFact] operator[SEP] operator[SEP]
}
|
private static void _traceMessageId(TraceComponent callersTrace, String action, String messageText)
{
// Build the trace string
String traceText = action + ": " + messageText;
// Trace using the correct trace group
if (light_tc.isDebugEnabled()) {
SibTr.debug(light_tc, traceText);
}
else {
SibTr.debug(callersTrace, traceText);
}
} | class class_name[name] begin[{]
method[_traceMessageId, return_type[void], modifier[private static], parameter[callersTrace, action, messageText]] begin[{]
local_variable[type[String], traceText]
if[call[light_tc.isDebugEnabled, parameter[]]] begin[{]
call[SibTr.debug, parameter[member[.light_tc], member[.traceText]]]
else begin[{]
call[SibTr.debug, parameter[member[.callersTrace], member[.traceText]]]
end[}]
end[}]
END[}] | Keyword[private] Keyword[static] Keyword[void] identifier[_traceMessageId] operator[SEP] identifier[TraceComponent] identifier[callersTrace] , identifier[String] identifier[action] , identifier[String] identifier[messageText] operator[SEP] {
identifier[String] identifier[traceText] operator[=] identifier[action] operator[+] literal[String] operator[+] identifier[messageText] operator[SEP] Keyword[if] operator[SEP] identifier[light_tc] operator[SEP] identifier[isDebugEnabled] operator[SEP] operator[SEP] operator[SEP] {
identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[light_tc] , identifier[traceText] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[SibTr] operator[SEP] identifier[debug] operator[SEP] identifier[callersTrace] , identifier[traceText] operator[SEP] operator[SEP]
}
}
|
public static <T extends ImageGray<T>>
T bitmapToGray( Bitmap input , T output , Class<T> imageType , byte[] storage) {
if( imageType == GrayF32.class )
return (T)bitmapToGray(input,(GrayF32)output,storage);
else if( imageType == GrayU8.class )
return (T)bitmapToGray(input,(GrayU8)output,storage);
else
throw new IllegalArgumentException("Unsupported BoofCV Image Type");
} | class class_name[name] begin[{]
method[bitmapToGray, return_type[type[T]], modifier[public static], parameter[input, output, imageType, storage]] begin[{]
if[binary_operation[member[.imageType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GrayF32, sub_type=None))]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=GrayF32, sub_type=None)), MemberReference(member=storage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bitmapToGray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))]
else begin[{]
if[binary_operation[member[.imageType], ==, ClassReference(postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=GrayU8, sub_type=None))]] begin[{]
return[Cast(expression=MethodInvocation(arguments=[MemberReference(member=input, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=output, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=GrayU8, sub_type=None)), MemberReference(member=storage, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=bitmapToGray, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=T, sub_type=None))]
else begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unsupported BoofCV Image Type")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
end[}]
end[}]
end[}]
END[}] | Keyword[public] Keyword[static] operator[<] identifier[T] Keyword[extends] identifier[ImageGray] operator[<] identifier[T] operator[>] operator[>] identifier[T] identifier[bitmapToGray] operator[SEP] identifier[Bitmap] identifier[input] , identifier[T] identifier[output] , identifier[Class] operator[<] identifier[T] operator[>] identifier[imageType] , Keyword[byte] operator[SEP] operator[SEP] identifier[storage] operator[SEP] {
Keyword[if] operator[SEP] identifier[imageType] operator[==] identifier[GrayF32] operator[SEP] Keyword[class] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[bitmapToGray] operator[SEP] identifier[input] , operator[SEP] identifier[GrayF32] operator[SEP] identifier[output] , identifier[storage] operator[SEP] operator[SEP] Keyword[else] Keyword[if] operator[SEP] identifier[imageType] operator[==] identifier[GrayU8] operator[SEP] Keyword[class] operator[SEP] Keyword[return] operator[SEP] identifier[T] operator[SEP] identifier[bitmapToGray] operator[SEP] identifier[input] , operator[SEP] identifier[GrayU8] operator[SEP] identifier[output] , identifier[storage] operator[SEP] operator[SEP] Keyword[else] Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
private void doClose() {
open = false;
connections.remove(this);
for (Map.Entry<Long, ContextualFuture> entry : futures.entrySet()) {
ContextualFuture future = entry.getValue();
try {
future.context.executor().execute(() -> future.completeExceptionally(new ConnectException("connection closed")));
} catch (RejectedExecutionException e) {
}
}
futures.clear();
for (Consumer<Connection> closeListener : closeListeners) {
try {
context.executor().execute(() -> closeListener.accept(this));
} catch (RejectedExecutionException e) {
}
}
} | class class_name[name] begin[{]
method[doClose, return_type[void], modifier[private], parameter[]] begin[{]
assign[member[.open], literal[false]]
call[connections.remove, parameter[THIS[]]]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getValue, postfix_operators=[], prefix_operators=[], qualifier=entry, selectors=[], type_arguments=None), name=future)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=ContextualFuture, sub_type=None)), TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=executor, postfix_operators=[], prefix_operators=[], qualifier=future.context, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="connection closed")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=ConnectException, sub_type=None))], member=completeExceptionally, postfix_operators=[], prefix_operators=[], qualifier=future, selectors=[], type_arguments=None), parameters=[])], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RejectedExecutionException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MethodInvocation(arguments=[], member=entrySet, postfix_operators=[], prefix_operators=[], qualifier=futures, selectors=[], type_arguments=None), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=entry)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Map, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Long, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=ContextualFuture, sub_type=None))], dimensions=None, name=Entry, sub_type=None)))), label=None)
call[futures.clear, parameter[]]
ForStatement(body=BlockStatement(label=None, statements=[TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=executor, postfix_operators=[], prefix_operators=[], qualifier=context, selectors=[MethodInvocation(arguments=[LambdaExpression(body=MethodInvocation(arguments=[This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[])], member=accept, postfix_operators=[], prefix_operators=[], qualifier=closeListener, selectors=[], type_arguments=None), parameters=[])], member=execute, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['RejectedExecutionException']))], finally_block=None, label=None, resources=None)]), control=EnhancedForControl(iterable=MemberReference(member=closeListeners, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=closeListener)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Connection, sub_type=None))], dimensions=[], name=Consumer, sub_type=None))), label=None)
end[}]
END[}] | Keyword[private] Keyword[void] identifier[doClose] operator[SEP] operator[SEP] {
identifier[open] operator[=] literal[boolean] operator[SEP] identifier[connections] operator[SEP] identifier[remove] operator[SEP] Keyword[this] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Map] operator[SEP] identifier[Entry] operator[<] identifier[Long] , identifier[ContextualFuture] operator[>] identifier[entry] operator[:] identifier[futures] operator[SEP] identifier[entrySet] operator[SEP] operator[SEP] operator[SEP] {
identifier[ContextualFuture] identifier[future] operator[=] identifier[entry] operator[SEP] identifier[getValue] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[future] operator[SEP] identifier[context] operator[SEP] identifier[executor] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[future] operator[SEP] identifier[completeExceptionally] operator[SEP] Keyword[new] identifier[ConnectException] operator[SEP] literal[String] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RejectedExecutionException] identifier[e] operator[SEP] {
}
}
identifier[futures] operator[SEP] identifier[clear] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Consumer] operator[<] identifier[Connection] operator[>] identifier[closeListener] operator[:] identifier[closeListeners] operator[SEP] {
Keyword[try] {
identifier[context] operator[SEP] identifier[executor] operator[SEP] operator[SEP] operator[SEP] identifier[execute] operator[SEP] operator[SEP] operator[SEP] operator[->] identifier[closeListener] operator[SEP] identifier[accept] operator[SEP] Keyword[this] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[RejectedExecutionException] identifier[e] operator[SEP] {
}
}
}
|
public static List<Domain> getRunningDomains(Connect libvirt) {
try {
List<Domain> domains = new ArrayList<>();
int[] ids = libvirt.listDomains();
for (int id : ids) {
domains.add(libvirt.domainLookupByID(id));
}
return domains;
} catch (LibvirtException e) {
throw new LibvirtRuntimeException("Unable to list defined domains", e);
}
} | class class_name[name] begin[{]
method[getRunningDomains, return_type[type[List]], modifier[public static], parameter[libvirt]] begin[{]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=[], dimensions=None, name=ArrayList, sub_type=None)), name=domains)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Domain, sub_type=None))], dimensions=[], name=List, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=listDomains, postfix_operators=[], prefix_operators=[], qualifier=libvirt, selectors=[], type_arguments=None), name=ids)], modifiers=set(), type=BasicType(dimensions=[None], name=int)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=domainLookupByID, postfix_operators=[], prefix_operators=[], qualifier=libvirt, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=domains, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=ids, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers=set(), type=BasicType(dimensions=[], name=int))), label=None), ReturnStatement(expression=MemberReference(member=domains, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Unable to list defined domains"), 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=LibvirtRuntimeException, sub_type=None)), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=e, types=['LibvirtException']))], finally_block=None, label=None, resources=None)
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Domain] operator[>] identifier[getRunningDomains] operator[SEP] identifier[Connect] identifier[libvirt] operator[SEP] {
Keyword[try] {
identifier[List] operator[<] identifier[Domain] operator[>] identifier[domains] operator[=] Keyword[new] identifier[ArrayList] operator[<] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[int] operator[SEP] operator[SEP] identifier[ids] operator[=] identifier[libvirt] operator[SEP] identifier[listDomains] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[id] operator[:] identifier[ids] operator[SEP] {
identifier[domains] operator[SEP] identifier[add] operator[SEP] identifier[libvirt] operator[SEP] identifier[domainLookupByID] operator[SEP] identifier[id] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[domains] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[LibvirtException] identifier[e] operator[SEP] {
Keyword[throw] Keyword[new] identifier[LibvirtRuntimeException] operator[SEP] literal[String] , identifier[e] operator[SEP] operator[SEP]
}
}
|
public void getGroupsForUser(List<String> grpMbrshipAttrs, int countLimit) throws Exception {
throw new WIMApplicationException(WIMMessageKey.METHOD_NOT_IMPLEMENTED, Tr.formatMessage(tc, WIMMessageKey.METHOD_NOT_IMPLEMENTED));
} | class class_name[name] begin[{]
method[getGroupsForUser, return_type[void], modifier[public], parameter[grpMbrshipAttrs, countLimit]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=METHOD_NOT_IMPLEMENTED, postfix_operators=[], prefix_operators=[], qualifier=WIMMessageKey, selectors=[]), MethodInvocation(arguments=[MemberReference(member=tc, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=METHOD_NOT_IMPLEMENTED, postfix_operators=[], prefix_operators=[], qualifier=WIMMessageKey, selectors=[])], member=formatMessage, postfix_operators=[], prefix_operators=[], qualifier=Tr, selectors=[], type_arguments=None)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=WIMApplicationException, sub_type=None)), label=None)
end[}]
END[}] | Keyword[public] Keyword[void] identifier[getGroupsForUser] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[grpMbrshipAttrs] , Keyword[int] identifier[countLimit] operator[SEP] Keyword[throws] identifier[Exception] {
Keyword[throw] Keyword[new] identifier[WIMApplicationException] operator[SEP] identifier[WIMMessageKey] operator[SEP] identifier[METHOD_NOT_IMPLEMENTED] , identifier[Tr] operator[SEP] identifier[formatMessage] operator[SEP] identifier[tc] , identifier[WIMMessageKey] operator[SEP] identifier[METHOD_NOT_IMPLEMENTED] operator[SEP] operator[SEP] operator[SEP]
}
|
public List find(String nativeQuery, List<String> relations, EntityMetadata m)
{
List entities = new ArrayList();
s = getStatelessSession();
SQLQuery q = s.createSQLQuery(nativeQuery);
q.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
List result = q.list();
try
{
MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
m.getPersistenceUnit());
EntityType entityType = metaModel.entity(m.getEntityClazz());
List<AbstractManagedType> subManagedType = ((AbstractManagedType) entityType).getSubManagedType();
for (Object o : result)
{
Map<String, Object> relationValue = null;
Object entity = null;
EntityMetadata subEntityMetadata = null;
if (!subManagedType.isEmpty())
{
for (AbstractManagedType subEntity : subManagedType)
{
String discColumn = subEntity.getDiscriminatorColumn();
String disColValue = subEntity.getDiscriminatorValue();
Object value = ((Map<String, Object>) o).get(discColumn);
if (value != null && value.toString().equals(disColValue))
{
subEntityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
subEntity.getJavaType());
break;
}
}
entity = instantiateEntity(subEntityMetadata.getEntityClazz(), entity);
relationValue = HibernateUtils.getTranslatedObject(kunderaMetadata, entity,
(Map<String, Object>) o, m);
}
else
{
entity = instantiateEntity(m.getEntityClazz(), entity);
relationValue = HibernateUtils.getTranslatedObject(kunderaMetadata, entity,
(Map<String, Object>) o, m);
}
if (relationValue != null && !relationValue.isEmpty())
{
entity = new EnhanceEntity(entity, PropertyAccessorHelper.getId(entity, m), relationValue);
}
entities.add(entity);
}
return entities;
}
catch (Exception e)
{
if (e.getMessage().equals("Can not be translated into entity."))
{
return result;
}
throw new EntityReaderException(e);
}
} | class class_name[name] begin[{]
method[find, return_type[type[List]], modifier[public], parameter[nativeQuery, relations, m]] begin[{]
local_variable[type[List], entities]
assign[member[.s], call[.getStatelessSession, parameter[]]]
local_variable[type[SQLQuery], q]
call[q.setResultTransformer, parameter[member[AliasToEntityMapResultTransformer.INSTANCE]]]
local_variable[type[List], result]
TryStatement(block=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MethodInvocation(arguments=[], member=getApplicationMetadata, postfix_operators=[], prefix_operators=[], qualifier=kunderaMetadata, selectors=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getPersistenceUnit, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=getMetamodel, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), type=ReferenceType(arguments=None, dimensions=[], name=MetamodelImpl, sub_type=None)), name=metaModel)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MetamodelImpl, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEntityClazz, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None)], member=entity, postfix_operators=[], prefix_operators=[], qualifier=metaModel, selectors=[], type_arguments=None), name=entityType)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EntityType, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=entityType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=AbstractManagedType, sub_type=None)), name=subManagedType)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=AbstractManagedType, sub_type=None))], dimensions=[], name=List, sub_type=None)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=relationValue)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=entity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), name=subEntityMetadata)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=EntityMetadata, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=subManagedType, selectors=[], type_arguments=None), else_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEntityClazz, postfix_operators=[], prefix_operators=[], qualifier=m, selectors=[], type_arguments=None), MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=instantiateEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=relationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=kunderaMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTranslatedObject, postfix_operators=[], prefix_operators=[], qualifier=HibernateUtils, selectors=[], type_arguments=None)), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDiscriminatorColumn, postfix_operators=[], prefix_operators=[], qualifier=subEntity, selectors=[], type_arguments=None), name=discColumn)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getDiscriminatorValue, postfix_operators=[], prefix_operators=[], qualifier=subEntity, selectors=[], type_arguments=None), name=disColValue)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=toString, postfix_operators=[], prefix_operators=[], qualifier=value, selectors=[MethodInvocation(arguments=[MemberReference(member=disColValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=equals, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=subEntityMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=kunderaMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=getJavaType, postfix_operators=[], prefix_operators=[], qualifier=subEntity, selectors=[], type_arguments=None)], member=getEntityMetadata, postfix_operators=[], prefix_operators=[], qualifier=KunderaMetadataManager, selectors=[], type_arguments=None)), label=None), BreakStatement(goto=None, label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=subManagedType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=subEntity)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=AbstractManagedType, sub_type=None))), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getEntityClazz, postfix_operators=[], prefix_operators=[], qualifier=subEntityMetadata, selectors=[], type_arguments=None), MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=instantiateEntity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=relationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=kunderaMetadata, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Cast(expression=MemberReference(member=o, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))], dimensions=[], name=Map, sub_type=None)), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getTranslatedObject, postfix_operators=[], prefix_operators=[], qualifier=HibernateUtils, selectors=[], type_arguments=None)), label=None)])), IfStatement(condition=BinaryOperation(operandl=BinaryOperation(operandl=MemberReference(member=relationValue, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator=!=), operandr=MethodInvocation(arguments=[], member=isEmpty, postfix_operators=[], prefix_operators=['!'], qualifier=relationValue, selectors=[], type_arguments=None), operator=&&), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=ClassCreator(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getId, postfix_operators=[], prefix_operators=[], qualifier=PropertyAccessorHelper, selectors=[], type_arguments=None), MemberReference(member=relationValue, 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=EnhanceEntity, sub_type=None))), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=entity, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=[], prefix_operators=[], qualifier=entities, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=o)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Object, sub_type=None))), label=None), ReturnStatement(expression=MemberReference(member=entities, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)], catches=[CatchClause(block=[IfStatement(condition=MethodInvocation(arguments=[], member=getMessage, postfix_operators=[], prefix_operators=[], qualifier=e, selectors=[MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="Can not be translated into entity.")], 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=[ReturnStatement(expression=MemberReference(member=result, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), label=None)])), ThrowStatement(expression=ClassCreator(arguments=[MemberReference(member=e, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=EntityReaderException, 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] identifier[List] identifier[find] operator[SEP] identifier[String] identifier[nativeQuery] , identifier[List] operator[<] identifier[String] operator[>] identifier[relations] , identifier[EntityMetadata] identifier[m] operator[SEP] {
identifier[List] identifier[entities] operator[=] Keyword[new] identifier[ArrayList] operator[SEP] operator[SEP] operator[SEP] identifier[s] operator[=] identifier[getStatelessSession] operator[SEP] operator[SEP] operator[SEP] identifier[SQLQuery] identifier[q] operator[=] identifier[s] operator[SEP] identifier[createSQLQuery] operator[SEP] identifier[nativeQuery] operator[SEP] operator[SEP] identifier[q] operator[SEP] identifier[setResultTransformer] operator[SEP] identifier[AliasToEntityMapResultTransformer] operator[SEP] identifier[INSTANCE] operator[SEP] operator[SEP] identifier[List] identifier[result] operator[=] identifier[q] operator[SEP] identifier[list] operator[SEP] operator[SEP] operator[SEP] Keyword[try] {
identifier[MetamodelImpl] identifier[metaModel] operator[=] operator[SEP] identifier[MetamodelImpl] operator[SEP] identifier[kunderaMetadata] operator[SEP] identifier[getApplicationMetadata] operator[SEP] operator[SEP] operator[SEP] identifier[getMetamodel] operator[SEP] identifier[m] operator[SEP] identifier[getPersistenceUnit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[EntityType] identifier[entityType] operator[=] identifier[metaModel] operator[SEP] identifier[entity] operator[SEP] identifier[m] operator[SEP] identifier[getEntityClazz] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[AbstractManagedType] operator[>] identifier[subManagedType] operator[=] operator[SEP] operator[SEP] identifier[AbstractManagedType] operator[SEP] identifier[entityType] operator[SEP] operator[SEP] identifier[getSubManagedType] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Object] identifier[o] operator[:] identifier[result] operator[SEP] {
identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[relationValue] operator[=] Other[null] operator[SEP] identifier[Object] identifier[entity] operator[=] Other[null] operator[SEP] identifier[EntityMetadata] identifier[subEntityMetadata] operator[=] Other[null] operator[SEP] Keyword[if] operator[SEP] operator[!] identifier[subManagedType] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
Keyword[for] operator[SEP] identifier[AbstractManagedType] identifier[subEntity] operator[:] identifier[subManagedType] operator[SEP] {
identifier[String] identifier[discColumn] operator[=] identifier[subEntity] operator[SEP] identifier[getDiscriminatorColumn] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[disColValue] operator[=] identifier[subEntity] operator[SEP] identifier[getDiscriminatorValue] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[=] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[o] operator[SEP] operator[SEP] identifier[get] operator[SEP] identifier[discColumn] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[value] operator[!=] Other[null] operator[&&] identifier[value] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] identifier[disColValue] operator[SEP] operator[SEP] {
identifier[subEntityMetadata] operator[=] identifier[KunderaMetadataManager] operator[SEP] identifier[getEntityMetadata] operator[SEP] identifier[kunderaMetadata] , identifier[subEntity] operator[SEP] identifier[getJavaType] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[break] operator[SEP]
}
}
identifier[entity] operator[=] identifier[instantiateEntity] operator[SEP] identifier[subEntityMetadata] operator[SEP] identifier[getEntityClazz] operator[SEP] operator[SEP] , identifier[entity] operator[SEP] operator[SEP] identifier[relationValue] operator[=] identifier[HibernateUtils] operator[SEP] identifier[getTranslatedObject] operator[SEP] identifier[kunderaMetadata] , identifier[entity] , operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[o] , identifier[m] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[entity] operator[=] identifier[instantiateEntity] operator[SEP] identifier[m] operator[SEP] identifier[getEntityClazz] operator[SEP] operator[SEP] , identifier[entity] operator[SEP] operator[SEP] identifier[relationValue] operator[=] identifier[HibernateUtils] operator[SEP] identifier[getTranslatedObject] operator[SEP] identifier[kunderaMetadata] , identifier[entity] , operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] identifier[o] , identifier[m] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[relationValue] operator[!=] Other[null] operator[&&] operator[!] identifier[relationValue] operator[SEP] identifier[isEmpty] operator[SEP] operator[SEP] operator[SEP] {
identifier[entity] operator[=] Keyword[new] identifier[EnhanceEntity] operator[SEP] identifier[entity] , identifier[PropertyAccessorHelper] operator[SEP] identifier[getId] operator[SEP] identifier[entity] , identifier[m] operator[SEP] , identifier[relationValue] operator[SEP] operator[SEP]
}
identifier[entities] operator[SEP] identifier[add] operator[SEP] identifier[entity] operator[SEP] operator[SEP]
}
Keyword[return] identifier[entities] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[Exception] identifier[e] operator[SEP] {
Keyword[if] operator[SEP] identifier[e] operator[SEP] identifier[getMessage] operator[SEP] operator[SEP] operator[SEP] identifier[equals] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[return] identifier[result] operator[SEP]
}
Keyword[throw] Keyword[new] identifier[EntityReaderException] operator[SEP] identifier[e] operator[SEP] operator[SEP]
}
}
|
public ChronoLocalDate dateNow(Clock clock) {
Jdk8Methods.requireNonNull(clock, "clock");
return date(LocalDate.now(clock));
} | class class_name[name] begin[{]
method[dateNow, return_type[type[ChronoLocalDate]], modifier[public], parameter[clock]] begin[{]
call[Jdk8Methods.requireNonNull, parameter[member[.clock], literal["clock"]]]
return[call[.date, parameter[call[LocalDate.now, parameter[member[.clock]]]]]]
end[}]
END[}] | Keyword[public] identifier[ChronoLocalDate] identifier[dateNow] operator[SEP] identifier[Clock] identifier[clock] operator[SEP] {
identifier[Jdk8Methods] operator[SEP] identifier[requireNonNull] operator[SEP] identifier[clock] , literal[String] operator[SEP] operator[SEP] Keyword[return] identifier[date] operator[SEP] identifier[LocalDate] operator[SEP] identifier[now] operator[SEP] identifier[clock] operator[SEP] operator[SEP] operator[SEP]
}
|
public PagedList<EndpointServiceResultInner> list(final String location) {
ServiceResponse<Page<EndpointServiceResultInner>> response = listSinglePageAsync(location).toBlocking().single();
return new PagedList<EndpointServiceResultInner>(response.body()) {
@Override
public Page<EndpointServiceResultInner> nextPage(String nextPageLink) {
return listNextSinglePageAsync(nextPageLink).toBlocking().single().body();
}
};
} | class class_name[name] begin[{]
method[list, return_type[type[PagedList]], modifier[public], parameter[location]] begin[{]
local_variable[type[ServiceResponse], response]
return[ClassCreator(arguments=[MethodInvocation(arguments=[], member=body, postfix_operators=[], prefix_operators=[], qualifier=response, selectors=[], type_arguments=None)], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[ReturnStatement(expression=MethodInvocation(arguments=[MemberReference(member=nextPageLink, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=listNextSinglePageAsync, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=toBlocking, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=single, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None), MethodInvocation(arguments=[], member=body, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=nextPage, 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=None, dimensions=[], name=EndpointServiceResultInner, sub_type=None))], dimensions=[], name=Page, 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=EndpointServiceResultInner, sub_type=None))], dimensions=None, name=PagedList, sub_type=None))]
end[}]
END[}] | Keyword[public] identifier[PagedList] operator[<] identifier[EndpointServiceResultInner] operator[>] identifier[list] operator[SEP] Keyword[final] identifier[String] identifier[location] operator[SEP] {
identifier[ServiceResponse] operator[<] identifier[Page] operator[<] identifier[EndpointServiceResultInner] operator[>] operator[>] identifier[response] operator[=] identifier[listSinglePageAsync] operator[SEP] identifier[location] operator[SEP] operator[SEP] identifier[toBlocking] operator[SEP] operator[SEP] operator[SEP] identifier[single] operator[SEP] operator[SEP] operator[SEP] Keyword[return] Keyword[new] identifier[PagedList] operator[<] identifier[EndpointServiceResultInner] operator[>] operator[SEP] identifier[response] operator[SEP] identifier[body] operator[SEP] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] identifier[Page] operator[<] identifier[EndpointServiceResultInner] operator[>] identifier[nextPage] operator[SEP] identifier[String] identifier[nextPageLink] operator[SEP] {
Keyword[return] identifier[listNextSinglePageAsync] operator[SEP] identifier[nextPageLink] 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]
}
} operator[SEP]
}
|
public long getSize() {
long size = isParsed ? getContentSize() : content.limit();
size += (8 + // size|type
(size >= ((1L << 32) - 8) ? 8 : 0) + // 32bit - 8 byte size and type
(UserBox.TYPE.equals(getType()) ? 16 : 0));
size += (deadBytes == null ? 0 : deadBytes.limit());
return size;
} | class class_name[name] begin[{]
method[getSize, return_type[type[long]], modifier[public], parameter[]] begin[{]
local_variable[type[long], size]
assign[member[.size], binary_operation[binary_operation[literal[8], +, TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=size, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1L), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=32), operator=<<), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8), operator=-), operator=>=), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=8))], +, TernaryExpression(condition=MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=equals, postfix_operators=[], prefix_operators=[], qualifier=UserBox.TYPE, selectors=[], type_arguments=None), if_false=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=16))]]
assign[member[.size], TernaryExpression(condition=BinaryOperation(operandl=MemberReference(member=deadBytes, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), if_false=MethodInvocation(arguments=[], member=limit, postfix_operators=[], prefix_operators=[], qualifier=deadBytes, selectors=[], type_arguments=None), if_true=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))]
return[member[.size]]
end[}]
END[}] | Keyword[public] Keyword[long] identifier[getSize] operator[SEP] operator[SEP] {
Keyword[long] identifier[size] operator[=] identifier[isParsed] operator[?] identifier[getContentSize] operator[SEP] operator[SEP] operator[:] identifier[content] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[+=] operator[SEP] Other[8] operator[+] operator[SEP] identifier[size] operator[>=] operator[SEP] operator[SEP] Other[1L] operator[<<] Other[32] operator[SEP] operator[-] Other[8] operator[SEP] operator[?] Other[8] operator[:] Other[0] operator[SEP] operator[+] operator[SEP] identifier[UserBox] operator[SEP] identifier[TYPE] operator[SEP] identifier[equals] operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] operator[?] Other[16] operator[:] Other[0] operator[SEP] operator[SEP] operator[SEP] identifier[size] operator[+=] operator[SEP] identifier[deadBytes] operator[==] Other[null] operator[?] Other[0] operator[:] identifier[deadBytes] operator[SEP] identifier[limit] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[size] operator[SEP]
}
|
private Map<NodeId, NodeId> resolveAliases(Iterable<Alias> aliases) {
Map<NodeId, NodeId> resolved = Maps.newHashMap();
Map<NodeId, Set<NodeId>> inverse = Maps.newHashMap();
for (Alias alias : aliases) {
NodeId from = alias.getFromId();
NodeId to = alias.getToId();
if (resolved.containsKey(to)) {
to = resolved.get(to);
}
resolved.put(from, to);
if (inverse.get(to) == null) {
inverse.put(to, Sets.<NodeId> newHashSet());
}
inverse.get(to).add(from);
Set<NodeId> prev = inverse.get(from);
if (prev != null) {
for (NodeId id : prev) {
resolved.remove(id);
inverse.get(from).remove(id);
resolved.put(id, to);
inverse.get(to).add(id);
}
}
}
return resolved;
} | class class_name[name] begin[{]
method[resolveAliases, return_type[type[Map]], modifier[private], parameter[aliases]] begin[{]
local_variable[type[Map], resolved]
local_variable[type[Map], inverse]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getFromId, postfix_operators=[], prefix_operators=[], qualifier=alias, selectors=[], type_arguments=None), name=from)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeId, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getToId, postfix_operators=[], prefix_operators=[], qualifier=alias, selectors=[], type_arguments=None), name=to)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeId, sub_type=None)), IfStatement(condition=MethodInvocation(arguments=[MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=containsKey, postfix_operators=[], prefix_operators=[], qualifier=resolved, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=resolved, selectors=[], type_arguments=None)), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=from, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=resolved, selectors=[], type_arguments=None), label=None), IfStatement(condition=BinaryOperation(operandl=MethodInvocation(arguments=[MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=inverse, selectors=[], type_arguments=None), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operator===), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MethodInvocation(arguments=[], member=Sets, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NodeId, sub_type=None))])], member=put, postfix_operators=[], prefix_operators=[], qualifier=inverse, selectors=[], type_arguments=None), label=None)])), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=inverse, selectors=[MethodInvocation(arguments=[MemberReference(member=from, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[MemberReference(member=from, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=inverse, selectors=[], type_arguments=None), name=prev)], modifiers=set(), type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=NodeId, sub_type=None))], dimensions=[], name=Set, sub_type=None)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=prev, 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=[ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=[], prefix_operators=[], qualifier=resolved, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=from, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=inverse, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=remove, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=resolved, selectors=[], type_arguments=None), label=None), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=to, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=[], prefix_operators=[], qualifier=inverse, selectors=[MethodInvocation(arguments=[MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=add, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=MemberReference(member=prev, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=NodeId, sub_type=None))), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=aliases, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=alias)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=Alias, sub_type=None))), label=None)
return[member[.resolved]]
end[}]
END[}] | Keyword[private] identifier[Map] operator[<] identifier[NodeId] , identifier[NodeId] operator[>] identifier[resolveAliases] operator[SEP] identifier[Iterable] operator[<] identifier[Alias] operator[>] identifier[aliases] operator[SEP] {
identifier[Map] operator[<] identifier[NodeId] , identifier[NodeId] operator[>] identifier[resolved] operator[=] identifier[Maps] operator[SEP] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[NodeId] , identifier[Set] operator[<] identifier[NodeId] operator[>] operator[>] identifier[inverse] operator[=] identifier[Maps] operator[SEP] identifier[newHashMap] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[Alias] identifier[alias] operator[:] identifier[aliases] operator[SEP] {
identifier[NodeId] identifier[from] operator[=] identifier[alias] operator[SEP] identifier[getFromId] operator[SEP] operator[SEP] operator[SEP] identifier[NodeId] identifier[to] operator[=] identifier[alias] operator[SEP] identifier[getToId] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[resolved] operator[SEP] identifier[containsKey] operator[SEP] identifier[to] operator[SEP] operator[SEP] {
identifier[to] operator[=] identifier[resolved] operator[SEP] identifier[get] operator[SEP] identifier[to] operator[SEP] operator[SEP]
}
identifier[resolved] operator[SEP] identifier[put] operator[SEP] identifier[from] , identifier[to] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[inverse] operator[SEP] identifier[get] operator[SEP] identifier[to] operator[SEP] operator[==] Other[null] operator[SEP] {
identifier[inverse] operator[SEP] identifier[put] operator[SEP] identifier[to] , identifier[Sets] operator[SEP] operator[<] identifier[NodeId] operator[>] identifier[newHashSet] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
identifier[inverse] operator[SEP] identifier[get] operator[SEP] identifier[to] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[from] operator[SEP] operator[SEP] identifier[Set] operator[<] identifier[NodeId] operator[>] identifier[prev] operator[=] identifier[inverse] operator[SEP] identifier[get] operator[SEP] identifier[from] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[prev] operator[!=] Other[null] operator[SEP] {
Keyword[for] operator[SEP] identifier[NodeId] identifier[id] operator[:] identifier[prev] operator[SEP] {
identifier[resolved] operator[SEP] identifier[remove] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[inverse] operator[SEP] identifier[get] operator[SEP] identifier[from] operator[SEP] operator[SEP] identifier[remove] operator[SEP] identifier[id] operator[SEP] operator[SEP] identifier[resolved] operator[SEP] identifier[put] operator[SEP] identifier[id] , identifier[to] operator[SEP] operator[SEP] identifier[inverse] operator[SEP] identifier[get] operator[SEP] identifier[to] operator[SEP] operator[SEP] identifier[add] operator[SEP] identifier[id] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[resolved] operator[SEP]
}
|
public static List<Monomer> getAllMonomers(MonomerNotation not, int position) throws HELM2HandledException,
MonomerException, NotationException, ChemistryException, CTKException, MonomerLoadingException {
List<Monomer> monomers = new ArrayList<Monomer>();
MonomerFactory monomerFactory = MonomerFactory.getInstance();
MonomerStore monomerStore = monomerFactory.getMonomerStore();
if (not instanceof MonomerNotationUnitRNA) {
monomers.addAll(getMonomersRNA((MonomerNotationUnitRNA) not, monomerStore, position));
} else if (not instanceof MonomerNotationUnit) {
String id = not.getUnit();
// if (id.startsWith("[") && id.endsWith("]")) {
// id = id.substring(1, id.length() - 1);
// }
monomers.add(MethodsMonomerUtils.getMonomer(not.getType(), id, ""));
} else if (not instanceof MonomerNotationGroup) {
for (MonomerNotationGroupElement groupElement : ((MonomerNotationGroup) not).getListOfElements()) {
String id = groupElement.getMonomerNotation().getUnit();
/*
* if (id.startsWith("[") && id.endsWith("]")) { id =
* id.substring(1, id.length() - 1); }
*/
monomers.add(MethodsMonomerUtils.getMonomer(not.getType(), id, ""));
}
} else if (not instanceof MonomerNotationList) {
for (MonomerNotation listElement : ((MonomerNotationList) not).getListofMonomerUnits()) {
if (listElement instanceof MonomerNotationUnitRNA) {
monomers.addAll(getMonomersRNA(((MonomerNotationUnitRNA) listElement), monomerStore, position));
} else {
String id = listElement.getUnit();
/*
* if (id.startsWith("[") && id.endsWith("]")) { id =
* id.substring(1, id.length() - 1); }
*/
monomers.add(MethodsMonomerUtils.getMonomer(not.getType(), id, ""));
}
}
}
return monomers;
} | class class_name[name] begin[{]
method[getAllMonomers, return_type[type[List]], modifier[public static], parameter[not, position]] begin[{]
local_variable[type[List], monomers]
local_variable[type[MonomerFactory], monomerFactory]
local_variable[type[MonomerStore], monomerStore]
if[binary_operation[member[.not], instanceof, type[MonomerNotationUnitRNA]]] begin[{]
call[monomers.addAll, parameter[call[.getMonomersRNA, parameter[Cast(expression=MemberReference(member=not, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MonomerNotationUnitRNA, sub_type=None)), member[.monomerStore], member[.position]]]]]
else begin[{]
if[binary_operation[member[.not], instanceof, type[MonomerNotationUnit]]] begin[{]
local_variable[type[String], id]
call[monomers.add, parameter[call[MethodsMonomerUtils.getMonomer, parameter[call[not.getType, parameter[]], member[.id], literal[""]]]]]
else begin[{]
if[binary_operation[member[.not], instanceof, type[MonomerNotationGroup]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getMonomerNotation, postfix_operators=[], prefix_operators=[], qualifier=groupElement, selectors=[MethodInvocation(arguments=[], member=getUnit, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=not, selectors=[], type_arguments=None), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=getMonomer, postfix_operators=[], prefix_operators=[], qualifier=MethodsMonomerUtils, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=monomers, selectors=[], type_arguments=None), label=None)]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=not, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MonomerNotationGroup, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=groupElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MonomerNotationGroupElement, sub_type=None))), label=None)
else begin[{]
if[binary_operation[member[.not], instanceof, type[MonomerNotationList]]] begin[{]
ForStatement(body=BlockStatement(label=None, statements=[IfStatement(condition=BinaryOperation(operandl=MemberReference(member=listElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=ReferenceType(arguments=None, dimensions=[], name=MonomerNotationUnitRNA, sub_type=None), operator=instanceof), else_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[], member=getUnit, postfix_operators=[], prefix_operators=[], qualifier=listElement, selectors=[], type_arguments=None), name=id)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[MethodInvocation(arguments=[], member=getType, postfix_operators=[], prefix_operators=[], qualifier=not, selectors=[], type_arguments=None), MemberReference(member=id, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=getMonomer, postfix_operators=[], prefix_operators=[], qualifier=MethodsMonomerUtils, selectors=[], type_arguments=None)], member=add, postfix_operators=[], prefix_operators=[], qualifier=monomers, selectors=[], type_arguments=None), label=None)]), label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MethodInvocation(arguments=[Cast(expression=MemberReference(member=listElement, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MonomerNotationUnitRNA, sub_type=None)), MemberReference(member=monomerStore, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=position, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=getMonomersRNA, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None)], member=addAll, postfix_operators=[], prefix_operators=[], qualifier=monomers, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=Cast(expression=MemberReference(member=not, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=ReferenceType(arguments=None, dimensions=[], name=MonomerNotationList, sub_type=None)), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=listElement)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=MonomerNotation, sub_type=None))), label=None)
else begin[{]
None
end[}]
end[}]
end[}]
end[}]
return[member[.monomers]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[List] operator[<] identifier[Monomer] operator[>] identifier[getAllMonomers] operator[SEP] identifier[MonomerNotation] identifier[not] , Keyword[int] identifier[position] operator[SEP] Keyword[throws] identifier[HELM2HandledException] , identifier[MonomerException] , identifier[NotationException] , identifier[ChemistryException] , identifier[CTKException] , identifier[MonomerLoadingException] {
identifier[List] operator[<] identifier[Monomer] operator[>] identifier[monomers] operator[=] Keyword[new] identifier[ArrayList] operator[<] identifier[Monomer] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[MonomerFactory] identifier[monomerFactory] operator[=] identifier[MonomerFactory] operator[SEP] identifier[getInstance] operator[SEP] operator[SEP] operator[SEP] identifier[MonomerStore] identifier[monomerStore] operator[=] identifier[monomerFactory] operator[SEP] identifier[getMonomerStore] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[not] Keyword[instanceof] identifier[MonomerNotationUnitRNA] operator[SEP] {
identifier[monomers] operator[SEP] identifier[addAll] operator[SEP] identifier[getMonomersRNA] operator[SEP] operator[SEP] identifier[MonomerNotationUnitRNA] operator[SEP] identifier[not] , identifier[monomerStore] , identifier[position] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[not] Keyword[instanceof] identifier[MonomerNotationUnit] operator[SEP] {
identifier[String] identifier[id] operator[=] identifier[not] operator[SEP] identifier[getUnit] operator[SEP] operator[SEP] operator[SEP] identifier[monomers] operator[SEP] identifier[add] operator[SEP] identifier[MethodsMonomerUtils] operator[SEP] identifier[getMonomer] operator[SEP] identifier[not] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[id] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[not] Keyword[instanceof] identifier[MonomerNotationGroup] operator[SEP] {
Keyword[for] operator[SEP] identifier[MonomerNotationGroupElement] identifier[groupElement] operator[:] operator[SEP] operator[SEP] identifier[MonomerNotationGroup] operator[SEP] identifier[not] operator[SEP] operator[SEP] identifier[getListOfElements] operator[SEP] operator[SEP] operator[SEP] {
identifier[String] identifier[id] operator[=] identifier[groupElement] operator[SEP] identifier[getMonomerNotation] operator[SEP] operator[SEP] operator[SEP] identifier[getUnit] operator[SEP] operator[SEP] operator[SEP] identifier[monomers] operator[SEP] identifier[add] operator[SEP] identifier[MethodsMonomerUtils] operator[SEP] identifier[getMonomer] operator[SEP] identifier[not] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[id] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
Keyword[else] Keyword[if] operator[SEP] identifier[not] Keyword[instanceof] identifier[MonomerNotationList] operator[SEP] {
Keyword[for] operator[SEP] identifier[MonomerNotation] identifier[listElement] operator[:] operator[SEP] operator[SEP] identifier[MonomerNotationList] operator[SEP] identifier[not] operator[SEP] operator[SEP] identifier[getListofMonomerUnits] operator[SEP] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[listElement] Keyword[instanceof] identifier[MonomerNotationUnitRNA] operator[SEP] {
identifier[monomers] operator[SEP] identifier[addAll] operator[SEP] identifier[getMonomersRNA] operator[SEP] operator[SEP] operator[SEP] identifier[MonomerNotationUnitRNA] operator[SEP] identifier[listElement] operator[SEP] , identifier[monomerStore] , identifier[position] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[String] identifier[id] operator[=] identifier[listElement] operator[SEP] identifier[getUnit] operator[SEP] operator[SEP] operator[SEP] identifier[monomers] operator[SEP] identifier[add] operator[SEP] identifier[MethodsMonomerUtils] operator[SEP] identifier[getMonomer] operator[SEP] identifier[not] operator[SEP] identifier[getType] operator[SEP] operator[SEP] , identifier[id] , literal[String] operator[SEP] operator[SEP] operator[SEP]
}
}
}
Keyword[return] identifier[monomers] operator[SEP]
}
|
public Object nextElement()
{
if (_array == null)
{
return null;
}
else
{
synchronized(this){
if (_index < _array.length)
{
Object obj = _array[_index];
_index++;
return obj;
}
else
{
return null;
}
}
}
} | class class_name[name] begin[{]
method[nextElement, return_type[type[Object]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[._array], ==, literal[null]]] begin[{]
return[literal[null]]
else begin[{]
SYNCHRONIZED[THIS[]] BEGIN[{]
if[binary_operation[member[._index], <, member[_array.length]]] begin[{]
local_variable[type[Object], obj]
member[._index]
return[member[.obj]]
else begin[{]
return[literal[null]]
end[}]
END[}]
end[}]
end[}]
END[}] | Keyword[public] identifier[Object] identifier[nextElement] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[_array] operator[==] Other[null] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[else] {
Keyword[synchronized] operator[SEP] Keyword[this] operator[SEP] {
Keyword[if] operator[SEP] identifier[_index] operator[<] identifier[_array] operator[SEP] identifier[length] operator[SEP] {
identifier[Object] identifier[obj] operator[=] identifier[_array] operator[SEP] identifier[_index] operator[SEP] operator[SEP] identifier[_index] operator[++] operator[SEP] Keyword[return] identifier[obj] operator[SEP]
}
Keyword[else] {
Keyword[return] Other[null] operator[SEP]
}
}
}
}
|
public ApiResponse<Templates> putTemplatesWithHttpInfo() throws ApiException {
com.squareup.okhttp.Call call = putTemplatesValidateBeforeCall(null, null);
Type localVarReturnType = new TypeToken<Templates>(){}.getType();
return apiClient.execute(call, localVarReturnType);
} | class class_name[name] begin[{]
method[putTemplatesWithHttpInfo, return_type[type[ApiResponse]], modifier[public], parameter[]] begin[{]
local_variable[type[com], call]
local_variable[type[Type], localVarReturnType]
return[call[apiClient.execute, parameter[member[.call], member[.localVarReturnType]]]]
end[}]
END[}] | Keyword[public] identifier[ApiResponse] operator[<] identifier[Templates] operator[>] identifier[putTemplatesWithHttpInfo] operator[SEP] operator[SEP] Keyword[throws] identifier[ApiException] {
identifier[com] operator[SEP] identifier[squareup] operator[SEP] identifier[okhttp] operator[SEP] identifier[Call] identifier[call] operator[=] identifier[putTemplatesValidateBeforeCall] operator[SEP] Other[null] , Other[null] operator[SEP] operator[SEP] identifier[Type] identifier[localVarReturnType] operator[=] Keyword[new] identifier[TypeToken] operator[<] identifier[Templates] operator[>] operator[SEP] operator[SEP] {
} operator[SEP] identifier[getType] operator[SEP] operator[SEP] operator[SEP] Keyword[return] identifier[apiClient] operator[SEP] identifier[execute] operator[SEP] identifier[call] , identifier[localVarReturnType] operator[SEP] operator[SEP]
}
|
public JSONArray toJSONArray(Collection<String> names) throws JSONException {
if (CollectionUtil.isEmpty(names)) {
return null;
}
final JSONArray ja = new JSONArray();
Object value;
for (String name : names) {
value = this.get(name);
if (null != value) {
ja.put(value);
}
}
return ja;
} | class class_name[name] begin[{]
method[toJSONArray, return_type[type[JSONArray]], modifier[public], parameter[names]] begin[{]
if[call[CollectionUtil.isEmpty, parameter[member[.names]]]] begin[{]
return[literal[null]]
else begin[{]
None
end[}]
local_variable[type[JSONArray], ja]
local_variable[type[Object], value]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=This(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[MethodInvocation(arguments=[MemberReference(member=name, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=get, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)])), label=None), IfStatement(condition=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=null), operandr=MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=!=), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=ja, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=names, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=name)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.ja]]
end[}]
END[}] | Keyword[public] identifier[JSONArray] identifier[toJSONArray] operator[SEP] identifier[Collection] operator[<] identifier[String] operator[>] identifier[names] operator[SEP] Keyword[throws] identifier[JSONException] {
Keyword[if] operator[SEP] identifier[CollectionUtil] operator[SEP] identifier[isEmpty] operator[SEP] identifier[names] operator[SEP] operator[SEP] {
Keyword[return] Other[null] operator[SEP]
}
Keyword[final] identifier[JSONArray] identifier[ja] operator[=] Keyword[new] identifier[JSONArray] operator[SEP] operator[SEP] operator[SEP] identifier[Object] identifier[value] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[name] operator[:] identifier[names] operator[SEP] {
identifier[value] operator[=] Keyword[this] operator[SEP] identifier[get] operator[SEP] identifier[name] operator[SEP] operator[SEP] Keyword[if] operator[SEP] Other[null] operator[!=] identifier[value] operator[SEP] {
identifier[ja] operator[SEP] identifier[put] operator[SEP] identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[ja] operator[SEP]
}
|
private void cmbJavaTypeActionPerformed (java.awt.event.ActionEvent evt)//GEN-FIRST:event_cmbJavaTypeActionPerformed
{//GEN-HEADEREND:event_cmbJavaTypeActionPerformed
// Add your handling code here:
aColumn.setJavaFieldType(cmbJavaType.getSelectedItem().toString());
if (cmbJavaType.getModel() instanceof org.apache.ojb.tools.swing.SortingComboBoxModel)
{
org.apache.ojb.tools.swing.SortingComboBoxModel cmbModel =
(org.apache.ojb.tools.swing.SortingComboBoxModel)this.cmbJavaType.getModel();
if (cmbModel.getIndexOf(cmbJavaType.getSelectedItem()) == -1 )
cmbJavaType.addItem(cmbJavaType.getSelectedItem());
}
else if (cmbJavaType.getModel() instanceof javax.swing.DefaultComboBoxModel)
{
javax.swing.DefaultComboBoxModel cmbModel =
(javax.swing.DefaultComboBoxModel)this.cmbJavaType.getModel();
if (cmbModel.getIndexOf(cmbJavaType.getSelectedItem()) == -1 )
cmbJavaType.addItem(cmbJavaType.getSelectedItem());
}
} | class class_name[name] begin[{]
method[cmbJavaTypeActionPerformed, return_type[void], modifier[private], parameter[evt]] begin[{]
call[aColumn.setJavaFieldType, parameter[call[cmbJavaType.getSelectedItem, parameter[]]]]
if[binary_operation[call[cmbJavaType.getModel, parameter[]], instanceof, type[org]]] begin[{]
local_variable[type[org], cmbModel]
if[binary_operation[call[cmbModel.getIndexOf, parameter[call[cmbJavaType.getSelectedItem, parameter[]]]], ==, literal[1]]] begin[{]
call[cmbJavaType.addItem, parameter[call[cmbJavaType.getSelectedItem, parameter[]]]]
else begin[{]
None
end[}]
else begin[{]
if[binary_operation[call[cmbJavaType.getModel, parameter[]], instanceof, type[javax]]] begin[{]
local_variable[type[javax], cmbModel]
if[binary_operation[call[cmbModel.getIndexOf, parameter[call[cmbJavaType.getSelectedItem, parameter[]]]], ==, literal[1]]] begin[{]
call[cmbJavaType.addItem, parameter[call[cmbJavaType.getSelectedItem, parameter[]]]]
else begin[{]
None
end[}]
else begin[{]
None
end[}]
end[}]
end[}]
END[}] | Keyword[private] Keyword[void] identifier[cmbJavaTypeActionPerformed] operator[SEP] identifier[java] operator[SEP] identifier[awt] operator[SEP] identifier[event] operator[SEP] identifier[ActionEvent] identifier[evt] operator[SEP] {
identifier[aColumn] operator[SEP] identifier[setJavaFieldType] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[getSelectedItem] operator[SEP] operator[SEP] operator[SEP] identifier[toString] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] Keyword[instanceof] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[ojb] operator[SEP] identifier[tools] operator[SEP] identifier[swing] operator[SEP] identifier[SortingComboBoxModel] operator[SEP] {
identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[ojb] operator[SEP] identifier[tools] operator[SEP] identifier[swing] operator[SEP] identifier[SortingComboBoxModel] identifier[cmbModel] operator[=] operator[SEP] identifier[org] operator[SEP] identifier[apache] operator[SEP] identifier[ojb] operator[SEP] identifier[tools] operator[SEP] identifier[swing] operator[SEP] identifier[SortingComboBoxModel] operator[SEP] Keyword[this] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmbModel] operator[SEP] identifier[getIndexOf] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[getSelectedItem] operator[SEP] operator[SEP] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[addItem] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[getSelectedItem] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] Keyword[instanceof] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[DefaultComboBoxModel] operator[SEP] {
identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[DefaultComboBoxModel] identifier[cmbModel] operator[=] operator[SEP] identifier[javax] operator[SEP] identifier[swing] operator[SEP] identifier[DefaultComboBoxModel] operator[SEP] Keyword[this] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[getModel] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[cmbModel] operator[SEP] identifier[getIndexOf] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[getSelectedItem] operator[SEP] operator[SEP] operator[SEP] operator[==] operator[-] Other[1] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[addItem] operator[SEP] identifier[cmbJavaType] operator[SEP] identifier[getSelectedItem] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
}
|
public Se3_F64 getWorldToCurr3D() {
// compute transform in 2D space
Se2_F64 currToWorld = getCurrToWorld2D();
// 2D to 3D coordinates
currPlaneToWorld3D.getT().set(-currToWorld.T.y, 0, currToWorld.T.x);
DMatrixRMaj R = currPlaneToWorld3D.getR();
// set rotation around Y axis.
// Transpose the 2D transform since the rotation are pointing in opposite directions
R.unsafe_set(0, 0, currToWorld.c);
R.unsafe_set(0, 2, -currToWorld.s);
R.unsafe_set(1, 1, 1);
R.unsafe_set(2, 0, currToWorld.s);
R.unsafe_set(2, 2, currToWorld.c);
currPlaneToWorld3D.invert(worldToCurrPlane3D);
worldToCurrPlane3D.concat(planeToCamera, worldToCurrCam3D);
return worldToCurrCam3D;
} | class class_name[name] begin[{]
method[getWorldToCurr3D, return_type[type[Se3_F64]], modifier[public], parameter[]] begin[{]
local_variable[type[Se2_F64], currToWorld]
call[currPlaneToWorld3D.getT, parameter[]]
local_variable[type[DMatrixRMaj], R]
call[R.unsafe_set, parameter[literal[0], literal[0], member[currToWorld.c]]]
call[R.unsafe_set, parameter[literal[0], literal[2], member[currToWorld.s]]]
call[R.unsafe_set, parameter[literal[1], literal[1], literal[1]]]
call[R.unsafe_set, parameter[literal[2], literal[0], member[currToWorld.s]]]
call[R.unsafe_set, parameter[literal[2], literal[2], member[currToWorld.c]]]
call[currPlaneToWorld3D.invert, parameter[member[.worldToCurrPlane3D]]]
call[worldToCurrPlane3D.concat, parameter[member[.planeToCamera], member[.worldToCurrCam3D]]]
return[member[.worldToCurrCam3D]]
end[}]
END[}] | Keyword[public] identifier[Se3_F64] identifier[getWorldToCurr3D] operator[SEP] operator[SEP] {
identifier[Se2_F64] identifier[currToWorld] operator[=] identifier[getCurrToWorld2D] operator[SEP] operator[SEP] operator[SEP] identifier[currPlaneToWorld3D] operator[SEP] identifier[getT] operator[SEP] operator[SEP] operator[SEP] identifier[set] operator[SEP] operator[-] identifier[currToWorld] operator[SEP] identifier[T] operator[SEP] identifier[y] , Other[0] , identifier[currToWorld] operator[SEP] identifier[T] operator[SEP] identifier[x] operator[SEP] operator[SEP] identifier[DMatrixRMaj] identifier[R] operator[=] identifier[currPlaneToWorld3D] operator[SEP] identifier[getR] operator[SEP] operator[SEP] operator[SEP] identifier[R] operator[SEP] identifier[unsafe_set] operator[SEP] Other[0] , Other[0] , identifier[currToWorld] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[R] operator[SEP] identifier[unsafe_set] operator[SEP] Other[0] , Other[2] , operator[-] identifier[currToWorld] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[R] operator[SEP] identifier[unsafe_set] operator[SEP] Other[1] , Other[1] , Other[1] operator[SEP] operator[SEP] identifier[R] operator[SEP] identifier[unsafe_set] operator[SEP] Other[2] , Other[0] , identifier[currToWorld] operator[SEP] identifier[s] operator[SEP] operator[SEP] identifier[R] operator[SEP] identifier[unsafe_set] operator[SEP] Other[2] , Other[2] , identifier[currToWorld] operator[SEP] identifier[c] operator[SEP] operator[SEP] identifier[currPlaneToWorld3D] operator[SEP] identifier[invert] operator[SEP] identifier[worldToCurrPlane3D] operator[SEP] operator[SEP] identifier[worldToCurrPlane3D] operator[SEP] identifier[concat] operator[SEP] identifier[planeToCamera] , identifier[worldToCurrCam3D] operator[SEP] operator[SEP] Keyword[return] identifier[worldToCurrCam3D] operator[SEP]
}
|
public java.util.List<GlobalCluster> getGlobalClusters() {
if (globalClusters == null) {
globalClusters = new com.amazonaws.internal.SdkInternalList<GlobalCluster>();
}
return globalClusters;
} | class class_name[name] begin[{]
method[getGlobalClusters, return_type[type[java]], modifier[public], parameter[]] begin[{]
if[binary_operation[member[.globalClusters], ==, literal[null]]] begin[{]
assign[member[.globalClusters], ClassCreator(arguments=[], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=com, sub_type=ReferenceType(arguments=None, dimensions=None, name=amazonaws, sub_type=ReferenceType(arguments=None, dimensions=None, name=internal, sub_type=ReferenceType(arguments=[TypeArgument(pattern_type=None, type=ReferenceType(arguments=None, dimensions=[], name=GlobalCluster, sub_type=None))], dimensions=None, name=SdkInternalList, sub_type=None)))))]
else begin[{]
None
end[}]
return[member[.globalClusters]]
end[}]
END[}] | Keyword[public] identifier[java] operator[SEP] identifier[util] operator[SEP] identifier[List] operator[<] identifier[GlobalCluster] operator[>] identifier[getGlobalClusters] operator[SEP] operator[SEP] {
Keyword[if] operator[SEP] identifier[globalClusters] operator[==] Other[null] operator[SEP] {
identifier[globalClusters] operator[=] Keyword[new] identifier[com] operator[SEP] identifier[amazonaws] operator[SEP] identifier[internal] operator[SEP] identifier[SdkInternalList] operator[<] identifier[GlobalCluster] operator[>] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[return] identifier[globalClusters] operator[SEP]
}
|
public static Map<String, String> parseProperties(String text) {
String[] lines = text.split("\n");
Map<String, String> result = new HashMap<String, String>();
for (String line : lines) {
line = line.replaceFirst("^ +", "");
line = line.replaceAll("\r", "");
if (line.startsWith("#")) {
continue;
}
int eqPos = line.indexOf('=');
if (eqPos > 0) {
String key = line.substring(0, eqPos);
String value = line.substring(eqPos + 1);
result.put(key, value);
}
}
return result;
} | class class_name[name] begin[{]
method[parseProperties, return_type[type[Map]], modifier[public static], parameter[text]] begin[{]
local_variable[type[String], lines]
local_variable[type[Map], result]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="^ +"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceFirst, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=line, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type==, value=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="\r"), Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="")], member=replaceAll, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None)), label=None), IfStatement(condition=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="#")], member=startsWith, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[ContinueStatement(goto=None, label=None)])), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value='=')], member=indexOf, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), name=eqPos)], modifiers=set(), type=BasicType(dimensions=[], name=int)), IfStatement(condition=BinaryOperation(operandl=MemberReference(member=eqPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), operator=>), else_statement=None, label=None, then_statement=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), MemberReference(member=eqPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), name=key)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MethodInvocation(arguments=[BinaryOperation(operandl=MemberReference(member=eqPos, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), operator=+)], member=substring, postfix_operators=[], prefix_operators=[], qualifier=line, selectors=[], type_arguments=None), name=value)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None)), StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=key, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=value, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=put, postfix_operators=[], prefix_operators=[], qualifier=result, selectors=[], type_arguments=None), label=None)]))]), control=EnhancedForControl(iterable=MemberReference(member=lines, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), var=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=None, name=line)], modifiers=set(), type=ReferenceType(arguments=None, dimensions=[], name=String, sub_type=None))), label=None)
return[member[.result]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[parseProperties] operator[SEP] identifier[String] identifier[text] operator[SEP] {
identifier[String] operator[SEP] operator[SEP] identifier[lines] operator[=] identifier[text] operator[SEP] identifier[split] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[result] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[String] operator[>] operator[SEP] operator[SEP] operator[SEP] Keyword[for] operator[SEP] identifier[String] identifier[line] operator[:] identifier[lines] operator[SEP] {
identifier[line] operator[=] identifier[line] operator[SEP] identifier[replaceFirst] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] identifier[line] operator[=] identifier[line] operator[SEP] identifier[replaceAll] operator[SEP] literal[String] , literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[line] operator[SEP] identifier[startsWith] operator[SEP] literal[String] operator[SEP] operator[SEP] {
Keyword[continue] operator[SEP]
}
Keyword[int] identifier[eqPos] operator[=] identifier[line] operator[SEP] identifier[indexOf] operator[SEP] literal[String] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[eqPos] operator[>] Other[0] operator[SEP] {
identifier[String] identifier[key] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] Other[0] , identifier[eqPos] operator[SEP] operator[SEP] identifier[String] identifier[value] operator[=] identifier[line] operator[SEP] identifier[substring] operator[SEP] identifier[eqPos] operator[+] Other[1] operator[SEP] operator[SEP] identifier[result] operator[SEP] identifier[put] operator[SEP] identifier[key] , identifier[value] operator[SEP] operator[SEP]
}
}
Keyword[return] identifier[result] operator[SEP]
}
|
protected double calculateLofWithUpdate(LofPoint recievedPoint, LofDataSet dataSet)
{
double result = 0.0d;
if (this.hasIntermediate)
{
result = LofCalculator.calculateLofWithUpdate(this.kn, this.maxDataCount,
recievedPoint, dataSet);
}
else
{
LofCalculator.addPointToDataSet(this.maxDataCount, recievedPoint, dataSet);
result = LofCalculator.calculateLofNoIntermediate(this.kn, recievedPoint, dataSet);
}
return result;
} | class class_name[name] begin[{]
method[calculateLofWithUpdate, return_type[type[double]], modifier[protected], parameter[recievedPoint, dataSet]] begin[{]
local_variable[type[double], result]
if[THIS[member[None.hasIntermediate]]] begin[{]
assign[member[.result], call[LofCalculator.calculateLofWithUpdate, parameter[THIS[member[None.kn]], THIS[member[None.maxDataCount]], member[.recievedPoint], member[.dataSet]]]]
else begin[{]
call[LofCalculator.addPointToDataSet, parameter[THIS[member[None.maxDataCount]], member[.recievedPoint], member[.dataSet]]]
assign[member[.result], call[LofCalculator.calculateLofNoIntermediate, parameter[THIS[member[None.kn]], member[.recievedPoint], member[.dataSet]]]]
end[}]
return[member[.result]]
end[}]
END[}] | Keyword[protected] Keyword[double] identifier[calculateLofWithUpdate] operator[SEP] identifier[LofPoint] identifier[recievedPoint] , identifier[LofDataSet] identifier[dataSet] operator[SEP] {
Keyword[double] identifier[result] operator[=] literal[Float] operator[SEP] Keyword[if] operator[SEP] Keyword[this] operator[SEP] identifier[hasIntermediate] operator[SEP] {
identifier[result] operator[=] identifier[LofCalculator] operator[SEP] identifier[calculateLofWithUpdate] operator[SEP] Keyword[this] operator[SEP] identifier[kn] , Keyword[this] operator[SEP] identifier[maxDataCount] , identifier[recievedPoint] , identifier[dataSet] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[LofCalculator] operator[SEP] identifier[addPointToDataSet] operator[SEP] Keyword[this] operator[SEP] identifier[maxDataCount] , identifier[recievedPoint] , identifier[dataSet] operator[SEP] operator[SEP] identifier[result] operator[=] identifier[LofCalculator] operator[SEP] identifier[calculateLofNoIntermediate] operator[SEP] Keyword[this] operator[SEP] identifier[kn] , identifier[recievedPoint] , identifier[dataSet] operator[SEP] operator[SEP]
}
Keyword[return] identifier[result] operator[SEP]
}
|
public void register(final SelectableChannel ch, final int interestOps, final NioTask<?> task) {
if (ch == null) {
throw new NullPointerException("ch");
}
if (interestOps == 0) {
throw new IllegalArgumentException("interestOps must be non-zero.");
}
if ((interestOps & ~ch.validOps()) != 0) {
throw new IllegalArgumentException(
"invalid interestOps: " + interestOps + "(validOps: " + ch.validOps() + ')');
}
if (task == null) {
throw new NullPointerException("task");
}
if (isShutdown()) {
throw new IllegalStateException("event loop shut down");
}
if (inEventLoop()) {
register0(ch, interestOps, task);
} else {
try {
// Offload to the EventLoop as otherwise java.nio.channels.spi.AbstractSelectableChannel.register
// may block for a long time while trying to obtain an internal lock that may be hold while selecting.
submit(new Runnable() {
@Override
public void run() {
register0(ch, interestOps, task);
}
}).sync();
} catch (InterruptedException ignore) {
// Even if interrupted we did schedule it so just mark the Thread as interrupted.
Thread.currentThread().interrupt();
}
}
} | class class_name[name] begin[{]
method[register, return_type[void], modifier[public], parameter[ch, interestOps, task]] begin[{]
if[binary_operation[member[.ch], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="ch")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.interestOps], ==, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="interestOps must be non-zero.")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[binary_operation[member[.interestOps], &, call[ch.validOps, parameter[]]], !=, literal[0]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="invalid interestOps: "), operandr=MemberReference(member=interestOps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="(validOps: "), operator=+), operandr=MethodInvocation(arguments=[], member=validOps, postfix_operators=[], prefix_operators=[], qualifier=ch, selectors=[], type_arguments=None), operator=+), operandr=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=')'), operator=+)], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalArgumentException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[binary_operation[member[.task], ==, literal[null]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="task")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=NullPointerException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[.isShutdown, parameter[]]] begin[{]
ThrowStatement(expression=ClassCreator(arguments=[Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value="event loop shut down")], body=None, constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=IllegalStateException, sub_type=None)), label=None)
else begin[{]
None
end[}]
if[call[.inEventLoop, parameter[]]] begin[{]
call[.register0, parameter[member[.ch], member[.interestOps], member[.task]]]
else begin[{]
TryStatement(block=[StatementExpression(expression=MethodInvocation(arguments=[ClassCreator(arguments=[], body=[MethodDeclaration(annotations=[Annotation(element=None, name=Override)], body=[StatementExpression(expression=MethodInvocation(arguments=[MemberReference(member=ch, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=interestOps, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), MemberReference(member=task, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])], member=register0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[], type_arguments=None), label=None)], documentation=None, modifiers={'public'}, name=run, parameters=[], return_type=None, throws=None, type_parameters=None)], constructor_type_arguments=None, postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], type=ReferenceType(arguments=None, dimensions=None, name=Runnable, sub_type=None))], member=submit, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[MethodInvocation(arguments=[], member=sync, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], catches=[CatchClause(block=[StatementExpression(expression=MethodInvocation(arguments=[], member=currentThread, postfix_operators=[], prefix_operators=[], qualifier=Thread, selectors=[MethodInvocation(arguments=[], member=interrupt, postfix_operators=None, prefix_operators=None, qualifier=None, selectors=None, type_arguments=None)], type_arguments=None), label=None)], label=None, parameter=CatchClauseParameter(annotations=None, modifiers=None, name=ignore, types=['InterruptedException']))], finally_block=None, label=None, resources=None)
end[}]
end[}]
END[}] | Keyword[public] Keyword[void] identifier[register] operator[SEP] Keyword[final] identifier[SelectableChannel] identifier[ch] , Keyword[final] Keyword[int] identifier[interestOps] , Keyword[final] identifier[NioTask] operator[<] operator[?] operator[>] identifier[task] operator[SEP] {
Keyword[if] operator[SEP] identifier[ch] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[interestOps] operator[==] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] operator[SEP] identifier[interestOps] operator[&] operator[~] identifier[ch] operator[SEP] identifier[validOps] operator[SEP] operator[SEP] operator[SEP] operator[!=] Other[0] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalArgumentException] operator[SEP] literal[String] operator[+] identifier[interestOps] operator[+] literal[String] operator[+] identifier[ch] operator[SEP] identifier[validOps] operator[SEP] operator[SEP] operator[+] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[task] operator[==] Other[null] operator[SEP] {
Keyword[throw] Keyword[new] identifier[NullPointerException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[isShutdown] operator[SEP] operator[SEP] operator[SEP] {
Keyword[throw] Keyword[new] identifier[IllegalStateException] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
Keyword[if] operator[SEP] identifier[inEventLoop] operator[SEP] operator[SEP] operator[SEP] {
identifier[register0] operator[SEP] identifier[ch] , identifier[interestOps] , identifier[task] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[try] {
identifier[submit] operator[SEP] Keyword[new] identifier[Runnable] operator[SEP] operator[SEP] {
annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[run] operator[SEP] operator[SEP] {
identifier[register0] operator[SEP] identifier[ch] , identifier[interestOps] , identifier[task] operator[SEP] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[sync] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[catch] operator[SEP] identifier[InterruptedException] identifier[ignore] operator[SEP] {
identifier[Thread] operator[SEP] identifier[currentThread] operator[SEP] operator[SEP] operator[SEP] identifier[interrupt] operator[SEP] operator[SEP] operator[SEP]
}
}
}
|
private double[][] solveL(double[][] X) {
final int n = L.length, m = X[0].length;
{ // First iteration, simplified.
final double[] X0 = X[0], L0 = L[0];
for(int j = 0; j < m; j++) {
X0[j] /= L0[0];
}
}
for(int k = 1; k < n; k++) {
final double[] Xk = X[k], Lk = L[k];
final double iLkk = 1. / Lk[k];
for(int j = 0; j < m; j++) {
double Xkj = Xk[j];
for(int i = 0; i < k; i++) {
Xkj -= X[i][j] * Lk[i];
}
Xk[j] = Xkj * iLkk;
}
}
return X;
} | class class_name[name] begin[{]
method[solveL, return_type[type[double]], modifier[private], parameter[X]] begin[{]
local_variable[type[int], n]
local_variable[type[double], X0]
ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=X0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type=/=, value=MemberReference(member=L0, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0))])), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=X, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=Xk), VariableDeclarator(dimensions=[], initializer=MemberReference(member=L, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=Lk)], modifiers={'final'}, type=BasicType(dimensions=[None], name=double)), LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=BinaryOperation(operandl=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1.), operandr=MemberReference(member=Lk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=/), name=iLkk)], modifiers={'final'}, type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[LocalVariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=[], initializer=MemberReference(member=Xk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), name=Xkj)], modifiers=set(), type=BasicType(dimensions=[], name=double)), ForStatement(body=BlockStatement(label=None, statements=[StatementExpression(expression=Assignment(expressionl=MemberReference(member=Xkj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), type=-=, value=BinaryOperation(operandl=MemberReference(member=X, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[])), ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operandr=MemberReference(member=Lk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=i, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=i)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=i, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None), StatementExpression(expression=Assignment(expressionl=MemberReference(member=Xk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[ArraySelector(index=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]))]), type==, value=BinaryOperation(operandl=MemberReference(member=Xkj, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=iLkk, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=*)), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=j, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=m, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=0), name=j)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=j, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)]), control=ForControl(condition=BinaryOperation(operandl=MemberReference(member=k, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operandr=MemberReference(member=n, postfix_operators=[], prefix_operators=[], qualifier=, selectors=[]), operator=<), init=VariableDeclaration(annotations=[], declarators=[VariableDeclarator(dimensions=None, initializer=Literal(postfix_operators=[], prefix_operators=[], qualifier=None, selectors=[], value=1), name=k)], modifiers=set(), type=BasicType(dimensions=[], name=int)), update=[MemberReference(member=k, postfix_operators=['++'], prefix_operators=[], qualifier=, selectors=[])]), label=None)
return[member[.X]]
end[}]
END[}] | Keyword[private] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[solveL] operator[SEP] Keyword[double] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[X] operator[SEP] {
Keyword[final] Keyword[int] identifier[n] operator[=] identifier[L] operator[SEP] identifier[length] , identifier[m] operator[=] identifier[X] operator[SEP] Other[0] operator[SEP] operator[SEP] identifier[length] operator[SEP] {
Keyword[final] Keyword[double] operator[SEP] operator[SEP] identifier[X0] operator[=] identifier[X] operator[SEP] Other[0] operator[SEP] , identifier[L0] operator[=] identifier[L] operator[SEP] Other[0] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[m] operator[SEP] identifier[j] operator[++] operator[SEP] {
identifier[X0] operator[SEP] identifier[j] operator[SEP] operator[/=] identifier[L0] operator[SEP] Other[0] operator[SEP] operator[SEP]
}
}
Keyword[for] operator[SEP] Keyword[int] identifier[k] operator[=] Other[1] operator[SEP] identifier[k] operator[<] identifier[n] operator[SEP] identifier[k] operator[++] operator[SEP] {
Keyword[final] Keyword[double] operator[SEP] operator[SEP] identifier[Xk] operator[=] identifier[X] operator[SEP] identifier[k] operator[SEP] , identifier[Lk] operator[=] identifier[L] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[final] Keyword[double] identifier[iLkk] operator[=] literal[Float] operator[/] identifier[Lk] operator[SEP] identifier[k] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[j] operator[=] Other[0] operator[SEP] identifier[j] operator[<] identifier[m] operator[SEP] identifier[j] operator[++] operator[SEP] {
Keyword[double] identifier[Xkj] operator[=] identifier[Xk] operator[SEP] identifier[j] operator[SEP] operator[SEP] Keyword[for] operator[SEP] Keyword[int] identifier[i] operator[=] Other[0] operator[SEP] identifier[i] operator[<] identifier[k] operator[SEP] identifier[i] operator[++] operator[SEP] {
identifier[Xkj] operator[-=] identifier[X] operator[SEP] identifier[i] operator[SEP] operator[SEP] identifier[j] operator[SEP] operator[*] identifier[Lk] operator[SEP] identifier[i] operator[SEP] operator[SEP]
}
identifier[Xk] operator[SEP] identifier[j] operator[SEP] operator[=] identifier[Xkj] operator[*] identifier[iLkk] operator[SEP]
}
}
Keyword[return] identifier[X] operator[SEP]
}
|
@Override
public void execute(IntuitMessage intuitMessage) throws FMSException {
LOG.debug("Enter PrepareRequestInterceptor...");
RequestElements requestElements = intuitMessage.getRequestElements();
Map<String, String> requestParameters = requestElements.getRequestParameters();
String action = (requestElements.getAction() == null) ? getEntityName(requestElements.getEntity()) : requestElements.getAction();
if (intuitMessage.isPlatformService()) {
requestParameters.put(RequestElements.REQ_PARAM_RESOURCE_URL, prepareIPSUri(action, requestElements.getContext()));
} else if (intuitMessage.isEntitlementService()) {
prepareEntitlementsRequest(intuitMessage, requestElements, requestParameters);
}else {
prepareDataServiceRequest(intuitMessage, requestElements, requestParameters, action);
}
LOG.debug("Exit PrepareRequestInterceptor.");
} | class class_name[name] begin[{]
method[execute, return_type[void], modifier[public], parameter[intuitMessage]] begin[{]
call[LOG.debug, parameter[literal["Enter PrepareRequestInterceptor..."]]]
local_variable[type[RequestElements], requestElements]
local_variable[type[Map], requestParameters]
local_variable[type[String], action]
if[call[intuitMessage.isPlatformService, parameter[]]] begin[{]
call[requestParameters.put, parameter[member[RequestElements.REQ_PARAM_RESOURCE_URL], call[.prepareIPSUri, parameter[member[.action], call[requestElements.getContext, parameter[]]]]]]
else begin[{]
if[call[intuitMessage.isEntitlementService, parameter[]]] begin[{]
call[.prepareEntitlementsRequest, parameter[member[.intuitMessage], member[.requestElements], member[.requestParameters]]]
else begin[{]
call[.prepareDataServiceRequest, parameter[member[.intuitMessage], member[.requestElements], member[.requestParameters], member[.action]]]
end[}]
end[}]
call[LOG.debug, parameter[literal["Exit PrepareRequestInterceptor."]]]
end[}]
END[}] | annotation[@] identifier[Override] Keyword[public] Keyword[void] identifier[execute] operator[SEP] identifier[IntuitMessage] identifier[intuitMessage] operator[SEP] Keyword[throws] identifier[FMSException] {
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP] identifier[RequestElements] identifier[requestElements] operator[=] identifier[intuitMessage] operator[SEP] identifier[getRequestElements] operator[SEP] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[String] operator[>] identifier[requestParameters] operator[=] identifier[requestElements] operator[SEP] identifier[getRequestParameters] operator[SEP] operator[SEP] operator[SEP] identifier[String] identifier[action] operator[=] operator[SEP] identifier[requestElements] operator[SEP] identifier[getAction] operator[SEP] operator[SEP] operator[==] Other[null] operator[SEP] operator[?] identifier[getEntityName] operator[SEP] identifier[requestElements] operator[SEP] identifier[getEntity] operator[SEP] operator[SEP] operator[SEP] operator[:] identifier[requestElements] operator[SEP] identifier[getAction] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[intuitMessage] operator[SEP] identifier[isPlatformService] operator[SEP] operator[SEP] operator[SEP] {
identifier[requestParameters] operator[SEP] identifier[put] operator[SEP] identifier[RequestElements] operator[SEP] identifier[REQ_PARAM_RESOURCE_URL] , identifier[prepareIPSUri] operator[SEP] identifier[action] , identifier[requestElements] operator[SEP] identifier[getContext] operator[SEP] operator[SEP] operator[SEP] operator[SEP] operator[SEP]
}
Keyword[else] Keyword[if] operator[SEP] identifier[intuitMessage] operator[SEP] identifier[isEntitlementService] operator[SEP] operator[SEP] operator[SEP] {
identifier[prepareEntitlementsRequest] operator[SEP] identifier[intuitMessage] , identifier[requestElements] , identifier[requestParameters] operator[SEP] operator[SEP]
}
Keyword[else] {
identifier[prepareDataServiceRequest] operator[SEP] identifier[intuitMessage] , identifier[requestElements] , identifier[requestParameters] , identifier[action] operator[SEP] operator[SEP]
}
identifier[LOG] operator[SEP] identifier[debug] operator[SEP] literal[String] operator[SEP] operator[SEP]
}
|
private static Map<String, Object> buildJSONBody(List<RevisionInternal> revs, final Database db) {
// Build up a JSON body describing what revisions we want:
final int maxRevTreeDepth = db.getMaxRevTreeDepth();
Collection<Map<String, Object>> keys = CollectionUtils.transform(
revs, new CollectionUtils.Functor<RevisionInternal, Map<String, Object>>() {
public Map<String, Object> invoke(RevisionInternal rev) {
AtomicBoolean haveBodies = new AtomicBoolean(false);
List<String> possibleAncestors = db.getPossibleAncestorRevisionIDs(
rev, PullerInternal.MAX_NUMBER_OF_ATTS_SINCE, haveBodies, true);
Map<String, Object> key = new HashMap<String, Object>();
key.put("id", rev.getDocID());
key.put("rev", rev.getRevID());
if (possibleAncestors != null) {
key.put(haveBodies.get() ? "atts_since" : "revs_from", possibleAncestors);
} else {
if (rev.getGeneration() > maxRevTreeDepth)
key.put("revs_limit", maxRevTreeDepth);
}
return key;
}
});
Map<String, Object> retval = new HashMap<String, Object>();
retval.put("docs", keys);
return retval;
} | class class_name[name] begin[{]
method[buildJSONBody, return_type[type[Map]], modifier[private static], parameter[revs, db]] begin[{]
local_variable[type[int], maxRevTreeDepth]
local_variable[type[Collection], keys]
local_variable[type[Map], retval]
call[retval.put, parameter[literal["docs"], member[.keys]]]
return[member[.retval]]
end[}]
END[}] | Keyword[private] Keyword[static] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[buildJSONBody] operator[SEP] identifier[List] operator[<] identifier[RevisionInternal] operator[>] identifier[revs] , Keyword[final] identifier[Database] identifier[db] operator[SEP] {
Keyword[final] Keyword[int] identifier[maxRevTreeDepth] operator[=] identifier[db] operator[SEP] identifier[getMaxRevTreeDepth] operator[SEP] operator[SEP] operator[SEP] identifier[Collection] operator[<] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] identifier[keys] operator[=] identifier[CollectionUtils] operator[SEP] identifier[transform] operator[SEP] identifier[revs] , Keyword[new] identifier[CollectionUtils] operator[SEP] identifier[Functor] operator[<] identifier[RevisionInternal] , identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] operator[>] operator[SEP] operator[SEP] {
Keyword[public] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[invoke] operator[SEP] identifier[RevisionInternal] identifier[rev] operator[SEP] {
identifier[AtomicBoolean] identifier[haveBodies] operator[=] Keyword[new] identifier[AtomicBoolean] operator[SEP] literal[boolean] operator[SEP] operator[SEP] identifier[List] operator[<] identifier[String] operator[>] identifier[possibleAncestors] operator[=] identifier[db] operator[SEP] identifier[getPossibleAncestorRevisionIDs] operator[SEP] identifier[rev] , identifier[PullerInternal] operator[SEP] identifier[MAX_NUMBER_OF_ATTS_SINCE] , identifier[haveBodies] , literal[boolean] operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[key] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rev] operator[SEP] identifier[getDocID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] identifier[key] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[rev] operator[SEP] identifier[getRevID] operator[SEP] operator[SEP] operator[SEP] operator[SEP] Keyword[if] operator[SEP] identifier[possibleAncestors] operator[!=] Other[null] operator[SEP] {
identifier[key] operator[SEP] identifier[put] operator[SEP] identifier[haveBodies] operator[SEP] identifier[get] operator[SEP] operator[SEP] operator[?] literal[String] operator[:] literal[String] , identifier[possibleAncestors] operator[SEP] operator[SEP]
}
Keyword[else] {
Keyword[if] operator[SEP] identifier[rev] operator[SEP] identifier[getGeneration] operator[SEP] operator[SEP] operator[>] identifier[maxRevTreeDepth] operator[SEP] identifier[key] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[maxRevTreeDepth] operator[SEP] operator[SEP]
}
Keyword[return] identifier[key] operator[SEP]
}
} operator[SEP] operator[SEP] identifier[Map] operator[<] identifier[String] , identifier[Object] operator[>] identifier[retval] operator[=] Keyword[new] identifier[HashMap] operator[<] identifier[String] , identifier[Object] operator[>] operator[SEP] operator[SEP] operator[SEP] identifier[retval] operator[SEP] identifier[put] operator[SEP] literal[String] , identifier[keys] operator[SEP] operator[SEP] Keyword[return] identifier[retval] operator[SEP]
}
|
public static Object streamIn(byte[] bytes, ClassLoader classLoader)
throws IOException, ClassNotFoundException {
return streamIn(bytes, classLoader, false);
} | class class_name[name] begin[{]
method[streamIn, return_type[type[Object]], modifier[public static], parameter[bytes, classLoader]] begin[{]
return[call[.streamIn, parameter[member[.bytes], member[.classLoader], literal[false]]]]
end[}]
END[}] | Keyword[public] Keyword[static] identifier[Object] identifier[streamIn] operator[SEP] Keyword[byte] operator[SEP] operator[SEP] identifier[bytes] , identifier[ClassLoader] identifier[classLoader] operator[SEP] Keyword[throws] identifier[IOException] , identifier[ClassNotFoundException] {
Keyword[return] identifier[streamIn] operator[SEP] identifier[bytes] , identifier[classLoader] , literal[boolean] operator[SEP] operator[SEP]
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.